diff --git a/composer.json b/composer.json index 2533d8f144..5ade96f298 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "The Kirby core", "license": "proprietary", "type": "kirby-cms", - "version": "4.0.0-alpha.3", + "version": "4.0.0-alpha.4", "keywords": [ "kirby", "cms", diff --git a/composer.lock b/composer.lock index 5757b43843..58113a61cd 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": "a8956a2d0c1679a3692b532a809183aa", + "content-hash": "03c7f4f170fedf148f73b0ab2c7b7ee9", "packages": [ { "name": "claviska/simpleimage", diff --git a/config/aliases.php b/config/aliases.php index 1bee09dfc7..114579e9bb 100644 --- a/config/aliases.php +++ b/config/aliases.php @@ -3,7 +3,6 @@ return [ // cms classes 'collection' => 'Kirby\Cms\Collection', - 'field' => 'Kirby\Cms\Field', 'file' => 'Kirby\Cms\File', 'files' => 'Kirby\Cms\Files', 'find' => 'Kirby\Cms\Find', @@ -24,6 +23,9 @@ 'users' => 'Kirby\Cms\Users', 'visitor' => 'Kirby\Cms\Visitor', + // content classes + 'field' => 'Kirby\Content\Field', + // data handler 'data' => 'Kirby\Data\Data', 'json' => 'Kirby\Data\Json', @@ -70,17 +72,20 @@ 'xml' => 'Kirby\Toolkit\Xml', // Deprecated aliases: - // Any of these might be removed at any point in the future - 'kirby\cms\asset' => 'Kirby\Filesystem\Asset', - 'kirby\cms\dir' => 'Kirby\Filesystem\Dir', - 'kirby\cms\filename' => 'Kirby\Filesystem\Filename', - 'kirby\cms\filefoundation' => 'Kirby\Filesystem\IsFile', - 'kirby\cms\form' => 'Kirby\Form\Form', - 'kirby\cms\kirbytag' => 'Kirby\Text\KirbyTag', - 'kirby\cms\kirbytags' => 'Kirby\Text\KirbyTags', - 'kirby\cms\template' => 'Kirby\Template\Template', - 'kirby\toolkit\dir' => 'Kirby\Filesystem\Dir', - 'kirby\toolkit\f' => 'Kirby\Filesystem\F', - 'kirby\toolkit\file' => 'Kirby\Filesystem\File', - 'kirby\toolkit\mime' => 'Kirby\Filesystem\Mime', + // Any of these might be removed at any point in the future + 'kirby\cms\asset' => 'Kirby\Filesystem\Asset', + 'kirby\cms\content' => 'Kirby\Content\Content', + 'kirby\cms\contenttranslation' => 'Kirby\Content\ContentTranslation', + 'kirby\cms\dir' => 'Kirby\Filesystem\Dir', + 'kirby\cms\filename' => 'Kirby\Filesystem\Filename', + 'kirby\cms\filefoundation' => 'Kirby\Filesystem\IsFile', + 'kirby\cms\field' => 'Kirby\Content\Field', + 'kirby\cms\form' => 'Kirby\Form\Form', + 'kirby\cms\kirbytag' => 'Kirby\Text\KirbyTag', + 'kirby\cms\kirbytags' => 'Kirby\Text\KirbyTags', + 'kirby\cms\template' => 'Kirby\Template\Template', + 'kirby\toolkit\dir' => 'Kirby\Filesystem\Dir', + 'kirby\toolkit\f' => 'Kirby\Filesystem\F', + 'kirby\toolkit\file' => 'Kirby\Filesystem\File', + 'kirby\toolkit\mime' => 'Kirby\Filesystem\Mime', ]; diff --git a/config/api/routes/kql.php b/config/api/routes/kql.php new file mode 100644 index 0000000000..68710ecd03 --- /dev/null +++ b/config/api/routes/kql.php @@ -0,0 +1,35 @@ + function ($kirby) { + return [ + [ + 'pattern' => 'query', + 'method' => 'POST|GET', + 'auth' => $kirby->option('kql.auth') !== false, + 'action' => function () use ($kirby) { + $kql = '\Kirby\Kql\Kql'; + + if (class_exists($kql) === false) { + return [ + 'code' => 500, + 'status' => 'error', + 'message' => 'KQL plugin is not installed', + ]; + } + + $input = $kirby->request()->get(); + $result = $kql::run($input); + + return [ + 'code' => 200, + 'result' => $result, + 'status' => 'ok', + ]; + } + ] + ]; + } +]; +// @codeCoverageIgnoreEnd diff --git a/config/components.php b/config/components.php index b56a707ebc..b2507accd1 100644 --- a/config/components.php +++ b/config/components.php @@ -136,7 +136,6 @@ /** * Add your own search engine * - * @param \Kirby\Cms\App $kirby Kirby instance * @param \Kirby\Cms\Collection $collection Collection of searchable models */ 'search' => function ( @@ -145,11 +144,6 @@ string $query = null, string|array $params = [] ): Collection { - // empty search query - if (empty(trim($query ?? '')) === true) { - return $collection->limit(0); - } - if (is_string($params) === true) { $params = ['fields' => Str::split($params, '|')]; } @@ -161,30 +155,42 @@ 'words' => false, ]; - $options = array_merge($defaults, $params); $collection = clone $collection; + $options = array_merge($defaults, $params); + $query = trim($query); + + // empty or too short search query + if (Str::length($query) < $options['minlength']) { + return $collection->limit(0); + } $words = preg_replace('/(\s)/u', ',', $query); $words = Str::split($words, ',', $options['minlength']); - $exact = $options['words'] ? '(\b' . preg_quote($query) . '\b)' : preg_quote($query); - $query = Str::lower($query); if (empty($options['stopwords']) === false) { $words = array_diff($words, $options['stopwords']); } + // returns an empty collection if there is no search word + if (empty($words) === true) { + return $collection->limit(0); + } + $words = A::map( $words, - fn ($value) => $options['words'] ? '\b' . preg_quote($value) . '\b' : preg_quote($value) + fn ($value) => Str::wrap(preg_quote($value), $options['words'] ? '\b' : '') ); - // returns an empty collection if there is no search word - if (empty($words) === true) { - return $collection->limit(0); + $exact = preg_quote($query); + + if ($options['words']) { + $exact = '(\b' . $exact . '\b)'; } + $query = Str::lower($query); $preg = '!(' . implode('|', $words) . ')!i'; $scores = []; + $results = $collection->filter(function ($item) use ($query, $exact, $preg, $options, &$scores) { $data = $item->content()->toArray(); $keys = array_keys($data); @@ -196,10 +202,10 @@ $keys[] = 'role'; } elseif ($item instanceof Page) { // apply the default score for pages - $options['score'] = array_merge([ - 'id' => 64, - 'title' => 64, - ], $options['score']); + $options['score'] = array_merge( + ['id' => 64, 'title' => 64], + $options['score'] + ); } if (empty($options['fields']) === false) { @@ -245,6 +251,7 @@ } $scores[$item->id()] = $scoring; + return $scoring['hits'] > 0; }); diff --git a/config/fields/files.php b/config/fields/files.php index e8d4686da8..4f3776549d 100644 --- a/config/fields/files.php +++ b/config/fields/files.php @@ -1,5 +1,6 @@ function () { if ( is_string($this->parent) === true && - $model = $this->model()->query($this->parent, 'Kirby\Cms\ModelWithContent') + $model = $this->model()->query( + $this->parent, + ModelWithContent::class + ) ) { return $model; } diff --git a/config/fields/link.php b/config/fields/link.php index 2cc9775c7f..b86cf9fa95 100644 --- a/config/fields/link.php +++ b/config/fields/link.php @@ -7,53 +7,150 @@ return [ 'props' => [ + 'after' => null, + 'before' => null, + 'icon' => null, + 'placeholder' => null, + + /** + * @values 'anchor', 'url, 'page, 'file', 'email', 'tel', 'custom' + */ + 'options' => function (array|null $options = null): array { + return $options ?? [ + 'url', + 'page', + 'file', + 'email', + 'tel', + 'anchor', + 'custom' + ]; + }, 'value' => function (string|null $value = null) { return $value ?? ''; } ], + 'methods' => [ + 'activeTypes' => function () { + return array_filter($this->availableTypes(), function (string $type) { + return in_array($type, $this->props['options']) === true; + }, ARRAY_FILTER_USE_KEY); + }, + 'availableTypes' => function () { + return [ + 'anchor' => [ + 'detect' => function (string $value): bool { + return Str::startsWith($value, '#') === true; + }, + 'link' => function (string $value): string { + return $value; + }, + 'validate' => function (string $value): bool { + return Str::startsWith($value, '#') === true; + }, + ], + 'email' => [ + 'detect' => function (string $value): bool { + return Str::startsWith($value, 'mailto:') === true; + }, + 'link' => function (string $value): string { + return str_replace('mailto:', '', $value); + }, + 'validate' => function (string $value): bool { + return V::email($value); + }, + ], + 'file' => [ + 'detect' => function (string $value): bool { + return Str::startsWith($value, 'file://') === true; + }, + 'link' => function (string $value): string { + return $value; + }, + 'validate' => function (string $value): bool { + return V::uuid($value, 'file'); + }, + ], + 'page' => [ + 'detect' => function (string $value): bool { + return Str::startsWith($value, 'page://') === true; + }, + 'link' => function (string $value): string { + return $value; + }, + 'validate' => function (string $value): bool { + return V::uuid($value, 'page'); + }, + ], + 'tel' => [ + 'detect' => function (string $value): bool { + return Str::startsWith($value, 'tel:') === true; + }, + 'link' => function (string $value): string { + return str_replace('tel:', '', $value); + }, + 'validate' => function (string $value): bool { + return V::tel($value); + }, + ], + 'url' => [ + 'detect' => function (string $value): bool { + return Str::startsWith($value, 'http://') === true || Str::startsWith($value, 'https://') === true; + }, + 'link' => function (string $value): string { + return $value; + }, + 'validate' => function (string $value): bool { + return V::url($value); + }, + ], + + // needs to come last + 'custom' => [ + 'detect' => function (string $value): bool { + return true; + }, + 'link' => function (string $value): string { + return $value; + }, + 'validate' => function (): bool { + return true; + }, + ] + ]; + }, + ], 'validations' => [ - 'value' => function ($value) { - if (V::uuid($value) === true) { + 'value' => function (string|null $value) { + if (empty($value) === true) { return true; } - if (Str::startsWith($value, 'mailto:') === true) { - // get the plain email address - $email = str_replace('mailto:', '', $value); + $detected = false; - // validate the email address - if (V::email($email) === false) { - throw new InvalidArgumentException([ - 'key' => 'validation.email' - ]); + foreach ($this->activeTypes() as $type => $options) { + if ($options['detect']($value) !== true) { + continue; } - return true; - } + $link = $options['link']($value); + $detected = true; - if (Str::startsWith($value, 'tel:') === true) { - // get the plain phone number - $tel = str_replace('tel:', '', $value); - - // validate the phone address - if (V::tel($tel) === false) { + if ($options['validate']($link) === false) { throw new InvalidArgumentException([ - 'key' => 'validation.tel' + 'key' => 'validation.' . $type ]); } - - return true; } - if (Url::isAbsolute($value) === true) { - if (V::url($value) === false) { - throw new InvalidArgumentException([ - 'key' => 'validation.url' - ]); - } - - return true; + // none of the configured types has been detected + if ($detected === false) { + throw new InvalidArgumentException([ + 'key' => 'validation.linkType' + ]); } + + return true; }, ] ]; diff --git a/config/fields/mixins/upload.php b/config/fields/mixins/upload.php index 00f35dc2ce..700cef9ccb 100644 --- a/config/fields/mixins/upload.php +++ b/config/fields/mixins/upload.php @@ -3,6 +3,7 @@ use Kirby\Cms\Api; use Kirby\Cms\File; use Kirby\Exception\Exception; +use Kirby\Exception\InvalidArgumentException; return [ 'props' => [ @@ -28,7 +29,11 @@ // get parent object for upload target $parent = $this->uploadParent($uploads['parent'] ?? null); - $file = new File([ + if ($parent === null) { + throw new InvalidArgumentException('"' . $uploads['parent'] . '" could not be resolved as a valid parent for the upload'); + } + + $file = new File([ 'filename' => 'tmp', 'parent' => $parent, 'template' => $template diff --git a/config/fields/number.php b/config/fields/number.php index 62470ed476..11334e878a 100644 --- a/config/fields/number.php +++ b/config/fields/number.php @@ -8,7 +8,7 @@ * Default number that will be saved when a new page/user/file is created */ 'default' => function ($default = null) { - return $this->toNumber($default); + return $this->toNumber($default) ?? ''; }, /** * The lowest allowed number @@ -26,10 +26,10 @@ * Allowed incremental steps between numbers (i.e `0.5`) */ 'step' => function ($step = null) { - return $this->toNumber($step); + return $this->toNumber($step) ?? ''; }, 'value' => function ($value = null) { - return $this->toNumber($value); + return $this->toNumber($value) ?? ''; } ], 'methods' => [ diff --git a/config/fields/users.php b/config/fields/users.php index b962a36fc1..f30f6ab894 100644 --- a/config/fields/users.php +++ b/config/fields/users.php @@ -24,29 +24,31 @@ /** * Default selected user(s) when a new page/file/user is created */ - 'default' => function ($default = null) { - if ($default === false) { + 'default' => function (string|array|bool|null $default = null) { + return $default; + }, + + 'value' => function ($value = null) { + return $this->toUsers($value); + }, + ], + 'computed' => [ + 'default' => function (): array { + if ($this->default === false) { return []; } - if ($default === null && $user = $this->kirby()->user()) { + if ( + $this->default === true && + $user = $this->kirby()->user() + ) { return [ $this->userResponse($user) ]; } - return $this->toUsers($default); - }, - - 'value' => function ($value = null) { - return $this->toUsers($value); - }, - ], - 'computed' => [ - /** - * Unset inherited computed - */ - 'default' => null + return $this->toUsers($this->default); + } ], 'methods' => [ 'userResponse' => function ($user) { @@ -57,7 +59,7 @@ 'text' => $this->text, ]); }, - 'toUsers' => function ($value = null) { + 'toUsers' => function ($value = null): array { $users = []; $kirby = App::instance(); diff --git a/config/methods.php b/config/methods.php index 63c68d2c49..fe3ffa72d4 100644 --- a/config/methods.php +++ b/config/methods.php @@ -2,13 +2,13 @@ use Kirby\Cms\App; use Kirby\Cms\Blocks; -use Kirby\Cms\Content; -use Kirby\Cms\Field; use Kirby\Cms\Files; use Kirby\Cms\Html; use Kirby\Cms\Layouts; use Kirby\Cms\Structure; use Kirby\Cms\Url; +use Kirby\Content\Content; +use Kirby\Content\Field; use Kirby\Data\Data; use Kirby\Exception\Exception; use Kirby\Exception\InvalidArgumentException; @@ -27,7 +27,7 @@ /** * Converts the field value into a proper boolean and inverts it * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @return bool */ 'isFalse' => function (Field $field): bool { @@ -37,7 +37,7 @@ /** * Converts the field value into a proper boolean * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @return bool */ 'isTrue' => function (Field $field): bool { @@ -59,7 +59,7 @@ /** * Converts a yaml or json field to a Blocks object * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @return \Kirby\Cms\Blocks */ 'toBlocks' => function (Field $field) { @@ -84,7 +84,7 @@ /** * Converts the field value into a proper boolean * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param bool $default Default value if the field is empty * @return bool */ @@ -96,7 +96,7 @@ /** * Parses the field value with the given method * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param string $method [',', 'yaml', 'json'] * @return array */ @@ -110,7 +110,7 @@ /** * Converts the field value to a timestamp or a formatted date * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param string|\IntlDateFormatter|null $format PHP date formatting string * @param string|null $fallback Fallback string for `strtotime` (since 3.2) * @return string|int @@ -133,7 +133,7 @@ /** * Returns a file object from a filename in the field * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @return \Kirby\Cms\File|null */ 'toFile' => function (Field $field) { @@ -143,7 +143,7 @@ /** * Returns a file collection from a yaml list of filenames in the field * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param string $separator * @return \Kirby\Cms\Files */ @@ -163,7 +163,7 @@ /** * Converts the field value into a proper float * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param float $default Default value if the field is empty * @return float */ @@ -175,7 +175,7 @@ /** * Converts the field value into a proper integer * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param int $default Default value if the field is empty * @return int */ @@ -188,7 +188,7 @@ * Parse layouts and turn them into * Layout objects * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @return \Kirby\Cms\Layouts */ 'toLayouts' => function (Field $field) { @@ -201,7 +201,7 @@ /** * Wraps a link tag around the field value. The field value is used as the link text * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param mixed $attr1 Can be an optional Url. If no Url is set, the Url of the Page, File or Site will be used. Can also be an array of link attributes * @param mixed $attr2 If `$attr1` is used to set the Url, you can use `$attr2` to pass an array of additional attributes. * @return string @@ -226,8 +226,8 @@ * Parse yaml data and convert it to a * content object * - * @param \Kirby\Cms\Field $field - * @return \Kirby\Cms\Content + * @param \Kirby\Content\Field $field + * @return \Kirby\Content\Content */ 'toObject' => function (Field $field) { return new Content($field->yaml(), $field->parent(), true); @@ -236,7 +236,7 @@ /** * Returns a page object from a page id in the field * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @return \Kirby\Cms\Page|null */ 'toPage' => function (Field $field) { @@ -246,7 +246,7 @@ /** * Returns a pages collection from a yaml list of page ids in the field * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param string $separator Can be any other separator to split the field value by * @return \Kirby\Cms\Pages */ @@ -257,17 +257,20 @@ /** * Converts a yaml field to a Structure object * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @return \Kirby\Cms\Structure */ 'toStructure' => function (Field $field) { try { - return new Structure(Data::decode($field->value, 'yaml'), $field->parent()); + return Structure::factory( + Data::decode($field->value, 'yaml'), + ['parent' => $field->parent()] + ); } catch (Exception) { $message = 'Invalid structure data for "' . $field->key() . '" field'; if ($parent = $field->parent()) { - $message .= ' on parent "' . $parent->title() . '"'; + $message .= ' on parent "' . $parent->id() . '"'; } throw new InvalidArgumentException($message); @@ -277,7 +280,7 @@ /** * Converts the field value to a Unix timestamp * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @return int|false */ 'toTimestamp' => function (Field $field): int|false { @@ -294,7 +297,7 @@ /** * Converts a user email address to a user object * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @return \Kirby\Cms\User|null */ 'toUser' => function (Field $field) { @@ -304,7 +307,7 @@ /** * Returns a users collection from a yaml list of user email addresses in the field * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param string $separator * @return \Kirby\Cms\Users */ @@ -334,7 +337,7 @@ * Applies the callback function to the field * @since 3.4.0 * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param Closure $callback */ 'callback' => function (Field $field, Closure $callback) { @@ -345,7 +348,7 @@ * Escapes the field value to be safely used in HTML * templates without the risk of XSS attacks * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param string $context Location of output (`html`, `attr`, `js`, `css`, `url` or `xml`) */ 'escape' => function (Field $field, string $context = 'html') { @@ -357,11 +360,11 @@ * Creates an excerpt of the field value without html * or any other formatting. * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param int $cahrs * @param bool $strip * @param string $rep - * @return \Kirby\Cms\Field + * @return \Kirby\Content\Field */ 'excerpt' => function (Field $field, int $chars = 0, bool $strip = true, string $rep = ' …') { $field->value = Str::excerpt($field->kirbytext()->value(), $chars, $strip, $rep); @@ -371,8 +374,8 @@ /** * Converts the field content to valid HTML * - * @param \Kirby\Cms\Field $field - * @return \Kirby\Cms\Field + * @param \Kirby\Content\Field $field + * @return \Kirby\Content\Field */ 'html' => function (Field $field) { $field->value = Html::encode($field->value); @@ -385,8 +388,8 @@ * without the risk of breaking the HTML structure. * @since 3.3.0 * - * @param \Kirby\Cms\Field $field - * @return \Kirby\Cms\Field + * @param \Kirby\Content\Field $field + * @return \Kirby\Content\Field */ 'inline' => function (Field $field) { // List of valid inline elements taken from: https://developer.mozilla.org/de/docs/Web/HTML/Inline_elemente @@ -400,9 +403,9 @@ /** * Converts the field content from Markdown/Kirbytext to valid HTML * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param array $options - * @return \Kirby\Cms\Field + * @return \Kirby\Content\Field */ 'kirbytext' => function (Field $field, array $options = []) use ($app) { $field->value = $app->kirbytext($field->value, A::merge($options, [ @@ -418,9 +421,9 @@ * to valid HTML * @since 3.1.0 * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param array $options - * @return \Kirby\Cms\Field + * @return \Kirby\Content\Field */ 'kirbytextinline' => function (Field $field, array $options = []) use ($app) { $field->value = $app->kirbytext($field->value, A::merge($options, [ @@ -437,8 +440,8 @@ /** * Parses all KirbyTags without also parsing Markdown * - * @param \Kirby\Cms\Field $field - * @return \Kirby\Cms\Field + * @param \Kirby\Content\Field $field + * @return \Kirby\Content\Field */ 'kirbytags' => function (Field $field) use ($app) { $field->value = $app->kirbytags($field->value, [ @@ -452,8 +455,8 @@ /** * Converts the field content to lowercase * - * @param \Kirby\Cms\Field $field - * @return \Kirby\Cms\Field + * @param \Kirby\Content\Field $field + * @return \Kirby\Content\Field */ 'lower' => function (Field $field) { $field->value = Str::lower($field->value); @@ -463,9 +466,9 @@ /** * Converts markdown to valid HTML * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param array $options - * @return \Kirby\Cms\Field + * @return \Kirby\Content\Field */ 'markdown' => function (Field $field, array $options = []) use ($app) { $field->value = $app->markdown($field->value, $options); @@ -476,8 +479,8 @@ * Converts all line breaks in the field content to `
` tags. * @since 3.3.0 * - * @param \Kirby\Cms\Field $field - * @return \Kirby\Cms\Field + * @param \Kirby\Content\Field $field + * @return \Kirby\Content\Field */ 'nl2br' => function (Field $field) { $field->value = nl2br($field->value ?? '', false); @@ -487,7 +490,7 @@ /** * Uses the field value as Kirby query * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param string|null $expect * @return mixed */ @@ -506,11 +509,11 @@ /** * It parses any queries found in the field value. * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param array $data * @param string|null $fallback Fallback for tokens in the template that cannot be replaced * (`null` to keep the original token) - * @return \Kirby\Cms\Field + * @return \Kirby\Content\Field */ 'replace' => function (Field $field, array $data = [], string|null $fallback = '') use ($app) { if ($parent = $field->parent()) { @@ -531,10 +534,10 @@ * Cuts the string after the given length and * adds "…" if it is longer * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @param int $length The number of characters in the string * @param string $appendix An optional replacement for the missing rest - * @return \Kirby\Cms\Field + * @return \Kirby\Content\Field */ 'short' => function (Field $field, int $length, string $appendix = '…') { $field->value = Str::short($field->value, $length, $appendix); @@ -544,8 +547,8 @@ /** * Converts the field content to a slug * - * @param \Kirby\Cms\Field $field - * @return \Kirby\Cms\Field + * @param \Kirby\Content\Field $field + * @return \Kirby\Content\Field */ 'slug' => function (Field $field) { $field->value = Str::slug($field->value); @@ -555,8 +558,8 @@ /** * Applies SmartyPants to the field * - * @param \Kirby\Cms\Field $field - * @return \Kirby\Cms\Field + * @param \Kirby\Content\Field $field + * @return \Kirby\Content\Field */ 'smartypants' => function (Field $field) use ($app) { $field->value = $app->smartypants($field->value); @@ -566,7 +569,7 @@ /** * Splits the field content into an array * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @return array */ 'split' => function (Field $field, $separator = ',') { @@ -576,8 +579,8 @@ /** * Converts the field content to uppercase * - * @param \Kirby\Cms\Field $field - * @return \Kirby\Cms\Field + * @param \Kirby\Content\Field $field + * @return \Kirby\Content\Field */ 'upper' => function (Field $field) { $field->value = Str::upper($field->value); @@ -588,8 +591,8 @@ * Avoids typographical widows in strings by replacing * the last space with ` ` * - * @param \Kirby\Cms\Field $field - * @return \Kirby\Cms\Field + * @param \Kirby\Content\Field $field + * @return \Kirby\Content\Field */ 'widont' => function (Field $field) { $field->value = Str::widont($field->value); @@ -599,8 +602,8 @@ /** * Converts the field content to valid XML * - * @param \Kirby\Cms\Field $field - * @return \Kirby\Cms\Field + * @param \Kirby\Content\Field $field + * @return \Kirby\Content\Field */ 'xml' => function (Field $field) { $field->value = Xml::encode($field->value); @@ -612,7 +615,7 @@ /** * Parses yaml in the field content and returns an array * - * @param \Kirby\Cms\Field $field + * @param \Kirby\Content\Field $field * @return array */ 'yaml' => function (Field $field): array { diff --git a/config/sections/pages.php b/config/sections/pages.php index 88e76daf49..7d8b92e664 100644 --- a/config/sections/pages.php +++ b/config/sections/pages.php @@ -50,11 +50,23 @@ return $status; }, + /** + * Filters the list by single template. + */ + 'template' => function (string $template = null) { + return $template; + }, /** * Filters the list by templates and sets template options when adding new pages to the section. */ 'templates' => function ($templates = null) { return A::wrap($templates ?? $this->template); + }, + /** + * Excludes the selected templates. + */ + 'templatesIgnore' => function ($templates = null) { + return A::wrap($templates); } ], 'computed' => [ @@ -94,8 +106,21 @@ return false; } + $intendedTemplate = $page->intendedTemplate()->name(); + // filter by all set templates - if ($this->templates && in_array($page->intendedTemplate()->name(), $this->templates) === false) { + if ( + $this->templates && + in_array($intendedTemplate, $this->templates) === false + ) { + return false; + } + + // exclude by all ignored templates + if ( + $this->templatesIgnore && + in_array($intendedTemplate, $this->templatesIgnore) === true + ) { return false; } @@ -227,6 +252,11 @@ $templates = $this->kirby()->blueprints(); } + // excludes ignored templates + if ($templatesIgnore = $this->templatesIgnore) { + $templates = array_diff($templates, $templatesIgnore); + } + // convert every template to a usable option array // for the template select box foreach ($templates as $template) { diff --git a/config/sections/stats.php b/config/sections/stats.php index e73e7dceba..e18eba0acd 100644 --- a/config/sections/stats.php +++ b/config/sections/stats.php @@ -34,9 +34,9 @@ ], 'computed' => [ 'reports' => function () { - $reports = []; - $model = $this->model(); - $value = fn ($value) => $value === null ? null : $model->toString($value); + $reports = []; + $model = $this->model(); + $toString = fn ($value) => $value === null ? null : $model->toString($value); foreach ($this->reports as $report) { if (is_string($report) === true) { @@ -47,14 +47,17 @@ continue; } - $info = $report['info'] ?? null; + $info = $report['info'] ?? null; + $label = $report['label'] ?? null; + $link = $report['link'] ?? null; + $value = $report['value'] ?? null; $reports[] = [ - 'label' => I18n::translate($report['label'], $report['label']), - 'value' => $value($report['value'] ?? null), - 'info' => $value(I18n::translate($info, $info)), - 'link' => $value($report['link'] ?? null), - 'theme' => $value($report['theme'] ?? null) + 'info' => $toString(I18n::translate($info, $info)), + 'label' => $toString(I18n::translate($label, $label)), + 'link' => $toString(I18n::translate($link, $link)), + 'theme' => $toString($report['theme'] ?? null), + 'value' => $toString(I18n::translate($value, $value)) ]; } diff --git a/i18n/translations/en.json b/i18n/translations/en.json index c3554e1cdb..acd4ddeddd 100644 --- a/i18n/translations/en.json +++ b/i18n/translations/en.json @@ -17,6 +17,7 @@ "copy.all": "Copy all", "copy.success": "{count} copied!", "create": "Create", + "custom": "Custom", "date": "Date", "date.select": "Select a date", @@ -211,6 +212,7 @@ "error.validation.accepted": "Please confirm", "error.validation.alpha": "Please only enter characters between a-z", "error.validation.alphanum": "Please only enter characters between a-z or numerals 0-9", + "error.validation.anchor": "Please enter a correct link anchor", "error.validation.between": "Please enter a value between \"{min}\" and \"{max}\"", "error.validation.boolean": "Please confirm or deny", "error.validation.contains": "Please enter a value that contains \"{needle}\"", @@ -227,6 +229,7 @@ "error.validation.integer": "Please enter a valid integer", "error.validation.ip": "Please enter a valid IP address", "error.validation.less": "Please enter a value lower than {max}", + "error.validation.linkType": "The link type is not allowed", "error.validation.match": "The value does not match the expected pattern", "error.validation.max": "Please enter a value equal to or lower than {max}", "error.validation.maxlength": "Please enter a shorter value. (max. {max} characters)", @@ -248,6 +251,7 @@ "error.validation.time.after": "Please enter a time after {time}", "error.validation.time.before": "Please enter a time before {time}", "error.validation.time.between": "Please enter a time between {min} and {max}", + "error.validation.uuid": "Please enter a valid UUID", "error.validation.url": "Please enter a valid URL", "expand": "Expand", @@ -554,8 +558,10 @@ "system.updateStatus.update": "Free update { version } available", "system.updateStatus.upgrade": "Upgrade { version } available", - "title": "Title", + "tel": "Phone", + "tel.placeholder": "+49123456789", "template": "Template", + "title": "Title", "today": "Today", "toolbar.button.clear": "Clear formatting", diff --git a/i18n/translations/is_IS.json b/i18n/translations/is_IS.json index d2fe7d63c6..f1d63caf41 100644 --- a/i18n/translations/is_IS.json +++ b/i18n/translations/is_IS.json @@ -10,9 +10,9 @@ "cancel": "Hætta við", "change": "Breyta", "close": "Loka", - "confirm": "Ok", - "collapse": "Collapse", - "collapse.all": "Collapse All", + "confirm": "OK", + "collapse": "Fella", + "collapse.all": "Fella allt", "copy": "Afrita", "copy.all": "Afrita allt", "create": "Stofna", @@ -495,7 +495,7 @@ "show": "Sýna", "site.blueprint": "Þessi vefur hefur ekki skipan (e. blueprint) ennþá. Þú mátt skilgreina skipanina í /site/blueprints/site.yml", "size": "Stærð", - "slug": "Slögg", + "slug": "Slögg forskeyti", "sort": "Raða", "stats.empty": "Engar skýrslur", diff --git a/i18n/translations/ko.json b/i18n/translations/ko.json index 21b4343e24..a453238c45 100644 --- a/i18n/translations/ko.json +++ b/i18n/translations/ko.json @@ -292,7 +292,7 @@ "field.pages.empty": "선택한 페이지가 없습니다.", "field.structure.delete.confirm": "이 항목을 삭제할까요?", - "field.structure.delete.confirm.all": "Do you really want to delete all entries?", + "field.structure.delete.confirm.all": "모든 항목을 삭제할까요?", "field.structure.empty": "항목이 없습니다.", "field.users.empty": "선택한 사용자가 없습니다.", diff --git a/i18n/translations/pl.json b/i18n/translations/pl.json index ddee187c1a..69ace65c8e 100644 --- a/i18n/translations/pl.json +++ b/i18n/translations/pl.json @@ -70,14 +70,14 @@ "error.blocks.max.singular": "Możesz dodać tylko jeden blok", "error.blocks.min.plural": "Musisz dodać co najmniej {min} bloki/-ów", "error.blocks.min.singular": "Musisz dodać co najmniej jeden blok", - "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.blocks.validation": "Wystąpił błąd w polu „{field}” w bloku {index} o typie bloku „{fieldset}”", - "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.cache.type.invalid": "Nieprawidłowy typ pamięci podręcznej „{type}”", "error.email.preset.notFound": "Nie udało się załadować wzorca wiadomości e-mail \"{name}\"", "error.field.converter.invalid": "Nieprawidłowy konwerter \"{converter}\"", - "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", + "error.field.type.missing": "Pole „{ name }”: Typ pola „{ type }” nie istnieje", "error.file.changeName.empty": "Imię nie może być puste", "error.file.changeName.permission": "Nie masz uprawnień, by zmienić nazwę \"{filename}\"", @@ -110,14 +110,14 @@ "error.language.name": "Wprowadź poprawną nazwę języka.", "error.language.notFound": "Język nie został odnaleziony", - "error.layout.validation.block": "There's an error on the \"{field}\" field in block {blockIndex} using the \"{fieldset}\" block type in layout {layoutIndex}", + "error.layout.validation.block": "Wystąpił błąd w polu „{field}” w bloku {blockIndex} o typie bloku „{fieldset}” w układzie {layoutIndex}", "error.layout.validation.settings": "W ustawieniach układu {index} jest błąd", "error.license.format": "Wprowadź poprawny klucz licencyjny", "error.license.email": "Wprowadź poprawny adres email", "error.license.verification": "Nie udało się zweryfikować licencji", - "error.object.validation": "There’s an error in the \"{label}\" field:\n{message}", + "error.object.validation": "Wystąpił błąd w polu „{label}”:\n{message}", "error.offline": "Panel jest obecnie offline", @@ -262,7 +262,7 @@ "field.blocks.image.placeholder": "Wybierz obrazek", "field.blocks.image.ratio": "Proporcje", "field.blocks.image.url": "URL obrazka", - "field.blocks.line.name": "Linijka", + "field.blocks.line.name": "Linia", "field.blocks.list.name": "Lista", "field.blocks.markdown.name": "Markdown", "field.blocks.markdown.label": "Tekst", @@ -287,12 +287,12 @@ "field.layout.empty": "Nie ma jeszcze żadnych rzędów", "field.layout.select": "Wybierz układ", - "field.object.empty": "No information yet", + "field.object.empty": "Brak informacji", "field.pages.empty": "Nie wybrano jeszcze żadnych stron", "field.structure.delete.confirm": "Czy na pewno chcesz usunąć ten wiersz?", - "field.structure.delete.confirm.all": "Do you really want to delete all entries?", + "field.structure.delete.confirm.all": "Czy na pewno chcesz usunąć wszystkie wpisy?", "field.structure.empty": "Nie ma jeszcze \u017cadnych wpis\u00f3w.", "field.users.empty": "Nie wybrano jeszcze żadnych użytkowników", @@ -353,8 +353,8 @@ "license.manage": "Zarządzaj swoimi licencjami", "license.register.help": "Po zakupieniu licencji otrzymałaś/-eś mailem klucz. Skopiuj go i wklej tutaj, aby dokonać rejestracji.", "license.register.label": "Wprowadź swój kod licencji", - "license.register.domain": "Your license will be registered to {host}.", - "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", + "license.register.domain": "Twoja licencja zostanie zarejestrowana na {host}.", + "license.register.local": "Zamierzasz zarejestrować licencję dla swojej domeny lokalnej {host}. Jeśli ta witryna zostanie wdrożona w domenie ogólnodostępnej, zarejestruj ją tam. Jeżeli {host} jest faktycznie domeną, do której chcesz przypisać licencję, kontynuuj.", "license.register.success": "Dziękujemy za wspieranie Kirby", "license.unregistered": "To jest niezarejestrowana wersja demonstracyjna Kirby", "license.unregistered.label": "Niezarejestrowane", @@ -460,7 +460,7 @@ "paste": "Wklej", "paste.after": "Wklej po", "pixel": "Piksel", - "plugin": "Plugin", + "plugin": "Wtyczka", "plugins": "Wtyczki", "prev": "Poprzednie", "preview": "Podgląd", @@ -500,24 +500,24 @@ "stats.empty": "Brak raportów", "system.issues.content": "Zdaje się, że folder „content” jest wystawiony na publiczny dostęp", - "system.issues.eol.kirby": "Your installed Kirby version has reached end-of-life and will not receive further security updates", - "system.issues.eol.plugin": "Your installed version of the { plugin } plugin is has reached end-of-life and will not receive further security updates", + "system.issues.eol.kirby": "Twoja zainstalowana wersja Kirby osiągnęła koniec okresu wsparcia i nie będzie otrzymywać dalszych aktualizacji zabezpieczeń", + "system.issues.eol.plugin": "Twoja zainstalowana wersja wtyczki { plugin } osiągnęła koniec okresu wsparcia i nie będzie otrzymywać dalszych aktualizacji zabezpieczeń", "system.issues.debug": "Debugowanie musi być wyłączone w środowisku produkcyjnym", "system.issues.git": "Zdaje się, że folder „.git” jest wystawiony na publiczny dostęp", "system.issues.https": "Zalecamy HTTPS dla wszystkich Twoich witryn", "system.issues.kirby": "Zdaje się, że folder „kirby” jest wystawiony na publiczny dostęp", "system.issues.site": "Zdaje się, że folder „site” jest wystawiony na publiczny dostęp", - "system.issues.vulnerability.kirby": "Your installation might be affected by the following vulnerability ({ severity } severity): { description }", - "system.issues.vulnerability.plugin": "Your installation might be affected by the following vulnerability in the { plugin } plugin ({ severity } severity): { description }", - "system.updateStatus": "Update status", - "system.updateStatus.error": "Could not check for updates", - "system.updateStatus.not-vulnerable": "No known vulnerabilities", - "system.updateStatus.security-update": "Free security update { version } available", - "system.updateStatus.security-upgrade": "Upgrade { version } with security fixes available", - "system.updateStatus.unreleased": "Unreleased version", - "system.updateStatus.up-to-date": "Up to date", - "system.updateStatus.update": "Free update { version } available", - "system.updateStatus.upgrade": "Upgrade { version } available", + "system.issues.vulnerability.kirby": "Twojej instalacji może zagrażać następująca luka w zabezpieczeniach ({ severity } stopień): { description }", + "system.issues.vulnerability.plugin": "Twojej instalacji może zagrażać następująca luka w zabezpieczeniach we wtyczce { plugin } ({ severity } poziom): { description }", + "system.updateStatus": "Stan aktualizacji", + "system.updateStatus.error": "Nie udało się sprawdzić dostępności aktualizacji", + "system.updateStatus.not-vulnerable": "Brak znanych luk bezpieczeństwa", + "system.updateStatus.security-update": "Dostępna darmowa aktualizacja { version } z poprawkami bezpieczeństwa", + "system.updateStatus.security-upgrade": "Dostępna aktualizacja { version } z poprawkami bezpieczeństwa", + "system.updateStatus.unreleased": "Niepublikowana wersja", + "system.updateStatus.up-to-date": "Aktualna", + "system.updateStatus.update": "Dostępna darmowa aktualizacja { version }", + "system.updateStatus.upgrade": "Dostępna aktualizacja { version }", "title": "Tytuł", "template": "Szablon", @@ -584,9 +584,9 @@ "users": "Użytkownicy", "version": "Wersja", - "version.current": "Current version", - "version.latest": "Latest version", - "versionInformation": "Version information", + "version.current": "Obecna wersja", + "version.latest": "Ostatnia wersja", + "versionInformation": "Informacje o wersji", "view.account": "Twoje konto", "view.installation": "Instalacja", diff --git a/panel/dist/css/style.css b/panel/dist/css/style.css index 1786877f03..1a14b8f077 100644 --- a/panel/dist/css/style.css +++ b/panel/dist/css/style.css @@ -1 +1 @@ -.k-dialog-body{padding:var(--dialog-padding)}.k-button-group.k-dialog-buttons{display:flex;justify-content:space-between;margin:0}.k-button-group.k-dialog-buttons .k-button{line-height:1.25rem;padding:.75rem 1rem}.k-button-group.k-dialog-buttons .k-button.k-dialog-button-cancel{padding-left:1.5rem;text-align:left}.k-button-group.k-dialog-buttons .k-button.k-dialog-button-submit{padding-right:1.5rem;text-align:right}.k-dialog-fields{padding-bottom:.5rem}.k-dialog-footer{border-top:1px solid var(--color-gray-300);flex-shrink:0;line-height:1;padding:0}.k-notification.k-dialog-notification{border-top-left-radius:var(--rounded);border-top-right-radius:var(--rounded);margin-top:-1px}.k-dialog-search{margin-bottom:.75rem}.k-dialog-search.k-input{background:rgba(0,0,0,.075);border-radius:var(--rounded);height:36px;padding:0 1rem}:root{--dialog-color-back:var(--color-light);--dialog-color-text:currentColor;--dialog-rounded:var(--rounded-md);--dialog-padding:var(--spacing-6);--dialog-shadow:var(--shadow-xl);--dialog-width:22rem}.k-dialog{background:var(--dialog-color-back);border-radius:var(--dialog-rounded);box-shadow:var(--dialog-shadow);color:var(--dialog-color-text);display:flex;flex-direction:column;line-height:1;margin:1.5rem;max-height:calc(100vh - 3rem);position:relative;width:clamp(10rem,100%,var(--dialog-width))}@media screen and (min-width:20rem){.k-dialog[data-size=small]{--dialog-width:20rem}}@media screen and (min-width:22rem){.k-dialog[data-size=default]{--dialog-width:22rem}}@media screen and (min-width:30rem){.k-dialog[data-size=medium]{--dialog-width:30rem}}@media screen and (min-width:40rem){.k-dialog[data-size=large]{--dialog-width:40rem}}.k-dialog .k-pagination{align-items:center;display:flex;justify-content:center;margin-bottom:-1.5rem}.k-error-details{background:var(--color-white);display:block;font-size:var(--text-sm);line-height:1.25em;margin-top:.75rem;overflow:auto;padding:1rem}.k-error-details dt{color:var(--color-negative-light);margin-bottom:.25rem}.k-error-details dd{overflow:hidden;overflow-wrap:break-word;text-overflow:ellipsis}.k-error-details dd:not(:last-of-type){margin-bottom:1.5em}.k-error-details li{white-space:pre-line}.k-error-details li:not(:last-child){border-bottom:1px solid var(--color-background);margin-bottom:.25rem;padding-bottom:.25rem}.k-files-dialog .k-list-item{cursor:pointer}.k-page-template-switch{border-bottom:1px dashed var(--color-gray-300);margin-bottom:var(--spacing-6);padding-bottom:var(--spacing-6)}.k-page-template-switch nav{display:grid;gap:2px;grid-template-columns:1fr 1fr}.k-page-template-switch .k-headline{line-height:1.25;margin-bottom:.75rem}.k-page-template-switch button{background:var(--color-white);border-radius:var(--rounded-sm);box-shadow:var(--shadow);font-size:var(--text-sm);padding:.625rem .75rem;text-align:left}.k-page-template-switch button[aria-current]{background:var(--color-light)}.k-page-move-dialog .k-headline{margin-bottom:var(--spacing-2)}.k-page-move-parent{--tree-color-back:var(--color-white);--tree-color-hover-back:var(--color-light);background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);padding:var(--spacing-3)}.k-pages-dialog-navbar{align-items:center;display:flex;justify-content:center;margin-bottom:.5rem;padding-right:38px}.k-pages-dialog-navbar .k-button{width:38px}.k-pages-dialog-navbar .k-button[disabled]{opacity:0}.k-pages-dialog-navbar .k-headline{flex-grow:1;text-align:center}.k-pages-dialog .k-list-item{cursor:pointer}.k-pages-dialog .k-list-item .k-button[data-theme=disabled],.k-pages-dialog .k-list-item .k-button[disabled]{opacity:.25}.k-pages-dialog .k-list-item .k-button[data-theme=disabled]:hover{opacity:1}.k-search-dialog{margin:2.5rem auto}.k-search-dialog-input{display:flex}.k-search-dialog-types{display:flex;flex-shrink:0}.k-search-dialog-types>.k-button{font-size:var(--text-base);height:2.5rem;line-height:1;padding-left:1rem}.k-search-dialog-types>.k-button .k-icon{height:2.5rem}.k-search-dialog-types>.k-button .k-button-text{font-weight:500;opacity:1}.k-search-dialog-input input{background:none;border:0;flex-grow:1;font:inherit;height:2.5rem;padding:.75rem}.k-search-dialog-input input:focus{outline:0}.k-search-dialog-close{line-height:1;width:3rem}.k-search-dialog-close .k-icon-loader{animation:Spin 2s linear infinite}.k-search-dialog-results{padding:.5rem 1rem 1rem}.k-search-dialog-results .k-item:not(:last-child){margin-bottom:.25rem}.k-search-dialog-results .k-item[data-selected=true]{outline:2px solid var(--color-focus)}.k-search-dialog-results .k-item-info{font-size:var(--text-xs)}.k-search-dialog-footer{text-align:center}.k-search-dialog-footer p{color:var(--color-gray-600);font-size:var(--text-xs)}.k-search-dialog-footer .k-button{margin-top:var(--spacing-3)}.k-upload-dialog.k-dialog{--dialog-width:40rem}.k-upload-items{display:grid;gap:.25rem}.k-upload-item{accent-color:var(--color-focus);background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);display:grid;grid-template-areas:"preview input input" "preview body toggle" "preview progress toggle";grid-template-columns:6rem 1fr auto;grid-template-rows:1fr 1fr 1fr;height:6rem}.k-upload-item-preview{border-bottom-left-radius:var(--rounded);border-top-left-radius:var(--rounded);display:block;grid-area:preview;height:100%;overflow:hidden;width:100%}.k-upload-item-preview:focus{border-radius:var(--rounded);outline:2px solid var(--color-focus);z-index:1}.k-upload-item-preview .k-aspect-ratio>*{border-right:1px solid var(--color-light);color:var(--color-gray-500);display:grid;place-items:center}.k-upload-item-body{grid-area:body;padding:var(--spacing-2) var(--spacing-3) 0}.k-upload-item-input.k-input{border-bottom:1px solid var(--color-light);font-size:var(--text-sm);grid-area:input;padding:var(--spacing-2) var(--spacing-3)}.k-upload-item-input.k-input:focus-within{border-radius:var(--rounded);outline:2px solid var(--color-focus);z-index:1}.k-upload-item-input .k-input-after,.k-upload-item-meta{color:var(--color-gray-600)}.k-upload-item-error,.k-upload-item-meta{font-size:var(--text-xs)}.k-upload-item-error{color:var(--color-red-400);margin-top:.25rem}.k-upload-item-progress{--progress-height:.25rem;--progress-color-back:var(--color-light);align-self:end;grid-area:progress;height:1.375rem;padding-left:var(--spacing-3);padding-right:var(--spacing-3)}.k-upload-item-toggle{align-self:end;grid-area:toggle}.k-upload-item-toggle>*{padding:var(--spacing-3)}.k-upload-item[data-completed] .k-upload-item-progress{--progress-color-value:var(--color-green-400)}.k-upload-replace-dialog .k-upload-items{align-items:center;display:flex;gap:var(--spacing-3)}.k-upload-original{border-radius:var(--rounded);box-shadow:var(--shadow);overflow:hidden;width:6rem}.k-upload-replace-dialog .k-upload-item{flex-grow:1}.k-users-dialog .k-list-item{cursor:pointer}.k-drawer-body{background:var(--color-background);flex-grow:1;padding:1.5rem}.k-drawer-body .k-table th,.k-drawer-body .k-textarea-input:focus-within .k-toolbar{top:-1.5rem}.k-drawer-header{align-items:center;background:var(--color-white);display:flex;flex-shrink:0;font-size:var(--text-sm);height:var(--drawer-header-height);justify-content:space-between;line-height:1;padding-left:var(--drawer-header-padding)}.k-drawer-title{padding:0 .75rem}.k-drawer-breadcrumb,.k-drawer-title{align-items:center;display:flex;flex-grow:1;font-size:var(--text-sm);font-weight:var(--font-normal);margin-left:-.75rem;min-width:0}.k-drawer-breadcrumb li:not(:last-child) .k-button:after{align-items:center;color:var(--color-gray-500);content:"›";display:inline-flex;height:var(--drawer-header-height);justify-content:center;position:absolute;right:-.75rem;width:1.5rem}.k-drawer-breadcrumb .k-icon,.k-drawer-title .k-icon{color:var(--color-gray-500);margin-right:.5rem;width:1rem}.k-drawer-breadcrumb .k-button{align-items:center;display:inline-flex;height:var(--drawer-header-height);padding-left:.75rem;padding-right:.75rem}.k-drawer-breadcrumb .k-button-text{opacity:1}.k-drawer-breadcrumb .k-button .k-button-icon~.k-button-text{padding-left:0}.k-drawer-option.k-button,.k-drawer-options{align-items:center;display:flex;padding-right:.75rem}.k-drawer-option.k-button{height:var(--drawer-header-height);justify-content:center;line-height:1;min-width:var(--drawer-header-height);padding-left:.75rem}.k-notification.k-drawer-notification{padding:.625rem 1.5rem}.k-drawer-tabs{align-items:center;display:flex;line-height:1;margin-right:.75rem}.k-drawer-tab.k-button{align-items:center;display:flex;font-size:var(--text-xs);height:var(--drawer-header-height);padding-left:.75rem;padding-right:.75rem}.k-drawer-tab.k-button[aria-current]:after{background:var(--color-black);bottom:-1px;content:"";height:2px;left:.75rem;position:absolute;right:.75rem;z-index:1}:root{--drawer-color-back:var(--color-light);--drawer-header-height:2.5rem;--drawer-header-padding:1.5rem;--drawer-shadow:var(--shadow-xl);--drawer-width:50rem}.k-drawer-overlay{--overlay-color-back:rgba(0,0,0,.2);align-items:stretch;display:flex;justify-content:flex-end}.k-drawer-overlay+.k-drawer-overlay{--overlay-color-back:none}.k-drawer{background:var(--drawer-color-back);box-shadow:var(--drawer-shadow);display:flex;flex-basis:var(--drawer-width);flex-direction:column;position:relative;z-index:var(--z-toolbar)}.k-calendar-input{--cell-padding:.25rem .5rem;border-radius:var(--rounded-xs);color:var(--color-light);padding:.5rem}.k-calendar-table{min-width:15rem;padding-top:.5rem;table-layout:fixed;width:100%}.k-calendar-input>nav{direction:ltr;display:flex}.k-calendar-input>nav .k-button{padding:.5rem}.k-calendar-selects{align-items:center;display:flex;flex-grow:1;justify-content:center}[dir=ltr] .k-calendar-selects{direction:ltr}[dir=rtl] .k-calendar-selects{direction:rtl}.k-calendar-selects .k-select-input{font-size:var(--text-sm);font-weight:var(--font-normal);padding:0 .5rem}.k-calendar-selects .k-select-input:focus-within{color:var(--color-focus-light)!important}.k-calendar-input th{color:var(--color-gray-500);font-size:var(--text-xs);font-weight:400;padding:.5rem 0;text-align:center}.k-calendar-day .k-button{border:2px solid transparent;border-radius:50%;color:var(--color-white);display:flex;height:2rem;justify-content:center;line-height:1.75rem;margin-left:auto;margin-right:auto;width:2rem}.k-calendar-day .k-button .k-button-text{opacity:1}.k-calendar-table .k-button:hover{color:var(--color-white)}.k-calendar-day:hover .k-button:not([data-disabled=true]){border-color:#ffffff40}.k-calendar-day[aria-current=date] .k-button{text-decoration:underline}.k-calendar-day[aria-selected=date] .k-button{border-color:currentColor;color:var(--color-focus-light);font-weight:600}.k-calendar-today{padding-top:.5rem;text-align:center}.k-calendar-today .k-button{font-size:var(--text-xs);padding:1rem;text-decoration:underline}.k-calendar-today .k-button-text{opacity:1;vertical-align:baseline}.k-counter{color:var(--color-gray-900);font-size:var(--text-xs);font-weight:var(--font-bold)}.k-counter[data-invalid=true]{border:0;box-shadow:none;color:var(--color-negative)}.k-counter-rules{color:var(--color-gray-600);font-weight:var(--font-normal);padding-left:.5rem}.k-form-submitter{display:none}.k-form-buttons[data-theme]{background:var(--theme-light)}.k-form-buttons .k-view{align-items:center;display:flex;justify-content:space-between}.k-form-button.k-button{align-items:center;display:flex;font-weight:500;height:2.5rem;line-height:1;padding:0 1rem;white-space:nowrap}.k-form-button:first-child{margin-left:-1rem}.k-form-button:last-child{margin-right:-1rem}.k-form-lock-info{align-items:center;display:flex;font-size:var(--text-sm);line-height:1.5em;margin-right:3rem;padding:.625rem 0}.k-form-lock-info>.k-icon{margin-right:.5rem}.k-form-lock-buttons{display:flex;flex-shrink:0}.k-form-lock-loader{animation:Spin 4s linear infinite}.k-form-lock-loader .k-icon-loader{display:flex}.k-form-indicator-toggle{color:var(--color-notice-light)}.k-form-indicator-info{font-size:var(--text-sm);font-weight:var(--font-bold);line-height:1.25em;padding:.75rem 1rem .25rem;width:15rem}.k-field-label{display:block;flex-grow:1;font-weight:var(--font-bold);line-height:1.25rem;padding:0 0 .75rem}.k-field-label abbr{color:var(--color-gray-500);padding-left:.25rem;text-decoration:none}.k-field-header{align-items:baseline;display:flex;position:relative}.k-field-options{position:absolute;right:0;top:calc(-.5rem - 1px)}.k-field-options.k-button-group .k-dropdown{height:auto}.k-field-options.k-button-group .k-field-options-button.k-button{display:flex;padding:.75rem}.k-field[data-disabled=true]{cursor:not-allowed}.k-field[data-disabled=true] *{pointer-events:none}.k-field[data-disabled=true] .k-text[data-theme=help] *{pointer-events:auto}.k-field:focus-within>.k-field-header>.k-field-counter{display:block}.k-field-help{padding-top:.5rem}.k-field-add-item-button{align-items:center;color:var(--color-gray-500);display:flex;justify-content:center;padding:.75rem 0;width:100%}.k-field-add-item-button:hover{color:var(--color-black)}.k-fieldset{border:0}.k-fieldset .k-grid{grid-row-gap:2.25rem}@media screen and (min-width:30em){.k-fieldset .k-grid{grid-column-gap:1.5rem}}.k-sections>.k-column[data-width="1/3"] .k-fieldset .k-grid,.k-sections>.k-column[data-width="1/4"] .k-fieldset .k-grid{grid-template-columns:repeat(1,1fr)}.k-sections>.k-column[data-width="1/3"] .k-fieldset .k-grid .k-column,.k-sections>.k-column[data-width="1/4"] .k-fieldset .k-grid .k-column{grid-column-start:auto}.k-input{align-items:center;background:none;border:0;display:flex;line-height:1;outline:0}.k-input-element{flex-grow:1}.k-input-icon{align-items:center;display:flex;justify-content:center;line-height:0}.k-input[data-disabled=true]{pointer-events:none}[data-disabled=true] .k-input-icon{color:var(--color-gray-600)}.k-input[data-theme=field]{background:var(--field-input-background);border:var(--field-input-border);border-radius:var(--rounded);line-height:1}.k-input[data-theme=field]:focus-within{border:var(--field-input-focus-border);box-shadow:var(--color-focus-outline) 0 0 0 2px}.k-input[data-theme=field][data-disabled=true]{background:var(--color-background)}.k-input[data-theme=field] .k-input-icon{width:var(--field-input-height)}.k-input[data-theme=field] .k-input-after,.k-input[data-theme=field] .k-input-before,.k-input[data-theme=field] .k-input-icon{align-items:center;align-self:stretch;display:flex;flex-shrink:0}.k-input[data-theme=field] .k-input-after,.k-input[data-theme=field] .k-input-before{padding:0 var(--field-input-padding)}.k-input[data-theme=field] .k-input-before{color:var(--field-input-color-before);padding-right:0}.k-input[data-theme=field] .k-input-after{color:var(--field-input-color-after);padding-left:0}.k-input[data-theme=field] .k-input-icon>.k-dropdown{height:100%;width:100%}.k-input[data-theme=field] .k-input-icon-button{align-items:center;display:flex;flex-shrink:0;height:100%;justify-content:center;width:100%}.k-input[data-theme=field] .k-number-input,.k-input[data-theme=field] .k-select-input,.k-input[data-theme=field] .k-text-input{border-radius:var(--rounded);line-height:var(--field-input-line-height);padding:var(--field-input-padding)}.k-input[data-theme=field] .k-date-input .k-select-input,.k-input[data-theme=field] .k-time-input .k-select-input{padding-left:0;padding-right:0}.k-input[data-theme=field] .k-date-input .k-select-input:first-child,.k-input[data-theme=field] .k-time-input .k-select-input:first-child{padding-left:var(--field-input-padding)}.k-input[data-theme=field] .k-date-input .k-select-input:focus-within,.k-input[data-theme=field] .k-time-input .k-select-input:focus-within{color:var(--color-focus);font-weight:var(--font-bold)}.k-input[data-theme=field].k-time-input .k-time-input-meridiem{padding-left:var(--field-input-padding)}.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input li,.k-input[data-theme=field][data-type=checkboxes] .k-radio-input li,.k-input[data-theme=field][data-type=radio] .k-checkboxes-input li,.k-input[data-theme=field][data-type=radio] .k-radio-input li{min-width:0;overflow-wrap:break-word}.k-input[data-theme=field][data-type=checkboxes] .k-input-before{border-right:1px solid var(--color-background)}.k-input[data-theme=field][data-type=checkboxes] .k-input-element+.k-input-after,.k-input[data-theme=field][data-type=checkboxes] .k-input-element+.k-input-icon{border-left:1px solid var(--color-background)}.k-input[data-theme=field][data-type=checkboxes] .k-input-element{overflow:hidden}.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input{display:grid;grid-template-columns:1fr;margin-bottom:-1px;margin-right:-1px}@media screen and (min-width:65em){.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input{grid-template-columns:repeat(var(--columns),1fr)}}.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input li{border-bottom:1px solid var(--color-background);border-right:1px solid var(--color-background)}.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input label{display:block;line-height:var(--field-input-line-height);padding:var(--field-input-padding) var(--field-input-padding)}.k-input[data-theme=field][data-type=checkboxes] .k-checkbox-input-icon{left:var(--field-input-padding);margin-top:0;top:calc((var(--field-input-height) - var(--field-input-font-size))/2)}.k-input[data-theme=field][data-type=radio] .k-input-before{border-right:1px solid var(--color-background)}.k-input[data-theme=field][data-type=radio] .k-input-element+.k-input-after,.k-input[data-theme=field][data-type=radio] .k-input-element+.k-input-icon{border-left:1px solid var(--color-background)}.k-input[data-theme=field][data-type=radio] .k-input-element{overflow:hidden}.k-input[data-theme=field][data-type=radio] .k-radio-input{display:grid;grid-template-columns:1fr;margin-bottom:-1px;margin-right:-1px}@media screen and (min-width:65em){.k-input[data-theme=field][data-type=radio] .k-radio-input{grid-template-columns:repeat(var(--columns),1fr)}}.k-input[data-theme=field][data-type=radio] .k-radio-input li{border-bottom:1px solid var(--color-background);border-right:1px solid var(--color-background)}.k-input[data-theme=field][data-type=radio] .k-radio-input label{display:block;flex-grow:1;line-height:var(--field-input-line-height);min-height:var(--field-input-height);padding:calc((var(--field-input-height) - var(--field-input-line-height))/2) var(--field-input-padding)}.k-input[data-theme=field][data-type=radio] .k-radio-input label:before{left:var(--field-input-padding);margin-top:-1px;top:calc((var(--field-input-height) - 1rem)/2)}.k-input[data-theme=field][data-type=radio] .k-radio-input .k-radio-input-info{color:var(--color-gray-600);display:block;font-size:var(--text-sm);line-height:var(--field-input-line-height);padding-top:calc(var(--field-input-line-height)/10)}.k-input[data-theme=field][data-type=radio] .k-radio-input .k-icon{align-items:center;display:flex;height:var(--field-input-height);justify-content:center;width:var(--field-input-height)}.k-input[data-theme=field][data-type=range] .k-range-input{padding:var(--field-input-padding)}.k-input[data-theme=field][data-type=select]{position:relative}.k-input[data-theme=field][data-type=select] .k-input-icon{bottom:0;position:absolute;right:0;top:0}.k-input[data-theme=field][data-type=tags] .k-tags-input{padding:.25rem .25rem 0}.k-input[data-theme=field][data-type=tags] .k-tag{font-size:var(--text-sm);height:auto;margin-bottom:.25rem;margin-right:.25rem;min-height:1.75rem}.k-input[data-theme=field][data-type=tags] .k-tags-input input{font-size:var(--text-sm);height:1.75rem;line-height:1;margin-bottom:.25rem;padding:0 .25rem}.k-input[data-theme=field][data-type=tags] .k-tags-input .k-dropdown-content{top:calc(100% + .5rem + 2px)}.k-input[data-theme=field][data-type=tags] .k-tags-input .k-dropdown-content[data-dropup]{bottom:auto;margin-bottom:0;top:calc(100% + .5rem + 2px)}.k-input[data-theme=field][data-type=multiselect]{position:relative}.k-input[data-theme=field][data-type=multiselect] .k-multiselect-input{min-height:2.25rem;padding:.25rem 2rem 0 .25rem}.k-input[data-theme=field][data-type=multiselect] .k-tag{font-size:var(--text-sm);height:1.75rem;margin-bottom:.25rem;margin-right:.25rem}.k-input[data-theme=field][data-type=multiselect] .k-input-icon{bottom:0;pointer-events:none;position:absolute;right:0;top:0}.k-input[data-theme=field][data-type=textarea] .k-textarea-input-native{line-height:1.5rem;padding:.25rem var(--field-input-padding)}.k-input[data-theme=field][data-type=toggle] .k-input-before{padding-right:calc(var(--field-input-padding)/2)}.k-input[data-theme=field][data-type=toggle] .k-toggle-input{padding-left:var(--field-input-padding)}.k-input[data-theme=field][data-type=toggle] .k-toggle-input-label{line-height:var(--field-input-height);padding:0 var(--field-input-padding) 0 .75rem}.k-login-code-form .k-user-info{background:var(--color-white);border-radius:var(--rounded-xs);box-shadow:var(--shadow);height:38px;margin-bottom:2.25rem;padding:.5rem}.k-times{grid-gap:var(--spacing-6);display:grid;grid-template-columns:1fr 1fr;line-height:1;padding:var(--spacing-4) var(--spacing-6)}.k-times .k-icon{margin-bottom:var(--spacing-2);width:1rem}.k-times-slot .k-button{font-variant-numeric:tabular-nums;padding:var(--spacing-1) var(--spacing-3) var(--spacing-1) 0;white-space:nowrap}.k-times .k-times-slot hr{background:var(--color-dark);border:0;height:1px;margin:var(--spacing-2) 0;opacity:1;position:relative;top:1px}.k-login-alert{align-items:center;background:var(--color-negative);border-radius:var(--rounded-xs);box-shadow:var(--shadow-lg);color:var(--color-white);cursor:pointer;display:flex;font-size:var(--text-sm);justify-content:space-between;margin-bottom:2rem;min-height:38px;padding:.5rem .75rem}.k-structure-backdrop{bottom:0;height:100vh;left:0;position:absolute;right:0;top:0;z-index:2}.k-structure-form section{background:var(--color-background);border:1px solid var(--color-border);border-radius:var(--rounded-xs);box-shadow:0 0 0 3px #1212120d;margin-bottom:1px;position:relative;z-index:3}.k-structure-form-fields{padding:1.5rem 1.5rem 2rem}.k-structure-form-buttons{border-top:1px solid var(--color-border);display:flex;justify-content:space-between}.k-structure-form-buttons .k-pagination{display:none}@media screen and (min-width:65em){.k-structure-form-buttons .k-pagination{display:flex}}.k-structure-form-buttons .k-pagination>.k-button,.k-structure-form-buttons .k-pagination>span{padding:.875rem 1rem!important}.k-structure-form-cancel-button,.k-structure-form-submit-button{display:flex;line-height:1rem;padding:.875rem 1.5rem}:root{--toolbar-size:38px;--toolbar-text:#aaa;--toolbar-back:var(--color-white);--toolbar-hover:hsla(0,0%,94%,.5);--toolbar-border:var(--color-background)}.k-toolbar{background:var(--toolbar-back);border-bottom:1px solid var(--toolbar-border);border-top-left-radius:var(--rounded);border-top-right-radius:var(--rounded);color:var(--toolbar-text);display:flex;height:var(--toolbar-size);margin-bottom:var(--spacing-1);max-width:100%}.k-toolbar-divider{border-left:1px solid var(--toolbar-border);width:1px}.k-toolbar-button.k-button{align-items:center;display:flex;height:var(--toolbar-size);justify-content:center;line-height:1;width:var(--toolbar-size)}.k-toolbar-button:hover{background:var(--toolbar-hover)}.js-has-pseudo [csstools-has-1a-2z-19-38-33-33-30-2q-2p-36-1m-32-33-38-14-2j-2s-2p-38-2p-19-2x-32-30-2x-32-2t-1p-y-38-36-39-2t-y-2l-15-1m-2w-2p-37-14-3i-w-1m-2u-33-2r-39-37-19-3b-2x-38-2w-2x-32-15]:not(.does-not-exist):not(.does-not-exist){--toolbar-text:var(--color-black);--toolbar-border:rgba(0,0,0,.1);box-shadow:0 2px 5px #0000000d;left:0;position:sticky;right:0;top:0;z-index:1}.k-toolbar:not([data-inline=true]):has(~:focus-within){--toolbar-text:var(--color-black);--toolbar-border:rgba(0,0,0,.1);box-shadow:0 2px 5px #0000000d;left:0;position:sticky;right:0;top:0;z-index:1}.k-code.k-block-type-code-editor{--code-font-size:var(--text-sm);line-height:1.5em;padding:.5rem .75rem 3rem}.k-block-type-code-editor .k-editor{line-height:1.75em;white-space:pre-wrap}.k-block-type-code-editor-language{bottom:0;font-size:var(--text-sm);position:absolute;right:0}.k-block-type-code-editor-language .k-icon{display:flex;height:1.5rem;left:0;position:absolute;top:0;width:2rem;z-index:0}.k-block-type-code-editor-language .k-select-input{font-size:var(--text-xs);padding:.325rem .75rem .5rem 2rem;position:relative;z-index:1}.k-block-type-default .k-block-title{line-height:1.5em}.js-has-pseudo [csstools-has-1a-2z-19-2q-30-33-2r-2z-19-2r-33-32-38-2p-2x-32-2t-36-1m-2w-2p-37-14-1a-2z-19-2q-30-33-2r-2z-19-38-3d-34-2t-19-2u-2x-2t-30-2s-37-15]:not(.does-not-exist){padding-top:0}.k-block-container:has(.k-block-type-fields){padding-top:0}.k-block-type-fields-header{background:var(--color-white);border-top-left-radius:var(--rounded);border-top-right-radius:var(--rounded);display:flex;height:2.5rem;justify-content:space-between;padding-left:var(--spacing-3);padding-right:var(--spacing-3)}.k-block-type-fields-header .k-button{height:2.5rem}.k-block-type-fields-form{background-color:#eeeff2;border-radius:var(--rounded);padding:var(--spacing-6) var(--spacing-6) var(--spacing-8)}.k-block-container[data-hidden=true]{padding-bottom:0}.k-block-container[data-hidden=true] :where(.k-drawer-tabs,.k-block-type-fields-form){display:none}.k-block-type-gallery ul{grid-gap:.75rem;align-items:center;cursor:pointer;display:grid;grid-template-columns:repeat(auto-fit,minmax(6rem,1fr));justify-content:center;line-height:0}.k-block-type-gallery-placeholder{background:var(--color-background)}.k-block-type-gallery figcaption{color:var(--color-gray-600);font-size:var(--text-sm);padding-top:.5rem;text-align:center}.k-block-type-heading-input{align-items:center;display:flex;font-size:var(--text-size);font-weight:var(--font-bold);line-height:1.25em}.k-block-type-heading-input[data-level=h1]{--text-size:var(--text-3xl);line-height:1.125em}.k-block-type-heading-input[data-level=h2]{--text-size:var(--text-2xl)}.k-block-type-heading-input[data-level=h3]{--text-size:var(--text-xl)}.k-block-type-heading-input[data-level=h4]{--text-size:var(--text-lg)}.k-block-type-heading-input[data-level=h5]{--text-size:var(--text-base);line-height:1.5em}.k-block-type-heading-input[data-level=h6]{--text-size:var(--text-sm);line-height:1.5em}.k-block-type-heading-input .k-writer .ProseMirror strong{font-weight:700}.k-block-type-heading-level{color:var(--color-gray-500);font-size:var(--text-sm);font-weight:var(--font-bold);text-transform:uppercase}.k-block-type-image .k-block-figure-container{display:block;line-height:0;text-align:center}.k-block-type-image-auto{max-height:30rem;max-width:100%}.k-block-type-line hr{border:0;border-top:2px solid var(--color-gray-400);margin-bottom:.75rem;margin-top:.75rem}.k-block-type-markdown-input{background:var(--color-background);border-radius:var(--rounded);font-family:var(--font-mono);font-size:var(--text-sm);line-height:1.5em;padding:.5rem .5rem 0;position:relative}.k-block-type-quote-editor{border-left:2px solid var(--color-black);padding-left:1rem}.k-block-type-quote-text{font-size:var(--text-xl);line-height:1.25em;margin-bottom:.25rem}.k-block-type-quote-citation{color:var(--color-gray-600);font-size:var(--text-sm);font-style:italic}.k-block-type-table-preview{border:1px solid var(--color-gray-300);border-radius:var(--rounded-sm);border-spacing:0;cursor:pointer;overflow:hidden}.k-block-type-table-preview td,.k-block-type-table-preview th{font-size:var(--text-sm);line-height:1.5em;text-align:left}.k-block-type-table-preview th{padding:.5rem .75rem}.k-block-type-table-preview td:not(.k-table-index-column){padding:0 .75rem}.k-block-type-table-preview td [class$=-field-preview],.k-block-type-table-preview td>*{padding:0}.k-block-type-text-input{font-size:var(--text-base);height:100%;line-height:1.5em}.k-block-container-type-text,.k-block-type-text,.k-block-type-text .k-writer .ProseMirror{height:100%}.k-block-container{background:var(--color-white);border-radius:var(--rounded);padding:.75rem;position:relative}.k-block-container:not(:last-of-type){border-bottom:1px dashed rgba(0,0,0,.1)}.k-block-container:focus{outline:0}.k-block-container[data-selected=true]{border-bottom-color:transparent;box-shadow:var(--color-focus) 0 0 0 1px,var(--color-focus-outline) 0 0 0 3px;z-index:2}.k-block-container[data-batched=true]:after{background:rgba(177,194,216,.175);bottom:0;content:"";left:0;mix-blend-mode:multiply;position:absolute;right:0;top:0}.k-block-container .k-block-options{display:none;margin-top:calc(-1.75rem + 2px);position:absolute;right:.75rem;top:0}.k-block-container[data-last-selected=true]>.k-block-options{display:flex}.k-block-container[data-hidden=true] .k-block{opacity:.25}.k-drawer-options .k-drawer-option[data-disabled=true]{display:inline-grid;vertical-align:middle}[data-disabled=true] .k-block-container{background:var(--color-background)}.k-block-container:is(.k-sortable-ghost,.k-sortable-fallback) .k-block{max-height:4rem;overflow:hidden;position:relative}.k-block-container:is(.k-sortable-ghost,.k-sortable-fallback) .k-block:after{background:linear-gradient(to top,var(--color-white),transparent);bottom:0;content:"";height:2rem;position:absolute;width:100%}.k-blocks{background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow)}[data-disabled=true] .k-blocks{background:var(--color-background)}.k-blocks[data-multi-select-key=true] .k-block-container *{pointer-events:none}.k-blocks[data-empty=true]{background:none;box-shadow:none;padding:0}.k-blocks .k-sortable-ghost{box-shadow:0 5px 10px #12121240;cursor:grabbing;cursor:-webkit-grabbing;outline:2px solid var(--color-focus)}.k-blocks-list>.k-blocks-empty{align-items:center;display:flex}.k-blocks-list>.k-blocks-empty:not(:only-child){display:none}.k-block-figure{cursor:pointer}.k-block-figure iframe{background:var(--color-black);border:0;pointer-events:none}.k-block-figure figcaption{color:var(--color-gray-600);font-size:var(--text-sm);padding-top:.5rem;text-align:center}.k-block-figure-empty.k-button{align-items:center;background:var(--color-background);border-radius:var(--rounded-sm);color:var(--color-gray-600);display:flex;height:6rem;justify-content:center;width:100%}.k-block-options{align-items:center;background:var(--color-white);border-radius:var(--rounded);box-shadow:#0000001a -2px 0 5px,var(--shadow),var(--shadow-xl);color:var(--color-black);display:flex;z-index:var(--z-dropdown)}.k-block-options-button{--block-options-button-size:30px;align-items:center;border-right:1px solid var(--color-background);display:inline-flex;height:var(--block-options-button-size);justify-content:center;line-height:1;width:var(--block-options-button-size)}.k-block-options-button:first-child{border-bottom-left-radius:var(--rounded);border-top-left-radius:var(--rounded)}.k-block-options-button:last-child{border-bottom-right-radius:var(--rounded);border-top-right-radius:var(--rounded)}.k-block-options-button:last-of-type{border-right:0}.k-block-options-button[aria-current]{color:var(--color-focus)}.k-block-options-button:hover{background:var(--color-gray-100)}.k-block-options .k-dropdown-content{margin-top:.5rem}.k-block-importer.k-dialog{background:var(--color-dark);color:var(--color-white)}.k-block-importer .k-dialog-body{padding:0}.k-block-importer label{color:var(--color-gray-400);display:block;padding:var(--spacing-6) var(--spacing-6) 0}.k-block-importer label kbd{background:rgba(0,0,0,.5);border-radius:var(--rounded);font-family:var(--font-mono);letter-spacing:.1em;margin:0 .25rem;padding:.25rem}.k-block-importer label small{color:var(--color-gray-500);display:block;margin-top:.5rem}.k-block-importer textarea{background:none;border:0;color:var(--color-white);font:inherit;height:20rem;padding:var(--spacing-6);resize:none;width:100%}.k-block-importer textarea:focus{outline:0}.k-block-selector.k-dialog{background:var(--color-dark);color:var(--color-white)}.k-block-selector .k-headline{margin-bottom:1rem}.k-block-selector details:not(:last-of-type){margin-bottom:1.5rem}.k-block-selector summary{color:var(--color-gray-400);cursor:pointer;font-size:var(--text-xs)}.k-block-selector details:only-of-type summary{pointer-events:none}.k-block-selector summary:focus{outline:0}.k-block-selector summary:focus-visible{color:var(--color-green-400)}.k-block-types{grid-gap:2px;display:grid;grid-template-columns:repeat(1,1fr);margin-top:.75rem}.k-block-types .k-button{align-items:flex-start;background:rgba(0,0,0,.5);border-radius:var(--rounded);display:flex;line-height:1.5em;padding:0 .75rem 0 0;text-align:left;width:100%}.k-block-types .k-button:focus{outline:2px solid var(--color-green-300)}.k-block-types .k-button .k-button-text{padding:.5rem 0 .5rem .5rem}.k-block-types .k-button .k-icon{height:38px;width:38px}.k-clipboard-hint{color:var(--color-gray-400);font-size:var(--text-xs);padding-top:1.5rem}.k-clipboard-hint kbd{background:rgba(0,0,0,.5);border-radius:var(--rounded);font-family:var(--font-mono);letter-spacing:.1em;margin:0 .25rem;padding:.25rem}.k-clipboard-hint small{color:var(--color-gray-500);display:block;margin-top:.5rem}.k-block-title{align-items:center;display:flex;font-size:var(--text-sm);line-height:1;min-width:0;padding-right:.75rem}.k-block-icon{color:var(--color-gray-500);width:1rem}.k-block-icon,.k-block-name{margin-right:.5rem}.k-block-label{color:var(--color-gray-600);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:root{--range-thumb-color:var(--color-white);--range-thumb-height:1rem;--range-thumb-shadow:rgba(0,0,0,.1) 0 2px 4px 2px,rgba(0,0,0,.125) 0 0 0 1px;--range-track-height:var(--range-thumb-height)}input[type=range]{align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--color-gray-300);border-radius:var(--range-track-height);display:flex;height:var(--range-thumb-size);height:var(--range-track-height);padding:0}input[type=range][disabled]{--range-thumb-color:hsla(0,0%,100%,.2)}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;aspect-ratio:1/1;background:var(--range-thumb-color);border-radius:50%;box-shadow:var(--range-thumb-shadow);cursor:grab;height:var(--range-thumb-height);transform:translateY(-50%);transform:translate(0);z-index:1}input[type=range]::-webkit-slider-thumb:active{cursor:grabbing}input[type=range][disabled]::-webkit-slider-thumb{cursor:not-allowed}input[type=range]::-webkit-slider-runnable-track{border-radius:var(--range-track-height)}input[type=range]:focus::-webkit-slider-thumb{outline:var(--field-input-focus-outline)}input[type=range][data-variant=hue]{background:linear-gradient(90deg,red 0,#ff0 16.67%,#0f0 33.33%,#0ff 50%,#00f 66.67%,#f0a 83.33%,red) no-repeat}input[type=range][data-variant=alpha]{background:var(--color-white) var(--bg-pattern)}input[type=range][data-variant=alpha]::-webkit-slider-runnable-track{background:linear-gradient(90deg,transparent,currentColor) no-repeat}:root{--color-preview-rounded:var(--rounded-sm);--color-preview-size:1.5rem;--color-preview-darkness:0%}.k-color{--h:0;--s:0%;--l:0%;--a:1;--range-thumb-height:.75rem;--range-track-height:.75rem;--range-color-border:var(--color-white);display:flex;flex-direction:column;gap:var(--spacing-3);width:-moz-max-content;width:max-content}.k-color>*{border-radius:var(--rounded)}.k-color :focus{outline:var(--outline)}.k-color .k-coords{aspect-ratio:1/1;background:linear-gradient(to bottom,transparent,#000),linear-gradient(to right,#fff,hsl(var(--h),100%,50%))}.k-color input[data-variant=alpha]{color:hsl(var(--h),var(--s),var(--l))}.k-color-preview{aspect-ratio:1/1;background:#fff var(--bg-pattern);background-clip:padding-box;border-radius:var(--color-preview-rounded);color:transparent;display:inline-block;overflow:hidden;position:relative;width:var(--color-preview-size)}.k-color-preview:after{background-color:currentColor;border-radius:calc(var(--color-preview-rounded) - 1px);bottom:0;box-shadow:0 0 0 1px inset hsla(0,0%,var(--color-preview-darkness),.175);content:"";left:0;position:absolute;right:0;top:0}.k-coords{display:block;position:relative}.k-coords img{width:100%}.k-coords-thumb{aspect-ratio:1/1;background:var(--range-thumb-color);border-radius:var(--range-thumb-height);box-shadow:var(--range-thumb-shadow);cursor:move;position:absolute;transform:translate(-50%,-50%);width:var(--range-thumb-height)}.k-coords-thumb:active{cursor:grabbing}.k-coords:focus-within{outline:var(--outline)}.k-coords[aria-disabled]{opacity:var(--opacity-disabled);pointer-events:none}.k-coords[aria-disabled] .k-coords-thumb{display:none}.k-blocks-field{position:relative}.k-text-input.k-color-input{font-family:var(--font-mono);font-size:var(--text-sm)}.k-color-field .k-input .k-input-before{padding:var(--spacing-1)}.k-color-field-preview{--color-preview-size:calc(var(--field-input-height) - var(--spacing-2))}.k-color-field-picker{display:flex;flex-direction:column;gap:var(--spacing-3);padding:var(--spacing-2)}.k-color-field .k-color{width:12rem}.k-color-field-options{--color-preview-size:100%;--color-preview-darkness:100%;display:grid;gap:var(--spacing-2);grid-template-columns:repeat(6,1fr)}.k-color-field .k-color-preview[aria-current]{border:2px solid var(--color-focus);outline:var(--field-input-focus-outline)}.k-color-field .k-input-after{font-size:var(--text-xs)}.k-date-field-body{background:var(--color-gray-300);border:var(--field-input-border);border-radius:var(--rounded);display:flex;flex-wrap:wrap;gap:1px;line-height:1}.k-date-field-body:focus-within{border:var(--field-input-focus-border);box-shadow:var(--color-focus-outline) 0 0 0 2px}.k-date-field[data-disabled] .k-date-field-body{background:none}.k-date-field-body>.k-input[data-theme=field]{border:0;border-radius:var(--rounded);box-shadow:none}.k-date-field-body>.k-input[data-invalid=true],.k-date-field-body>.k-input[data-invalid=true]:focus-within{border:0!important;box-shadow:none!important}.k-date-field-body{--multiplier:calc(25rem - 100%)}.k-date-field-body>*{flex-basis:calc(var(--multiplier)*999);flex-grow:1;max-width:100%}.k-date-field-body .k-input[data-type=date]{min-width:60%}.k-date-field-body .k-input[data-type=time]{min-width:30%}.k-text-input{background:none;border:0;color:inherit;font:inherit;font-variant-numeric:tabular-nums;width:100%}.k-text-input::-moz-placeholder{color:var(--color-gray-500)}.k-text-input::placeholder{color:var(--color-gray-500)}.k-text-input:focus{outline:0}.k-text-input:invalid{box-shadow:none;outline:0}.k-files-field[data-disabled=true] .k-item *{pointer-events:all!important}body{counter-reset:headline-counter}.k-headline-field{padding-top:1.5rem;position:relative}.k-fieldset>.k-grid .k-column:first-child .k-headline-field{padding-top:0}.k-headline-field .k-headline[data-numbered]:before{color:var(--color-focus);content:counter(headline-counter,decimal-leading-zero);counter-increment:headline-counter;font-weight:400;padding-right:.25rem}.k-info-field .k-headline{line-height:1.25rem;padding-bottom:.75rem}.k-line-field{border:0;height:3rem;position:relative;width:auto}.k-line-field:after{background:var(--color-border);content:"";height:1px;left:0;margin-top:-1px;position:absolute;right:0;top:50%}.k-link-input-header{align-items:center;display:grid;gap:.25rem;grid-area:header;grid-template-columns:max-content minmax(0,1fr);height:var(--field-input-height)}.k-link-input-toggle.k-button{align-items:center;background:var(--color-gray-200);border-radius:var(--rounded-sm);display:flex;gap:.25rem;height:var(--height-sm);margin-left:.25rem;padding:0 1.325rem 0 .375rem}.k-link-input-toggle.k-button .k-button-text{padding-left:var(--spacing-1)}.k-link-input-toggle .k-button-text:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid var(--color-black);content:"";margin-top:-2px;position:absolute;right:.5rem;top:50%}.k-link-input-model{--tag-color-back:var(--color-gray-200);--tag-color-text:var(--color-black);--tag-color-focus-back:var(--tag-color-back);--tag-color-focus-text:var(--tag-color-text);--tag-rounded:var(--rounded-sm);display:flex;height:var(--height-sm);justify-content:space-between;margin-right:var(--spacing-1);overflow:hidden}.k-link-input-model-preview{overflow:hidden;white-space:nowrap}.k-link-input-model-preview .k-tag-text{align-items:center;display:flex;gap:.5rem;overflow:hidden;text-overflow:ellipsis}.k-link-input-model-preview-image{aspect-ratio:1/1;border-radius:1px;height:calc(var(--height-sm) - .5rem)}.js-has-pseudo [csstools-has-1a-2z-19-30-2x-32-2z-19-2x-32-34-39-38-19-31-33-2s-2t-30-19-34-36-2t-3a-2x-2t-3b-w-1a-2z-19-38-2p-2v-19-38-2t-3c-38-1m-2w-2p-37-14-1a-2z-19-30-2x-32-2z-19-2x-32-34-39-38-19-31-33-2s-2t-30-19-34-36-2t-3a-2x-2t-3b-19-2x-31-2p-2v-2t-15]:not(.does-not-exist):not(.does-not-exist){padding-left:.25rem}.k-link-input-model-preview .k-tag-text:has(.k-link-input-model-preview-image){padding-left:.25rem}.k-link-input-model-placeholder.k-button{align-items:center;color:var(--color-gray-600);display:flex;flex-grow:1;font-size:var(--text-base);height:var(--height-sm);justify-content:flex-start;overflow:hidden;padding-left:var(--spacing-2);padding-right:var(--spacing-2);white-space:nowrap}.k-link-input-model-toggle{align-items:center;display:flex;flex-shrink:0;height:var(--height-sm);justify-content:center;width:var(--height-sm)}.k-link-input-body{--tree-color-back:var(--color-gray-100);--tree-color-hover-back:var(--color-gray-200);background:var(--color-gray-100);border-top:1px solid var(--color-gray-300);display:grid;overflow:hidden}.k-link-input-body[data-type=page] .k-page-browser{container-type:inline-size;overflow:auto;padding:var(--spacing-2);padding-bottom:calc(var(--spacing-2) - 1px);width:100%}.k-list-input .ProseMirror{line-height:1.5em}.k-list-input .ProseMirror ol>li::marker{color:var(--color-gray-500);font-size:var(--text-sm)}.k-list-field .k-list-input{padding:.375rem .5rem .375rem .75rem}.k-multiselect-input{display:flex;flex-wrap:wrap;font-size:var(--text-sm);line-height:1;min-height:2.25rem;position:relative}.k-multiselect-input .k-sortable-ghost{background:var(--color-focus)}.k-multiselect-input .k-tag{border-radius:var(--rounded-sm)}.k-multiselect-input .k-dropdown-content{width:100%}.k-multiselect-search{background:var(--color-gray-900);border-bottom:1px dashed hsla(0,0%,100%,.2);color:var(--color-white);margin-top:0!important}.k-multiselect-search>.k-button-text{flex:1;opacity:1!important}.k-multiselect-search input{background:none;border:none;color:var(--color-white);font:inherit;outline:none;padding:.25rem 0;width:100%}.k-multiselect-options{max-height:275px;padding:.5rem 0;position:relative}.k-multiselect-option{position:relative}.k-multiselect-option.selected{color:var(--color-positive-light)}.k-multiselect-option.disabled:not(.selected) .k-icon{opacity:0}.k-multiselect-option b{color:var(--color-focus-light);font-weight:700}.k-multiselect-input[data-layout=list] .k-tag{margin-right:0!important;width:100%}.k-multiselect-more{border-top:1px dashed hsla(0,0%,100%,.2);color:#fffc;padding:.75rem;text-align:center;width:100%}.k-multiselect-more:hover{color:var(--color-white)}.k-number-input{background:none;border:0;color:inherit;font:inherit;width:100%}.k-number-input::-moz-placeholder{color:var(--color-gray-500)}.k-number-input::placeholder{color:var(--color-gray-500)}.k-number-input:focus{outline:0}.k-number-input:invalid{box-shadow:none;outline:0}.k-table.k-object-field-table{table-layout:auto}.k-table.k-object-field-table tbody td,.k-table.k-object-field-table tbody th,.k-table.k-object-field-table tbody th button{cursor:pointer;overflow:hidden;text-overflow:ellipsis}.k-table.k-object-field-table tbody td{max-width:0}.k-pages-field[data-disabled=true] .k-item *{pointer-events:all!important}.k-radio-input li{line-height:1.5rem;padding-left:1.75rem;position:relative}.k-radio-input input{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:0;opacity:0;position:absolute;width:0}.k-radio-input label{align-items:center;cursor:pointer}.k-radio-input label:before{border:2px solid var(--color-gray-500);border-radius:50%;box-shadow:var(--color-white) 0 0 0 2px inset;content:"";height:1rem;left:0;position:absolute;top:.175em;width:1rem}.k-radio-input input:checked+label:before{background:var(--color-gray-900);border-color:var(--color-gray-900)}[data-disabled=true] .k-radio-input input:checked+label:before{background:var(--color-gray-600);border-color:var(--color-gray-600)}.k-radio-input input:focus+label:before{border-color:var(--color-blue-600)}.k-radio-input input:focus:checked+label:before{background:var(--color-focus)}.k-radio-input-text{display:block}.k-range-input{--range-thumb-size:16px;--range-thumb-border:4px solid var(--color-gray-900);--range-thumb-border-disabled:4px solid var(--color-gray-600);--range-thumb-background:var(--color-background);--range-thumb-focus-border:4px solid var(--color-focus);--range-thumb-focus-background:var(--color-background);--range-track-height:4px;--range-track-background:var(--color-border);--range-track-color:var(--color-gray-900);--range-track-color-disabled:var(--color-gray-600);--range-track-focus-color:var(--color-focus);align-items:center;display:flex}.k-range-input-native{--min:0;--max:100;--value:0;--range:calc(var(--max) - var(--min));--ratio:calc((var(--value) - var(--min))/var(--range));--position:calc(var(--range-thumb-size)*.5 + var(--ratio)*(100% - var(--range-thumb-size)));-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;font-size:var(--text-sm);height:var(--range-thumb-size);line-height:1;width:100%}.k-range-input-native::-webkit-slider-thumb{-webkit-appearance:none;appearance:none}.k-range-input-native::-webkit-slider-runnable-track{background:var(--range-track-background);border:none;border-radius:var(--range-track-height);height:var(--range-track-height);width:100%}.k-range-input-native::-moz-range-track{background:var(--range-track-background);border:none;border-radius:var(--range-track-height);height:var(--range-track-height);width:100%}.k-range-input-native::-ms-track{background:var(--range-track-background);border:none;border-radius:var(--range-track-height);height:var(--range-track-height);width:100%}.k-range-input-native::-webkit-slider-runnable-track{background:linear-gradient(var(--range-track-color),var(--range-track-color)) 0 /var(--position) 100% no-repeat var(--range-track-background)}.k-range-input-native::-moz-range-progress{background:var(--range-track-color);height:var(--range-track-height)}.k-range-input-native::-ms-fill-lower{background:var(--range-track-color);height:var(--range-track-height)}.k-range-input-native::-webkit-slider-thumb{background:var(--range-thumb-background);border:var(--range-thumb-border);border-radius:50%;box-sizing:border-box;cursor:pointer;height:var(--range-thumb-size);margin-top:calc((var(--range-track-height) - var(--range-thumb-size))*.5);width:var(--range-thumb-size)}.k-range-input-native::-moz-range-thumb{background:var(--range-thumb-background);border:var(--range-thumb-border);border-radius:50%;box-sizing:border-box;cursor:pointer;height:var(--range-thumb-size);width:var(--range-thumb-size)}.k-range-input-native::-ms-thumb{background:var(--range-thumb-background);border:var(--range-thumb-border);border-radius:50%;box-sizing:border-box;cursor:pointer;height:var(--range-thumb-size);margin-top:0;width:var(--range-thumb-size)}.k-range-input-native::-ms-tooltip{display:none}.k-range-input-native:focus{outline:none}.k-range-input-native:focus::-webkit-slider-runnable-track{background:var(--range-track-background);background:linear-gradient(var(--range-track-focus-color),var(--range-track-focus-color)) 0 /var(--position) 100% no-repeat var(--range-track-background);border:none;border-radius:var(--range-track-height);height:var(--range-track-height);width:100%}.k-range-input-native:focus::-moz-range-progress{background:var(--range-track-focus-color);height:var(--range-track-height)}.k-range-input-native:focus::-ms-fill-lower{background:var(--range-track-focus-color);height:var(--range-track-height)}.k-range-input-native:focus::-webkit-slider-thumb{background:var(--range-thumb-focus-background);border:var(--range-thumb-focus-border)}.k-range-input-native:focus::-moz-range-thumb{background:var(--range-thumb-focus-background);border:var(--range-thumb-focus-border)}.k-range-input-native:focus::-ms-thumb{background:var(--range-thumb-focus-background);border:var(--range-thumb-focus-border)}.k-range-input-tooltip{align-items:center;background:var(--color-gray-900);border-radius:var(--rounded-xs);color:var(--color-white);display:flex;font-size:var(--text-xs);line-height:1;margin-left:1rem;max-width:20%;padding:0 .25rem;position:relative;text-align:center;white-space:nowrap}.k-range-input-tooltip:after{border-bottom:5px solid transparent;border-right:5px solid var(--color-gray-900);border-top:5px solid transparent;content:"";height:0;left:-5px;position:absolute;top:50%;transform:translateY(-50%);width:0}.k-range-input-tooltip>*{padding:4px}[data-disabled=true] .k-range-input-native::-webkit-slider-runnable-track{background:linear-gradient(var(--range-track-color-disabled),var(--range-track-color-disabled)) 0 /var(--position) 100% no-repeat var(--range-track-background)}[data-disabled=true] .k-range-input-native::-moz-range-progress{background:var(--range-track-color-disabled);height:var(--range-track-height)}[data-disabled=true] .k-range-input-native::-ms-fill-lower{background:var(--range-track-color-disabled);height:var(--range-track-height)}[data-disabled=true] .k-range-input-native::-webkit-slider-thumb{border:var(--range-thumb-border-disabled)}[data-disabled=true] .k-range-input-native::-moz-range-thumb{border:var(--range-thumb-border-disabled)}[data-disabled=true] .k-range-input-native::-ms-thumb{border:var(--range-thumb-border-disabled)}[data-disabled=true] .k-range-input-tooltip{background:var(--color-gray-600)}[data-disabled=true] .k-range-input-tooltip:after{border-right:5px solid var(--color-gray-600)}.k-select-input{cursor:pointer;display:block;overflow:hidden;position:relative}.k-select-input-native{-webkit-appearance:none;-moz-appearance:none;appearance:none;bottom:0;cursor:pointer;font:inherit;left:0;opacity:0;position:absolute;right:0;top:0;width:100%;z-index:1}.k-select-input-native[disabled]{cursor:default}.k-select-input-native{font-weight:var(--font-normal)}.k-structure-field:not([data-disabled=true]) td.k-table-column{cursor:pointer}.k-tags-input{display:flex;flex-wrap:wrap}.k-tags-input .k-tag{border-radius:var(--rounded-sm)}.k-tags-input .k-sortable-ghost{background:var(--color-focus)}.k-tags-input-element{flex-basis:0;flex-grow:1;min-width:0}.k-tags-input:focus-within .k-tags-input-element{flex-basis:4rem}.k-tags-input-element input{background:none;border:0;font:inherit;width:100%}.k-tags-input-element input:focus{outline:0}.k-tags-input[data-layout=list] .k-tag{margin-right:0!important;width:100%}.k-field-counter{display:none}.k-text-field:focus-within .k-field-counter{display:block}.k-textarea-input[data-size=small]{--size:7.5rem}.k-textarea-input[data-size=medium]{--size:15rem}.k-textarea-input[data-size=large]{--size:30rem}.k-textarea-input[data-size=huge]{--size:45rem}.k-textarea-input-wrapper{position:relative}.k-textarea-input-native{background:none;border:0;color:inherit;font:inherit;line-height:1.5em;min-height:var(--size);resize:none;width:100%}.k-textarea-input-native::-moz-placeholder{color:var(--color-gray-500)}.k-textarea-input-native::placeholder{color:var(--color-gray-500)}.k-textarea-input-native:focus{outline:0}.k-textarea-input-native:invalid{box-shadow:none;outline:0}.k-textarea-input-native[data-font=monospace]{font-family:var(--font-mono)}.k-toggle-input{--toggle-background:var(--color-white);--toggle-color:var(--color-gray-500);--toggle-active-color:var(--color-gray-900);--toggle-focus-color:var(--color-focus);--toggle-height:16px;align-items:center;display:flex}.k-toggle-input-native{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--toggle-color);border:2px solid var(--toggle-color);border-radius:var(--toggle-height);box-shadow:inset 0 0 0 2px var(--toggle-background),inset calc(var(--toggle-height)*-1) 0 0 2px var(--toggle-background);cursor:pointer;flex-shrink:0;height:var(--toggle-height);outline:0;position:relative;transition:all .1s ease-in-out;width:calc(var(--toggle-height)*2)}.k-toggle-input-native:checked{background-color:var(--toggle-active-color);border-color:var(--toggle-active-color);box-shadow:inset 0 0 0 2px var(--toggle-background),inset var(--toggle-height) 0 0 2px var(--toggle-background)}.k-toggle-input-native[disabled]{background-color:var(--color-border);border-color:var(--color-border);box-shadow:inset 0 0 0 2px var(--color-background),inset calc(var(--toggle-height)*-1) 0 0 2px var(--color-background)}.k-toggle-input-native[disabled]:checked{box-shadow:inset 0 0 0 2px var(--color-background),inset var(--toggle-height) 0 0 2px var(--color-background)}.k-toggle-input-native:focus:checked{background-color:var(--toggle-focus-color);border:2px solid var(--color-focus)}.k-toggle-input-native::-ms-check{opacity:0}.k-toggle-input-label{cursor:pointer;flex-grow:1}.k-input[data-type=toggles]{display:inline-flex}.k-input[data-type=toggles].grow{display:flex}.k-toggles-input{background:var(--color-border);border-radius:var(--rounded);display:grid;gap:1px;grid-template-columns:repeat(var(--options),minmax(0,1fr));line-height:1;overflow:hidden}.k-toggles-input li{background:var(--color-white);height:var(--field-input-height)}.k-toggles-input label{align-items:center;background:var(--color-white);cursor:pointer;display:flex;font-size:var(--text-sm);height:100%;justify-content:center;line-height:1.25;padding:0 var(--spacing-3)}.k-toggles-input .k-icon+.k-toggles-text{margin-left:var(--spacing-2)}.k-toggles-input input:focus:not(:checked)+label{background:var(--color-gray-200)}.k-toggles-input input:checked+label{background:var(--color-black);color:var(--color-white)}.k-users-field[data-disabled=true] .k-item *{pointer-events:all!important}.k-writer{display:grid;gap:var(--spacing-1);grid-template-areas:"content";position:relative;width:100%}.k-writer .ProseMirror{word-wrap:break-word;font-variant-ligatures:none;grid-area:content;line-height:inherit;overflow-wrap:break-word;white-space:pre-wrap;word-break:break-word}.k-writer .ProseMirror:focus{outline:0}.k-writer .ProseMirror *{caret-color:currentColor}.k-writer .ProseMirror a{color:var(--color-focus);text-decoration:underline}.k-writer .ProseMirror>:last-child{margin-bottom:0}.k-writer .ProseMirror :where(p,ul,ol,h1,h2,h3){margin-bottom:.75rem}.k-writer .ProseMirror :where(p,ul,ol){line-height:1.5}.k-writer .ProseMirror h1{font-size:var(--text-3xl);line-height:1.25em}.k-writer .ProseMirror h2{font-size:var(--text-2xl);line-height:1.25em}.k-writer .ProseMirror h3{font-size:var(--text-xl);line-height:1.25em}.k-writer .ProseMirror :where(h1,h2,h3) strong{font-weight:700}.k-writer .ProseMirror strong{font-weight:600}.k-writer .ProseMirror :where(sup,sub){font-size:var(--text-xs);line-height:1}.k-writer .ProseMirror code{background:var(--color-gray-300);border-radius:var(--rounded);display:inline-block;font-family:var(--font-mono);font-size:.925em;line-height:1.325;padding:.05em .325em;position:relative}.k-writer .ProseMirror :where(ul,ol){padding-left:1.75rem}.k-writer .ProseMirror ul>li{list-style:disc}.k-writer .ProseMirror ul ul>li{list-style:circle}.k-writer .ProseMirror ul ul ul>li{list-style:square}.k-writer .ProseMirror ol>li{list-style:decimal}.k-writer .ProseMirror li>:where(p,ol,ul){margin:0}.k-writer .ProseMirror hr{border:0;border-radius:var(--rounded);border-top:2px solid var(--color-gray-300);margin-bottom:var(--spacing-1);margin-top:var(--spacing-1)}.k-writer .ProseMirror hr.ProseMirror-selectednode{outline:2px var(--color-focus) solid}.k-writer-code pre{-webkit-overflow-scrolling:touch;font-size:var(--text-sm);line-height:2em;overflow-x:auto;overflow-y:hidden;-moz-tab-size:2;-o-tab-size:2;tab-size:2;white-space:pre}.k-writer-code code{font-family:var(--font-mono)}.k-writer[data-placeholder][data-empty=true]:before{word-wrap:break-word;color:var(--color-gray-500);content:attr(data-placeholder);grid-area:content;pointer-events:none;white-space:pre-wrap}.k-writer-field .k-writer-input .ProseMirror,.k-writer-field .k-writer-input:before{line-height:1.5em;padding:.375rem .5rem}.k-checkbox-input{cursor:pointer;position:relative}.k-checkbox-input-label{display:block;padding-left:1.75rem}.k-checkbox-input-icon{border:2px solid var(--color-gray-500);border-radius:var(--rounded);height:1rem;left:0;position:absolute;width:1rem}.k-checkbox-input-icon svg{display:none;height:12px;position:absolute;width:12px}.k-checkbox-input-icon path{stroke:var(--color-white)}.k-checkbox-input-native:checked+.k-checkbox-input-icon{background:var(--color-gray-900);border-color:var(--color-gray-900)}[data-disabled=true] .k-checkbox-input-native:checked+.k-checkbox-input-icon{background:var(--color-gray-600);border-color:var(--color-gray-600)}.k-checkbox-input-native:checked+.k-checkbox-input-icon svg{display:block}.k-checkbox-input-native:focus+.k-checkbox-input-icon{border-color:var(--color-blue-600)}.k-checkbox-input-native:focus:checked+.k-checkbox-input-icon{background:var(--color-focus)}.k-layout{--layout-border-color:var(--color-gray-300);--layout-toolbar-width:2rem;background:#fff;box-shadow:var(--shadow);padding-right:var(--layout-toolbar-width);position:relative}[data-disabled=true] .k-layout{padding-right:0}.k-layout:not(:last-of-type){margin-bottom:1px}.k-layout:focus{outline:0}.k-layout-toolbar{background:var(--color-gray-100);border-left:1px solid var(--color-light);bottom:0;color:var(--color-gray-500);display:flex;flex-direction:column;font-size:var(--text-sm);position:absolute;right:0;top:0;width:var(--layout-toolbar-width)}.k-layout-toolbar:hover{color:var(--color-black)}.k-layout-toolbar-button{height:var(--layout-toolbar-width);width:var(--layout-toolbar-width)}.k-layout-toolbar .k-sort-handle{color:currentColor;margin-top:auto}.k-layout-columns.k-grid{grid-gap:1px;background:var(--layout-border-color);background:var(--color-gray-300)}.k-layout:not(:first-child) .k-layout-columns.k-grid{border-top:0}.k-layout-column{background:var(--color-white);display:flex;flex-direction:column;height:100%;min-height:6rem;position:relative}.k-layout-column:focus{outline:0}.k-layout-column .k-blocks{background:none;background:var(--color-white);box-shadow:none;height:100%;min-height:4rem;padding:0}.k-layout-column .k-blocks[data-empty=true]{min-height:6rem}.k-layout-column .k-blocks-list{display:flex;flex-direction:column;height:100%}.k-layout-column .k-blocks .k-block-container:last-of-type{flex-grow:1}.k-layout-column .k-blocks-empty{border:0;bottom:0;justify-content:center;left:0;opacity:0;position:absolute;right:0;top:0;transition:opacity .3s}.k-layout-column .k-blocks-empty:hover{opacity:1}.k-layout-column .k-blocks-empty.k-empty .k-icon{border-right:0;width:1rem}.k-layouts .k-sortable-ghost{box-shadow:0 5px 10px #12121240;cursor:grabbing;outline:2px solid var(--color-focus);position:relative;z-index:1}.k-layout-selector.k-dialog{background:#313740;color:var(--color-white)}.k-layout-selector .k-headline{line-height:1;margin-bottom:1.5rem;margin-top:-.25rem}.k-layout-selector ul{grid-gap:1.5rem;display:grid;grid-template-columns:repeat(3,1fr)}.k-layout-selector-option{outline:2px solid var(--option-outline,transparent);outline-offset:2px}.k-layout-selector-option[aria-current=true]{--option-outline:var(--color-blue-300)}.k-layout-selector-option:not([aria-current]):hover{--option-outline:var(--color-green-300)}.k-layout-selector-option:last-child{margin-bottom:0}.k-layout-selector-option .k-grid{grid-gap:2px;box-shadow:var(--shadow);cursor:pointer;height:5rem}.k-layout-selector-option .k-column{align-items:center;background:hsla(0,0%,100%,.2);display:flex;justify-content:center}.k-bubbles-field-preview{padding:.325rem .75rem}.k-text-field-preview{overflow-x:hidden;padding:.325rem .75rem;text-overflow:ellipsis;white-space:nowrap}.k-url-field-preview{overflow-x:hidden;padding:.325rem .75rem;text-overflow:ellipsis}.k-url-field-preview[data-link]{color:var(--color-focus)}.k-url-field-preview a{overflow:hidden;text-decoration:underline;text-overflow:ellipsis;transition:color .3s;white-space:nowrap}.k-url-field-preview a:hover{color:var(--color-black)}.k-flag-field-preview{align-items:center;display:flex;height:var(--table-row-height);justify-content:center;width:var(--table-row-height)}.k-html-field-preview{line-height:1.5em;overflow:hidden;padding:.325rem .75rem;text-overflow:ellipsis;white-space:nowrap}.k-html-field-preview p:not(:last-child){margin-bottom:1.5em}.k-html-field-preview ol,.k-html-field-preview ul{margin-left:1rem}.k-html-field-preview ul>li{list-style:disc}.k-html-field-preview ol ul>li,.k-html-field-preview ul ul>li{list-style:circle}.k-html-field-preview ol>li{list-style:decimal}.k-html-field-preview ol>li::marker{color:var(--color-gray-500);font-size:var(--text-xs)}.k-html-field-preview a{color:var(--color-focus);text-decoration:underline}.k-toggle-field-preview label{cursor:pointer;display:flex;height:38px;overflow:hidden;padding:0 .25rem 0 .75rem;white-space:nowrap}.k-toggle-field-preview .k-toggle-input-label{padding-left:.5rem}[data-align=right] .k-toggle-field-preview .k-toggle-input-label{padding-right:.5rem}.k-toggle-field-preview .k-toggle-input{padding:0 .25rem 0 .75rem}[data-align=right] .k-toggle-field-preview .k-toggle-input{flex-direction:row-reverse;padding-left:.25rem;padding-right:.75rem}.js-has-pseudo [csstools-has-1a-2z-19-3b-36-2x-38-2t-36-1m-2w-2p-37-14-1a-2z-19-3b-36-2x-38-2t-36-19-38-33-33-30-2q-2p-36-1m-32-33-38-14-2j-2s-2p-38-2p-19-2x-32-30-2x-32-2t-1p-y-38-36-39-2t-y-2l-15-15]:not(.does-not-exist):not(.does-not-exist){grid-template-areas:"topbar" "content";grid-template-rows:38px 1fr}.k-writer:has(.k-writer-toolbar:not([data-inline=true])){grid-template-areas:"topbar" "content";grid-template-rows:38px 1fr}.js-has-pseudo [csstools-has-1a-2z-19-3b-36-2x-38-2t-36-19-38-33-33-30-2q-2p-36-1m-2w-2p-37-14-3i-w-1m-2u-33-2r-39-37-19-3b-2x-38-2w-2x-32-15-w-1a-2z-19-2q-39-38-38-33-32-2j-2p-36-2x-2p-19-2r-39-36-36-2t-32-38-2l]:not(.does-not-exist):not(.does-not-exist):not(.does-not-exist){color:var(--color-blue-400)}.k-writer-toolbar:has(~:focus-within) .k-button[aria-current]{color:var(--color-blue-400)}.k-writer-toolbar[data-inline=true]{--toolbar-size:var(--height-md);--toolbar-text:var(--color-white);--toolbar-back:var(--color-black);--toolbar-hover:hsla(0,0%,100%,.15);--toolbar-border:var(--color-gray-700);border:0;border-radius:var(--rounded);box-shadow:var(--shadow);position:absolute;transform:translate(-50%) translateY(-.75rem);z-index:calc(var(--z-dropdown) + 1)}.k-aspect-ratio{display:block;overflow:hidden;padding-bottom:100%;position:relative}.k-aspect-ratio>*{bottom:0;height:100%;left:0;-o-object-fit:contain;object-fit:contain;position:absolute!important;right:0;top:0;width:100%}.k-aspect-ratio[data-cover=true]>*{-o-object-fit:cover;object-fit:cover}.k-bar{align-items:center;display:flex;justify-content:space-between;line-height:1}.k-bar-slot{flex-grow:1}.k-bar-slot[data-position=center]{text-align:center}.k-bar-slot[data-position=right]{text-align:right}.k-box{word-wrap:break-word;font-size:var(--text-sm)}.k-box:not([data-theme=none]){background:var(--color-white);border-radius:var(--rounded);line-height:1.25rem;padding:.5rem .75rem}.k-box[data-theme=code]{background:var(--color-gray-900);border:1px solid var(--color-black);color:var(--color-light);font-family:Input,Menlo,monospace;font-size:var(--text-sm);line-height:1.5}.k-box[data-theme=button]{padding:0}.k-box[data-theme=button] .k-button{align-items:center;display:flex;height:2.25rem;line-height:2rem;padding:0 .75rem;text-align:left;width:100%}.k-box[data-theme=info],.k-box[data-theme=negative],.k-box[data-theme=notice],.k-box[data-theme=positive]{background:var(--theme-bg);border:0;border-left-color:var(--theme-light)}.k-box[data-theme=empty]{align-items:center;background:var(--color-background);border-left:0;border:1px dashed var(--color-border);color:var(--color-gray-600);display:flex;flex-direction:column;justify-content:center;padding:3rem 1.5rem;text-align:center}.k-box[data-theme=empty] .k-icon{color:var(--color-gray-500);margin-bottom:.5rem}.k-box[data-theme=empty] p{color:var(--color-gray-600)}.k-bubble{align-items:center;background:var(--color-light);border-radius:var(--rounded);color:var(--color-black);display:flex;font-size:var(--text-xs);height:1.525rem;line-height:1.5;overflow:hidden;padding:0 .5rem;white-space:nowrap}.k-bubble .k-item-figure{height:1.525rem;margin-left:-.5rem;margin-right:var(--spacing-2);width:1.525rem}.k-bubbles{display:flex;gap:.25rem}.k-collection-help{padding:.5rem .75rem}.k-collection-footer{display:flex;justify-content:space-between;margin-left:-.75rem;margin-right:-.75rem}.k-collection-pagination{flex-shrink:0;line-height:1.25rem;min-height:2.75rem}.k-collection-pagination .k-pagination .k-button{line-height:1.125rem;padding:.5rem .75rem}.k-column{grid-column-start:span 12;min-width:0}.k-column[data-sticky=true]>div{position:sticky;top:4vh;z-index:2}@media screen and (min-width:65em){.k-column[data-width="1/1"],.k-column[data-width="12/12"],.k-column[data-width="2/2"],.k-column[data-width="3/3"],.k-column[data-width="4/4"],.k-column[data-width="6/6"]{grid-column-start:span 12}.k-column[data-width="11/12"]{grid-column-start:span 11}.k-column[data-width="10/12"],.k-column[data-width="5/6"]{grid-column-start:span 10}.k-column[data-width="3/4"],.k-column[data-width="9/12"]{grid-column-start:span 9}.k-column[data-width="2/3"],.k-column[data-width="4/6"],.k-column[data-width="8/12"]{grid-column-start:span 8}.k-column[data-width="7/12"]{grid-column-start:span 7}.k-column[data-width="1/2"],.k-column[data-width="2/4"],.k-column[data-width="3/6"],.k-column[data-width="6/12"]{grid-column-start:span 6}.k-column[data-width="5/12"]{grid-column-start:span 5}.k-column[data-width="1/3"],.k-column[data-width="2/6"],.k-column[data-width="4/12"]{grid-column-start:span 4}.k-column[data-width="1/4"],.k-column[data-width="3/12"]{grid-column-start:span 3}.k-column[data-width="1/6"],.k-column[data-width="2/12"]{grid-column-start:span 2}.k-column[data-width="1/12"]{grid-column-start:span 1}}.k-column[data-disabled=true]{cursor:not-allowed;opacity:.4}.k-column[data-disabled=true] *{pointer-events:none}.k-column[data-disabled=true] .k-text[data-theme=help] *{pointer-events:auto}.k-dropzone{position:relative}.k-dropzone:after{bottom:0;content:"";display:none;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:1}.k-dropzone[data-over=true]:after{box-shadow:var(--color-focus-outline) 0 0 0 3px;display:block;outline:1px solid var(--color-focus)}.k-empty{align-items:stretch;border:1px dashed var(--color-border);border-radius:var(--rounded);color:var(--color-gray-600);display:flex}button.k-empty{width:100%}button.k-empty:focus{outline:none}.k-empty p{color:var(--color-gray-600);font-size:var(--text-sm)}.k-empty>.k-icon{color:var(--color-gray-500)}.k-empty[data-layout=cardlets],.k-empty[data-layout=cards]{flex-direction:column;justify-content:center;padding:1.5rem;text-align:center}.k-empty[data-layout=cardlets] .k-icon,.k-empty[data-layout=cards] .k-icon{margin-bottom:1rem}.k-empty[data-layout=cardlets] .k-icon svg,.k-empty[data-layout=cards] .k-icon svg{height:2rem;width:2rem}.k-empty[data-layout=list],.k-empty[data-layout=table]{min-height:38px}.k-empty[data-layout=list]>.k-icon,.k-empty[data-layout=table]>.k-icon{border-right:1px solid rgba(0,0,0,.05);min-height:36px;width:36px}.k-empty[data-layout=list]>p,.k-empty[data-layout=table]>p{line-height:1.25rem;padding:.5rem .75rem}.k-file-preview{background:var(--color-gray-800)}.k-file-preview-layout{align-items:stretch;border-radius:var(--rounded-lg);display:grid;margin-bottom:var(--spacing-6);overflow:hidden}.k-file-preview-layout>*{min-width:0}.k-file-preview-thumb{--icon-size:2rem;aspect-ratio:1/1;background:var(--bg-pattern);container-type:size;display:grid;padding:var(--spacing-6);place-items:center}.k-file-preview .k-coords{--opacity-disabled:1;cursor:crosshair}.k-file-preview-thumb img{max-height:100cqh;max-width:100cqw}.k-file-preview .k-coords-thumb{--range-thumb-height:1.25rem;background:rgba(92,141,214,.75);box-shadow:none}.k-file-preview .k-coords-thumb:after{background:var(--color-white);border-radius:50%;content:"";height:.4rem;left:calc(50% - .2rem);position:absolute;top:calc(50% - .2rem);width:.4rem}.k-file-preview:not([data-has-focus=true]) .k-coords-thumb{display:none}.k-file-preview-icon{--icon-size:3rem}.k-file-preview-thumb .k-dropdown{left:var(--spacing-2);position:absolute;top:var(--spacing-2)}.k-file-preview-details{display:grid}.k-file-preview-details dl{grid-gap:var(--spacing-6) var(--spacing-12);align-self:center;display:grid;grid-template-columns:repeat(auto-fill,minmax(12rem,1fr));line-height:1.5em;padding:var(--spacing-6)}.k-file-preview-details dt{color:var(--color-gray-500);font-size:var(--text-sm);font-weight:500;font-weight:var(--font-semi);margin-bottom:var(--spacing-1)}.k-file-preview-details :where(dd,a){color:#ffffff80;color:#ffffffbf;font-size:var(--text-xs);font-size:var(--text-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.k-file-preview-focus-info dd{align-items:center;display:flex}.k-file-preview-focus-info .k-button{align-items:center;background:var(--color-gray-700);border-radius:var(--rounded);display:flex;font-size:var(--text-sm);height:24px;line-height:1;padding:.25rem .25rem .25rem .5rem}.k-file-preview-focus-info .k-button:hover{background:var(--color-gray-600)}.k-file-preview[data-has-focus=true] .k-file-preview-focus-info .k-button{display:flex;flex-direction:row-reverse;gap:.25rem}.k-file-preview[data-has-focus=true] .k-file-preview-focus-info .k-button-text{padding:0}@media screen and (min-width:36rem){.k-file-preview-layout{grid-template-columns:50% auto}.k-file-preview-thumb{aspect-ratio:auto}}@media screen and (min-width:65rem){.k-file-preview-thumb{aspect-ratio:1/1}.k-file-preview-layout{grid-template-columns:33.333% auto}}@media screen and (min-width:90rem){.k-file-preview-layout{grid-template-columns:25% auto}}.k-grid{--columns:12;grid-column-gap:0;grid-row-gap:0;display:grid;grid-template-columns:1fr}@media screen and (min-width:30em){.k-grid[data-gutter=small]{grid-column-gap:1rem;grid-row-gap:1rem}.k-grid[data-gutter=huge],.k-grid[data-gutter=large],.k-grid[data-gutter=medium]{grid-column-gap:1.5rem;grid-row-gap:1.5rem}}@media screen and (min-width:65em){.k-grid{grid-template-columns:repeat(var(--columns),1fr)}.k-grid[data-gutter=large]{grid-column-gap:3rem}.k-grid[data-gutter=huge]{grid-column-gap:4.5rem}}@media screen and (min-width:90em){.k-grid[data-gutter=large]{grid-column-gap:4.5rem}.k-grid[data-gutter=huge]{grid-column-gap:6rem}}@media screen and (min-width:120em){.k-grid[data-gutter=large]{grid-column-gap:6rem}.k-grid[data-gutter=huge]{grid-column-gap:7.5rem}}.k-header{border-bottom:1px solid var(--color-border);margin-bottom:2rem;padding-top:4vh}.k-header[data-tabs=true]{border-bottom:0}.k-header .k-headline{word-wrap:break-word;margin-bottom:.5rem;min-height:1.25em}.k-header[data-editable=true] .k-headline{cursor:pointer}.k-header .k-headline .k-icon{color:var(--color-gray-500);display:inline-block;margin-left:.5rem;opacity:0;transition:opacity .3s}.k-header[data-editable=true] .k-headline:hover .k-icon{opacity:1}.k-header .k-header-buttons{height:3.25rem;margin-top:-.5rem}.k-panel-inside{bottom:0;display:flex;flex-direction:column;left:0;position:absolute;right:0;top:0}.k-panel-inside:focus{outline:0}.k-panel-header{flex-shrink:0;z-index:var(--z-navigation)}.k-panel-view{flex-grow:1;padding-bottom:6rem}.k-item{background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);display:grid;grid-template-columns:auto;line-height:1;position:relative}.k-item:focus{outline:0}.k-item.k-sortable-ghost,.k-item:focus-within{box-shadow:var(--shadow-outline)}.k-item a:focus{outline:0}.k-item-sort-handle.k-sort-handle{border-radius:1px;height:1.5rem;opacity:0;position:absolute;width:1.25rem;z-index:2}.k-item:hover .k-item-sort-handle{opacity:1}.k-item-figure{grid-area:figure}.k-item-content{grid-area:content;overflow:hidden}.k-item-info,.k-item-title{font-size:var(--text-sm);font-weight:400;line-height:1.125rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.k-item-info{color:var(--color-gray-500);grid-area:info}.k-item-title-link.k-link[data-=true]{box-shadow:none}.k-item-title-link:after{bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}.k-item-footer{align-items:center;display:flex;grid-area:footer;justify-content:space-between;min-width:0}.k-item-label{margin-right:.5rem}.k-item-buttons{display:flex;flex-grow:1;flex-shrink:0;justify-content:flex-end;position:relative}.k-item-buttons>.k-button,.k-item-buttons>.k-dropdown{align-items:center;display:flex!important;height:38px;justify-content:center;line-height:1;position:relative;width:38px}.k-item-buttons>.k-button{z-index:1}.k-item-buttons>.k-options-dropdown>.k-options-dropdown-toggle{z-index:var(--z-toolbar)}.k-list-item{align-items:center;display:flex;height:38px}.k-list-item .k-item-sort-handle{left:-1.5rem;width:1.5rem}.k-list-item .k-item-figure{border-bottom-left-radius:var(--rounded);border-top-left-radius:var(--rounded);width:38px}.k-list-item .k-item-content{align-items:center;display:flex;flex-grow:1;flex-shrink:2;justify-content:space-between;margin-left:.75rem}.k-list-item .k-item-info,.k-list-item .k-item-title{flex-grow:1;line-height:1.5rem}.k-list-item .k-item-title{flex-shrink:1;margin-right:.5rem}.k-list-item .k-item-info{flex-shrink:2;justify-self:end;margin-right:.5rem;text-align:right}.k-list-item .k-item-buttons,.k-list-item .k-item-footer{flex-shrink:0}.k-item:not(.k-list-item) .k-item-sort-handle{background:var(--color-background);border-radius:var(--rounded-sm);box-shadow:var(--shadow-lg);margin:var(--spacing-2)}.k-item:not(.k-list-item) .k-item-label{margin-left:-2px}.k-item:not(.k-list-item) .k-item-content{padding:.625rem .75rem}.k-cardlets-item{grid-template-areas:"content" "footer";grid-template-rows:auto 38px;height:6rem}.k-cardlets-item[data-has-figure=true]{grid-template-areas:"figure content" "figure footer";grid-template-columns:6rem auto}.k-cardlets-item .k-item-figure{border-bottom-left-radius:var(--rounded);border-top-left-radius:var(--rounded)}.k-cardlets-item .k-item-footer{padding-bottom:.5rem;padding-top:.5rem}.k-cards-item{grid-template-areas:"figure" "content";grid-template-columns:auto;grid-template-rows:auto 1fr}.k-cards-item .k-item-figure{border-top-left-radius:var(--rounded);border-top-right-radius:var(--rounded)}.k-cards-item .k-item-content{overflow:hidden;padding:.5rem .75rem!important}.k-cards-item .k-item-info,.k-cards-item .k-item-title{line-height:1.375rem;white-space:normal}.k-cards-item .k-item-info:after,.k-cards-item .k-item-title:after{content:" ";display:inline-block;width:var(--item-content-wrapper)}.k-cards-item{--item-content-wrapper:0}.k-cards-item[data-has-flag=true],.k-cards-item[data-has-options=true]{--item-content-wrapper:38px}.k-cards-item[data-has-flag=true][data-has-options=true]{--item-content-wrapper:76px}.k-cards-item[data-has-info=true] .k-item-title:after{display:none}.k-cards-item .k-item-footer{bottom:0;position:absolute;right:0;width:auto}.k-item-figure{flex-shrink:0;overflow:hidden}.k-cards-items{--min:13rem;--max:1fr;--gap:1.5rem;--column-gap:var(--gap);--row-gap:var(--gap);grid-column-gap:var(--column-gap);grid-row-gap:var(--row-gap);display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--min),var(--max)))}@media screen and (min-width:30em){.k-cards-items[data-size=tiny]{--min:10rem}.k-cards-items[data-size=small]{--min:16rem}.k-cards-items[data-size=medium]{--min:24rem}.k-cards-items[data-size=huge],.k-cards-items[data-size=large],.k-column[data-width="1/4"] .k-cards-items,.k-column[data-width="1/5"] .k-cards-items,.k-column[data-width="1/6"] .k-cards-items{--min:1fr}}@media screen and (min-width:65em){.k-cards-items[data-size=large]{--min:32rem}}.k-cardlets-items{grid-gap:.5rem;display:grid;grid-template-columns:repeat(auto-fill,minmax(16rem,1fr))}.k-list-items .k-list-item:not(:last-child){margin-bottom:2px}:root{--overlay-color-back:var(--color-backdrop)}.k-overlay{bottom:0;height:100%;left:0;position:fixed;right:0;top:0;transform:translateZ(0);width:100%;z-index:var(--z-dialog)}.k-overlay[data-centered=true]{display:grid;place-items:center}.k-overlay[data-dimmed=true]{background:var(--overlay-color-back)}.k-overlay-loader{color:var(--color-white)}.k-panel[data-loading=true]{animation:LoadingCursor .5s}.k-panel[data-dragging=true],.k-panel[data-loading=true]:after{-webkit-user-select:none;-moz-user-select:none;user-select:none}.k-stats{grid-gap:var(--spacing-2px);display:grid;grid-auto-rows:1fr;grid-template-columns:repeat(auto-fit,minmax(14rem,1fr))}.k-stat{background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);display:flex;flex-direction:column;line-height:var(--leading-normal);padding:var(--spacing-3) var(--spacing-6)}.k-stat.k-link:hover{background:var(--color-gray-100);cursor:pointer}.k-stat dd,.k-stat dt{display:block}.k-stat-value{font-size:var(--value);margin-bottom:var(--spacing-1);order:1}.k-stat-info,.k-stat-label{font-size:var(--text-xs)}.k-stat-label{order:2}.k-stat-info{color:var(--theme,var(--color-gray-500));order:3}.k-stats[data-size=small]{--value:var(--text-base)}.k-stats[data-size=medium]{--value:var(--text-xl)}.k-stats[data-size=large]{--value:var(--text-2xl)}.k-stats[data-size=huge]{--value:var(--text-3xl)}.k-table{--table-row-height:38px;background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);font-size:var(--text-sm);position:relative}.k-table table{border-spacing:0;font-variant-numeric:tabular-nums;table-layout:fixed;width:100%}.k-table[data-invalid]{border:0;box-shadow:var(--color-negative-outline) 0 0 0 1px,var(--color-negative-outline) 0 0 3px 2px}.k-table td,.k-table th{height:var(--table-row-height);line-height:1.25em;overflow:hidden;text-overflow:ellipsis;width:100%}.k-table thead th:first-child{border-top-left-radius:var(--rounded)}.k-table thead th:last-child{border-top-right-radius:var(--rounded)}.k-table td:last-child,.k-table th:last-child{border-right:0;height:var(--table-row-height)}.k-table th,.k-table tr:not(:last-child) td{border-bottom:1px solid var(--color-background)}.k-table td:last-child{overflow:visible}.k-table td,.k-table th{border-right:1px solid var(--color-background);text-align:left}.k-table th{background:var(--color-gray-100);color:var(--color-gray-600);font-family:var(--font-mono);font-size:var(--text-xs);font-weight:400;padding:0 .75rem;width:100%}.k-table th button{border-radius:var(--rounded);display:block;font:inherit;height:100%;padding:0 .75rem;text-align:left;width:100%}.k-table th button:focus-visible{outline:2px solid var(--color-black);outline-offset:-2px}.k-table tbody tr:hover td{background:hsla(0,0%,94%,.25)}.k-table thead th{left:0;position:sticky;right:0;top:0;z-index:1}.k-table tbody th{border-radius:0;overflow:visible;padding:0;white-space:nowrap;width:auto}.k-table tbody tr:first-child th{border-top-left-radius:var(--rounded)}.k-table tbody tr:last-child th{border-bottom:0;border-bottom-left-radius:var(--rounded)}.k-table-column[data-align]{text-align:var(--align)!important}.k-table-column[data-align=right]>.k-input{align-items:flex-end;flex-direction:column}.k-table .k-sort-handle,.k-table-index{display:grid;height:var(--table-row-height);place-items:center;width:100%}.k-table .k-sort-handle,.k-table tr:hover .k-table-index-column[data-sortable=true] .k-table-index{display:none}.k-table tr:hover .k-sort-handle{display:grid!important}.k-table-row-ghost{background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow-outline);cursor:grabbing;cursor:-webkit-grabbing;margin-bottom:2px;outline:2px solid var(--color-black)}.k-table-row-fallback{opacity:0!important}td.k-table-index-column,td.k-table-options-column,th.k-table-index-column,th.k-table-options-column{text-align:center!important;width:var(--table-row-height)}.k-table-index{color:var(--color-gray-500);font-size:var(--text-xs);line-height:1.1em}.k-table-empty{color:var(--color-gray-600);font-size:var(--text-sm)}[data-disabled=true] .k-table{background:var(--color-gray-100)}[data-disabled=true] .k-table tbody td,[data-disabled=true] .k-table th{border-color:var(--color-gray-200)}[data-disabled=true] .k-table td:last-child{overflow:hidden;text-overflow:ellipsis}@media screen and (max-width:65em){.k-table tbody td:not([data-mobile]),.k-table thead th:not([data-mobile]){display:none}}.k-table-pagination.k-pagination{align-items:center;background:var(--color-gray-100);border-bottom-left-radius:var(--rounded);border-bottom-right-radius:var(--rounded);border-top:1px solid var(--color-gray-200);display:flex;height:var(--table-row-height);justify-content:space-between}.k-table-pagination.k-pagination .k-button{align-items:center;display:flex;height:var(--table-row-height);line-height:1;padding:0 .75rem}.k-table-update-status-cell{align-items:center;display:flex;height:100%;padding:0 .75rem}.k-table-update-status-cell-button,.k-table-update-status-cell-version{font-variant-numeric:tabular-nums}.k-table-update-status-cell-button{align-items:center;background:var(--color-gray-200);border-radius:var(--rounded);display:inline-flex;line-height:1;padding:.25rem 1.5rem .25rem .325rem}.k-table-update-status-cell-button .k-button-text:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #000;content:"";margin-top:-2px;position:absolute;right:.5rem;top:50%}.k-table-update-status-cell-button .k-icon{color:var(--theme)}.k-plugin-info{padding:1rem}.k-plugin-info div+div{margin-top:.5rem}.k-plugin-info dt{color:var(--color-gray-400);margin-right:.5rem}.k-plugin-info dd[data-theme]{color:var(--theme-light)}.k-plugin-info+.k-dropdown-item{border-top:1px solid var(--color-gray-700);padding-top:.75rem}@media screen and (min-width:30em){.k-plugin-info{width:20rem}.k-plugin-info div{display:flex}}.k-tabs{background:#e9e9e9;border:1px solid var(--color-border);border-radius:var(--rounded);position:relative}.k-tabs nav{display:flex;justify-content:center;margin-left:-1px;margin-right:-1px}.k-tab-button.k-button{align-items:center;border-left:1px solid transparent;border-right:1px solid var(--color-border);display:inline-flex;flex-direction:column;flex-grow:1;flex-shrink:1;font-size:var(--text-xs);font-weight:500;justify-content:center;max-width:15rem;padding:.625rem .75rem;position:relative;text-align:center;text-transform:uppercase;z-index:1}@media screen and (min-width:30em){.k-tab-button.k-button{flex-direction:row}.k-tab-button.k-button .k-icon{margin-right:.5rem}}.k-tab-button.k-button>.k-button-text{font-size:10px;max-width:10rem;opacity:1;overflow:hidden;padding-left:0;padding-top:.375rem;text-overflow:ellipsis}@media screen and (min-width:30em){.k-tab-button.k-button>.k-button-text{font-size:var(--text-xs);padding-top:0}}.k-tab-button:last-child{border-right:1px solid transparent}.k-tab-button[aria-current]{background:var(--color-background);border-right:1px solid var(--color-border);pointer-events:none;position:relative}.k-tab-button[aria-current]:first-child{border-left:1px solid var(--color-border)}.k-tab-button[aria-current]:after,.k-tab-button[aria-current]:before{content:"";position:absolute}.k-tab-button[aria-current]:before{background:var(--color-black);height:2px;left:-1px;right:-1px;top:-1px}.k-tab-button[aria-current]:after{background:var(--color-background);bottom:-1px;height:1px;left:0;right:0}.k-tabs-dropdown{right:0;top:100%}.k-tabs-badge{border-radius:2px;box-shadow:var(--shadow-md);font-size:10px;font-variant-numeric:tabular-nums;line-height:1.5;padding:0 .25rem;position:absolute;right:2px;top:3px}.k-tabs[data-theme=notice] .k-tabs-badge{background:var(--theme-light);color:var(--color-black)}.k-view{margin:0 auto;max-width:100rem;padding-left:1.5rem;padding-right:1.5rem}@media screen and (min-width:30em){.k-view{padding-left:3rem;padding-right:3rem}}@media screen and (min-width:90em){.k-view{padding-left:6rem;padding-right:6rem}}.k-view[data-align=center]{align-items:center;display:flex;height:100vh;justify-content:center;overflow:auto;padding:0 3rem}.k-view[data-align=center]>*{flex-basis:22.5rem}.k-fatal{align-items:center;background:var(--color-backdrop);bottom:0;display:flex;justify-content:center;left:0;padding:1.5rem;position:fixed;right:0;top:0;z-index:var(--z-fatal)}.k-fatal-box{background:var(--color-red-400);border-radius:var(--rounded);box-shadow:var(--shadow-xl);color:var(--color-black);display:flex;flex-direction:column;height:100%;width:100%}.k-fatal-box .k-headline{font-size:var(--text-sm);line-height:1;padding:.75rem}.k-fatal-box .k-button{padding:.75rem}.k-fatal-iframe{background:var(--color-white);border:0;flex-grow:1;width:100%}.k-icon{--size:1rem;align-items:center;display:flex;flex-shrink:0;font-size:var(--size);justify-content:center;line-height:0;position:relative}.k-icon[data-size=medium]{--size:2rem}.k-icon[data-size=large]{--size:3rem}.k-icon svg{height:var(--size);-moz-transform:scale(1);width:var(--size)}.k-icon svg *{fill:currentColor}.k-icon[data-back=black]{color:var(--color-white)}.k-icon[data-back=white]{color:var(--color-gray-900)}.k-icon[data-back=pattern]{color:var(--color-white)}[data-disabled=true] .k-icon[data-back=pattern] svg{opacity:1}.k-icon-emoji{display:block;font-size:var(--size);font-style:normal;line-height:1}@media not all,only screen and (min-resolution:192dpi),only screen and (min-resolution:2dppx){.k-icon-emoji{font-size:1.25em}}.k-icons{height:0;position:absolute;width:0}.k-image span{display:block;line-height:0;padding-bottom:100%;position:relative}.k-image img{bottom:0;height:100%;left:0;-o-object-fit:contain;object-fit:contain;position:absolute;right:0;top:0;width:100%}.k-image-error{color:var(--color-white);font-size:.9em;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.k-image-error svg *{fill:#ffffff4d}.k-image[data-cover=true] img{-o-object-fit:cover;object-fit:cover}.k-image[data-back=black] span{background:var(--color-gray-900)}.k-image[data-back=white] span{background:var(--color-white);color:var(--color-gray-900)}.k-image[data-back=white] .k-image-error{background:var(--color-gray-900);color:var(--color-white)}.k-image[data-back=pattern] span{background:var(--color-gray-800) var(--bg-pattern)}.k-loader{z-index:1}.k-loader-icon{animation:Spin .9s linear infinite}.k-notification{align-items:center;background:var(--color-gray-900);color:var(--color-white);display:flex;flex-shrink:0;line-height:1.25rem;padding:.75rem 1.5rem;width:100%}.k-notification[data-theme]{background:var(--theme-light);color:var(--color-black)}.k-notification p{word-wrap:break-word;flex-grow:1;overflow:hidden}.k-notification .k-button{display:flex;margin-left:1rem}.k-offline-warning{align-items:center;background:var(--color-backdrop);bottom:0;display:flex;justify-content:center;left:0;line-height:1;position:fixed;right:0;top:0;z-index:var(--z-offline)}.k-offline-warning p{align-items:center;background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);display:flex;gap:.5rem;padding:.75rem}.k-offline-warning p .k-icon{color:var(--color-red-400)}:root{--progress-height:var(--spacing-2);--progress-color-back:var(--color-gray-300);--progress-color-value:var(--color-focus)}progress{border-radius:var(--progress-height);display:block;height:var(--progress-height);overflow:hidden;width:100%}progress::-webkit-progress-bar{background:var(--progress-color-back)}progress::-webkit-progress-value{border-radius:var(--progress-height)}progress::-webkit-progress-value,progress:not([value])::-webkit-progress-bar{background:var(--progress-color-value)}.k-registration{align-items:center;display:flex;margin-right:1rem}.k-registration p{color:var(--color-negative-light);font-size:var(--text-sm);font-weight:600;margin-right:1rem}@media screen and (max-width:90em){.k-registration p{display:none}}.k-registration .k-button{color:var(--color-white)}.k-sort-handle{align-items:center;color:var(--color-gray-900);cursor:move;cursor:grab;cursor:-webkit-grab;display:flex;height:2rem;justify-content:center;line-height:0;transition:opacity .3s;width:2rem;will-change:opacity,color;z-index:1}.k-sort-handle svg{height:1rem;width:1rem}.k-sort-handle:active{cursor:grabbing;cursor:-webkit-grabbing}.k-status-icon svg{height:14px;width:14px}.k-status-icon .k-icon{color:var(--theme-light)}.k-status-icon .k-button-text{color:var(--color-black)}.k-status-icon[data-disabled=true]{opacity:1!important}.k-status-icon[data-disabled=true] .k-icon{color:var(--color-gray-400);opacity:.5}.k-user-info{align-items:center;display:flex;font-size:var(--text-sm);line-height:1}.k-user-info .k-icon,.k-user-info .k-image{margin-right:.75rem;width:1.5rem}.k-user-info .k-icon{background:var(--color-black);color:var(--color-white);height:1.5rem}.k-breadcrumb{padding-left:.5rem;padding-right:.5rem}.k-breadcrumb-dropdown{align-items:center;display:flex;height:2.5rem;justify-content:center;width:2.5rem}.k-breadcrumb ol{align-items:center;display:none}@media screen and (min-width:30em){.k-breadcrumb ol{display:flex}.k-breadcrumb-dropdown{display:none}}.k-breadcrumb-link{align-self:stretch;font-size:var(--text-sm);line-height:1.25rem;padding-bottom:.625rem;padding-top:.625rem}.k-breadcrumb li,.k-breadcrumb-link{align-items:center;display:flex;min-width:0}.k-breadcrumb li{flex-shrink:3}.k-breadcrumb li:last-child{flex-shrink:1}.k-breadcrumb li:not(:last-child):after{content:"/";flex-shrink:0;opacity:.5;padding-left:.5rem;padding-right:.5rem}.k-breadcrumb li:not(:first-child):not(:last-child){max-width:15vw}.k-breadcrumb-icon{margin-right:.5rem}.k-breadcrumb-icon.k-loader{opacity:.5}.k-breadcrumb-link-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.k-browser{container-type:inline-size;font-size:var(--text-sm)}.k-browser-items{--browser-item-gap:1px;--browser-item-size:1fr;--browser-item-height:var(--height-sm);--browser-item-padding:.25rem;--browser-item-rounded:var(--rounded);-moz-column-gap:var(--browser-item-gap);column-gap:var(--browser-item-gap);display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--browser-item-size),1fr));row-gap:var(--browser-item-gap)}.k-browser-item{align-items:center;border-radius:var(--browser-item-rounded);cursor:pointer;display:flex;flex-shrink:0;gap:.5rem;height:var(--browser-item-height);overflow:hidden;padding-left:calc(var(--browser-item-padding) + 1px);padding-right:calc(var(--browser-item-padding) + 1px);white-space:nowrap}.k-browser-item-image{aspect-ratio:1/1;border-radius:var(--rounded-sm);box-shadow:var(--shadow);height:calc(var(--browser-item-height) - var(--browser-item-padding)*2)}.js-has-pseudo [csstools-has-1a-2z-19-2q-36-33-3b-37-2t-36-19-2x-38-2t-31-19-2x-31-2p-2v-2t-1m-2w-2p-37-14-37-3a-2v-15]:not(does-not-exist){background:var(--color-white);box-shadow:none}.k-browser-item-image:has(svg){background:var(--color-white);box-shadow:none}.k-browser-item-image svg{transform:scale(.8)}.k-browser-item input{box-shadow:var(--shadow);opacity:0;position:absolute;width:0}.js-has-pseudo [csstools-has-1a-2z-19-2q-36-33-3b-37-2t-36-19-2x-38-2t-31-1m-2w-2p-37-14-2x-32-34-39-38-1m-2r-2w-2t-2r-2z-2t-2s-15]:not(.does-not-exist):not(does-not-exist){background:var(--color-blue-200);color:var(--color-blue-700)}.k-browser-item:has(input:checked){background:var(--color-blue-200);color:var(--color-blue-700)}button{background:none;border:0;color:currentColor;cursor:pointer;font-family:var(--font-sans);font-size:1rem;line-height:inherit}button::-moz-focus-inner{border:0;padding:0}.k-button{display:inline-block;font-size:var(--text-sm);position:relative;transition:color .3s}.k-button,.k-button:focus,.k-button:hover{outline:none}.k-button *{vertical-align:middle}.k-button[data-responsive=true] .k-button-text{display:none}@media screen and (min-width:30em){.k-button[data-responsive=true] .k-button-text{display:inline}}.k-button[data-theme]{color:var(--theme)}.k-button-icon{align-items:center;display:inline-flex;line-height:0}.k-button-icon~.k-button-text{padding-left:.5rem}.k-button-text{opacity:.75}.k-button:focus .k-button-text,.k-button:hover .k-button-text{opacity:1}.k-button-text b,.k-button-text span{vertical-align:baseline}.k-button[data-disabled=true]{cursor:default;opacity:.5;pointer-events:none}.k-card-options>.k-button[data-disabled=true]{display:inline-flex}.k-button-group{--padding-x:.75rem;--padding-y:1rem;--line-height:1rem;font-size:0;margin:0 calc(var(--padding-x)*-1)}.k-button-group>.k-dropdown{display:inline-block;height:calc(var(--line-height) + var(--padding-y)*2)}.k-button-group>.k-button,.k-button-group>.k-dropdown>.k-button{line-height:var(--line-height);padding:var(--padding-y) var(--padding-x)}.k-button-group .k-dropdown-content{margin:0 var(--padding-x);top:calc(100% + 1px)}.k-dropdown{position:relative}.k-dropdown-content{background:var(--color-black);border-radius:var(--rounded);box-shadow:var(--shadow-lg);color:var(--color-white);margin-bottom:6rem;position:absolute;text-align:left;top:100%;z-index:var(--z-dropdown)}.k-dropdown-content[data-align=left]{left:0}.k-dropdown-content[data-align=right]{right:0}.k-dropdown-content>.k-dropdown-item:first-child{margin-top:.5rem}.k-dropdown-content>.k-dropdown-item:last-child{margin-bottom:.5rem}.k-dropdown-content[data-dropup=true]{bottom:100%;margin-bottom:.5rem;top:auto}.k-dropdown-content hr{border-color:currentColor;margin:.5rem 1rem;opacity:.2}.k-dropdown-content[data-theme=light]{background:var(--color-white);color:var(--color-black)}.k-dropdown-item{align-items:center;display:flex;font-size:var(--text-sm);line-height:1;padding:6px 16px;white-space:nowrap;width:100%}.k-dropdown-item:focus{box-shadow:var(--shadow-outline);outline:none}.k-dropdown-item .k-button-figure{padding-right:.5rem;text-align:center}.k-file-browser{container-type:inline-size;overflow:hidden}.k-file-browser-layout{display:grid;grid-template-columns:minmax(10rem,15rem) 1fr}.k-file-browser-tree{border-right:1px solid var(--color-gray-300);padding:var(--spacing-2)}.k-file-browser-items{background:var(--color-gray-100);padding:var(--spacing-2)}.k-file-browser-back-button{display:none}@container (max-width: 30rem){.k-file-browser-layout{grid-template-columns:minmax(0,1fr);min-height:10rem}.k-file-browser-back-button{align-items:center;background:var(--color-gray-200);border-radius:var(--rounded);display:flex;height:var(--height-sm);margin-bottom:.5rem;padding-left:.25rem;padding-right:.25rem;width:100%}.k-file-browser-tree{border-right:0}.k-file-browser[data-view=files] .k-file-browser-tree,.k-file-browser[data-view=tree] .k-file-browser-items{display:none}}.k-link{outline:none}.k-options-dropdown,.k-options-dropdown-toggle{align-items:center;display:flex;height:38px;justify-content:center}.k-options-dropdown-toggle{min-width:38px;padding:0 .75rem}:root{--tree-color-back:var(--color-gray-200);--tree-color-hover-back:var(--color-gray-300);--tree-color-selected-back:var(--color-blue-200);--tree-color-selected-text:var(--color-black);--tree-color-text:var(--color-text-dimmed);--tree-level:0;--tree-indentation:.6rem}.k-tree-branch{align-items:center;display:flex;margin-bottom:1px;padding-left:calc(var(--tree-level)*var(--tree-indentation))}.js-has-pseudo [csstools-has-1a-2z-19-38-36-2t-2t-19-2q-36-2p-32-2r-2w-1m-2w-2p-37-14-17-w-1a-2z-19-38-36-2t-2t-15]:not(.does-not-exist){background:var(--tree-color-back);top:calc(var(--tree-level)*1.5rem);z-index:calc(100 - var(--tree-level))}.k-tree-branch:has(+.k-tree){background:var(--tree-color-back);top:calc(var(--tree-level)*1.5rem);z-index:calc(100 - var(--tree-level))}.k-tree-branch:hover,li[aria-current]>.k-tree-branch{--tree-color-text:var(--tree-color-selected-text);background:var(--tree-color-hover-back);border-radius:var(--rounded)}li[aria-current]>.k-tree-branch{background:var(--tree-color-selected-back)}.k-tree-toggle{--icon-size:12px;aspect-ratio:1/1;border-radius:var(--rounded-sm);display:grid;flex-shrink:0;margin-left:.25rem;padding:0;place-items:center;width:1rem}.k-tree-toggle:hover{background:rgba(0,0,0,.075)}.k-tree-toggle[disabled]{visibility:hidden}.k-tree-folder{align-items:center;border-radius:var(--rounded-sm);display:flex;font-size:var(--text-sm);gap:.325rem;height:var(--height-sm);line-height:1.25;min-width:3rem;padding-left:.25rem;padding-right:.25rem;width:100%}@container (max-width: 15rem){.k-tree{--tree-indentation:.375rem}.k-tree-folder{padding-left:.125rem;padding-right:.125rem}.k-tree-folder .k-icon{display:none}}.k-tree-folder>span{color:var(--tree-color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.k-pagination{align-items:center;direction:ltr;display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none}.k-pagination-details{white-space:nowrap}.js-has-pseudo .k-pagination-details:not([csstools-has-1m-2w-2p-37-14-17-w-1a-2z-19-2s-36-33-34-2s-33-3b-32-19-2r-33-32-38-2t-32-38-15]){cursor:default}.k-pagination-details:not(:has(+.k-dropdown-content)){cursor:default}.k-pagination[data-align]{text-align:var(--align)}.k-dropdown-content.k-pagination-selector{background:var(--color-black);left:50%;position:absolute;top:100%;transform:translate(-50%)}[dir=ltr] .k-dropdown-content.k-pagination-selector{direction:ltr}[dir=rtl] .k-dropdown-content.k-pagination-selector{direction:rtl}.k-pagination-settings{align-items:center;display:flex;justify-content:space-between}.k-pagination-settings label{align-items:center;border-right:1px solid hsla(0,0%,100%,.35);display:flex;font-size:var(--text-xs);padding:.625rem 1rem}.k-pagination-settings label span{margin-right:.5rem}.k-prev-next{direction:ltr}:root{--tag-color-back:var(--color-gray-900);--tag-color-text:var(--color-light);--tag-color-focus-back:var(--color-focus);--tag-color-focus-text:var(--color-white);--tag-color-disabled-back:var(--color-gray-600);--tag-color-disabled-text:var(--tag-color-text);--tag-rounded:var(--rounded);--tag-height:var(--height-sm)}.k-tag{align-items:center;background-color:var(--tag-color-back);border-radius:var(--tag-rounded);color:var(--tag-color-text);cursor:pointer;display:flex;font-size:var(--text-sm);height:var(--tag-height);justify-content:space-between;line-height:1;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.k-tag:focus{background-color:var(--tag-color-focus-back);color:var(--tag-color-focus-text);outline:0}.k-tag-text{line-height:var(--leading-tight);padding-left:.75rem;padding-right:.75rem}.k-tag-toggle{height:var(--tag-height);width:var(--tag-height)}.js-has-pseudo [csstools-has-1a-2z-19-38-2p-2v-1m-2w-2p-37-14-1a-2z-19-38-2p-2v-19-38-33-2v-2v-30-2t-15-w-1a-2z-19-38-2p-2v-19-38-2t-3c-38]:not(.does-not-exist):not(.does-not-exist){padding-right:.125rem}.k-tag:has(.k-tag-toggle) .k-tag-text{padding-right:.125rem}[data-disabled=true] .k-tag{background-color:var(--tag-color-disabled-back);color:var(--tag-color-disabled-text)}[data-disabled=true] .k-tag .k-tag-toggle{display:none}.k-topbar{--bg:var(--color-gray-900);background:var(--bg);color:var(--color-white);flex-shrink:0;height:2.5rem;line-height:1;position:relative}.k-topbar-wrapper{align-items:center;display:flex;margin-left:-.75rem;margin-right:-.75rem;position:relative}.k-topbar-wrapper:after{background:var(--bg);content:"";height:2.5rem;left:100%;position:absolute;width:3rem}.k-topbar-menu{flex-shrink:0}.k-topbar-menu ul{padding:.5rem 0}.k-topbar .k-button[data-theme]{color:var(--theme-light)}.k-topbar .k-button-text{opacity:1}.k-topbar-menu-button{align-items:center;display:flex}.k-topbar-menu .k-link[aria-current]{color:var(--color-focus);font-weight:500}.k-topbar-button{font-size:var(--text-sm);line-height:1;padding:.75rem}.k-topbar-button .k-button-text{display:flex}.k-topbar-view-button{align-items:center;display:flex;flex-shrink:0;padding-right:0}.k-topbar-view-button .k-icon{margin-right:.5rem}.k-topbar-signals{align-items:center;background:var(--bg);display:flex;height:2.5rem;position:absolute;right:0;top:0}.k-topbar-signals:before{background:-webkit-linear-gradient(inline-start,hsla(0,0%,7%,0),#111);bottom:0;content:"";position:absolute;top:-.5rem;width:.5rem}.k-topbar-signals .k-button{line-height:1}.k-topbar-notification{display:flex;font-weight:var(--font-bold);line-height:1}@media screen and (max-width:30em){.k-topbar .k-button[data-theme=negative] .k-button-text{display:none}}.k-section,.k-sections{padding-bottom:3rem}.k-section-header{align-items:baseline;display:flex;position:relative;z-index:1}.k-section-header .k-headline{flex-grow:1;line-height:1.25rem;min-height:2rem;overflow:hidden;padding-right:var(--spacing-3);text-overflow:ellipsis;white-space:nowrap}.k-section-header .k-button-group{position:absolute;right:0;top:calc(-.5rem - 1px)}.k-section-header .k-button-group>.k-button{display:inline-flex;padding:.75rem}.k-fields-issue-headline{margin-bottom:.5rem}.k-fields-section input[type=submit]{display:none}[data-locked=true] .k-fields-section{opacity:.2;pointer-events:none}.k-models-section[data-processing=true]{pointer-events:none}.k-models-section-search.k-input{background:var(--color-gray-300);border-radius:var(--rounded);font-size:var(--text-sm);height:var(--field-input-height);margin-bottom:var(--spacing-3);padding:var(--spacing-2) var(--spacing-3)}.k-info-section-label{margin-bottom:.5rem}:root{--code-color-back:var(--color-black);--code-color-icon:var(--color-gray-500);--code-color-text:var(--color-gray-200,#fff);--code-font-family:var(--font-mono);--code-font-size:1em}.k-code,.k-text pre{background:var(--code-color-back);border-radius:var(--rounded,.5rem);color:var(--code-color-text);display:block;font-family:var(--code-font-family);font-size:var(--code-font-size);line-height:1.5;max-width:100%;overflow-x:auto;overflow-y:hidden;padding:.75rem;position:relative;-moz-tab-size:2;-o-tab-size:2;tab-size:2;white-space:nowrap}.k-code:not(code),.k-text pre{white-space:pre-wrap}.k-code:before{background:var(--code-color-back);border-radius:var(--rounded,.5rem);content:attr(data-language);font-size:calc(var(--text-xs)*.75);padding:.5rem .5rem .25rem .25rem;position:absolute;right:0;top:0}.k-headline{--size:var(--text-base);font-size:var(--size);font-weight:var(--font-bold);line-height:1.5em}.k-headline[data-size=small]{--size:var(--text-sm)}.k-headline[data-size=large]{--size:var(--text-xl);font-weight:var(--font-normal)}@media screen and (min-width:65em){.k-headline[data-size=large]{--size:var(--text-2xl)}}.k-headline[data-size=huge]{--size:var(--text-2xl);line-height:1.15em}@media screen and (min-width:65em){.k-headline[data-size=huge]{--size:var(--text-3xl)}}.k-headline[data-theme]{color:var(--theme)}.k-headline abbr{color:var(--color-gray-500);padding-left:.25rem;text-decoration:none}.k-text{line-height:1.5em}.k-text ol,.k-text ul{margin-left:1rem}.k-text li{list-style:inherit}.k-text p,.k-text>ol,.k-text>ul{margin-bottom:1.5em}.k-text a{text-decoration:underline}.k-text>:last-child{margin-bottom:0}.k-text[data-size=tiny]{font-size:var(--text-xs)}.k-text[data-size=small]{font-size:var(--text-sm)}.k-text[data-size=medium]{font-size:var(--text-base)}.k-text[data-size=large]{font-size:var(--text-xl)}.k-text[data-align]{text-align:var(--align)}.k-text[data-theme=help]{color:var(--color-gray-600);font-size:var(--text-sm);line-height:1.25rem}.k-dialog-body .k-text{word-wrap:break-word}.k-user-profile{background:var(--color-white)}.k-user-profile>.k-view{align-items:center;display:flex;line-height:0;padding-bottom:3rem;padding-top:3rem}.k-user-profile .k-button-group{margin-left:.75rem;overflow:hidden}.k-user-profile .k-button-group .k-button{display:block;overflow:hidden;padding-bottom:.25rem;padding-top:.25rem;white-space:nowrap}.k-user-view-image .k-icon,.k-user-view-image .k-image{border-radius:var(--rounded);height:5rem;line-height:0;overflow:hidden;width:5rem}.k-user-view-image[data-disabled=true]{opacity:1}.k-user-view-image .k-image{display:block}.k-user-view-image .k-button-text{opacity:1}.k-user-name-placeholder{color:var(--color-gray-500);transition:color .3s}.k-header[data-editable=true] .k-user-name-placeholder:hover{color:var(--color-gray-900)}.k-error-view{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.k-error-view-content{line-height:1.5em;max-width:25rem;text-align:center}.k-error-view-icon{color:var(--color-negative);display:inline-block}.k-error-view-content p:not(:last-child){margin-bottom:.75rem}.k-installation-view .k-button{display:block;margin-top:1.5rem}.k-installation-view .k-headline{margin-bottom:.75rem}.k-installation-issues{font-size:var(--text-sm);line-height:1.5em}.k-installation-issues li{background:var(--color-white);padding:1.5rem 1.5rem 1.5rem 3.5rem;position:relative}.k-installation-issues .k-icon{left:1.5rem;position:absolute;top:calc(1.5rem + 2px)}.k-installation-issues .k-icon svg *{fill:var(--color-negative)}.k-installation-issues li:not(:last-child){margin-bottom:2px}.k-installation-issues li code{color:var(--color-negative);font:inherit}.k-installation-view .k-button[type=submit]{margin-left:-1rem;padding:1rem}.k-language-view section+section{margin-top:var(--spacing-6)}.k-languages-view .k-header{margin-bottom:1.5rem}.k-languages-view-section-header{margin-bottom:.5rem}.k-languages-view-section{margin-bottom:3rem}.k-login-fields{position:relative}.k-login-toggler{font-size:.875rem;position:absolute;right:0;text-decoration:underline;top:0;z-index:1}.k-login-form label abbr{visibility:hidden}.k-login-buttons{align-items:center;display:flex;justify-content:flex-end;padding:1.5rem 0}.k-login-button{font-weight:500;margin-right:-1rem;padding:.5rem 1rem;transition:opacity .3s}.k-login-button span{opacity:1}.k-login-button[disabled]{opacity:.25}.k-login-back-button,.k-login-checkbox{align-items:center;display:flex;flex-grow:1}.k-login-back-button{margin-left:-1rem}.k-login-checkbox{cursor:pointer;font-size:var(--text-sm);padding:.5rem 0}.k-login-checkbox .k-checkbox-text{opacity:.75;transition:opacity .3s}.k-login-checkbox:focus span,.k-login-checkbox:hover span{opacity:1}.k-password-reset-view .k-user-info{background:var(--color-white);border-radius:var(--rounded-xs);box-shadow:var(--shadow);height:38px;margin-bottom:2.25rem;padding:.5rem}.k-search-view .k-header{margin-bottom:var(--spacing-6)}.k-search-view-layout{display:grid;row-gap:1.5rem}.k-search-view-types nav{background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);display:flex;flex-direction:column;gap:2px;padding:var(--spacing-1)}.k-search-view-type{align-items:center;border-radius:var(--rounded-sm);display:flex;height:var(--height-sm);padding-left:var(--spacing-2);padding-right:var(--spacing-2)}.k-search-view-type[aria-current]{background:var(--color-blue-200)}.k-search-view-input{background:var(--color-gray-300);border:none;border-radius:var(--rounded);font:inherit;padding:var(--spacing-3);width:100%}@media (min-width:50rem){.k-search-view-layout{-moz-column-gap:3rem;column-gap:3rem;grid-template-areas:"types input" "types results";grid-template-columns:15rem 1fr;grid-template-rows:var(--height-lg) 1fr}.k-search-view-types{grid-area:types}.k-search-view-input{grid-area:input}}.k-system-view .k-header{margin-bottom:1.5rem}.k-system-view-section-header{display:flex;justify-content:space-between;margin-bottom:.5rem}.k-system-view-section{margin-bottom:3rem}.k-system-info .k-stat-label{color:var(--theme,var(--color-black))}:root{--color-backdrop:rgba(0,0,0,.6);--color-black:#000;--color-dark:#313740;--color-light:var(--color-gray-200);--color-white:#fff;--color-gray-100:#f7f7f7;--color-gray-200:#efefef;--color-gray-300:#ddd;--color-gray-400:#ccc;--color-gray-500:#999;--color-gray-600:#777;--color-gray-700:#555;--color-gray-800:#333;--color-gray-900:#111;--color-gray:var(--color-gray-600);--color-red-200:#edc1c1;--color-red-300:#e3a0a0;--color-red-400:#d16464;--color-red-600:#ce1f1f;--color-red:var(--color-red-600);--color-orange-200:#f2d4bf;--color-orange-300:#ebbe9e;--color-orange-400:#de935f;--color-orange-600:#f4861f;--color-orange:var(--color-orange-600);--color-yellow-200:#f9e8c7;--color-yellow-300:#f7e2b8;--color-yellow-400:#f0c674;--color-yellow-600:#cca000;--color-yellow:var(--color-yellow-600);--color-green-200:#dce5c2;--color-green-300:#c6d49d;--color-green-400:#a7bd68;--color-green-600:#678f00;--color-green:var(--color-green-600);--color-aqua-200:#d0e5e2;--color-aqua-300:#bbd9d5;--color-aqua-400:#8abeb7;--color-aqua-600:#398e93;--color-aqua:var(--color-aqua-600);--color-blue-200:#cbd7e5;--color-blue-300:#b1c2d8;--color-blue-400:#7e9abf;--color-blue-600:#4271ae;--color-blue:var(--color-blue-600);--color-purple-200:#e0d4e4;--color-purple-300:#d4c3d9;--color-purple-400:#b294bb;--color-purple-600:#9c48b9;--color-purple:var(--color-purple-600);--container:80rem;--font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--font-mono:"SFMono-Regular",Consolas,Liberation Mono,Menlo,Courier,monospace;--font-normal:400;--font-bold:600;--font-bolder:800;--height-2xs:1.375rem;--height-xs:1.5rem;--height-sm:1.75rem;--height-md:2rem;--height-lg:2.25rem;--height-xl:2.5rem;--height:var(--height-md);--leading-none:1;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--leading-loose:2;--rounded-xs:1px;--rounded-sm:.125rem;--rounded:.25rem;--rounded-md:.375rem;--shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06);--shadow-md:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);--shadow-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05);--shadow-xl:0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04);--shadow-outline:currentColor 0 0 0 2px;--shadow-inset:inset 0 2px 4px 0 rgba(0,0,0,.06);--spacing-0:0;--spacing-px:1px;--spacing-2px:2px;--spacing-1:.25rem;--spacing-2:.5rem;--spacing-3:.75rem;--spacing-4:1rem;--spacing-5:1.25rem;--spacing-6:1.5rem;--spacing-8:2rem;--spacing-10:2.5rem;--spacing-12:3rem;--spacing-16:4rem;--spacing-20:5rem;--spacing-24:6rem;--spacing-36:9rem;--text-xs:.75rem;--text-sm:.875rem;--text-base:1rem;--text-lg:1.125rem;--text-xl:1.25rem;--text-2xl:1.5rem;--text-3xl:1.75rem;--text-4xl:2.5rem;--text-5xl:3rem;--text-6xl:4rem;--color-background:var(--color-light);--color-border:var(--color-gray-400);--color-focus:var(--color-blue-600);--color-focus-light:var(--color-blue-400);--color-focus-outline:rgba(113,143,183,.25);--color-negative:var(--color-red-600);--color-negative-light:var(--color-red-400);--color-negative-outline:hsla(0,54%,63%,.25);--color-notice:var(--color-orange-600);--color-notice-light:var(--color-orange-400);--color-positive:var(--color-green-600);--color-positive-light:var(--color-green-400);--color-positive-outline:rgba(128,149,65,.25);--color-text:var(--color-gray-900);--color-text-light:var(--color-gray-600);--z-offline:1200;--z-fatal:1100;--z-loader:1000;--z-notification:900;--z-dialog:800;--z-navigation:700;--z-dropdown:600;--z-drawer:500;--z-dropzone:400;--z-toolbar:300;--z-content:200;--z-background:100;--bg-pattern:repeating-conic-gradient(transparent 0% 25%,rgba(0,0,0,.1) 0% 50%) 50% /20px 20px;--shadow-sticky:rgba(0,0,0,.05) 0 2px 5px;--shadow-dropdown:var(--shadow-lg);--shadow-item:var(--shadow);--field-input-padding:.5rem;--field-input-height:2.25rem;--field-input-line-height:1.25rem;--field-input-font-size:var(--text-base);--field-input-color-before:var(--color-gray-700);--field-input-color-after:var(--color-gray-700);--field-input-border:1px solid var(--color-border);--field-input-focus-border:1px solid var(--color-focus);--field-input-focus-outline:2px solid var(--color-focus-outline);--field-input-invalid-border:1px solid var(--color-negative-outline);--field-input-invalid-outline:0;--field-input-invalid-focus-border:1px solid var(--color-negative);--field-input-invalid-focus-outline:2px solid var(--color-negative-outline);--field-input-background:var(--color-white);--field-input-disabled-color:var(--color-gray-500);--field-input-disabled-background:var(--color-white);--field-input-disabled-border:1px solid var(--color-gray-300);--font-family-sans:var(--font-sans);--font-family-mono:var(--font-mono);--font-size-tiny:var(--text-xs);--font-size-small:var(--text-sm);--font-size-medium:var(--text-base);--font-size-large:var(--text-xl);--font-size-huge:var(--text-2xl);--font-size-monster:var(--text-3xl);--box-shadow-dropdown:var(--shadow-dropdown);--box-shadow-item:var(--shadow);--box-shadow-focus:var(--shadow-xl)}*,:after,:before{box-sizing:border-box;margin:0;padding:0}noscript{align-items:center;display:flex;height:100vh;justify-content:center;padding:1.5rem;text-align:center}html{background:var(--color-background);font-family:var(--font-sans)}body,html{color:var(--color-gray-900);height:100%;overflow:hidden}a{color:inherit;text-decoration:none}li{list-style:none}b,strong{font-weight:var(--font-bold)}@keyframes LoadingCursor{to{cursor:progress}}@keyframes Spin{to{transform:rotate(1turn)}}[data-align=left]{--align:start}[data-align=center]{--align:center}[data-align=right]{--align:end}[data-invalid=true]{border:1px solid var(--color-negative-outline);box-shadow:var(--color-negative-outline) 0 0 3px 2px}[data-invalid=true]:focus-within{border:var(--field-input-invalid-focus-border)!important;box-shadow:var(--color-negative-outline) 0 0 0 2px!important}[data-tabbed=true]{border-radius:var(--rounded);box-shadow:var(--shadow-outline)}[data-theme=positive],[data-theme=success]{--theme:var(--color-positive);--theme-light:var(--color-positive-light);--theme-bg:var(--color-green-300)}[data-theme=error],[data-theme=negative]{--theme:var(--color-negative);--theme-light:var(--color-negative-light);--theme-bg:var(--color-red-300)}[data-theme=notice]{--theme:var(--color-notice);--theme-light:var(--color-notice-light);--theme-bg:var(--color-orange-300)}[data-theme=info]{--theme:var(--color-focus);--theme-light:var(--color-focus-light);--theme-bg:var(--color-blue-200)}.scroll-x,.scroll-x-auto,.scroll-y,.scroll-y-auto{-webkit-overflow-scrolling:touch;transform:translateZ(0)}.scroll-x{overflow-x:scroll;overflow-y:hidden}.scroll-x-auto{overflow-x:auto;overflow-y:hidden}.scroll-y{overflow-x:hidden;overflow-y:scroll}.scroll-y-auto{overflow-x:hidden;overflow-y:auto}.input-hidden{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:0;opacity:0;position:absolute;width:0}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px} +.k-dialog-body{padding:var(--dialog-padding)}.k-button-group.k-dialog-buttons{display:flex;justify-content:space-between;margin:0}.k-button-group.k-dialog-buttons .k-button{line-height:1.25rem;padding:.75rem 1rem}.k-button-group.k-dialog-buttons .k-button.k-dialog-button-cancel{padding-left:1.5rem;text-align:left}.k-button-group.k-dialog-buttons .k-button.k-dialog-button-submit{padding-right:1.5rem;text-align:right}.k-dialog-fields{padding-bottom:.5rem}.k-dialog-footer{border-top:1px solid var(--color-gray-300);flex-shrink:0;line-height:1;padding:0}.k-notification.k-dialog-notification{border-top-left-radius:var(--rounded);border-top-right-radius:var(--rounded);margin-top:-1px}.k-dialog-search{margin-bottom:.75rem}.k-dialog-search.k-input{background:rgba(0,0,0,.075);border-radius:var(--rounded);height:36px;padding:0 1rem}:root{--dialog-color-back:var(--color-light);--dialog-color-text:currentColor;--dialog-rounded:var(--rounded-md);--dialog-padding:var(--spacing-6);--dialog-shadow:var(--shadow-xl);--dialog-width:22rem}.k-dialog{background:var(--dialog-color-back);border-radius:var(--dialog-rounded);box-shadow:var(--dialog-shadow);color:var(--dialog-color-text);display:flex;flex-direction:column;line-height:1;margin:1.5rem;max-height:calc(100vh - 3rem);position:relative;width:clamp(10rem,100%,var(--dialog-width))}@media screen and (min-width:20rem){.k-dialog[data-size=small]{--dialog-width:20rem}}@media screen and (min-width:22rem){.k-dialog[data-size=default]{--dialog-width:22rem}}@media screen and (min-width:30rem){.k-dialog[data-size=medium]{--dialog-width:30rem}}@media screen and (min-width:40rem){.k-dialog[data-size=large]{--dialog-width:40rem}}.k-dialog .k-pagination{align-items:center;display:flex;justify-content:center;margin-bottom:-1.5rem}.k-error-details{background:var(--color-white);display:block;font-size:var(--text-sm);line-height:1.25em;margin-top:.75rem;overflow:auto;padding:1rem}.k-error-details dt{color:var(--color-negative-light);margin-bottom:.25rem}.k-error-details dd{overflow:hidden;overflow-wrap:break-word;text-overflow:ellipsis}.k-error-details dd:not(:last-of-type){margin-bottom:1.5em}.k-error-details li{white-space:pre-line}.k-error-details li:not(:last-child){border-bottom:1px solid var(--color-background);margin-bottom:.25rem;padding-bottom:.25rem}.k-files-dialog .k-list-item{cursor:pointer}.k-page-template-switch{border-bottom:1px dashed var(--color-gray-300);margin-bottom:var(--spacing-6);padding-bottom:var(--spacing-6)}.k-page-template-switch nav{display:grid;gap:2px;grid-template-columns:1fr 1fr}.k-page-template-switch .k-headline{line-height:1.25;margin-bottom:.75rem}.k-page-template-switch button{background:var(--color-white);border-radius:var(--rounded-sm);box-shadow:var(--shadow);font-size:var(--text-sm);padding:.625rem .75rem;text-align:left}.k-page-template-switch button[aria-current]{background:var(--color-light)}.k-page-move-dialog .k-headline{margin-bottom:var(--spacing-2)}.k-page-move-parent{--tree-color-back:var(--color-white);--tree-color-hover-back:var(--color-light);background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);padding:var(--spacing-3)}.k-pages-dialog-navbar{align-items:center;display:flex;justify-content:center;margin-bottom:.5rem;padding-right:38px}.k-pages-dialog-navbar .k-button{width:38px}.k-pages-dialog-navbar .k-button[disabled]{opacity:0}.k-pages-dialog-navbar .k-headline{flex-grow:1;text-align:center}.k-pages-dialog .k-list-item{cursor:pointer}.k-pages-dialog .k-list-item .k-button[data-theme=disabled],.k-pages-dialog .k-list-item .k-button[disabled]{opacity:.25}.k-pages-dialog .k-list-item .k-button[data-theme=disabled]:hover{opacity:1}.k-search-dialog{margin:2.5rem auto}.k-search-dialog-input{display:flex}.k-search-dialog-types{display:flex;flex-shrink:0}.k-search-dialog-types>.k-button{font-size:var(--text-base);height:2.5rem;line-height:1;padding-left:1rem}.k-search-dialog-types>.k-button .k-icon{height:2.5rem}.k-search-dialog-types>.k-button .k-button-text{font-weight:500;opacity:1}.k-search-dialog-input input{background:none;border:0;flex-grow:1;font:inherit;height:2.5rem;padding:.75rem}.k-search-dialog-input input:focus{outline:0}.k-search-dialog-close{line-height:1;width:3rem}.k-search-dialog-close .k-icon-loader{animation:Spin 2s linear infinite}.k-search-dialog-results{padding:.5rem 1rem 1rem}.k-search-dialog-results .k-item:not(:last-child){margin-bottom:.25rem}.k-search-dialog-results .k-item[data-selected=true]{outline:2px solid var(--color-focus)}.k-search-dialog-results .k-item-info{font-size:var(--text-xs)}.k-search-dialog-footer{text-align:center}.k-search-dialog-footer p{color:var(--color-gray-600);font-size:var(--text-xs)}.k-search-dialog-footer .k-button{margin-top:var(--spacing-3)}.k-upload-dialog.k-dialog{--dialog-width:40rem}.k-upload-items{display:grid;gap:.25rem}.k-upload-item{accent-color:var(--color-focus);background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);display:grid;grid-template-areas:"preview input input" "preview body toggle" "preview progress toggle";grid-template-columns:6rem 1fr auto;grid-template-rows:1fr 1fr 1fr;height:6rem}.k-upload-item-preview{border-bottom-left-radius:var(--rounded);border-top-left-radius:var(--rounded);display:block;grid-area:preview;height:100%;overflow:hidden;width:100%}.k-upload-item-preview:focus{border-radius:var(--rounded);outline:2px solid var(--color-focus);z-index:1}.k-upload-item-preview .k-aspect-ratio>*{border-right:1px solid var(--color-light);color:var(--color-gray-500);display:grid;place-items:center}.k-upload-item-body{grid-area:body;padding:var(--spacing-2) var(--spacing-3) 0}.k-upload-item-input.k-input{border-bottom:1px solid var(--color-light);font-size:var(--text-sm);grid-area:input;padding:var(--spacing-2) var(--spacing-3)}.k-upload-item-input.k-input:focus-within{border-radius:var(--rounded);outline:2px solid var(--color-focus);z-index:1}.k-upload-item-input .k-input-after,.k-upload-item-meta{color:var(--color-gray-600)}.k-upload-item-error,.k-upload-item-meta{font-size:var(--text-xs)}.k-upload-item-error{color:var(--color-red-400);margin-top:.25rem}.k-upload-item-progress{--progress-height:.25rem;--progress-color-back:var(--color-light);align-self:end;grid-area:progress;height:1.375rem;padding-left:var(--spacing-3);padding-right:var(--spacing-3)}.k-upload-item-toggle{align-self:end;grid-area:toggle}.k-upload-item-toggle>*{padding:var(--spacing-3)}.k-upload-item[data-completed] .k-upload-item-progress{--progress-color-value:var(--color-green-400)}.k-upload-replace-dialog .k-upload-items{align-items:center;display:flex;gap:var(--spacing-3)}.k-upload-original{border-radius:var(--rounded);box-shadow:var(--shadow);overflow:hidden;width:6rem}.k-upload-replace-dialog .k-upload-item{flex-grow:1}.k-users-dialog .k-list-item{cursor:pointer}.k-drawer-body{background:var(--color-background);flex-grow:1;padding:1.5rem}.k-drawer-body .k-table th,.k-drawer-body .k-textarea-input:focus-within .k-toolbar{top:-1.5rem}.k-drawer-header{align-items:center;background:var(--color-white);display:flex;flex-shrink:0;font-size:var(--text-sm);height:var(--drawer-header-height);justify-content:space-between;line-height:1;padding-left:var(--drawer-header-padding)}.k-drawer-title{padding:0 .75rem}.k-drawer-breadcrumb,.k-drawer-title{align-items:center;display:flex;flex-grow:1;font-size:var(--text-sm);font-weight:var(--font-normal);margin-left:-.75rem;min-width:0}.k-drawer-breadcrumb li:not(:last-child) .k-button:after{align-items:center;color:var(--color-gray-500);content:"›";display:inline-flex;height:var(--drawer-header-height);justify-content:center;position:absolute;right:-.75rem;width:1.5rem}.k-drawer-breadcrumb .k-icon,.k-drawer-title .k-icon{color:var(--color-gray-500);margin-right:.5rem;width:1rem}.k-drawer-breadcrumb .k-button{align-items:center;display:inline-flex;height:var(--drawer-header-height);padding-left:.75rem;padding-right:.75rem}.k-drawer-breadcrumb .k-button-text{opacity:1}.k-drawer-breadcrumb .k-button .k-button-icon~.k-button-text{padding-left:0}.k-drawer-option.k-button,.k-drawer-options{align-items:center;display:flex;padding-right:.75rem}.k-drawer-option.k-button{height:var(--drawer-header-height);justify-content:center;line-height:1;min-width:var(--drawer-header-height);padding-left:.75rem}.k-notification.k-drawer-notification{padding:.625rem 1.5rem}.k-drawer-tabs{align-items:center;display:flex;line-height:1;margin-right:.75rem}.k-drawer-tab.k-button{align-items:center;display:flex;font-size:var(--text-xs);height:var(--drawer-header-height);padding-left:.75rem;padding-right:.75rem}.k-drawer-tab.k-button[aria-current]:after{background:var(--color-black);bottom:-1px;content:"";height:2px;left:.75rem;position:absolute;right:.75rem;z-index:1}:root{--drawer-color-back:var(--color-light);--drawer-header-height:2.5rem;--drawer-header-padding:1.5rem;--drawer-shadow:var(--shadow-xl);--drawer-width:50rem}.k-drawer-overlay{--overlay-color-back:rgba(0,0,0,.2);align-items:stretch;display:flex;justify-content:flex-end}.k-drawer-overlay+.k-drawer-overlay{--overlay-color-back:none}.k-drawer{background:var(--drawer-color-back);box-shadow:var(--drawer-shadow);display:flex;flex-basis:var(--drawer-width);flex-direction:column;position:relative;z-index:var(--z-toolbar)}.k-calendar-input{--cell-padding:.25rem .5rem;border-radius:var(--rounded-xs);color:var(--color-light);padding:.5rem}.k-calendar-table{min-width:15rem;padding-top:.5rem;table-layout:fixed;width:100%}.k-calendar-input>nav{direction:ltr;display:flex}.k-calendar-input>nav .k-button{padding:.5rem}.k-calendar-selects{align-items:center;display:flex;flex-grow:1;justify-content:center}[dir=ltr] .k-calendar-selects{direction:ltr}[dir=rtl] .k-calendar-selects{direction:rtl}.k-calendar-selects .k-select-input{font-size:var(--text-sm);font-weight:var(--font-normal);padding:0 .5rem}.k-calendar-selects .k-select-input:focus-within{color:var(--color-focus-light)!important}.k-calendar-input th{color:var(--color-gray-500);font-size:var(--text-xs);font-weight:400;padding:.5rem 0;text-align:center}.k-calendar-day .k-button{border:2px solid transparent;border-radius:50%;color:var(--color-white);display:flex;height:2rem;justify-content:center;line-height:1.75rem;margin-left:auto;margin-right:auto;width:2rem}.k-calendar-day .k-button .k-button-text{opacity:1}.k-calendar-table .k-button:hover{color:var(--color-white)}.k-calendar-day:hover .k-button:not([data-disabled=true]){border-color:#ffffff40}.k-calendar-day[aria-current=date] .k-button{text-decoration:underline}.k-calendar-day[aria-selected=date] .k-button{border-color:currentColor;color:var(--color-focus-light);font-weight:600}.k-calendar-today{padding-top:.5rem;text-align:center}.k-calendar-today .k-button{font-size:var(--text-xs);padding:1rem;text-decoration:underline}.k-calendar-today .k-button-text{opacity:1;vertical-align:baseline}.k-counter{color:var(--color-gray-900);font-size:var(--text-xs);font-weight:var(--font-bold)}.k-counter[data-invalid=true]{border:0;box-shadow:none;color:var(--color-negative)}.k-counter-rules{color:var(--color-gray-600);font-weight:var(--font-normal);padding-left:.5rem}.k-form-submitter{display:none}.k-form-buttons[data-theme]{background:var(--theme-light)}.k-form-buttons .k-view{align-items:center;display:flex;justify-content:space-between}.k-form-button.k-button{align-items:center;display:flex;font-weight:500;height:2.5rem;line-height:1;padding:0 1rem;white-space:nowrap}.k-form-button:first-child{margin-left:-1rem}.k-form-button:last-child{margin-right:-1rem}.k-form-lock-info{align-items:center;display:flex;font-size:var(--text-sm);line-height:1.5em;margin-right:3rem;padding:.625rem 0}.k-form-lock-info>.k-icon{margin-right:.5rem}.k-form-lock-buttons{display:flex;flex-shrink:0}.k-form-lock-loader{animation:Spin 4s linear infinite}.k-form-lock-loader .k-icon-loader{display:flex}.k-form-indicator-toggle{color:var(--color-notice-light)}.k-form-indicator-info{font-size:var(--text-sm);font-weight:var(--font-bold);line-height:1.25em;padding:.75rem 1rem .25rem;width:15rem}.k-field-label{display:block;flex-grow:1;font-weight:var(--font-bold);line-height:1.25rem;padding:0 0 .75rem}.k-field-label abbr{color:var(--color-gray-500);padding-left:.25rem;text-decoration:none}.k-field-header{align-items:baseline;display:flex;position:relative}.k-field-options{position:absolute;right:0;top:calc(-.5rem - 1px)}.k-field-options.k-button-group .k-dropdown{height:auto}.k-field-options.k-button-group .k-field-options-button.k-button{display:flex;padding:.75rem}.k-field[data-disabled=true]{cursor:not-allowed}.k-field[data-disabled=true] *{pointer-events:none}.k-field[data-disabled=true] .k-text[data-theme=help] *{pointer-events:auto}.k-field:focus-within>.k-field-header>.k-field-counter{display:block}.k-field-help{padding-top:.5rem}.k-field-add-item-button{align-items:center;color:var(--color-gray-500);display:flex;justify-content:center;padding:.75rem 0;width:100%}.k-field-add-item-button:hover{color:var(--color-black)}.k-fieldset{border:0}.k-fieldset .k-grid{grid-row-gap:2.25rem}@media screen and (min-width:30em){.k-fieldset .k-grid{grid-column-gap:1.5rem}}.k-sections>.k-column[data-width="1/3"] .k-fieldset .k-grid,.k-sections>.k-column[data-width="1/4"] .k-fieldset .k-grid{grid-template-columns:repeat(1,1fr)}.k-sections>.k-column[data-width="1/3"] .k-fieldset .k-grid .k-column,.k-sections>.k-column[data-width="1/4"] .k-fieldset .k-grid .k-column{grid-column-start:auto}.k-input{align-items:center;background:none;border:0;display:flex;line-height:1;outline:0}.k-input-element{flex-grow:1}.k-input-icon{align-items:center;display:flex;justify-content:center;line-height:0}.k-input[data-disabled=true]{pointer-events:none}[data-disabled=true] .k-input-icon{color:var(--color-gray-600)}.k-input[data-theme=field]{background:var(--field-input-background);border:var(--field-input-border);border-radius:var(--rounded);line-height:1}.k-input[data-theme=field]:focus-within{border:var(--field-input-focus-border);box-shadow:var(--color-focus-outline) 0 0 0 2px}.k-input[data-theme=field][data-disabled=true]{background:var(--color-background)}.k-input[data-theme=field] .k-input-icon{width:var(--field-input-height)}.k-input[data-theme=field] .k-input-after,.k-input[data-theme=field] .k-input-before,.k-input[data-theme=field] .k-input-icon{align-items:center;align-self:stretch;display:flex;flex-shrink:0}.k-input[data-theme=field] .k-input-after,.k-input[data-theme=field] .k-input-before{padding:0 var(--field-input-padding)}.k-input[data-theme=field] .k-input-before{color:var(--field-input-color-before);padding-right:0}.k-input[data-theme=field] .k-input-after{color:var(--field-input-color-after);padding-left:0}.k-input[data-theme=field] .k-input-icon>.k-dropdown{height:100%;width:100%}.k-input[data-theme=field] .k-input-icon-button{align-items:center;display:flex;flex-shrink:0;height:100%;justify-content:center;width:100%}.k-input[data-theme=field] .k-number-input,.k-input[data-theme=field] .k-select-input,.k-input[data-theme=field] .k-text-input{border-radius:var(--rounded);line-height:var(--field-input-line-height);padding:var(--field-input-padding)}.k-input[data-theme=field] .k-date-input .k-select-input,.k-input[data-theme=field] .k-time-input .k-select-input{padding-left:0;padding-right:0}.k-input[data-theme=field] .k-date-input .k-select-input:first-child,.k-input[data-theme=field] .k-time-input .k-select-input:first-child{padding-left:var(--field-input-padding)}.k-input[data-theme=field] .k-date-input .k-select-input:focus-within,.k-input[data-theme=field] .k-time-input .k-select-input:focus-within{color:var(--color-focus);font-weight:var(--font-bold)}.k-input[data-theme=field].k-time-input .k-time-input-meridiem{padding-left:var(--field-input-padding)}.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input li,.k-input[data-theme=field][data-type=checkboxes] .k-radio-input li,.k-input[data-theme=field][data-type=radio] .k-checkboxes-input li,.k-input[data-theme=field][data-type=radio] .k-radio-input li{min-width:0;overflow-wrap:break-word}.k-input[data-theme=field][data-type=checkboxes] .k-input-before{border-right:1px solid var(--color-background)}.k-input[data-theme=field][data-type=checkboxes] .k-input-element+.k-input-after,.k-input[data-theme=field][data-type=checkboxes] .k-input-element+.k-input-icon{border-left:1px solid var(--color-background)}.k-input[data-theme=field][data-type=checkboxes] .k-input-element{overflow:hidden}.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input{display:grid;grid-template-columns:1fr;margin-bottom:-1px;margin-right:-1px}@media screen and (min-width:65em){.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input{grid-template-columns:repeat(var(--columns),1fr)}}.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input li{border-bottom:1px solid var(--color-background);border-right:1px solid var(--color-background)}.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input label{display:block;line-height:var(--field-input-line-height);padding:var(--field-input-padding) var(--field-input-padding)}.k-input[data-theme=field][data-type=checkboxes] .k-checkbox-input-icon{left:var(--field-input-padding);margin-top:0;top:calc((var(--field-input-height) - var(--field-input-font-size))/2)}.k-input[data-theme=field][data-type=radio] .k-input-before{border-right:1px solid var(--color-background)}.k-input[data-theme=field][data-type=radio] .k-input-element+.k-input-after,.k-input[data-theme=field][data-type=radio] .k-input-element+.k-input-icon{border-left:1px solid var(--color-background)}.k-input[data-theme=field][data-type=radio] .k-input-element{overflow:hidden}.k-input[data-theme=field][data-type=radio] .k-radio-input{display:grid;grid-template-columns:1fr;margin-bottom:-1px;margin-right:-1px}@media screen and (min-width:65em){.k-input[data-theme=field][data-type=radio] .k-radio-input{grid-template-columns:repeat(var(--columns),1fr)}}.k-input[data-theme=field][data-type=radio] .k-radio-input li{border-bottom:1px solid var(--color-background);border-right:1px solid var(--color-background)}.k-input[data-theme=field][data-type=radio] .k-radio-input label{display:block;flex-grow:1;line-height:var(--field-input-line-height);min-height:var(--field-input-height);padding:calc((var(--field-input-height) - var(--field-input-line-height))/2) var(--field-input-padding)}.k-input[data-theme=field][data-type=radio] .k-radio-input label:before{left:var(--field-input-padding);margin-top:-1px;top:calc((var(--field-input-height) - 1rem)/2)}.k-input[data-theme=field][data-type=radio] .k-radio-input .k-radio-input-info{color:var(--color-gray-600);display:block;font-size:var(--text-sm);line-height:var(--field-input-line-height);padding-top:calc(var(--field-input-line-height)/10)}.k-input[data-theme=field][data-type=radio] .k-radio-input .k-icon{align-items:center;display:flex;height:var(--field-input-height);justify-content:center;width:var(--field-input-height)}.k-input[data-theme=field][data-type=range] .k-range-input{padding:var(--field-input-padding)}.k-input[data-theme=field][data-type=select]{position:relative}.k-input[data-theme=field][data-type=select] .k-input-icon{bottom:0;position:absolute;right:0;top:0}.k-input[data-theme=field][data-type=tags] .k-tags-input{padding:.25rem .25rem 0}.k-input[data-theme=field][data-type=tags] .k-tag{font-size:var(--text-sm);height:auto;margin-bottom:.25rem;margin-right:.25rem;min-height:1.75rem}.k-input[data-theme=field][data-type=tags] .k-tags-input input{font-size:var(--text-sm);height:1.75rem;line-height:1;margin-bottom:.25rem;padding:0 .25rem}.k-input[data-theme=field][data-type=tags] .k-tags-input .k-dropdown-content{top:calc(100% + .5rem + 2px)}.k-input[data-theme=field][data-type=tags] .k-tags-input .k-dropdown-content[data-dropup]{bottom:auto;margin-bottom:0;top:calc(100% + .5rem + 2px)}.k-input[data-theme=field][data-type=multiselect]{position:relative}.k-input[data-theme=field][data-type=multiselect] .k-multiselect-input{min-height:2.25rem;padding:.25rem 2rem 0 .25rem}.k-input[data-theme=field][data-type=multiselect] .k-tag{font-size:var(--text-sm);height:1.75rem;margin-bottom:.25rem;margin-right:.25rem}.k-input[data-theme=field][data-type=multiselect] .k-input-icon{bottom:0;pointer-events:none;position:absolute;right:0;top:0}.k-input[data-theme=field][data-type=textarea] .k-textarea-input-native{line-height:1.5rem;padding:.25rem var(--field-input-padding)}.k-input[data-theme=field][data-type=toggle] .k-input-before{padding-right:calc(var(--field-input-padding)/2)}.k-input[data-theme=field][data-type=toggle] .k-toggle-input{padding-left:var(--field-input-padding)}.k-input[data-theme=field][data-type=toggle] .k-toggle-input-label{line-height:var(--field-input-height);padding:0 var(--field-input-padding) 0 .75rem}.k-login-code-form .k-user-info{background:var(--color-white);border-radius:var(--rounded-xs);box-shadow:var(--shadow);height:38px;margin-bottom:2.25rem;padding:.5rem}.k-times{grid-gap:var(--spacing-6);display:grid;grid-template-columns:1fr 1fr;line-height:1;padding:var(--spacing-4) var(--spacing-6)}.k-times .k-icon{margin-bottom:var(--spacing-2);width:1rem}.k-times-slot .k-button{font-variant-numeric:tabular-nums;padding:var(--spacing-1) var(--spacing-3) var(--spacing-1) 0;white-space:nowrap}.k-times .k-times-slot hr{background:var(--color-dark);border:0;height:1px;margin:var(--spacing-2) 0;opacity:1;position:relative;top:1px}.k-login-alert{align-items:center;background:var(--color-negative);border-radius:var(--rounded-xs);box-shadow:var(--shadow-lg);color:var(--color-white);cursor:pointer;display:flex;font-size:var(--text-sm);justify-content:space-between;margin-bottom:2rem;min-height:38px;padding:.5rem .75rem}.k-structure-backdrop{bottom:0;height:100vh;left:0;position:absolute;right:0;top:0;z-index:2}.k-structure-form section{background:var(--color-background);border:1px solid var(--color-border);border-radius:var(--rounded-xs);box-shadow:0 0 0 3px #1212120d;margin-bottom:1px;position:relative;z-index:3}.k-structure-form-fields{padding:1.5rem 1.5rem 2rem}.k-structure-form-buttons{border-top:1px solid var(--color-border);display:flex;justify-content:space-between}.k-structure-form-buttons .k-pagination{display:none}@media screen and (min-width:65em){.k-structure-form-buttons .k-pagination{display:flex}}.k-structure-form-buttons .k-pagination>.k-button,.k-structure-form-buttons .k-pagination>span{padding:.875rem 1rem!important}.k-structure-form-cancel-button,.k-structure-form-submit-button{display:flex;line-height:1rem;padding:.875rem 1.5rem}:root{--toolbar-size:38px;--toolbar-text:#aaa;--toolbar-back:var(--color-white);--toolbar-hover:hsla(0,0%,94%,.5);--toolbar-border:var(--color-background)}.k-toolbar{background:var(--toolbar-back);border-bottom:1px solid var(--toolbar-border);border-top-left-radius:var(--rounded);border-top-right-radius:var(--rounded);color:var(--toolbar-text);display:flex;height:var(--toolbar-size);margin-bottom:var(--spacing-1);max-width:100%}.k-toolbar-divider{border-left:1px solid var(--toolbar-border);width:1px}.k-toolbar-button.k-button{align-items:center;display:flex;height:var(--toolbar-size);justify-content:center;line-height:1;width:var(--toolbar-size)}.k-toolbar-button:hover{background:var(--toolbar-hover)}.js-has-pseudo [csstools-has-1a-2z-19-38-33-33-30-2q-2p-36-1m-32-33-38-14-2j-2s-2p-38-2p-19-2x-32-30-2x-32-2t-1p-y-38-36-39-2t-y-2l-15-1m-2w-2p-37-14-3i-w-1m-2u-33-2r-39-37-19-3b-2x-38-2w-2x-32-15]:not(.does-not-exist):not(.does-not-exist){--toolbar-text:var(--color-black);--toolbar-border:rgba(0,0,0,.1);box-shadow:0 2px 5px #0000000d;left:0;position:sticky;right:0;top:0;z-index:1}.k-toolbar:not([data-inline=true]):has(~:focus-within){--toolbar-text:var(--color-black);--toolbar-border:rgba(0,0,0,.1);box-shadow:0 2px 5px #0000000d;left:0;position:sticky;right:0;top:0;z-index:1}.k-code.k-block-type-code-editor{--code-font-size:var(--text-sm);line-height:1.5em;padding:.5rem .75rem 3rem}.k-block-type-code-editor .k-editor{line-height:1.75em;white-space:pre-wrap}.k-block-type-code-editor-language{bottom:0;font-size:var(--text-sm);position:absolute;right:0}.k-block-type-code-editor-language .k-icon{display:flex;height:1.5rem;left:0;position:absolute;top:0;width:2rem;z-index:0}.k-block-type-code-editor-language .k-select-input{font-size:var(--text-xs);padding:.325rem .75rem .5rem 2rem;position:relative;z-index:1}.k-block-type-default .k-block-title{line-height:1.5em}.js-has-pseudo [csstools-has-1a-2z-19-2q-30-33-2r-2z-19-2r-33-32-38-2p-2x-32-2t-36-1m-2w-2p-37-14-1a-2z-19-2q-30-33-2r-2z-19-38-3d-34-2t-19-2u-2x-2t-30-2s-37-15]:not(.does-not-exist){padding-top:0}.k-block-container:has(.k-block-type-fields){padding-top:0}.k-block-type-fields-header{background:var(--color-white);border-top-left-radius:var(--rounded);border-top-right-radius:var(--rounded);display:flex;height:2.5rem;justify-content:space-between;padding-left:var(--spacing-3);padding-right:var(--spacing-3)}.k-block-type-fields-header .k-button{height:2.5rem}.k-block-type-fields-form{background-color:#eeeff2;border-radius:var(--rounded);padding:var(--spacing-6) var(--spacing-6) var(--spacing-8)}.k-block-container[data-hidden=true]{padding-bottom:0}.k-block-container[data-hidden=true] :where(.k-drawer-tabs,.k-block-type-fields-form){display:none}.k-block-type-gallery ul{grid-gap:.75rem;align-items:center;cursor:pointer;display:grid;grid-template-columns:repeat(auto-fit,minmax(6rem,1fr));justify-content:center;line-height:0}.k-block-type-gallery-placeholder{background:var(--color-background)}.k-block-type-gallery figcaption{color:var(--color-gray-600);font-size:var(--text-sm);padding-top:.5rem;text-align:center}.k-block-type-heading-input{align-items:center;display:flex;font-size:var(--text-size);font-weight:var(--font-bold);line-height:1.25em}.k-block-type-heading-input[data-level=h1]{--text-size:var(--text-3xl);line-height:1.125em}.k-block-type-heading-input[data-level=h2]{--text-size:var(--text-2xl)}.k-block-type-heading-input[data-level=h3]{--text-size:var(--text-xl)}.k-block-type-heading-input[data-level=h4]{--text-size:var(--text-lg)}.k-block-type-heading-input[data-level=h5]{--text-size:var(--text-base);line-height:1.5em}.k-block-type-heading-input[data-level=h6]{--text-size:var(--text-sm);line-height:1.5em}.k-block-type-heading-input .k-writer .ProseMirror strong{font-weight:700}.k-block-type-heading-level{color:var(--color-gray-500);font-size:var(--text-sm);font-weight:var(--font-bold);text-transform:uppercase}.k-block-type-image .k-block-figure-container{display:block;line-height:0;text-align:center}.k-block-type-image-auto{max-height:30rem;max-width:100%}.k-block-type-line hr{border:0;border-top:2px solid var(--color-gray-400);margin-bottom:.75rem;margin-top:.75rem}.k-block-type-markdown-input{background:var(--color-background);border-radius:var(--rounded);font-family:var(--font-mono);font-size:var(--text-sm);line-height:1.5em;padding:.5rem .5rem 0;position:relative}.k-block-type-quote-editor{border-left:2px solid var(--color-black);padding-left:1rem}.k-block-type-quote-text{font-size:var(--text-xl);line-height:1.25em;margin-bottom:.25rem}.k-block-type-quote-citation{color:var(--color-gray-600);font-size:var(--text-sm);font-style:italic}.k-block-type-table-preview{border:1px solid var(--color-gray-300);border-radius:var(--rounded-sm);border-spacing:0;cursor:pointer;overflow:hidden}.k-block-type-table-preview td,.k-block-type-table-preview th{font-size:var(--text-sm);line-height:1.5em;text-align:left}.k-block-type-table-preview th{padding:.5rem .75rem}.k-block-type-table-preview td:not(.k-table-index-column){padding:0 .75rem}.k-block-type-table-preview td [class$=-field-preview],.k-block-type-table-preview td>*{padding:0}.k-block-type-text-input{font-size:var(--text-base);height:100%;line-height:1.5em}.k-block-container{background:var(--color-white);border-radius:var(--rounded);padding:.75rem;position:relative}.k-block-container:not(:last-of-type){border-bottom:1px dashed rgba(0,0,0,.1)}.k-block-container:focus{outline:0}.k-block-container[data-selected=true]{border-bottom-color:transparent;box-shadow:var(--color-focus) 0 0 0 1px,var(--color-focus-outline) 0 0 0 3px;z-index:2}.k-block-container[data-batched=true]:after{background:rgba(177,194,216,.175);bottom:0;content:"";left:0;mix-blend-mode:multiply;position:absolute;right:0;top:0}.k-block-container .k-block-options{display:none;margin-top:calc(-1.75rem + 2px);position:absolute;right:.75rem;top:0}.k-block-container[data-last-selected=true]>.k-block-options{display:flex}.k-block-container[data-hidden=true] .k-block{opacity:.25}.k-drawer-options .k-drawer-option[data-disabled=true]{display:inline-grid;vertical-align:middle}[data-disabled=true] .k-block-container{background:var(--color-background)}.k-block-container:is(.k-sortable-ghost,.k-sortable-fallback) .k-block{max-height:4rem;overflow:hidden;position:relative}.k-block-container:is(.k-sortable-ghost,.k-sortable-fallback) .k-block:after{background:linear-gradient(to top,var(--color-white),transparent);bottom:0;content:"";height:2rem;position:absolute;width:100%}.k-blocks{background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow)}[data-disabled=true] .k-blocks{background:var(--color-background)}.k-blocks[data-multi-select-key=true] .k-block-container *{pointer-events:none}.k-blocks[data-empty=true]{background:none;box-shadow:none;padding:0}.k-blocks .k-sortable-ghost{box-shadow:0 5px 10px #12121240;cursor:grabbing;cursor:-webkit-grabbing;outline:2px solid var(--color-focus)}.k-blocks-list>.k-blocks-empty{align-items:center;display:flex}.k-blocks-list>.k-blocks-empty:not(:only-child){display:none}.k-block-figure{cursor:pointer}.k-block-figure iframe{background:var(--color-black);border:0;pointer-events:none}.k-block-figure figcaption{color:var(--color-gray-600);font-size:var(--text-sm);padding-top:.5rem;text-align:center}.k-block-figure-empty.k-button{align-items:center;background:var(--color-background);border-radius:var(--rounded-sm);color:var(--color-gray-600);display:flex;height:6rem;justify-content:center;width:100%}.k-block-options{align-items:center;background:var(--color-white);border-radius:var(--rounded);box-shadow:#0000001a -2px 0 5px,var(--shadow),var(--shadow-xl);color:var(--color-black);display:flex;z-index:var(--z-dropdown)}.k-block-options-button{--block-options-button-size:30px;align-items:center;border-right:1px solid var(--color-background);display:inline-flex;height:var(--block-options-button-size);justify-content:center;line-height:1;width:var(--block-options-button-size)}.k-block-options-button:first-child{border-bottom-left-radius:var(--rounded);border-top-left-radius:var(--rounded)}.k-block-options-button:last-child{border-bottom-right-radius:var(--rounded);border-top-right-radius:var(--rounded)}.k-block-options-button:last-of-type{border-right:0}.k-block-options-button[aria-current]{color:var(--color-focus)}.k-block-options-button:hover{background:var(--color-gray-100)}.k-block-options .k-dropdown-content{margin-top:.5rem}.k-block-importer.k-dialog{background:var(--color-dark);color:var(--color-white)}.k-block-importer .k-dialog-body{padding:0}.k-block-importer label{color:var(--color-gray-400);display:block;padding:var(--spacing-6) var(--spacing-6) 0}.k-block-importer label kbd{background:rgba(0,0,0,.5);border-radius:var(--rounded);font-family:var(--font-mono);letter-spacing:.1em;margin:0 .25rem;padding:.25rem}.k-block-importer label small{color:var(--color-gray-500);display:block;margin-top:.5rem}.k-block-importer textarea{background:none;border:0;color:var(--color-white);font:inherit;height:20rem;padding:var(--spacing-6);resize:none;width:100%}.k-block-importer textarea:focus{outline:0}.k-block-selector.k-dialog{background:var(--color-dark);color:var(--color-white)}.k-block-selector .k-headline{margin-bottom:1rem}.k-block-selector details:not(:last-of-type){margin-bottom:1.5rem}.k-block-selector summary{color:var(--color-gray-400);cursor:pointer;font-size:var(--text-xs)}.k-block-selector details:only-of-type summary{pointer-events:none}.k-block-selector summary:focus{outline:0}.k-block-selector summary:focus-visible{color:var(--color-green-400)}.k-block-types{grid-gap:2px;display:grid;grid-template-columns:repeat(1,1fr);margin-top:.75rem}.k-block-types .k-button{align-items:flex-start;background:rgba(0,0,0,.5);border-radius:var(--rounded);display:flex;line-height:1.5em;padding:0 .75rem 0 0;text-align:left;width:100%}.k-block-types .k-button:focus{outline:2px solid var(--color-green-300)}.k-block-types .k-button .k-button-text{padding:.5rem 0 .5rem .5rem}.k-block-types .k-button .k-icon{height:38px;width:38px}.k-clipboard-hint{color:var(--color-gray-400);font-size:var(--text-xs);padding-top:1.5rem}.k-clipboard-hint kbd{background:rgba(0,0,0,.5);border-radius:var(--rounded);font-family:var(--font-mono);letter-spacing:.1em;margin:0 .25rem;padding:.25rem}.k-clipboard-hint small{color:var(--color-gray-500);display:block;margin-top:.5rem}.k-block-title{align-items:center;display:flex;font-size:var(--text-sm);line-height:1;min-width:0;padding-right:.75rem}.k-block-icon{color:var(--color-gray-500);width:1rem}.k-block-icon,.k-block-name{margin-right:.5rem}.k-block-label{color:var(--color-gray-600);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:root{--range-thumb-color:var(--color-white);--range-thumb-height:1rem;--range-thumb-shadow:rgba(0,0,0,.1) 0 2px 4px 2px,rgba(0,0,0,.125) 0 0 0 1px;--range-track-height:var(--range-thumb-height)}input[type=range]{align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--color-gray-300);border-radius:var(--range-track-height);display:flex;height:var(--range-thumb-size);height:var(--range-track-height);padding:0}input[type=range][disabled]{--range-thumb-color:hsla(0,0%,100%,.2)}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;aspect-ratio:1/1;background:var(--range-thumb-color);border-radius:50%;box-shadow:var(--range-thumb-shadow);cursor:grab;height:var(--range-thumb-height);transform:translateY(-50%);transform:translate(0);z-index:1}input[type=range]::-webkit-slider-thumb:active{cursor:grabbing}input[type=range][disabled]::-webkit-slider-thumb{cursor:not-allowed}input[type=range]::-webkit-slider-runnable-track{border-radius:var(--range-track-height)}input[type=range]:focus::-webkit-slider-thumb{outline:var(--field-input-focus-outline)}input[type=range][data-variant=hue]{background:linear-gradient(90deg,red 0,#ff0 16.67%,#0f0 33.33%,#0ff 50%,#00f 66.67%,#f0a 83.33%,red) no-repeat}input[type=range][data-variant=alpha]{background:var(--color-white) var(--bg-pattern)}input[type=range][data-variant=alpha]::-webkit-slider-runnable-track{background:linear-gradient(90deg,transparent,currentColor) no-repeat}:root{--color-preview-rounded:var(--rounded-sm);--color-preview-size:1.5rem;--color-preview-darkness:0%}.k-color{--h:0;--s:0%;--l:0%;--a:1;--range-thumb-height:.75rem;--range-track-height:.75rem;--range-color-border:var(--color-white);display:flex;flex-direction:column;gap:var(--spacing-3);width:-moz-max-content;width:max-content}.k-color>*{border-radius:var(--rounded)}.k-color :focus{outline:var(--outline)}.k-color .k-coords{aspect-ratio:1/1;background:linear-gradient(to bottom,transparent,#000),linear-gradient(to right,#fff,hsl(var(--h),100%,50%))}.k-color input[data-variant=alpha]{color:hsl(var(--h),var(--s),var(--l))}.k-color-preview{aspect-ratio:1/1;background:#fff var(--bg-pattern);background-clip:padding-box;border-radius:var(--color-preview-rounded);color:transparent;display:inline-block;overflow:hidden;position:relative;width:var(--color-preview-size)}.k-color-preview:after{background-color:currentColor;border-radius:calc(var(--color-preview-rounded) - 1px);bottom:0;box-shadow:0 0 0 1px inset hsla(0,0%,var(--color-preview-darkness),.175);content:"";left:0;position:absolute;right:0;top:0}.k-coords{display:block;position:relative}.k-coords img{width:100%}.k-coords-thumb{aspect-ratio:1/1;background:var(--range-thumb-color);border-radius:var(--range-thumb-height);box-shadow:var(--range-thumb-shadow);cursor:move;position:absolute;transform:translate(-50%,-50%);width:var(--range-thumb-height)}.k-coords-thumb:active{cursor:grabbing}.k-coords:focus-within{outline:var(--outline)}.k-coords[aria-disabled]{opacity:var(--opacity-disabled);pointer-events:none}.k-coords[aria-disabled] .k-coords-thumb{display:none}.k-blocks-field{position:relative}.k-text-input.k-color-input{font-family:var(--font-mono);font-size:var(--text-sm)}.k-color-field .k-input .k-input-before{padding:var(--spacing-1)}.k-color-field .k-color-field-preview{--color-preview-size:calc(var(--field-input-height) - var(--spacing-2))}.k-color-field-picker{display:flex;flex-direction:column;gap:var(--spacing-3);padding:var(--spacing-2)}.k-color-field .k-color{width:12rem}.k-color-field-options{--color-preview-size:var(--field-input-height);display:grid;gap:var(--spacing-2);grid-template-columns:repeat(auto-fill,var(--color-preview-size))}.k-color-field-picker .k-color-field-options{--color-preview-size:100%;--color-preview-darkness:100%;grid-template-columns:repeat(6,1fr)}.k-color-field .k-color-preview[aria-current]{border:2px solid var(--color-focus);outline:var(--field-input-focus-outline)}.k-color-field .k-input-after{font-size:var(--text-xs)}.k-date-field-body{background:var(--color-gray-300);border:var(--field-input-border);border-radius:var(--rounded);display:flex;flex-wrap:wrap;gap:1px;line-height:1}.k-date-field-body:focus-within{border:var(--field-input-focus-border);box-shadow:var(--color-focus-outline) 0 0 0 2px}.k-date-field[data-disabled] .k-date-field-body{background:none}.k-date-field-body>.k-input[data-theme=field]{border:0;border-radius:var(--rounded);box-shadow:none}.k-date-field-body>.k-input[data-invalid=true],.k-date-field-body>.k-input[data-invalid=true]:focus-within{border:0!important;box-shadow:none!important}.k-date-field-body{--multiplier:calc(25rem - 100%)}.k-date-field-body>*{flex-basis:calc(var(--multiplier)*999);flex-grow:1;max-width:100%}.k-date-field-body .k-input[data-type=date]{min-width:60%}.k-date-field-body .k-input[data-type=time]{min-width:30%}.k-text-input{background:none;border:0;color:inherit;font:inherit;font-variant-numeric:tabular-nums;width:100%}.k-text-input::-moz-placeholder{color:var(--color-gray-500)}.k-text-input::placeholder{color:var(--color-gray-500)}.k-text-input:focus{outline:0}.k-text-input:invalid{box-shadow:none;outline:0}.k-files-field[data-disabled=true] .k-item *{pointer-events:all!important}body{counter-reset:headline-counter}.k-headline-field{padding-top:1.5rem;position:relative}.k-fieldset>.k-grid .k-column:first-child .k-headline-field{padding-top:0}.k-headline-field .k-headline[data-numbered]:before{color:var(--color-focus);content:counter(headline-counter,decimal-leading-zero);counter-increment:headline-counter;font-weight:400;padding-right:.25rem}.k-info-field .k-headline{line-height:1.25rem;padding-bottom:.75rem}.k-line-field{border:0;height:3rem;position:relative;width:auto}.k-line-field:after{background:var(--color-border);content:"";height:1px;left:0;margin-top:-1px;position:absolute;right:0;top:50%}.k-link-input-header{align-items:center;display:grid;gap:.25rem;grid-area:header;grid-template-columns:max-content minmax(0,1fr);height:var(--field-input-height)}.k-link-input-toggle.k-button{align-items:center;background:var(--color-gray-200);border-radius:var(--rounded-sm);display:flex;gap:.25rem;height:var(--height-sm);margin-left:.25rem;padding:0 1.325rem 0 .375rem}.k-link-input-toggle.k-button .k-button-text{padding-left:var(--spacing-1)}.k-link-input-toggle .k-button-text:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid var(--color-black);content:"";margin-top:-2px;position:absolute;right:.5rem;top:50%}.k-link-input-model{--tag-color-back:var(--color-gray-200);--tag-color-text:var(--color-black);--tag-color-focus-back:var(--tag-color-back);--tag-color-focus-text:var(--tag-color-text);--tag-rounded:var(--rounded-sm);display:flex;height:var(--height-sm);justify-content:space-between;margin-right:var(--spacing-1);overflow:hidden}.k-link-input-model-preview{overflow:hidden;white-space:nowrap}.k-link-input-model-preview .k-tag-text{align-items:center;display:flex;gap:.5rem;overflow:hidden;text-overflow:ellipsis}.k-link-input-model-preview-image{aspect-ratio:1/1;border-radius:1px;height:calc(var(--height-sm) - .5rem)}.js-has-pseudo [csstools-has-1a-2z-19-30-2x-32-2z-19-2x-32-34-39-38-19-31-33-2s-2t-30-19-34-36-2t-3a-2x-2t-3b-w-1a-2z-19-38-2p-2v-19-38-2t-3c-38-1m-2w-2p-37-14-1a-2z-19-30-2x-32-2z-19-2x-32-34-39-38-19-31-33-2s-2t-30-19-34-36-2t-3a-2x-2t-3b-19-2x-31-2p-2v-2t-15]:not(.does-not-exist):not(.does-not-exist){padding-left:.25rem}.k-link-input-model-preview .k-tag-text:has(.k-link-input-model-preview-image){padding-left:.25rem}.k-link-input-model-placeholder.k-button{align-items:center;color:var(--color-gray-600);display:flex;flex-grow:1;font-size:var(--text-base);height:var(--height-sm);justify-content:flex-start;overflow:hidden;padding-left:var(--spacing-2);padding-right:var(--spacing-2);white-space:nowrap}.k-link-input-model-toggle{align-items:center;display:flex;flex-shrink:0;height:var(--height-sm);justify-content:center;width:var(--height-sm)}.k-link-input-body{--tree-color-back:var(--color-gray-100);--tree-color-hover-back:var(--color-gray-200);background:var(--color-gray-100);border-top:1px solid var(--color-gray-300);display:grid;overflow:hidden}.k-link-input-body[data-type=page] .k-page-browser{container-type:inline-size;overflow:auto;padding:var(--spacing-2);padding-bottom:calc(var(--spacing-2) - 1px);width:100%}.k-list-input .ProseMirror{line-height:1.5em}.k-list-input .ProseMirror ol>li::marker{color:var(--color-gray-500);font-size:var(--text-sm)}.k-list-field .k-list-input{padding:.375rem .5rem .375rem .75rem}.k-multiselect-input{display:flex;flex-wrap:wrap;font-size:var(--text-sm);line-height:1;min-height:2.25rem;position:relative}.k-multiselect-input .k-sortable-ghost{background:var(--color-focus)}.k-multiselect-input .k-tag{border-radius:var(--rounded-sm)}.k-multiselect-input .k-dropdown-content{width:100%}.k-multiselect-search{background:var(--color-gray-900);border-bottom:1px dashed hsla(0,0%,100%,.2);color:var(--color-white);margin-top:0!important}.k-multiselect-search>.k-button-text{flex:1;opacity:1!important}.k-multiselect-search input{background:none;border:none;color:var(--color-white);font:inherit;outline:none;padding:.25rem 0;width:100%}.k-multiselect-options{max-height:275px;padding:.5rem 0;position:relative}.k-multiselect-option{position:relative}.k-multiselect-option.selected{color:var(--color-positive-light)}.k-multiselect-option.disabled:not(.selected) .k-icon{opacity:0}.k-multiselect-option b{color:var(--color-focus-light);font-weight:700}.k-multiselect-input[data-layout=list] .k-tag{margin-right:0!important;width:100%}.k-multiselect-more{border-top:1px dashed hsla(0,0%,100%,.2);color:#fffc;padding:.75rem;text-align:center;width:100%}.k-multiselect-more:hover{color:var(--color-white)}.k-number-input{background:none;border:0;color:inherit;font:inherit;width:100%}.k-number-input::-moz-placeholder{color:var(--color-gray-500)}.k-number-input::placeholder{color:var(--color-gray-500)}.k-number-input:focus{outline:0}.k-number-input:invalid{box-shadow:none;outline:0}.k-table.k-object-field-table{table-layout:auto}.k-table.k-object-field-table tbody td,.k-table.k-object-field-table tbody th,.k-table.k-object-field-table tbody th button{cursor:pointer;overflow:hidden;text-overflow:ellipsis}.k-table.k-object-field-table tbody td{max-width:0}.k-pages-field[data-disabled=true] .k-item *{pointer-events:all!important}.k-radio-input li{line-height:1.5rem;padding-left:1.75rem;position:relative}.k-radio-input input{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:0;opacity:0;position:absolute;width:0}.k-radio-input label{align-items:center;cursor:pointer}.k-radio-input label:before{border:2px solid var(--color-gray-500);border-radius:50%;box-shadow:var(--color-white) 0 0 0 2px inset;content:"";height:1rem;left:0;position:absolute;top:.175em;width:1rem}.k-radio-input input:checked+label:before{background:var(--color-gray-900);border-color:var(--color-gray-900)}[data-disabled=true] .k-radio-input input:checked+label:before{background:var(--color-gray-600);border-color:var(--color-gray-600)}.k-radio-input input:focus+label:before{border-color:var(--color-blue-600)}.k-radio-input input:focus:checked+label:before{background:var(--color-focus)}.k-radio-input-text{display:block}.k-range-input{--range-thumb-size:16px;--range-thumb-border:4px solid var(--color-gray-900);--range-thumb-border-disabled:4px solid var(--color-gray-600);--range-thumb-background:var(--color-background);--range-thumb-focus-border:4px solid var(--color-focus);--range-thumb-focus-background:var(--color-background);--range-track-height:4px;--range-track-background:var(--color-border);--range-track-color:var(--color-gray-900);--range-track-color-disabled:var(--color-gray-600);--range-track-focus-color:var(--color-focus);align-items:center;display:flex}.k-range-input-native{--min:0;--max:100;--value:0;--range:calc(var(--max) - var(--min));--ratio:calc((var(--value) - var(--min))/var(--range));--position:calc(var(--range-thumb-size)*.5 + var(--ratio)*(100% - var(--range-thumb-size)));-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;font-size:var(--text-sm);height:var(--range-thumb-size);line-height:1;width:100%}.k-range-input-native::-webkit-slider-thumb{-webkit-appearance:none;appearance:none}.k-range-input-native::-webkit-slider-runnable-track{background:var(--range-track-background);border:none;border-radius:var(--range-track-height);height:var(--range-track-height);width:100%}.k-range-input-native::-moz-range-track{background:var(--range-track-background);border:none;border-radius:var(--range-track-height);height:var(--range-track-height);width:100%}.k-range-input-native::-ms-track{background:var(--range-track-background);border:none;border-radius:var(--range-track-height);height:var(--range-track-height);width:100%}.k-range-input-native::-webkit-slider-runnable-track{background:linear-gradient(var(--range-track-color),var(--range-track-color)) 0 /var(--position) 100% no-repeat var(--range-track-background)}.k-range-input-native::-moz-range-progress{background:var(--range-track-color);height:var(--range-track-height)}.k-range-input-native::-ms-fill-lower{background:var(--range-track-color);height:var(--range-track-height)}.k-range-input-native::-webkit-slider-thumb{background:var(--range-thumb-background);border:var(--range-thumb-border);border-radius:50%;box-sizing:border-box;cursor:pointer;height:var(--range-thumb-size);margin-top:calc((var(--range-track-height) - var(--range-thumb-size))*.5);width:var(--range-thumb-size)}.k-range-input-native::-moz-range-thumb{background:var(--range-thumb-background);border:var(--range-thumb-border);border-radius:50%;box-sizing:border-box;cursor:pointer;height:var(--range-thumb-size);width:var(--range-thumb-size)}.k-range-input-native::-ms-thumb{background:var(--range-thumb-background);border:var(--range-thumb-border);border-radius:50%;box-sizing:border-box;cursor:pointer;height:var(--range-thumb-size);margin-top:0;width:var(--range-thumb-size)}.k-range-input-native::-ms-tooltip{display:none}.k-range-input-native:focus{outline:none}.k-range-input-native:focus::-webkit-slider-runnable-track{background:var(--range-track-background);background:linear-gradient(var(--range-track-focus-color),var(--range-track-focus-color)) 0 /var(--position) 100% no-repeat var(--range-track-background);border:none;border-radius:var(--range-track-height);height:var(--range-track-height);width:100%}.k-range-input-native:focus::-moz-range-progress{background:var(--range-track-focus-color);height:var(--range-track-height)}.k-range-input-native:focus::-ms-fill-lower{background:var(--range-track-focus-color);height:var(--range-track-height)}.k-range-input-native:focus::-webkit-slider-thumb{background:var(--range-thumb-focus-background);border:var(--range-thumb-focus-border)}.k-range-input-native:focus::-moz-range-thumb{background:var(--range-thumb-focus-background);border:var(--range-thumb-focus-border)}.k-range-input-native:focus::-ms-thumb{background:var(--range-thumb-focus-background);border:var(--range-thumb-focus-border)}.k-range-input-tooltip{align-items:center;background:var(--color-gray-900);border-radius:var(--rounded-xs);color:var(--color-white);display:flex;font-size:var(--text-xs);line-height:1;margin-left:1rem;max-width:20%;padding:0 .25rem;position:relative;text-align:center;white-space:nowrap}.k-range-input-tooltip:after{border-bottom:5px solid transparent;border-right:5px solid var(--color-gray-900);border-top:5px solid transparent;content:"";height:0;left:-5px;position:absolute;top:50%;transform:translateY(-50%);width:0}.k-range-input-tooltip>*{padding:4px}[data-disabled=true] .k-range-input-native::-webkit-slider-runnable-track{background:linear-gradient(var(--range-track-color-disabled),var(--range-track-color-disabled)) 0 /var(--position) 100% no-repeat var(--range-track-background)}[data-disabled=true] .k-range-input-native::-moz-range-progress{background:var(--range-track-color-disabled);height:var(--range-track-height)}[data-disabled=true] .k-range-input-native::-ms-fill-lower{background:var(--range-track-color-disabled);height:var(--range-track-height)}[data-disabled=true] .k-range-input-native::-webkit-slider-thumb{border:var(--range-thumb-border-disabled)}[data-disabled=true] .k-range-input-native::-moz-range-thumb{border:var(--range-thumb-border-disabled)}[data-disabled=true] .k-range-input-native::-ms-thumb{border:var(--range-thumb-border-disabled)}[data-disabled=true] .k-range-input-tooltip{background:var(--color-gray-600)}[data-disabled=true] .k-range-input-tooltip:after{border-right:5px solid var(--color-gray-600)}.k-select-input{cursor:pointer;display:block;overflow:hidden;position:relative}.k-select-input-native{-webkit-appearance:none;-moz-appearance:none;appearance:none;bottom:0;cursor:pointer;font:inherit;left:0;opacity:0;position:absolute;right:0;top:0;width:100%;z-index:1}.k-select-input-native[disabled]{cursor:default}.k-select-input-native{font-weight:var(--font-normal)}.k-structure-field:not([data-disabled=true]) td.k-table-column{cursor:pointer}.k-tags-input{display:flex;flex-wrap:wrap}.k-tags-input .k-tag{border-radius:var(--rounded-sm)}.k-tags-input .k-sortable-ghost{background:var(--color-focus)}.k-tags-input-element{flex-basis:0;flex-grow:1;min-width:0}.k-tags-input:focus-within .k-tags-input-element{flex-basis:4rem}.k-tags-input-element input{background:none;border:0;font:inherit;width:100%}.k-tags-input-element input:focus{outline:0}.k-tags-input[data-layout=list] .k-tag{margin-right:0!important;width:100%}.k-field-counter{display:none}.k-text-field:focus-within .k-field-counter{display:block}.k-textarea-input[data-size=small]{--size:7.5rem}.k-textarea-input[data-size=medium]{--size:15rem}.k-textarea-input[data-size=large]{--size:30rem}.k-textarea-input[data-size=huge]{--size:45rem}.k-textarea-input-wrapper{position:relative}.k-textarea-input-native{background:none;border:0;color:inherit;font:inherit;line-height:1.5em;min-height:var(--size);resize:none;width:100%}.k-textarea-input-native::-moz-placeholder{color:var(--color-gray-500)}.k-textarea-input-native::placeholder{color:var(--color-gray-500)}.k-textarea-input-native:focus{outline:0}.k-textarea-input-native:invalid{box-shadow:none;outline:0}.k-textarea-input-native[data-font=monospace]{font-family:var(--font-mono)}.k-toggle-input{--toggle-background:var(--color-white);--toggle-color:var(--color-gray-500);--toggle-active-color:var(--color-gray-900);--toggle-focus-color:var(--color-focus);--toggle-height:16px;align-items:center;display:flex}.k-toggle-input-native{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--toggle-color);border:2px solid var(--toggle-color);border-radius:var(--toggle-height);box-shadow:inset 0 0 0 2px var(--toggle-background),inset calc(var(--toggle-height)*-1) 0 0 2px var(--toggle-background);cursor:pointer;flex-shrink:0;height:var(--toggle-height);outline:0;position:relative;transition:all .1s ease-in-out;width:calc(var(--toggle-height)*2)}.k-toggle-input-native:checked{background-color:var(--toggle-active-color);border-color:var(--toggle-active-color);box-shadow:inset 0 0 0 2px var(--toggle-background),inset var(--toggle-height) 0 0 2px var(--toggle-background)}.k-toggle-input-native[disabled]{background-color:var(--color-border);border-color:var(--color-border);box-shadow:inset 0 0 0 2px var(--color-background),inset calc(var(--toggle-height)*-1) 0 0 2px var(--color-background)}.k-toggle-input-native[disabled]:checked{box-shadow:inset 0 0 0 2px var(--color-background),inset var(--toggle-height) 0 0 2px var(--color-background)}.k-toggle-input-native:focus:checked{background-color:var(--toggle-focus-color);border:2px solid var(--color-focus)}.k-toggle-input-native::-ms-check{opacity:0}.k-toggle-input-label{cursor:pointer;flex-grow:1}.k-input[data-type=toggles]{display:inline-flex}.k-input[data-type=toggles].grow{display:flex}.k-toggles-input{background:var(--color-border);border-radius:var(--rounded);display:grid;gap:1px;grid-template-columns:repeat(var(--options),minmax(0,1fr));line-height:1;overflow:hidden}.k-toggles-input li{background:var(--color-white);height:var(--field-input-height)}.k-toggles-input label{align-items:center;background:var(--color-white);cursor:pointer;display:flex;font-size:var(--text-sm);height:100%;justify-content:center;line-height:1.25;padding:0 var(--spacing-3)}.k-toggles-input .k-icon+.k-toggles-text{margin-left:var(--spacing-2)}.k-toggles-input input:focus:not(:checked)+label{background:var(--color-gray-200)}.k-toggles-input input:checked+label{background:var(--color-black);color:var(--color-white)}.k-users-field[data-disabled=true] .k-item *{pointer-events:all!important}.k-writer{display:grid;gap:var(--spacing-1);grid-template-areas:"content";position:relative;width:100%}.k-writer .ProseMirror{word-wrap:break-word;font-variant-ligatures:none;grid-area:content;line-height:inherit;overflow-wrap:break-word;white-space:pre-wrap;word-break:break-word}.k-writer .ProseMirror:focus{outline:0}.k-writer .ProseMirror *{caret-color:currentColor}.k-writer .ProseMirror a{color:var(--color-focus);text-decoration:underline}.k-writer .ProseMirror>:last-child{margin-bottom:0}.k-writer .ProseMirror :where(p,ul,ol,h1,h2,h3){margin-bottom:.75rem}.k-writer .ProseMirror :where(p,ul,ol){line-height:1.5}.k-writer .ProseMirror h1{font-size:var(--text-3xl);line-height:1.25em}.k-writer .ProseMirror h2{font-size:var(--text-2xl);line-height:1.25em}.k-writer .ProseMirror h3{font-size:var(--text-xl);line-height:1.25em}.k-writer .ProseMirror :where(h1,h2,h3) strong{font-weight:700}.k-writer .ProseMirror strong{font-weight:600}.k-writer .ProseMirror :where(sup,sub){font-size:var(--text-xs);line-height:1}.k-writer .ProseMirror code{background:var(--color-gray-300);border-radius:var(--rounded);display:inline-block;font-family:var(--font-mono);font-size:.925em;line-height:1.325;padding:.05em .325em;position:relative}.k-writer .ProseMirror :where(ul,ol){padding-left:1.75rem}.k-writer .ProseMirror ul>li{list-style:disc}.k-writer .ProseMirror ul ul>li{list-style:circle}.k-writer .ProseMirror ul ul ul>li{list-style:square}.k-writer .ProseMirror ol>li{list-style:decimal}.k-writer .ProseMirror li>:where(p,ol,ul){margin:0}.k-writer .ProseMirror hr{border:0;border-radius:var(--rounded);border-top:2px solid var(--color-gray-300);margin-bottom:var(--spacing-1);margin-top:var(--spacing-1)}.k-writer .ProseMirror hr.ProseMirror-selectednode{outline:2px var(--color-focus) solid}.k-writer-code pre{-webkit-overflow-scrolling:touch;font-size:var(--text-sm);line-height:2em;overflow-x:auto;overflow-y:hidden;-moz-tab-size:2;-o-tab-size:2;tab-size:2;white-space:pre}.k-writer-code code{font-family:var(--font-mono)}.k-writer[data-placeholder][data-empty=true]:before{word-wrap:break-word;color:var(--color-gray-500);content:attr(data-placeholder);grid-area:content;pointer-events:none;white-space:pre-wrap}.k-writer-field .k-writer-input .ProseMirror,.k-writer-field .k-writer-input:before{line-height:1.5em;padding:.375rem .5rem}.k-checkbox-input{cursor:pointer;position:relative}.k-checkbox-input-label{display:block;padding-left:1.75rem}.k-checkbox-input-icon{border:2px solid var(--color-gray-500);border-radius:var(--rounded);height:1rem;left:0;position:absolute;width:1rem}.k-checkbox-input-icon svg{display:none;height:12px;position:absolute;width:12px}.k-checkbox-input-icon path{stroke:var(--color-white)}.k-checkbox-input-native:checked+.k-checkbox-input-icon{background:var(--color-gray-900);border-color:var(--color-gray-900)}[data-disabled=true] .k-checkbox-input-native:checked+.k-checkbox-input-icon{background:var(--color-gray-600);border-color:var(--color-gray-600)}.k-checkbox-input-native:checked+.k-checkbox-input-icon svg{display:block}.k-checkbox-input-native:focus+.k-checkbox-input-icon{border-color:var(--color-blue-600)}.k-checkbox-input-native:focus:checked+.k-checkbox-input-icon{background:var(--color-focus)}.k-layout{--layout-border-color:var(--color-gray-300);--layout-toolbar-width:2rem;background:#fff;box-shadow:var(--shadow);padding-right:var(--layout-toolbar-width);position:relative}[data-disabled=true] .k-layout{padding-right:0}.k-layout:not(:last-of-type){margin-bottom:1px}.k-layout:focus{outline:0}.k-layout-toolbar{background:var(--color-gray-100);border-left:1px solid var(--color-light);bottom:0;color:var(--color-gray-500);display:flex;flex-direction:column;font-size:var(--text-sm);position:absolute;right:0;top:0;width:var(--layout-toolbar-width)}.k-layout-toolbar:hover{color:var(--color-black)}.k-layout-toolbar-button{height:var(--layout-toolbar-width);width:var(--layout-toolbar-width)}.k-layout-toolbar .k-sort-handle{color:currentColor;margin-top:auto}.k-layout-columns.k-grid{grid-gap:1px;background:var(--layout-border-color);background:var(--color-gray-300)}.k-layout:not(:first-child) .k-layout-columns.k-grid{border-top:0}.k-layout-column{background:var(--color-white);display:flex;flex-direction:column;height:100%;min-height:6rem;position:relative}.k-layout-column:focus{outline:0}.k-layout-column .k-blocks{background:none;background:var(--color-white);box-shadow:none;height:100%;min-height:4rem;padding:0}.k-layout-column .k-blocks[data-empty=true]{min-height:6rem}.k-layout-column .k-blocks-list{display:flex;flex-direction:column;height:100%}.k-layout-column .k-blocks-empty{border:0;bottom:0;justify-content:center;left:0;opacity:0;position:absolute;right:0;top:0;transition:opacity .3s}.k-layout-column .k-blocks-empty:hover{opacity:1}.k-layout-column .k-blocks-empty.k-empty .k-icon{border-right:0;width:1rem}.k-layouts .k-sortable-ghost{box-shadow:0 5px 10px #12121240;cursor:grabbing;outline:2px solid var(--color-focus);position:relative;z-index:1}.k-layout-selector.k-dialog{background:#313740;color:var(--color-white)}.k-layout-selector .k-headline{line-height:1;margin-bottom:1.5rem;margin-top:-.25rem}.k-layout-selector ul{grid-gap:1.5rem;display:grid;grid-template-columns:repeat(3,1fr)}.k-layout-selector-option{outline:2px solid var(--option-outline,transparent);outline-offset:2px}.k-layout-selector-option[aria-current=true]{--option-outline:var(--color-blue-300)}.k-layout-selector-option:not([aria-current]):hover{--option-outline:var(--color-green-300)}.k-layout-selector-option:last-child{margin-bottom:0}.k-layout-selector-option .k-grid{grid-gap:2px;box-shadow:var(--shadow);cursor:pointer;height:5rem}.k-layout-selector-option .k-column{align-items:center;background:hsla(0,0%,100%,.2);display:flex;justify-content:center}.k-bubbles-field-preview,.k-color-field-preview{padding:.325rem .75rem}.js-has-pseudo [csstools-has-1a-2z-19-2r-33-30-33-36-19-2u-2x-2t-30-2s-19-34-36-2t-3a-2x-2t-3b-w-1a-2z-19-2r-33-30-33-36-19-34-36-2t-3a-2x-2t-3b-1m-2w-2p-37-14-17-w-1a-2z-19-2q-39-2q-2q-30-2t-19-38-2t-3c-38-15]:not(.does-not-exist):not(.does-not-exist){border-bottom-right-radius:0;border-top-right-radius:0}.k-color-field-preview .k-color-preview:has(+.k-bubble-text){border-bottom-right-radius:0;border-top-right-radius:0}.k-text-field-preview{overflow-x:hidden;padding:.325rem .75rem;text-overflow:ellipsis;white-space:nowrap}.k-url-field-preview{overflow-x:hidden;padding:.325rem .75rem;text-overflow:ellipsis}.k-url-field-preview[data-link]{color:var(--color-focus)}.k-url-field-preview a{overflow:hidden;text-decoration:underline;text-overflow:ellipsis;transition:color .3s;white-space:nowrap}.k-url-field-preview a:hover{color:var(--color-black)}.k-flag-field-preview{align-items:center;display:flex;height:var(--table-row-height);justify-content:center;width:var(--table-row-height)}.k-html-field-preview{line-height:1.5em;overflow:hidden;padding:.325rem .75rem;text-overflow:ellipsis;white-space:nowrap}.k-html-field-preview p:not(:last-child){margin-bottom:1.5em}.k-html-field-preview ol,.k-html-field-preview ul{margin-left:1rem}.k-html-field-preview ul>li{list-style:disc}.k-html-field-preview ol ul>li,.k-html-field-preview ul ul>li{list-style:circle}.k-html-field-preview ol>li{list-style:decimal}.k-html-field-preview ol>li::marker{color:var(--color-gray-500);font-size:var(--text-xs)}.k-html-field-preview a{color:var(--color-focus);text-decoration:underline}.k-toggle-field-preview label{cursor:pointer;display:flex;height:38px;overflow:hidden;padding:0 .25rem 0 .75rem;white-space:nowrap}.k-toggle-field-preview .k-toggle-input-label{padding-left:.5rem}[data-align=right] .k-toggle-field-preview .k-toggle-input-label{padding-right:.5rem}.k-toggle-field-preview .k-toggle-input{padding:0 .25rem 0 .75rem}[data-align=right] .k-toggle-field-preview .k-toggle-input{flex-direction:row-reverse;padding-left:.25rem;padding-right:.75rem}.js-has-pseudo [csstools-has-1a-2z-19-3b-36-2x-38-2t-36-1m-2w-2p-37-14-1a-2z-19-3b-36-2x-38-2t-36-19-38-33-33-30-2q-2p-36-1m-32-33-38-14-2j-2s-2p-38-2p-19-2x-32-30-2x-32-2t-1p-y-38-36-39-2t-y-2l-15-15]:not(.does-not-exist):not(.does-not-exist){grid-template-areas:"topbar" "content";grid-template-rows:38px 1fr}.k-writer:has(.k-writer-toolbar:not([data-inline=true])){grid-template-areas:"topbar" "content";grid-template-rows:38px 1fr}.js-has-pseudo [csstools-has-1a-2z-19-3b-36-2x-38-2t-36-19-38-33-33-30-2q-2p-36-1m-2w-2p-37-14-3i-w-1m-2u-33-2r-39-37-19-3b-2x-38-2w-2x-32-15-w-1a-2z-19-2q-39-38-38-33-32-2j-2p-36-2x-2p-19-2r-39-36-36-2t-32-38-2l]:not(.does-not-exist):not(.does-not-exist):not(.does-not-exist){color:var(--color-blue-400)}.k-writer-toolbar:has(~:focus-within) .k-button[aria-current]{color:var(--color-blue-400)}.k-writer-toolbar[data-inline=true]{--toolbar-size:var(--height-md);--toolbar-text:var(--color-white);--toolbar-back:var(--color-black);--toolbar-hover:hsla(0,0%,100%,.15);--toolbar-border:var(--color-gray-700);border:0;border-radius:var(--rounded);box-shadow:var(--shadow);position:absolute;transform:translate(-50%) translateY(-.75rem);z-index:calc(var(--z-dropdown) + 1)}.k-aspect-ratio{display:block;overflow:hidden;padding-bottom:100%;position:relative}.k-aspect-ratio>*{bottom:0;height:100%;left:0;-o-object-fit:contain;object-fit:contain;position:absolute!important;right:0;top:0;width:100%}.k-aspect-ratio[data-cover=true]>*{-o-object-fit:cover;object-fit:cover}.k-bar{align-items:center;display:flex;justify-content:space-between;line-height:1}.k-bar-slot{flex-grow:1}.k-bar-slot[data-position=center]{text-align:center}.k-bar-slot[data-position=right]{text-align:right}.k-box{word-wrap:break-word;font-size:var(--text-sm)}.k-box:not([data-theme=none]){background:var(--color-white);border-radius:var(--rounded);line-height:1.25rem;padding:.5rem .75rem}.k-box[data-theme=code]{background:var(--color-gray-900);border:1px solid var(--color-black);color:var(--color-light);font-family:Input,Menlo,monospace;font-size:var(--text-sm);line-height:1.5}.k-box[data-theme=button]{padding:0}.k-box[data-theme=button] .k-button{align-items:center;display:flex;height:2.25rem;line-height:2rem;padding:0 .75rem;text-align:left;width:100%}.k-box[data-theme=info],.k-box[data-theme=negative],.k-box[data-theme=notice],.k-box[data-theme=positive]{background:var(--theme-bg);border:0;border-left-color:var(--theme-light)}.k-box[data-theme=empty]{align-items:center;background:var(--color-background);border-left:0;border:1px dashed var(--color-border);color:var(--color-gray-600);display:flex;flex-direction:column;justify-content:center;padding:3rem 1.5rem;text-align:center}.k-box[data-theme=empty] .k-icon{color:var(--color-gray-500);margin-bottom:.5rem}.k-box[data-theme=empty] p{color:var(--color-gray-600)}:root{--bubble-size:1.525rem}.k-bubble{background:var(--color-light);border-radius:var(--rounded);color:var(--color-black);height:var(--bubble-size);line-height:1.5;overflow:hidden;white-space:nowrap;width:-moz-min-content;width:min-content}.k-bubble .k-item-figure{height:var(--bubble-size);width:var(--bubble-size)}.js-has-pseudo [csstools-has-1a-2z-19-2q-39-2q-2q-30-2t-1m-2w-2p-37-14-1a-2z-19-2q-39-2q-2q-30-2t-19-38-2t-3c-38-15]:not(.does-not-exist){align-items:center;display:flex;font-size:var(--text-xs);gap:var(--spacing-2);padding-right:.5rem}.k-bubble:has(.k-bubble-text){align-items:center;display:flex;font-size:var(--text-xs);gap:var(--spacing-2);padding-right:.5rem}.k-bubbles{display:flex;gap:.25rem}.k-collection-help{padding:.5rem .75rem}.k-collection-footer{display:flex;justify-content:space-between;margin-left:-.75rem;margin-right:-.75rem}.k-collection-pagination{flex-shrink:0;line-height:1.25rem;min-height:2.75rem}.k-collection-pagination .k-pagination .k-button{line-height:1.125rem;padding:.5rem .75rem}.k-column{grid-column-start:span 12;min-width:0}.k-column[data-sticky=true]>div{position:sticky;top:4vh;z-index:2}@media screen and (min-width:65em){.k-column[data-width="1/1"],.k-column[data-width="12/12"],.k-column[data-width="2/2"],.k-column[data-width="3/3"],.k-column[data-width="4/4"],.k-column[data-width="6/6"]{grid-column-start:span 12}.k-column[data-width="11/12"]{grid-column-start:span 11}.k-column[data-width="10/12"],.k-column[data-width="5/6"]{grid-column-start:span 10}.k-column[data-width="3/4"],.k-column[data-width="9/12"]{grid-column-start:span 9}.k-column[data-width="2/3"],.k-column[data-width="4/6"],.k-column[data-width="8/12"]{grid-column-start:span 8}.k-column[data-width="7/12"]{grid-column-start:span 7}.k-column[data-width="1/2"],.k-column[data-width="2/4"],.k-column[data-width="3/6"],.k-column[data-width="6/12"]{grid-column-start:span 6}.k-column[data-width="5/12"]{grid-column-start:span 5}.k-column[data-width="1/3"],.k-column[data-width="2/6"],.k-column[data-width="4/12"]{grid-column-start:span 4}.k-column[data-width="1/4"],.k-column[data-width="3/12"]{grid-column-start:span 3}.k-column[data-width="1/6"],.k-column[data-width="2/12"]{grid-column-start:span 2}.k-column[data-width="1/12"]{grid-column-start:span 1}}.k-column[data-disabled=true]{cursor:not-allowed;opacity:.4}.k-column[data-disabled=true] *{pointer-events:none}.k-column[data-disabled=true] .k-text[data-theme=help] *{pointer-events:auto}.k-dropzone{position:relative}.k-dropzone:after{bottom:0;content:"";display:none;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:1}.k-dropzone[data-over=true]:after{box-shadow:var(--color-focus-outline) 0 0 0 3px;display:block;outline:1px solid var(--color-focus)}.k-empty{align-items:stretch;border:1px dashed var(--color-border);border-radius:var(--rounded);color:var(--color-gray-600);display:flex}button.k-empty{width:100%}button.k-empty:focus{outline:none}.k-empty p{color:var(--color-gray-600);font-size:var(--text-sm)}.k-empty>.k-icon{color:var(--color-gray-500)}.k-empty[data-layout=cardlets],.k-empty[data-layout=cards]{flex-direction:column;justify-content:center;padding:1.5rem;text-align:center}.k-empty[data-layout=cardlets] .k-icon,.k-empty[data-layout=cards] .k-icon{margin-bottom:1rem}.k-empty[data-layout=cardlets] .k-icon svg,.k-empty[data-layout=cards] .k-icon svg{height:2rem;width:2rem}.k-empty[data-layout=list],.k-empty[data-layout=table]{min-height:38px}.k-empty[data-layout=list]>.k-icon,.k-empty[data-layout=table]>.k-icon{border-right:1px solid rgba(0,0,0,.05);min-height:36px;width:36px}.k-empty[data-layout=list]>p,.k-empty[data-layout=table]>p{line-height:1.25rem;padding:.5rem .75rem}.k-file-preview{background:var(--color-gray-800)}.k-file-preview-layout{align-items:stretch;border-radius:var(--rounded-lg);display:grid;margin-bottom:var(--spacing-6);overflow:hidden}.k-file-preview-layout>*{min-width:0}.k-file-preview-thumb{--icon-size:2rem;aspect-ratio:1/1;background:var(--bg-pattern);container-type:size;display:grid;padding:var(--spacing-6);place-items:center}.k-file-preview .k-coords{--opacity-disabled:1;cursor:crosshair}.k-file-preview-thumb img{max-height:100cqh;max-width:100cqw}.k-file-preview .k-coords-thumb{--range-thumb-height:1.25rem;background:rgba(92,141,214,.75);box-shadow:none}.k-file-preview .k-coords-thumb:after{background:var(--color-white);border-radius:50%;content:"";height:.4rem;left:calc(50% - .2rem);position:absolute;top:calc(50% - .2rem);width:.4rem}.k-file-preview:not([data-has-focus=true]) .k-coords-thumb{display:none}.k-file-preview-icon{--icon-size:3rem}.k-file-preview-thumb .k-dropdown{left:var(--spacing-2);position:absolute;top:var(--spacing-2)}.k-file-preview-details{display:grid}.k-file-preview-details dl{grid-gap:var(--spacing-6) var(--spacing-12);align-self:center;display:grid;grid-template-columns:repeat(auto-fill,minmax(12rem,1fr));line-height:1.5em;padding:var(--spacing-6)}.k-file-preview-details dt{color:var(--color-gray-500);font-size:var(--text-sm);font-weight:500;font-weight:var(--font-semi);margin-bottom:var(--spacing-1)}.k-file-preview-details :where(dd,a){color:#ffffff80;color:#ffffffbf;font-size:var(--text-xs);font-size:var(--text-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.k-file-preview-focus-info dd{align-items:center;display:flex}.k-file-preview-focus-info .k-button{align-items:center;background:var(--color-gray-700);border-radius:var(--rounded);display:flex;font-size:var(--text-sm);height:24px;line-height:1;padding:.25rem .25rem .25rem .5rem}.k-file-preview-focus-info .k-button:hover{background:var(--color-gray-600)}.k-file-preview[data-has-focus=true] .k-file-preview-focus-info .k-button{display:flex;flex-direction:row-reverse;gap:.25rem}.k-file-preview[data-has-focus=true] .k-file-preview-focus-info .k-button-text{padding:0}@media screen and (min-width:36rem){.k-file-preview-layout{grid-template-columns:50% auto}.k-file-preview-thumb{aspect-ratio:auto}}@media screen and (min-width:65rem){.k-file-preview-thumb{aspect-ratio:1/1}.k-file-preview-layout{grid-template-columns:33.333% auto}}@media screen and (min-width:90rem){.k-file-preview-layout{grid-template-columns:25% auto}}.k-grid{--columns:12;grid-column-gap:0;grid-row-gap:0;display:grid;grid-template-columns:1fr}@media screen and (min-width:30em){.k-grid[data-gutter=small]{grid-column-gap:1rem;grid-row-gap:1rem}.k-grid[data-gutter=huge],.k-grid[data-gutter=large],.k-grid[data-gutter=medium]{grid-column-gap:1.5rem;grid-row-gap:1.5rem}}@media screen and (min-width:65em){.k-grid{grid-template-columns:repeat(var(--columns),1fr)}.k-grid[data-gutter=large]{grid-column-gap:3rem}.k-grid[data-gutter=huge]{grid-column-gap:4.5rem}}@media screen and (min-width:90em){.k-grid[data-gutter=large]{grid-column-gap:4.5rem}.k-grid[data-gutter=huge]{grid-column-gap:6rem}}@media screen and (min-width:120em){.k-grid[data-gutter=large]{grid-column-gap:6rem}.k-grid[data-gutter=huge]{grid-column-gap:7.5rem}}.k-header{border-bottom:1px solid var(--color-border);margin-bottom:2rem;padding-top:4vh}.k-header[data-tabs=true]{border-bottom:0}.k-header .k-headline{word-wrap:break-word;margin-bottom:.5rem;min-height:1.25em}.k-header[data-editable=true] .k-headline{cursor:pointer}.k-header .k-headline .k-icon{color:var(--color-gray-500);display:inline-block;margin-left:.5rem;opacity:0;transition:opacity .3s}.k-header[data-editable=true] .k-headline:hover .k-icon{opacity:1}.k-header .k-header-buttons{height:3.25rem;margin-top:-.5rem}.k-panel-inside{bottom:0;display:flex;flex-direction:column;left:0;position:absolute;right:0;top:0}.k-panel-inside:focus{outline:0}.k-panel-header{flex-shrink:0;z-index:var(--z-navigation)}.k-panel-view{flex-grow:1;padding-bottom:6rem}.k-item{background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);display:grid;grid-template-columns:auto;line-height:1;position:relative}.k-item:focus{outline:0}.k-item.k-sortable-ghost,.k-item:focus-within{box-shadow:var(--shadow-outline)}.k-item a:focus{outline:0}.k-item-sort-handle.k-sort-handle{border-radius:1px;height:1.5rem;opacity:0;position:absolute;width:1.25rem;z-index:2}.k-item:hover .k-item-sort-handle{opacity:1}.k-item-figure{grid-area:figure}.k-item-content{grid-area:content;overflow:hidden}.k-item-info,.k-item-title{font-size:var(--text-sm);font-weight:400;line-height:1.125rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.k-item-info{color:var(--color-gray-500);grid-area:info}.k-item-title-link.k-link[data-=true]{box-shadow:none}.k-item-title-link:after{bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}.k-item-footer{align-items:center;display:flex;grid-area:footer;justify-content:space-between;min-width:0}.k-item-label{margin-right:.5rem}.k-item-buttons{display:flex;flex-grow:1;flex-shrink:0;justify-content:flex-end;position:relative}.k-item-buttons>.k-button,.k-item-buttons>.k-dropdown{align-items:center;display:flex!important;height:38px;justify-content:center;line-height:1;position:relative;width:38px}.k-item-buttons>.k-button{z-index:1}.k-item-buttons>.k-options-dropdown>.k-options-dropdown-toggle{z-index:var(--z-toolbar)}.k-list-item{align-items:center;display:flex;height:38px}.k-list-item .k-item-sort-handle{left:-1.5rem;width:1.5rem}.k-list-item .k-item-figure{border-bottom-left-radius:var(--rounded);border-top-left-radius:var(--rounded);width:38px}.k-list-item .k-item-content{align-items:center;display:flex;flex-grow:1;flex-shrink:2;justify-content:space-between;margin-left:.75rem}.k-list-item .k-item-info,.k-list-item .k-item-title{flex-grow:1;line-height:1.5rem}.k-list-item .k-item-title{flex-shrink:1;margin-right:.5rem}.k-list-item .k-item-info{flex-shrink:2;justify-self:end;margin-right:.5rem;text-align:right}.k-list-item .k-item-buttons,.k-list-item .k-item-footer{flex-shrink:0}.k-item:not(.k-list-item) .k-item-sort-handle{background:var(--color-background);border-radius:var(--rounded-sm);box-shadow:var(--shadow-lg);margin:var(--spacing-2)}.k-item:not(.k-list-item) .k-item-label{margin-left:-2px}.k-item:not(.k-list-item) .k-item-content{padding:.625rem .75rem}.k-cardlets-item{grid-template-areas:"content" "footer";grid-template-rows:auto 38px;height:6rem}.k-cardlets-item[data-has-figure=true]{grid-template-areas:"figure content" "figure footer";grid-template-columns:6rem auto}.k-cardlets-item .k-item-figure{border-bottom-left-radius:var(--rounded);border-top-left-radius:var(--rounded)}.k-cardlets-item .k-item-footer{padding-bottom:.5rem;padding-top:.5rem}.k-cards-item{grid-template-areas:"figure" "content";grid-template-columns:auto;grid-template-rows:auto 1fr}.k-cards-item .k-item-figure{border-top-left-radius:var(--rounded);border-top-right-radius:var(--rounded)}.k-cards-item .k-item-content{overflow:hidden;padding:.5rem .75rem!important}.k-cards-item .k-item-info,.k-cards-item .k-item-title{line-height:1.375rem;white-space:normal}.k-cards-item .k-item-info:after,.k-cards-item .k-item-title:after{content:" ";display:inline-block;width:var(--item-content-wrapper)}.k-cards-item{--item-content-wrapper:0}.k-cards-item[data-has-flag=true],.k-cards-item[data-has-options=true]{--item-content-wrapper:38px}.k-cards-item[data-has-flag=true][data-has-options=true]{--item-content-wrapper:76px}.k-cards-item[data-has-info=true] .k-item-title:after{display:none}.k-cards-item .k-item-footer{bottom:0;position:absolute;right:0;width:auto}.k-item-figure{flex-shrink:0;overflow:hidden}.k-cards-items{--min:13rem;--max:1fr;--gap:1.5rem;--column-gap:var(--gap);--row-gap:var(--gap);grid-column-gap:var(--column-gap);grid-row-gap:var(--row-gap);display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--min),var(--max)))}@media screen and (min-width:30em){.k-cards-items[data-size=tiny]{--min:10rem}.k-cards-items[data-size=small]{--min:16rem}.k-cards-items[data-size=medium]{--min:24rem}.k-cards-items[data-size=huge],.k-cards-items[data-size=large],.k-column[data-width="1/4"] .k-cards-items,.k-column[data-width="1/5"] .k-cards-items,.k-column[data-width="1/6"] .k-cards-items{--min:1fr}}@media screen and (min-width:65em){.k-cards-items[data-size=large]{--min:32rem}}.k-cardlets-items{grid-gap:.5rem;display:grid;grid-template-columns:repeat(auto-fill,minmax(16rem,1fr))}.k-list-items .k-list-item:not(:last-child){margin-bottom:2px}:root{--overlay-color-back:var(--color-backdrop)}.k-overlay{bottom:0;height:100%;left:0;position:fixed;right:0;top:0;transform:translateZ(0);width:100%;z-index:var(--z-dialog)}.k-overlay[data-centered=true]{display:grid;place-items:center}.k-overlay[data-dimmed=true]{background:var(--overlay-color-back)}.k-overlay-loader{color:var(--color-white)}.k-panel[data-loading=true]{animation:LoadingCursor .5s}.k-panel[data-dragging=true],.k-panel[data-loading=true]:after{-webkit-user-select:none;-moz-user-select:none;user-select:none}.k-stats{grid-gap:var(--spacing-2px);display:grid;grid-auto-rows:1fr;grid-template-columns:repeat(auto-fit,minmax(14rem,1fr))}.k-stat{background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);display:flex;flex-direction:column;line-height:var(--leading-normal);padding:var(--spacing-3) var(--spacing-6)}.k-stat.k-link:hover{background:var(--color-gray-100);cursor:pointer}.k-stat dd,.k-stat dt{display:block}.k-stat-value{font-size:var(--value);margin-bottom:var(--spacing-1);order:1}.k-stat-info,.k-stat-label{font-size:var(--text-xs)}.k-stat-label{order:2}.k-stat-info{color:var(--theme,var(--color-gray-500));order:3}.k-stats[data-size=small]{--value:var(--text-base)}.k-stats[data-size=medium]{--value:var(--text-xl)}.k-stats[data-size=large]{--value:var(--text-2xl)}.k-stats[data-size=huge]{--value:var(--text-3xl)}.k-table{--table-row-height:38px;background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);font-size:var(--text-sm);position:relative}.k-table table{border-spacing:0;font-variant-numeric:tabular-nums;table-layout:fixed;width:100%}.k-table[data-invalid]{border:0;box-shadow:var(--color-negative-outline) 0 0 0 1px,var(--color-negative-outline) 0 0 3px 2px}.k-table td,.k-table th{height:var(--table-row-height);line-height:1.25em;overflow:hidden;text-overflow:ellipsis;width:100%}.k-table thead th:first-child{border-top-left-radius:var(--rounded)}.k-table thead th:last-child{border-top-right-radius:var(--rounded)}.k-table td:last-child,.k-table th:last-child{border-right:0;height:var(--table-row-height)}.k-table th,.k-table tr:not(:last-child) td{border-bottom:1px solid var(--color-background)}.k-table td:last-child{overflow:visible}.k-table td,.k-table th{border-right:1px solid var(--color-background);text-align:left}.k-table th{background:var(--color-gray-100);color:var(--color-gray-600);font-family:var(--font-mono);font-size:var(--text-xs);font-weight:400;padding:0 .75rem;width:100%}.k-table th button{border-radius:var(--rounded);display:block;font:inherit;height:100%;padding:0 .75rem;text-align:left;width:100%}.k-table th button:focus-visible{outline:2px solid var(--color-black);outline-offset:-2px}.k-table tbody tr:hover td{background:hsla(0,0%,94%,.25)}.k-table thead th{left:0;position:sticky;right:0;top:0;z-index:1}.k-table tbody th{border-radius:0;overflow:visible;padding:0;white-space:nowrap;width:auto}.k-table tbody tr:first-child th{border-top-left-radius:var(--rounded)}.k-table tbody tr:last-child th{border-bottom:0;border-bottom-left-radius:var(--rounded)}.k-table-column[data-align]{text-align:var(--align)!important}.k-table-column[data-align=right]>.k-input{align-items:flex-end;flex-direction:column}.k-table .k-sort-handle,.k-table-index{display:grid;height:var(--table-row-height);place-items:center;width:100%}.k-table .k-sort-handle,.k-table tr:hover .k-table-index-column[data-sortable=true] .k-table-index{display:none}.k-table tr:hover .k-sort-handle{display:grid!important}.k-table-row-ghost{background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow-outline);cursor:grabbing;cursor:-webkit-grabbing;margin-bottom:2px;outline:2px solid var(--color-black)}.k-table-row-fallback{opacity:0!important}td.k-table-index-column,td.k-table-options-column,th.k-table-index-column,th.k-table-options-column{text-align:center!important;width:var(--table-row-height)}.k-table-index{color:var(--color-gray-500);font-size:var(--text-xs);line-height:1.1em}.k-table-empty{color:var(--color-gray-600);font-size:var(--text-sm)}[data-disabled=true] .k-table{background:var(--color-gray-100)}[data-disabled=true] .k-table tbody td,[data-disabled=true] .k-table th{border-color:var(--color-gray-200)}[data-disabled=true] .k-table td:last-child{overflow:hidden;text-overflow:ellipsis}@media screen and (max-width:65em){.k-table tbody td:not([data-mobile]),.k-table thead th:not([data-mobile]){display:none}}.k-table-pagination.k-pagination{align-items:center;background:var(--color-gray-100);border-bottom-left-radius:var(--rounded);border-bottom-right-radius:var(--rounded);border-top:1px solid var(--color-gray-200);display:flex;height:var(--table-row-height);justify-content:space-between}.k-table-pagination.k-pagination .k-button{align-items:center;display:flex;height:var(--table-row-height);line-height:1;padding:0 .75rem}.k-table-update-status-cell{align-items:center;display:flex;height:100%;padding:0 .75rem}.k-table-update-status-cell-button,.k-table-update-status-cell-version{font-variant-numeric:tabular-nums}.k-table-update-status-cell-button{align-items:center;background:var(--color-gray-200);border-radius:var(--rounded);display:inline-flex;line-height:1;padding:.25rem 1.5rem .25rem .325rem}.k-table-update-status-cell-button .k-button-text:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #000;content:"";margin-top:-2px;position:absolute;right:.5rem;top:50%}.k-table-update-status-cell-button .k-icon{color:var(--theme)}.k-plugin-info{padding:1rem}.k-plugin-info div+div{margin-top:.5rem}.k-plugin-info dt{color:var(--color-gray-400);margin-right:.5rem}.k-plugin-info dd[data-theme]{color:var(--theme-light)}.k-plugin-info+.k-dropdown-item{border-top:1px solid var(--color-gray-700);padding-top:.75rem}@media screen and (min-width:30em){.k-plugin-info{width:20rem}.k-plugin-info div{display:flex}}.k-tabs{background:#e9e9e9;border:1px solid var(--color-border);border-radius:var(--rounded);position:relative}.k-tabs nav{display:flex;justify-content:center;margin-left:-1px;margin-right:-1px}.k-tab-button.k-button{align-items:center;border-left:1px solid transparent;border-right:1px solid var(--color-border);display:inline-flex;flex-direction:column;flex-grow:1;flex-shrink:1;font-size:var(--text-xs);font-weight:500;justify-content:center;max-width:15rem;padding:.625rem .75rem;position:relative;text-align:center;text-transform:uppercase;z-index:1}@media screen and (min-width:30em){.k-tab-button.k-button{flex-direction:row}.k-tab-button.k-button .k-icon{margin-right:.5rem}}.k-tab-button.k-button>.k-button-text{font-size:10px;max-width:10rem;opacity:1;overflow:hidden;padding-left:0;padding-top:.375rem;text-overflow:ellipsis}@media screen and (min-width:30em){.k-tab-button.k-button>.k-button-text{font-size:var(--text-xs);padding-top:0}}.k-tab-button:last-child{border-right:1px solid transparent}.k-tab-button[aria-current]{background:var(--color-background);border-right:1px solid var(--color-border);pointer-events:none;position:relative}.k-tab-button[aria-current]:first-child{border-left:1px solid var(--color-border)}.k-tab-button[aria-current]:after,.k-tab-button[aria-current]:before{content:"";position:absolute}.k-tab-button[aria-current]:before{background:var(--color-black);height:2px;left:-1px;right:-1px;top:-1px}.k-tab-button[aria-current]:after{background:var(--color-background);bottom:-1px;height:1px;left:0;right:0}.k-tabs-dropdown{right:0;top:100%}.k-tabs-badge{border-radius:2px;box-shadow:var(--shadow-md);font-size:10px;font-variant-numeric:tabular-nums;line-height:1.5;padding:0 .25rem;position:absolute;right:2px;top:3px}.k-tabs[data-theme=notice] .k-tabs-badge{background:var(--theme-light);color:var(--color-black)}.k-view{margin:0 auto;max-width:100rem;padding-left:1.5rem;padding-right:1.5rem}@media screen and (min-width:30em){.k-view{padding-left:3rem;padding-right:3rem}}@media screen and (min-width:90em){.k-view{padding-left:6rem;padding-right:6rem}}.k-view[data-align=center]{align-items:center;display:flex;height:100vh;justify-content:center;overflow:auto;padding:0 3rem}.k-view[data-align=center]>*{flex-basis:22.5rem}.k-fatal{align-items:center;background:var(--color-backdrop);bottom:0;display:flex;justify-content:center;left:0;padding:1.5rem;position:fixed;right:0;top:0;z-index:var(--z-fatal)}.k-fatal-box{background:var(--color-red-400);border-radius:var(--rounded);box-shadow:var(--shadow-xl);color:var(--color-black);display:flex;flex-direction:column;height:100%;width:100%}.k-fatal-box .k-headline{font-size:var(--text-sm);line-height:1;padding:.75rem}.k-fatal-box .k-button{padding:.75rem}.k-fatal-iframe{background:var(--color-white);border:0;flex-grow:1;width:100%}.k-icon{--size:1rem;align-items:center;display:flex;flex-shrink:0;font-size:var(--size);justify-content:center;line-height:0;position:relative}.k-icon[data-size=medium]{--size:2rem}.k-icon[data-size=large]{--size:3rem}.k-icon svg{height:var(--size);-moz-transform:scale(1);width:var(--size)}.k-icon svg *{fill:currentColor}.k-icon[data-back=black]{color:var(--color-white)}.k-icon[data-back=white]{color:var(--color-gray-900)}.k-icon[data-back=pattern]{color:var(--color-white)}[data-disabled=true] .k-icon[data-back=pattern] svg{opacity:1}.k-icon-emoji{display:block;font-size:var(--size);font-style:normal;line-height:1}@media not all,only screen and (min-resolution:192dpi),only screen and (min-resolution:2dppx){.k-icon-emoji{font-size:1.25em}}.k-icons{height:0;position:absolute;width:0}.k-image span{display:block;line-height:0;padding-bottom:100%;position:relative}.k-image img{bottom:0;height:100%;left:0;-o-object-fit:contain;object-fit:contain;position:absolute;right:0;top:0;width:100%}.k-image-error{color:var(--color-white);font-size:.9em;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.k-image-error svg *{fill:#ffffff4d}.k-image[data-cover=true] img{-o-object-fit:cover;object-fit:cover}.k-image[data-back=black] span{background:var(--color-gray-900)}.k-image[data-back=white] span{background:var(--color-white);color:var(--color-gray-900)}.k-image[data-back=white] .k-image-error{background:var(--color-gray-900);color:var(--color-white)}.k-image[data-back=pattern] span{background:var(--color-gray-800) var(--bg-pattern)}.k-loader{z-index:1}.k-loader-icon{animation:Spin .9s linear infinite}.k-notification{align-items:center;background:var(--color-gray-900);color:var(--color-white);display:flex;flex-shrink:0;line-height:1.25rem;padding:.75rem 1.5rem;width:100%}.k-notification[data-theme]{background:var(--theme-light);color:var(--color-black)}.k-notification p{word-wrap:break-word;flex-grow:1;overflow:hidden}.k-notification .k-button{display:flex;margin-left:1rem}.k-offline-warning{align-items:center;background:var(--color-backdrop);bottom:0;display:flex;justify-content:center;left:0;line-height:1;position:fixed;right:0;top:0;z-index:var(--z-offline)}.k-offline-warning p{align-items:center;background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);display:flex;gap:.5rem;padding:.75rem}.k-offline-warning p .k-icon{color:var(--color-red-400)}:root{--progress-height:var(--spacing-2);--progress-color-back:var(--color-gray-300);--progress-color-value:var(--color-focus)}progress{border-radius:var(--progress-height);display:block;height:var(--progress-height);overflow:hidden;width:100%}progress::-webkit-progress-bar{background:var(--progress-color-back)}progress::-webkit-progress-value{border-radius:var(--progress-height)}progress::-webkit-progress-value,progress:not([value])::-webkit-progress-bar{background:var(--progress-color-value)}.k-registration{align-items:center;display:flex;margin-right:1rem}.k-registration p{color:var(--color-negative-light);font-size:var(--text-sm);font-weight:600;margin-right:1rem}@media screen and (max-width:90em){.k-registration p{display:none}}.k-registration .k-button{color:var(--color-white)}.k-sort-handle{align-items:center;color:var(--color-gray-900);cursor:move;cursor:grab;cursor:-webkit-grab;display:flex;height:2rem;justify-content:center;line-height:0;transition:opacity .3s;width:2rem;will-change:opacity,color;z-index:1}.k-sort-handle svg{height:1rem;width:1rem}.k-sort-handle:active{cursor:grabbing;cursor:-webkit-grabbing}.k-status-icon svg{height:14px;width:14px}.k-status-icon .k-icon{color:var(--theme-light)}.k-status-icon .k-button-text{color:var(--color-black)}.k-status-icon[data-disabled=true]{opacity:1!important}.k-status-icon[data-disabled=true] .k-icon{color:var(--color-gray-400);opacity:.5}.k-user-info{align-items:center;display:flex;font-size:var(--text-sm);line-height:1}.k-user-info .k-icon,.k-user-info .k-image{margin-right:.75rem;width:1.5rem}.k-user-info .k-icon{background:var(--color-black);color:var(--color-white);height:1.5rem}.k-breadcrumb{padding-left:.5rem;padding-right:.5rem}.k-breadcrumb-dropdown{align-items:center;display:flex;height:2.5rem;justify-content:center;width:2.5rem}.k-breadcrumb ol{align-items:center;display:none}@media screen and (min-width:30em){.k-breadcrumb ol{display:flex}.k-breadcrumb-dropdown{display:none}}.k-breadcrumb-link{align-self:stretch;font-size:var(--text-sm);line-height:1.25rem;padding-bottom:.625rem;padding-top:.625rem}.k-breadcrumb li,.k-breadcrumb-link{align-items:center;display:flex;min-width:0}.k-breadcrumb li{flex-shrink:3}.k-breadcrumb li:last-child{flex-shrink:1}.k-breadcrumb li:not(:last-child):after{content:"/";flex-shrink:0;opacity:.5;padding-left:.5rem;padding-right:.5rem}.k-breadcrumb li:not(:first-child):not(:last-child){max-width:15vw}.k-breadcrumb-icon{margin-right:.5rem}.k-breadcrumb-icon.k-loader{opacity:.5}.k-breadcrumb-link-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.k-browser{container-type:inline-size;font-size:var(--text-sm)}.k-browser-items{--browser-item-gap:1px;--browser-item-size:1fr;--browser-item-height:var(--height-sm);--browser-item-padding:.25rem;--browser-item-rounded:var(--rounded);-moz-column-gap:var(--browser-item-gap);column-gap:var(--browser-item-gap);display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--browser-item-size),1fr));row-gap:var(--browser-item-gap)}.k-browser-item{align-items:center;border-radius:var(--browser-item-rounded);cursor:pointer;display:flex;flex-shrink:0;gap:.5rem;height:var(--browser-item-height);overflow:hidden;padding-left:calc(var(--browser-item-padding) + 1px);padding-right:calc(var(--browser-item-padding) + 1px);white-space:nowrap}.k-browser-item-image{aspect-ratio:1/1;border-radius:var(--rounded-sm);box-shadow:var(--shadow);height:calc(var(--browser-item-height) - var(--browser-item-padding)*2)}.js-has-pseudo [csstools-has-1a-2z-19-2q-36-33-3b-37-2t-36-19-2x-38-2t-31-19-2x-31-2p-2v-2t-1m-2w-2p-37-14-37-3a-2v-15]:not(does-not-exist){background:var(--color-white);box-shadow:none}.k-browser-item-image:has(svg){background:var(--color-white);box-shadow:none}.k-browser-item-image svg{transform:scale(.8)}.k-browser-item input{box-shadow:var(--shadow);opacity:0;position:absolute;width:0}.js-has-pseudo [csstools-has-1a-2z-19-2q-36-33-3b-37-2t-36-19-2x-38-2t-31-1m-2w-2p-37-14-2x-32-34-39-38-1m-2r-2w-2t-2r-2z-2t-2s-15]:not(.does-not-exist):not(does-not-exist){background:var(--color-blue-200);color:var(--color-blue-700)}.k-browser-item:has(input:checked){background:var(--color-blue-200);color:var(--color-blue-700)}button{background:none;border:0;color:currentColor;cursor:pointer;font-family:var(--font-sans);font-size:1rem;line-height:inherit}button::-moz-focus-inner{border:0;padding:0}.k-button{display:inline-block;font-size:var(--text-sm);position:relative;transition:color .3s}.k-button,.k-button:focus,.k-button:hover{outline:none}.k-button *{vertical-align:middle}.k-button[data-responsive=true] .k-button-text{display:none}@media screen and (min-width:30em){.k-button[data-responsive=true] .k-button-text{display:inline}}.k-button[data-theme]{color:var(--theme)}.k-button-icon{align-items:center;display:inline-flex;line-height:0}.k-button-icon~.k-button-text{padding-left:.5rem}.k-button-text{opacity:.75}.k-button:focus .k-button-text,.k-button:hover .k-button-text{opacity:1}.k-button-text b,.k-button-text span{vertical-align:baseline}.k-button[data-disabled=true]{cursor:default;opacity:.5;pointer-events:none}.k-card-options>.k-button[data-disabled=true]{display:inline-flex}.k-button-group{--padding-x:.75rem;--padding-y:1rem;--line-height:1rem;font-size:0;margin:0 calc(var(--padding-x)*-1)}.k-button-group>.k-dropdown{display:inline-block;height:calc(var(--line-height) + var(--padding-y)*2)}.k-button-group>.k-button,.k-button-group>.k-dropdown>.k-button{line-height:var(--line-height);padding:var(--padding-y) var(--padding-x)}.k-button-group .k-dropdown-content{margin:0 var(--padding-x);top:calc(100% + 1px)}.k-dropdown{position:relative}.k-dropdown-content{background:var(--color-black);border-radius:var(--rounded);box-shadow:var(--shadow-lg);color:var(--color-white);margin-bottom:6rem;position:absolute;text-align:left;top:100%;z-index:var(--z-dropdown)}.k-dropdown-content[data-align=left]{left:0}.k-dropdown-content[data-align=right]{right:0}.k-dropdown-content>.k-dropdown-item:first-child{margin-top:.5rem}.k-dropdown-content>.k-dropdown-item:last-child{margin-bottom:.5rem}.k-dropdown-content[data-dropup=true]{bottom:100%;margin-bottom:.5rem;top:auto}.k-dropdown-content hr{border-color:currentColor;margin:.5rem 1rem;opacity:.2}.k-dropdown-content[data-theme=light]{background:var(--color-white);color:var(--color-black)}.k-dropdown-item{align-items:center;display:flex;font-size:var(--text-sm);line-height:1;padding:6px 16px;white-space:nowrap;width:100%}.k-dropdown-item:focus{box-shadow:var(--shadow-outline);outline:none}.k-dropdown-item .k-button-figure{padding-right:.5rem;text-align:center}.k-file-browser{container-type:inline-size;overflow:hidden}.k-file-browser-layout{display:grid;grid-template-columns:minmax(10rem,15rem) 1fr}.k-file-browser-tree{border-right:1px solid var(--color-gray-300);padding:var(--spacing-2)}.k-file-browser-items{background:var(--color-gray-100);padding:var(--spacing-2)}.k-file-browser-back-button{display:none}@container (max-width: 30rem){.k-file-browser-layout{grid-template-columns:minmax(0,1fr);min-height:10rem}.k-file-browser-back-button{align-items:center;background:var(--color-gray-200);border-radius:var(--rounded);display:flex;height:var(--height-sm);margin-bottom:.5rem;padding-left:.25rem;padding-right:.25rem;width:100%}.k-file-browser-tree{border-right:0}.k-file-browser[data-view=files] .k-file-browser-tree,.k-file-browser[data-view=tree] .k-file-browser-items{display:none}}.k-link{outline:none}.k-options-dropdown,.k-options-dropdown-toggle{align-items:center;display:flex;height:38px;justify-content:center}.k-options-dropdown-toggle{min-width:38px;padding:0 .75rem}:root{--tree-color-back:var(--color-gray-200);--tree-color-hover-back:var(--color-gray-300);--tree-color-selected-back:var(--color-blue-200);--tree-color-selected-text:var(--color-black);--tree-color-text:var(--color-text-dimmed);--tree-level:0;--tree-indentation:.6rem}.k-tree-branch{align-items:center;display:flex;margin-bottom:1px;padding-left:calc(var(--tree-level)*var(--tree-indentation))}.js-has-pseudo [csstools-has-1a-2z-19-38-36-2t-2t-19-2q-36-2p-32-2r-2w-1m-2w-2p-37-14-17-w-1a-2z-19-38-36-2t-2t-15]:not(.does-not-exist){background:var(--tree-color-back);top:calc(var(--tree-level)*1.5rem);z-index:calc(100 - var(--tree-level))}.k-tree-branch:has(+.k-tree){background:var(--tree-color-back);top:calc(var(--tree-level)*1.5rem);z-index:calc(100 - var(--tree-level))}.k-tree-branch:hover,li[aria-current]>.k-tree-branch{--tree-color-text:var(--tree-color-selected-text);background:var(--tree-color-hover-back);border-radius:var(--rounded)}li[aria-current]>.k-tree-branch{background:var(--tree-color-selected-back)}.k-tree-toggle{--icon-size:12px;aspect-ratio:1/1;border-radius:var(--rounded-sm);display:grid;flex-shrink:0;margin-left:.25rem;padding:0;place-items:center;width:1rem}.k-tree-toggle:hover{background:rgba(0,0,0,.075)}.k-tree-toggle[disabled]{visibility:hidden}.k-tree-folder{align-items:center;border-radius:var(--rounded-sm);display:flex;font-size:var(--text-sm);gap:.325rem;height:var(--height-sm);line-height:1.25;min-width:3rem;padding-left:.25rem;padding-right:.25rem;width:100%}@container (max-width: 15rem){.k-tree{--tree-indentation:.375rem}.k-tree-folder{padding-left:.125rem;padding-right:.125rem}.k-tree-folder .k-icon{display:none}}.k-tree-folder>span{color:var(--tree-color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.k-pagination{align-items:center;direction:ltr;display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none}.k-pagination-details{white-space:nowrap}.js-has-pseudo .k-pagination-details:not([csstools-has-1m-2w-2p-37-14-17-w-1a-2z-19-2s-36-33-34-2s-33-3b-32-19-2r-33-32-38-2t-32-38-15]){cursor:default}.k-pagination-details:not(:has(+.k-dropdown-content)){cursor:default}.k-pagination[data-align]{text-align:var(--align)}.k-dropdown-content.k-pagination-selector{background:var(--color-black);left:50%;position:absolute;top:100%;transform:translate(-50%)}[dir=ltr] .k-dropdown-content.k-pagination-selector{direction:ltr}[dir=rtl] .k-dropdown-content.k-pagination-selector{direction:rtl}.k-pagination-settings{align-items:center;display:flex;justify-content:space-between}.k-pagination-settings label{align-items:center;border-right:1px solid hsla(0,0%,100%,.35);display:flex;font-size:var(--text-xs);padding:.625rem 1rem}.k-pagination-settings label span{margin-right:.5rem}.k-prev-next{direction:ltr}:root{--tag-color-back:var(--color-gray-900);--tag-color-text:var(--color-light);--tag-color-focus-back:var(--color-focus);--tag-color-focus-text:var(--color-white);--tag-color-disabled-back:var(--color-gray-600);--tag-color-disabled-text:var(--tag-color-text);--tag-rounded:var(--rounded);--tag-height:var(--height-sm)}.k-tag{align-items:center;background-color:var(--tag-color-back);border-radius:var(--tag-rounded);color:var(--tag-color-text);cursor:pointer;display:flex;font-size:var(--text-sm);height:var(--tag-height);justify-content:space-between;line-height:1;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.k-tag:focus{background-color:var(--tag-color-focus-back);color:var(--tag-color-focus-text);outline:0}.k-tag-text{line-height:var(--leading-tight);padding-left:.75rem;padding-right:.75rem}.k-tag-toggle{height:var(--tag-height);width:var(--tag-height)}.js-has-pseudo [csstools-has-1a-2z-19-38-2p-2v-1m-2w-2p-37-14-1a-2z-19-38-2p-2v-19-38-33-2v-2v-30-2t-15-w-1a-2z-19-38-2p-2v-19-38-2t-3c-38]:not(.does-not-exist):not(.does-not-exist){padding-right:.125rem}.k-tag:has(.k-tag-toggle) .k-tag-text{padding-right:.125rem}[data-disabled=true] .k-tag{background-color:var(--tag-color-disabled-back);color:var(--tag-color-disabled-text)}[data-disabled=true] .k-tag .k-tag-toggle{display:none}.k-topbar{--bg:var(--color-gray-900);background:var(--bg);color:var(--color-white);flex-shrink:0;height:2.5rem;line-height:1;position:relative}.k-topbar-wrapper{align-items:center;display:flex;margin-left:-.75rem;margin-right:-.75rem;position:relative}.k-topbar-wrapper:after{background:var(--bg);content:"";height:2.5rem;left:100%;position:absolute;width:3rem}.k-topbar-menu{flex-shrink:0}.k-topbar-menu ul{padding:.5rem 0}.k-topbar .k-button[data-theme]{color:var(--theme-light)}.k-topbar .k-button-text{opacity:1}.k-topbar-menu-button{align-items:center;display:flex}.k-topbar-menu .k-link[aria-current]{color:var(--color-focus);font-weight:500}.k-topbar-button{font-size:var(--text-sm);line-height:1;padding:.75rem}.k-topbar-button .k-button-text{display:flex}.k-topbar-view-button{align-items:center;display:flex;flex-shrink:0;padding-right:0}.k-topbar-view-button .k-icon{margin-right:.5rem}.k-topbar-signals{align-items:center;background:var(--bg);display:flex;height:2.5rem;position:absolute;right:0;top:0}.k-topbar-signals:before{background:-webkit-linear-gradient(inline-start,hsla(0,0%,7%,0),#111);bottom:0;content:"";position:absolute;top:-.5rem;width:.5rem}.k-topbar-signals .k-button{line-height:1}.k-topbar-notification{display:flex;font-weight:var(--font-bold);line-height:1}@media screen and (max-width:30em){.k-topbar .k-button[data-theme=negative] .k-button-text{display:none}}.k-section,.k-sections{padding-bottom:3rem}.k-section-header{align-items:baseline;display:flex;position:relative;z-index:1}.k-section-header .k-headline{flex-grow:1;line-height:1.25rem;min-height:2rem;overflow:hidden;padding-right:var(--spacing-3);text-overflow:ellipsis;white-space:nowrap}.k-section-header .k-button-group{position:absolute;right:0;top:calc(-.5rem - 1px)}.k-section-header .k-button-group>.k-button{display:inline-flex;padding:.75rem}.k-fields-issue-headline{margin-bottom:.5rem}.k-fields-section input[type=submit]{display:none}[data-locked=true] .k-fields-section{opacity:.2;pointer-events:none}.k-models-section[data-processing=true]{pointer-events:none}.k-models-section-search.k-input{background:var(--color-gray-300);border-radius:var(--rounded);font-size:var(--text-sm);height:var(--field-input-height);margin-bottom:var(--spacing-3);padding:var(--spacing-2) var(--spacing-3)}.k-info-section-label{margin-bottom:.5rem}:root{--code-color-back:var(--color-black);--code-color-icon:var(--color-gray-500);--code-color-text:var(--color-gray-200,#fff);--code-font-family:var(--font-mono);--code-font-size:1em}.k-code,.k-text pre{background:var(--code-color-back);border-radius:var(--rounded,.5rem);color:var(--code-color-text);display:block;font-family:var(--code-font-family);font-size:var(--code-font-size);line-height:1.5;max-width:100%;overflow-x:auto;overflow-y:hidden;padding:.75rem;position:relative;-moz-tab-size:2;-o-tab-size:2;tab-size:2;white-space:nowrap}.k-code:not(code),.k-text pre{white-space:pre-wrap}.k-code:before{background:var(--code-color-back);border-radius:var(--rounded,.5rem);content:attr(data-language);font-size:calc(var(--text-xs)*.75);padding:.5rem .5rem .25rem .25rem;position:absolute;right:0;top:0}.k-headline{--size:var(--text-base);font-size:var(--size);font-weight:var(--font-bold);line-height:1.5em}.k-headline[data-size=small]{--size:var(--text-sm)}.k-headline[data-size=large]{--size:var(--text-xl);font-weight:var(--font-normal)}@media screen and (min-width:65em){.k-headline[data-size=large]{--size:var(--text-2xl)}}.k-headline[data-size=huge]{--size:var(--text-2xl);line-height:1.15em}@media screen and (min-width:65em){.k-headline[data-size=huge]{--size:var(--text-3xl)}}.k-headline[data-theme]{color:var(--theme)}.k-headline abbr{color:var(--color-gray-500);padding-left:.25rem;text-decoration:none}.k-text{line-height:1.5em}.k-text ol,.k-text ul{margin-left:1rem}.k-text li{list-style:inherit}.k-text p,.k-text>ol,.k-text>ul{margin-bottom:1.5em}.k-text a{text-decoration:underline}.k-text>:last-child{margin-bottom:0}.k-text[data-size=tiny]{font-size:var(--text-xs)}.k-text[data-size=small]{font-size:var(--text-sm)}.k-text[data-size=medium]{font-size:var(--text-base)}.k-text[data-size=large]{font-size:var(--text-xl)}.k-text[data-align]{text-align:var(--align)}.k-text[data-theme=help]{color:var(--color-gray-600);font-size:var(--text-sm);line-height:1.25rem}.k-dialog-body .k-text{word-wrap:break-word}.k-user-profile{background:var(--color-white)}.k-user-profile>.k-view{align-items:center;display:flex;line-height:0;padding-bottom:3rem;padding-top:3rem}.k-user-profile .k-button-group{margin-left:.75rem;overflow:hidden}.k-user-profile .k-button-group .k-button{display:block;overflow:hidden;padding-bottom:.25rem;padding-top:.25rem;white-space:nowrap}.k-user-view-image .k-icon,.k-user-view-image .k-image{border-radius:var(--rounded);height:5rem;line-height:0;overflow:hidden;width:5rem}.k-user-view-image[data-disabled=true]{opacity:1}.k-user-view-image .k-image{display:block}.k-user-view-image .k-button-text{opacity:1}.k-user-name-placeholder{color:var(--color-gray-500);transition:color .3s}.k-header[data-editable=true] .k-user-name-placeholder:hover{color:var(--color-gray-900)}.k-error-view{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.k-error-view-content{line-height:1.5em;max-width:25rem;text-align:center}.k-error-view-icon{color:var(--color-negative);display:inline-block}.k-error-view-content p:not(:last-child){margin-bottom:.75rem}.k-installation-view .k-button{display:block;margin-top:1.5rem}.k-installation-view .k-headline{margin-bottom:.75rem}.k-installation-issues{font-size:var(--text-sm);line-height:1.5em}.k-installation-issues li{background:var(--color-white);padding:1.5rem 1.5rem 1.5rem 3.5rem;position:relative}.k-installation-issues .k-icon{left:1.5rem;position:absolute;top:calc(1.5rem + 2px)}.k-installation-issues .k-icon svg *{fill:var(--color-negative)}.k-installation-issues li:not(:last-child){margin-bottom:2px}.k-installation-issues li code{color:var(--color-negative);font:inherit}.k-installation-view .k-button[type=submit]{margin-left:-1rem;padding:1rem}.k-language-view section+section{margin-top:var(--spacing-6)}.k-languages-view .k-header{margin-bottom:1.5rem}.k-languages-view-section-header{margin-bottom:.5rem}.k-languages-view-section{margin-bottom:3rem}.k-login-fields{position:relative}.k-login-toggler{font-size:.875rem;position:absolute;right:0;text-decoration:underline;top:0;z-index:1}.k-login-form label abbr{visibility:hidden}.k-login-buttons{align-items:center;display:flex;justify-content:flex-end;padding:1.5rem 0}.k-login-button{font-weight:500;margin-right:-1rem;padding:.5rem 1rem;transition:opacity .3s}.k-login-button span{opacity:1}.k-login-button[disabled]{opacity:.25}.k-login-back-button,.k-login-checkbox{align-items:center;display:flex;flex-grow:1}.k-login-back-button{margin-left:-1rem}.k-login-checkbox{cursor:pointer;font-size:var(--text-sm);padding:.5rem 0}.k-login-checkbox .k-checkbox-text{opacity:.75;transition:opacity .3s}.k-login-checkbox:focus span,.k-login-checkbox:hover span{opacity:1}.k-password-reset-view .k-user-info{background:var(--color-white);border-radius:var(--rounded-xs);box-shadow:var(--shadow);height:38px;margin-bottom:2.25rem;padding:.5rem}.k-search-view .k-header{margin-bottom:var(--spacing-6)}.k-search-view-layout{display:grid;row-gap:1.5rem}.k-search-view-types nav{background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);display:flex;flex-direction:column;gap:2px;padding:var(--spacing-1)}.k-search-view-type{align-items:center;border-radius:var(--rounded-sm);display:flex;height:var(--height-sm);padding-left:var(--spacing-2);padding-right:var(--spacing-2)}.k-search-view-type[aria-current]{background:var(--color-blue-200)}.k-search-view-input{background:var(--color-gray-300);border:none;border-radius:var(--rounded);font:inherit;padding:var(--spacing-3);width:100%}@media (min-width:50rem){.k-search-view-layout{-moz-column-gap:3rem;column-gap:3rem;grid-template-areas:"types input" "types results";grid-template-columns:15rem 1fr;grid-template-rows:var(--height-lg) 1fr}.k-search-view-types{grid-area:types}.k-search-view-input{grid-area:input}}.k-system-view .k-header{margin-bottom:1.5rem}.k-system-view-section-header{display:flex;justify-content:space-between;margin-bottom:.5rem}.k-system-view-section{margin-bottom:3rem}.k-system-info .k-stat-label{color:var(--theme,var(--color-black))}:root{--color-backdrop:rgba(0,0,0,.6);--color-black:#000;--color-dark:#313740;--color-light:var(--color-gray-200);--color-white:#fff;--color-gray-100:#f7f7f7;--color-gray-200:#efefef;--color-gray-300:#ddd;--color-gray-400:#ccc;--color-gray-500:#999;--color-gray-600:#777;--color-gray-700:#555;--color-gray-800:#333;--color-gray-900:#111;--color-gray:var(--color-gray-600);--color-red-200:#edc1c1;--color-red-300:#e3a0a0;--color-red-400:#d16464;--color-red-600:#ce1f1f;--color-red:var(--color-red-600);--color-orange-200:#f2d4bf;--color-orange-300:#ebbe9e;--color-orange-400:#de935f;--color-orange-600:#f4861f;--color-orange:var(--color-orange-600);--color-yellow-200:#f9e8c7;--color-yellow-300:#f7e2b8;--color-yellow-400:#f0c674;--color-yellow-600:#cca000;--color-yellow:var(--color-yellow-600);--color-green-200:#dce5c2;--color-green-300:#c6d49d;--color-green-400:#a7bd68;--color-green-600:#678f00;--color-green:var(--color-green-600);--color-aqua-200:#d0e5e2;--color-aqua-300:#bbd9d5;--color-aqua-400:#8abeb7;--color-aqua-600:#398e93;--color-aqua:var(--color-aqua-600);--color-blue-200:#cbd7e5;--color-blue-300:#b1c2d8;--color-blue-400:#7e9abf;--color-blue-600:#4271ae;--color-blue:var(--color-blue-600);--color-purple-200:#e0d4e4;--color-purple-300:#d4c3d9;--color-purple-400:#b294bb;--color-purple-600:#9c48b9;--color-purple:var(--color-purple-600);--container:80rem;--font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--font-mono:"SFMono-Regular",Consolas,Liberation Mono,Menlo,Courier,monospace;--font-normal:400;--font-bold:600;--font-bolder:800;--height-2xs:1.375rem;--height-xs:1.5rem;--height-sm:1.75rem;--height-md:2rem;--height-lg:2.25rem;--height-xl:2.5rem;--height:var(--height-md);--leading-none:1;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--leading-loose:2;--rounded-xs:1px;--rounded-sm:.125rem;--rounded:.25rem;--rounded-md:.375rem;--shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06);--shadow-md:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);--shadow-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05);--shadow-xl:0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04);--shadow-outline:currentColor 0 0 0 2px;--shadow-inset:inset 0 2px 4px 0 rgba(0,0,0,.06);--spacing-0:0;--spacing-px:1px;--spacing-2px:2px;--spacing-1:.25rem;--spacing-2:.5rem;--spacing-3:.75rem;--spacing-4:1rem;--spacing-5:1.25rem;--spacing-6:1.5rem;--spacing-8:2rem;--spacing-10:2.5rem;--spacing-12:3rem;--spacing-16:4rem;--spacing-20:5rem;--spacing-24:6rem;--spacing-36:9rem;--text-xs:.75rem;--text-sm:.875rem;--text-base:1rem;--text-lg:1.125rem;--text-xl:1.25rem;--text-2xl:1.5rem;--text-3xl:1.75rem;--text-4xl:2.5rem;--text-5xl:3rem;--text-6xl:4rem;--color-background:var(--color-light);--color-border:var(--color-gray-400);--color-focus:var(--color-blue-600);--color-focus-light:var(--color-blue-400);--color-focus-outline:rgba(113,143,183,.25);--color-negative:var(--color-red-600);--color-negative-light:var(--color-red-400);--color-negative-outline:hsla(0,54%,63%,.25);--color-notice:var(--color-orange-600);--color-notice-light:var(--color-orange-400);--color-positive:var(--color-green-600);--color-positive-light:var(--color-green-400);--color-positive-outline:rgba(128,149,65,.25);--color-text:var(--color-gray-900);--color-text-light:var(--color-gray-600);--z-offline:1200;--z-fatal:1100;--z-loader:1000;--z-notification:900;--z-dialog:800;--z-navigation:700;--z-dropdown:600;--z-drawer:500;--z-dropzone:400;--z-toolbar:300;--z-content:200;--z-background:100;--bg-pattern:repeating-conic-gradient(transparent 0% 25%,rgba(0,0,0,.1) 0% 50%) 50% /20px 20px;--shadow-sticky:rgba(0,0,0,.05) 0 2px 5px;--shadow-dropdown:var(--shadow-lg);--shadow-item:var(--shadow);--field-input-padding:.5rem;--field-input-height:2.25rem;--field-input-line-height:1.25rem;--field-input-font-size:var(--text-base);--field-input-color-before:var(--color-gray-700);--field-input-color-after:var(--color-gray-700);--field-input-border:1px solid var(--color-border);--field-input-focus-border:1px solid var(--color-focus);--field-input-focus-outline:2px solid var(--color-focus-outline);--field-input-invalid-border:1px solid var(--color-negative-outline);--field-input-invalid-outline:0;--field-input-invalid-focus-border:1px solid var(--color-negative);--field-input-invalid-focus-outline:2px solid var(--color-negative-outline);--field-input-background:var(--color-white);--field-input-disabled-color:var(--color-gray-500);--field-input-disabled-background:var(--color-white);--field-input-disabled-border:1px solid var(--color-gray-300);--font-family-sans:var(--font-sans);--font-family-mono:var(--font-mono);--font-size-tiny:var(--text-xs);--font-size-small:var(--text-sm);--font-size-medium:var(--text-base);--font-size-large:var(--text-xl);--font-size-huge:var(--text-2xl);--font-size-monster:var(--text-3xl);--box-shadow-dropdown:var(--shadow-dropdown);--box-shadow-item:var(--shadow);--box-shadow-focus:var(--shadow-xl)}*,:after,:before{box-sizing:border-box;margin:0;padding:0}noscript{align-items:center;display:flex;height:100vh;justify-content:center;padding:1.5rem;text-align:center}html{background:var(--color-background);font-family:var(--font-sans)}body,html{color:var(--color-gray-900);height:100%;overflow:hidden}a{color:inherit;text-decoration:none}li{list-style:none}b,strong{font-weight:var(--font-bold)}@keyframes LoadingCursor{to{cursor:progress}}@keyframes Spin{to{transform:rotate(1turn)}}[data-align=left]{--align:start}[data-align=center]{--align:center}[data-align=right]{--align:end}[data-invalid=true]{border:1px solid var(--color-negative-outline);box-shadow:var(--color-negative-outline) 0 0 3px 2px}[data-invalid=true]:focus-within{border:var(--field-input-invalid-focus-border)!important;box-shadow:var(--color-negative-outline) 0 0 0 2px!important}[data-tabbed=true]{border-radius:var(--rounded);box-shadow:var(--shadow-outline)}[data-theme=positive],[data-theme=success]{--theme:var(--color-positive);--theme-light:var(--color-positive-light);--theme-bg:var(--color-green-300)}[data-theme=error],[data-theme=negative]{--theme:var(--color-negative);--theme-light:var(--color-negative-light);--theme-bg:var(--color-red-300)}[data-theme=notice]{--theme:var(--color-notice);--theme-light:var(--color-notice-light);--theme-bg:var(--color-orange-300)}[data-theme=info]{--theme:var(--color-focus);--theme-light:var(--color-focus-light);--theme-bg:var(--color-blue-200)}.scroll-x,.scroll-x-auto,.scroll-y,.scroll-y-auto{-webkit-overflow-scrolling:touch;transform:translateZ(0)}.scroll-x{overflow-x:scroll;overflow-y:hidden}.scroll-x-auto{overflow-x:auto;overflow-y:hidden}.scroll-y{overflow-x:hidden;overflow-y:scroll}.scroll-y-auto{overflow-x:hidden;overflow-y:auto}.input-hidden{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:0;opacity:0;position:absolute;width:0}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px} diff --git a/panel/dist/img/icons.svg b/panel/dist/img/icons.svg index 437d89501f..5591c8861c 100644 --- a/panel/dist/img/icons.svg +++ b/panel/dist/img/icons.svg @@ -12,6 +12,9 @@ + + + diff --git a/panel/dist/js/index.js b/panel/dist/js/index.js index 95e641a9ba..523b0466f0 100644 --- a/panel/dist/js/index.js +++ b/panel/dist/js/index.js @@ -1 +1 @@ -import{v as t,I as e,P as n,S as s,F as i,N as o,s as l,l as r,w as a,c as u,e as c,t as d,a as p,b as h,d as m,f,g,k,D as b,h as v,E as y,i as $,j as w,m as _,T as x,u as C,n as S,o as O,r as A,p as I,q as M,x as T,y as j,z as E,A as D,B as L,V as B,C as P}from"./vendor.js";const N={},F=function(t,e,n){if(!e||0===e.length)return t();const s=document.getElementsByTagName("link");return Promise.all(e.map((t=>{if((t=function(t){return"/"+t}(t))in N)return;N[t]=!0;const e=t.endsWith(".css"),i=e?'[rel="stylesheet"]':"";if(!!n)for(let n=s.length-1;n>=0;n--){const i=s[n];if(i.href===t&&(!e||"stylesheet"===i.rel))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;const o=document.createElement("link");return o.rel=e?"stylesheet":"modulepreload",e||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),e?new Promise(((e,n)=>{o.addEventListener("load",e),o.addEventListener("error",(()=>n(new Error(`Unable to preload CSS for ${t}`))))})):void 0}))).then((()=>t()))},q={created(){this.$panel.events.subscribe(),this.$panel.plugins.created.forEach((t=>{t(this)})),this.$panel.events.on("popstate",(()=>{this.$panel.open(window.location.href)})),this.$panel.events.on("drop",(()=>{this.$panel.drag.stop()})),this.$store.dispatch("content/init")},destroyed(){this.$panel.events.unsubscribe()},render(t){if(this.$panel.view.component)return t(this.$panel.view.component,{key:this.$panel.view.component,props:this.$panel.view.props})}};function R(t,e,n,s,i,o,l,r){var a,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),s&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),l?(a=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(l)},u._ssrRegister=a):i&&(a=r?function(){i.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:i),a)if(u.functional){u._injectStyles=a;var c=u.render;u.render=function(t,e){return a.call(e),c(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,a):[a]}return{exports:t,options:u}}const z=R({},(function(){return(0,this._self._c)("div",{staticClass:"k-dialog-body scroll-y-auto"},[this._t("default")],2)}),[],!1,null,null,null,null).exports;function Y(t){if(void 0!==t)return JSON.parse(JSON.stringify(t))}function H(t){return"object"==typeof t&&(null==t?void 0:t.constructor)===Object}function U(t){return Object.keys(t||{}).length}function K(t){return Object.keys(t).reduce(((e,n)=>(e[n.toLowerCase()]=t[n],e)),{})}const V={clone:Y,isEmpty:function(t){return null==t||""===t||(!(!H(t)||0!==U(t))||0===t.length)},isObject:H,length:U,merge:function t(e,n){for(const s of Object.keys(n))n[s]instanceof Object&&Object.assign(n[s],t(e[s]||{},n[s]));return Object.assign(e||{},n),e},toLowerKeys:K},W={props:{cancelButton:{default:!0,type:[Boolean,String,Object]},disabled:{default:!1,type:Boolean},icon:{default:"check",type:String},submitButton:{type:[Boolean,String,Object],default:!0},theme:{default:"positive",type:String}}};const J=R({mixins:[W],computed:{buttons(){return[this.button(this.cancelButton,{click:()=>{this.$emit("cancel")},class:"k-dialog-button-cancel",icon:"cancel",text:this.$t("cancel")}),this.button(this.submitButton,{class:"k-dialog-button-submit",disabled:this.disabled,icon:this.icon,text:this.$t("confirm"),theme:this.theme,type:"submit"})].filter((t=>!1!==t))}},methods:{button:(t,e)=>"string"==typeof t?{...e,text:t}:!1!==t&&(!1===H(t)?e:{...e,...t})}},(function(){return(0,this._self._c)("k-button-group",{staticClass:"k-dialog-buttons",attrs:{buttons:this.buttons}})}),[],!1,null,null,null,null).exports,G={props:{empty:{default:()=>window.panel.$t("dialog.fields.empty"),type:String},fields:{default:()=>[],type:[Array,Object]},novalidate:{default:!0,type:Boolean},value:{default:()=>({}),type:Object}}};const Z=R({mixins:[G],computed:{hasFields(){return this.$helper.object.length(this.fields)>0}}},(function(){var t=this,e=t._self._c;return t.hasFields?e("k-fieldset",{staticClass:"k-dialog-fields",attrs:{novalidate:t.novalidate,fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports;const Q=R({},(function(){return(0,this._self._c)("footer",{staticClass:"k-dialog-footer"},[this._t("default")],2)}),[],!1,null,null,null,null).exports;const X=R({},(function(){var t=this,e=t._self._c;return"dialog"===t.$panel.notification.context?e("k-notification",{staticClass:"k-dialog-notification"}):t._e()}),[],!1,null,null,null,null).exports;const tt=R({props:{autofocus:{default:!0,type:Boolean},placeholder:{default:()=>window.panel.$t("search")+" …",type:String},value:{type:String}}},(function(){var t=this;return(0,t._self._c)("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:t.autofocus,placeholder:t.placeholder,value:t.value,icon:"search",type:"text"},on:{input:function(e){return t.$emit("search",e)}}})}),[],!1,null,null,null,null).exports,et={props:{empty:{type:String,default:()=>window.panel.$t("dialog.text.empty")},text:{type:String}}};const nt=R({mixins:[et]},(function(){var t=this,e=t._self._c;return t.text?e("k-text",{attrs:{html:t.text}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports,st={install(t){t.component("k-dialog-body",z),t.component("k-dialog-buttons",J),t.component("k-dialog-fields",Z),t.component("k-dialog-footer",Q),t.component("k-dialog-notification",X),t.component("k-dialog-search",tt),t.component("k-dialog-text",nt)}},it={mixins:[W],props:{size:{default:"default",type:String},visible:{default:!1,type:Boolean}},methods:{cancel(){this.$panel.dialog.cancel()},close(){this.$panel.dialog.close()},error(t){this.$panel.dialog.error(t)},focus(t){this.$panel.dialog.focus(t)},hide(){this.$refs.dialog.hide()},input(t){this.$panel.dialog.input(t)},open(){this.$panel.dialog.open(this)},ready(){this.$panel.dialog.emit("ready")},show(){this.$refs.dialog.show()},submit(){this.$panel.dialog.submit(this.$panel.value)},success(t){this.$panel.dialog.success(t)}}};const ot=R({mixins:[it]},(function(){var t=this,e=t._self._c;return e("k-overlay",{ref:"dialog",attrs:{centered:!0,dimmed:!0,visible:t.visible,type:"dialog"},on:{cancel:t.cancel,ready:t.ready}},[e("form",{staticClass:"k-dialog",class:t.$vnode.data.staticClass,attrs:{"data-size":t.size,method:"dialog"},on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[e("k-dialog-notification"),e("k-dialog-body",[t._t("default")],2),t._t("footer",(function(){return[t.cancelButton||t.submitButton?e("k-dialog-footer",[e("k-dialog-buttons",{attrs:{"cancel-button":t.cancelButton,disabled:t.disabled,icon:t.icon,"submit-button":t.submitButton,theme:t.theme},on:{cancel:t.cancel,submit:t.submit}})],1):t._e()]}))],2)])}),[],!1,null,null,null,null).exports;const lt=R({mixins:[it],props:{details:[Object,Array],message:String,size:{default:"medium",type:String}},computed:{detailsList(){return Array.fromObject(this.details)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-error-dialog",attrs:{"cancel-button":!1,"submit-button":!1,size:t.size,visible:t.visible}},[e("k-text",[t._v(t._s(t.message))]),t.detailsList.length?e("dl",{staticClass:"k-error-details"},[t._l(t.detailsList,(function(n,s){return[e("dt",{key:"detail-label-"+s},[t._v(" "+t._s(n.label)+" ")]),e("dd",{key:"detail-message-"+s},["object"==typeof n.message?[e("ul",t._l(n.message,(function(n,s){return e("li",{key:s},[t._v(" "+t._s(n)+" ")])})),0)]:[t._v(" "+t._s(n.message)+" ")]],2)]}))],2):t._e()],1)}),[],!1,null,null,null,null).exports;const rt=R({},(function(){var t=this;return(0,t._self._c)(t.$panel.dialog.component,t._b({key:t.$panel.dialog.timestamp,ref:"dialog",tag:"component",attrs:{disabled:t.$panel.dialog.isLoading,visible:!0}},"component",t.$panel.dialog.props,!1))}),[],!1,null,null,null,null).exports,at=(t,e)=>{let n=null;return function(){clearTimeout(n),n=setTimeout((()=>t.apply(this,arguments)),e)}},ut={data:()=>({models:[],issue:null,selected:{},options:{endpoint:null,max:null,multiple:!0,parent:null,selected:[],search:!0},search:null,pagination:{limit:20,page:1,total:0}}),computed:{checkedIcon(){return!0===this.multiple?"check":"circle-filled"},collection(){return{empty:this.emptyProps,items:this.items,link:!1,layout:"list",pagination:{details:!0,dropdown:!1,align:"center",...this.pagination},sortable:!1}},items(){return this.models.map(this.item)},multiple(){return!0===this.options.multiple&&1!==this.options.max}},watch:{search(){this.updateSearch()}},created(){this.updateSearch=at(this.updateSearch,200)},methods:{async fetch(){const t={page:this.pagination.page,search:this.search,...this.fetchData||{}};try{const e=await this.$api.get(this.options.endpoint,t);this.models=e.data,this.pagination=e.pagination,this.onFetched&&this.onFetched(e)}catch(e){this.$panel.error(e,!1),this.models=[],this.issue=e.message}},async open(t,e){this.pagination.page=0,this.search=null;let n=!0;Array.isArray(t)?(this.models=t,n=!1):(this.models=[],e=t),this.options={...this.options,...e},this.selected={},this.options.selected.forEach((t=>{Vue.set(this.selected,t,{id:t})})),n&&await this.fetch(),this.$refs.dialog.open()},paginate(t){this.pagination.page=t.page,this.pagination.limit=t.limit,this.fetch()},submit(){this.$emit("submit",Object.values(this.selected)),this.$refs.dialog.close()},isSelected(t){return void 0!==this.selected[t.id]},item:t=>t,toggle(t){!1!==this.options.multiple&&1!==this.options.max||(this.selected={}),!0!==this.isSelected(t)?this.options.max&&this.options.max<=U(this.selected)||Vue.set(this.selected,t.id,t):this.$delete(this.selected,t.id)},toggleBtn(t){const e=this.isSelected(t);return{icon:e?this.checkedIcon:"circle-outline",tooltip:e?this.$t("remove"):this.$t("select"),theme:e?"positive":null}},updateSearch(){this.pagination.page=0,this.fetch()}}};const ct=R({mixins:[ut],computed:{emptyProps(){return{icon:"image",text:this.$t("dialog.files.empty")}}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-files-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[e("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.options.search?e("k-dialog-search",{attrs:{value:t.search},on:{search:function(e){t.search=e}}}):t._e(),e("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:n}){return[e("k-button",t._b({on:{click:function(e){return t.toggle(n)}}},"k-button",t.toggleBtn(n),!1))]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,null,null,null,null).exports;const dt=R({mixins:[it,G],props:{size:{default:"medium",type:String},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("save")},text:{type:String}},data(){return{model:this.value}},watch:{value(t){this.model=t}},methods:{input(t){this.model=t,this.$panel.dialog.input(t)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:t.cancel,submit:t.submit}},"k-dialog",t.$props,!1),[t._t("default",(function(){return[t.text?e("k-dialog-text",{attrs:{text:t.text}}):t._e(),e("k-dialog-fields",{attrs:{fields:t.fields,novalidate:t.novalidate,value:t.model},on:{input:t.input,submit:t.submit}})]}))],2)}),[],!1,null,null,null,null).exports;const pt=R({extends:dt,watch:{"model.name"(t){this.fields.code.disabled||this.onNameChanges(t)},"model.code"(t){this.fields.code.disabled||(this.model.code=this.$helper.slug(t,[this.$panel.system.ascii]),this.onCodeChanges(this.model.code))}},methods:{onCodeChanges(t){if(!t)return this.model.locale=null;if(t.length>=2)if(-1!==t.indexOf("-")){let e=t.split("-"),n=[e[0],e[1].toUpperCase()];this.model.locale=n.join("_")}else{let e=this.$panel.system.locales??[];this.model.locale=null==e?void 0:e[t]}},onNameChanges(t){this.model.code=this.$helper.slug(t,[this.model.rules,this.$panel.system.ascii]).substr(0,2)}}},null,null,!1,null,null,null,null).exports;const ht=R({mixins:[dt],props:{blueprints:{type:Array},size:{default:"medium",type:String},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("save")},template:{type:String}},data(){return{model:this.value}},computed:{templates(){return this.blueprints.map((t=>({text:t.title,value:t.name})))}},methods:{pick(t){this.$panel.dialog.reload({query:{...this.$panel.dialog.query,slug:this.value.slug,template:t,title:this.value.title}})}}},(function(){var t=this,e=t._self._c;return e("k-form-dialog",t._b({ref:"dialog",staticClass:"k-page-create-dialog",on:{cancel:t.cancel,submit:t.submit}},"k-form-dialog",t.$props,!1),[t.templates.length>1?e("k-select-field",{staticClass:"k-page-template-switch",attrs:{empty:!1,label:t.$t("template"),options:t.templates,required:!0,value:t.template},on:{input:function(e){return t.pick(e)}}}):t._e(),e("k-dialog-fields",{attrs:{fields:t.fields,novalidate:t.novalidate,value:t.value},on:{input:t.input,submit:t.submit}})],1)}),[],!1,null,null,null,null).exports;const mt=R({mixins:[it],methods:{select(t){this.$panel.dialog.input({parent:t.id})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-page-move-dialog",attrs:{"submit-button":{icon:"road-sign",text:t.$t("move")},size:"medium"}},"k-dialog",t.$props,!1),[e("k-headline",[t._v(t._s(t.$t("page.move")))]),e("div",{staticClass:"k-page-move-parent",attrs:{tabindex:"0","data-autofocus":""}},[e("k-page-tree",{attrs:{current:t.$panel.dialog.value.parent,identifier:"id"},on:{select:t.select}})],1)],1)}),[],!1,null,null,null,null).exports;const ft=R({mixins:[ut],data(){const t=ut.data();return{...t,model:{title:null,parent:null},options:{...t.options,parent:null}}},computed:{emptyProps(){return{icon:"page",text:this.$t("dialog.pages.empty")}},fetchData(){return{parent:this.options.parent}}},methods:{back(){this.options.parent=this.model.parent,this.pagination.page=1,this.fetch()},go(t){this.options.parent=t.id,this.pagination.page=1,this.fetch()},onFetched(t){this.model=t.model}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-pages-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[e("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.model?e("header",{staticClass:"k-pages-dialog-navbar"},[e("k-button",{attrs:{disabled:!t.model.id,tooltip:t.$t("back"),icon:"angle-left"},on:{click:t.back}}),e("k-headline",[t._v(t._s(t.model.title))])],1):t._e(),t.options.search?e("k-dialog-search",{attrs:{value:t.search},on:{search:function(e){t.search=e}}}):t._e(),e("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:n}){return[e("k-button",t._b({on:{click:function(e){return t.toggle(n)}}},"k-button",t.toggleBtn(n),!1)),t.model?e("k-button",{attrs:{disabled:!n.hasChildren,tooltip:t.$t("open"),icon:"angle-right"},on:{click:function(e){return e.stopPropagation(),t.go(n)}}}):t._e()]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,null,null,null,null).exports;const gt=R({mixins:[{mixins:[it,et]}]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:t.cancel,submit:t.submit}},"k-dialog",t.$props,!1),[t._t("default",(function(){return[e("k-dialog-text",{attrs:{text:t.text}})]}))],2)}),[],!1,null,null,null,null).exports;const kt=R({mixins:[gt],props:{icon:{default:"trash",type:String},submitButton:{default:()=>window.panel.$t("delete"),type:String},theme:{default:"negative",type:String}}},(function(){var t=this;return(0,t._self._c)("k-text-dialog",t._b({ref:"dialog",on:{cancel:t.cancel,submit:t.submit}},"k-text-dialog",t.$props,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const bt=R({mixins:[it],data(){return{isLoading:!1,items:[],pagination:{},q:null,selected:-1,type:this.$panel.view.search}},computed:{currentType(){return this.$panel.searches[this.type]??Object.values(this.$panel.searches)[0]}},watch:{type(){this.search(this.q)}},created(){this.search=at(this.search,250)},methods:{clear(){this.items=[],this.q=null},focus(){var t;null==(t=this.$refs.input)||t.focus()},navigate(t){t&&(this.$go(t.link),this.close())},onDown(){this.selected=0&&this.select(this.selected-1)},async search(t){var e,n;this.q=t,this.isLoading=!0,null==(e=this.$refs.types)||e.close(),null==(n=this.select)||n.call(this,-1);try{if(null===t||t.length<2)throw Error("Empty query");const e=await this.$search(this.type,t);this.items=e.results,this.pagination=e.pagination}catch(s){this.items=[],this.pagination={}}finally{this.isLoading=!1}},select(t){var e;this.selected=t;const n=(null==(e=this.$refs.items)?void 0:e.$el.querySelectorAll(".k-item"))??[];[...n].forEach((t=>delete t.dataset.selected)),t>=0&&(n[t].dataset.selected=!0)}}},(function(){var t,e=this,n=e._self._c;return n("k-overlay",{ref:"dialog",attrs:{dimmed:!0,visible:e.visible,type:"dialog"},on:{cancel:e.cancel,ready:e.ready}},[n("form",{staticClass:"k-search-dialog k-dialog",attrs:{"data-size":"medium",method:"dialog",role:"search"},on:{submit:function(t){return t.preventDefault(),e.submit.apply(null,arguments)}}},[n("div",{staticClass:"k-search-dialog-input"},[n("k-dropdown",{staticClass:"k-search-dialog-types"},[n("k-button",{attrs:{icon:e.currentType.icon,text:e.currentType.label},on:{click:function(t){return e.$refs.types.toggle()}}}),n("k-dropdown-content",{ref:"types"},e._l(e.$panel.searches,(function(t,s){return n("k-dropdown-item",{key:s,attrs:{icon:t.icon},on:{click:function(t){e.type=s,e.focus()}}},[e._v(" "+e._s(t.label)+" ")])})),1)],1),n("input",{ref:"input",attrs:{"aria-label":e.$t("search"),autofocus:!0,placeholder:e.$t("search")+" …",type:"text"},domProps:{value:e.q},on:{input:function(t){return e.search(t.target.value)},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),e.onDown.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),e.onUp.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"tab",9,t.key,"Tab")?null:(t.preventDefault(),e.onTab.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.onEnter.apply(null,arguments)},function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;e.clear(),e.close()}]}}),n("k-button",{staticClass:"k-search-dialog-close",attrs:{icon:e.isLoading?"loader":"cancel",tooltip:e.$t("close")},on:{click:e.close}})],1),(null==(t=e.q)?void 0:t.length)>1?n("div",{staticClass:"k-search-dialog-results"},[e.items.length?n("k-collection",{ref:"items",attrs:{items:e.items},nativeOn:{mouseout:function(t){return e.select(-1)}}}):e._e(),n("footer",{staticClass:"k-search-dialog-footer"},[e.items.length?e.items.length({icon:"upload",text:window.panel.$t("upload")})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-upload-dialog",attrs:{disabled:t.disabled||0===t.$panel.upload.files.length},on:{submit:t.submit}},"k-dialog",t.$props,!1),[e("k-dropzone",{on:{drop:function(e){return t.$panel.upload.select(e)}}},[0===t.$panel.upload.files.length?[e("k-empty",{attrs:{icon:"upload",layout:"cards"},on:{click:function(e){return t.$panel.upload.pick()}}},[t._v(" "+t._s(t.$t("files.empty"))+" ")])]:[e("ul",{staticClass:"k-upload-items"},t._l(t.$panel.upload.files,(function(n){return e("li",{key:n.id,staticClass:"k-upload-item",attrs:{"data-completed":n.completed}},[e("a",{staticClass:"k-upload-item-preview",attrs:{href:n.url,target:"_blank"}},[n.type.match("(jpg|jpeg|gif|png|webp|avif)")?e("k-image",{attrs:{cover:!0,src:n.url,back:"pattern"}}):e("k-aspect-ratio",{attrs:{ratio:"1/1"}},[e("k-icon",{attrs:{back:"pattern",type:"file"}})],1)],1),e("k-input",{staticClass:"k-upload-item-input",attrs:{disabled:n.completed,after:"."+n.extension,novalidate:!0,required:!0,type:"slug"},model:{value:n.name,callback:function(e){t.$set(n,"name",e)},expression:"file.name"}}),e("div",{staticClass:"k-upload-item-body"},[e("p",{staticClass:"k-upload-item-meta"},[t._v(" "+t._s(n.niceSize)+" "),n.progress?[t._v(" - "+t._s(n.progress)+"% ")]:t._e()],2),e("p",{staticClass:"k-upload-item-error"},[t._v(t._s(n.error))])]),e("div",{staticClass:"k-upload-item-progress"},[n.progress>0&&!n.error?e("k-progress",{attrs:{value:n.progress}}):t._e()],1),e("div",{staticClass:"k-upload-item-toggle"},[n.completed||n.progress?n.completed?e("k-button",{attrs:{icon:"check",theme:"positive"},on:{click:function(e){return t.$panel.upload.remove(n.id)}}}):e("div",[e("k-loader")],1):e("k-button",{attrs:{icon:"remove"},on:{click:function(e){return t.$panel.upload.remove(n.id)}}})],1)],1)})),0)]],2)],1)}),[],!1,null,null,null,null).exports;const yt=R({extends:vt,props:{original:Object,submitButton:{type:[String,Boolean,Object],default:()=>({icon:"upload",text:window.panel.$t("replace")})}}},(function(){var t,e=this,n=e._self._c;return n("k-dialog",e._b({ref:"dialog",staticClass:"k-upload-dialog k-upload-replace-dialog",on:{submit:e.submit}},"k-dialog",e.$props,!1),[n("ul",{staticClass:"k-upload-items"},[n("li",{staticClass:"k-upload-original"},[e.original.url.match("(jpg|jpeg|gif|png|webp|avif)")?n("k-image",{attrs:{cover:!0,src:e.original.url,back:"black"}}):n("k-aspect-ratio",{attrs:{ratio:"1/1"}},[n("k-icon",e._b({attrs:{back:"pattern",type:(null==(t=e.original.image)?void 0:t.icon)??"file"}},"k-icon",e.original.image,!1))],1)],1),n("li",[e._v("←")]),e._l(e.$panel.upload.files,(function(t){var s;return n("li",{key:t.id,staticClass:"k-upload-item",attrs:{"data-completed":t.completed}},[n("a",{staticClass:"k-upload-item-preview",attrs:{href:t.url,target:"_blank"}},[t.type.match("(jpg|jpeg|gif|png|webp|avif)")?n("k-image",{attrs:{cover:!0,src:t.url,back:"pattern"}}):n("k-aspect-ratio",{attrs:{ratio:"1/1"}},[n("k-icon",e._b({attrs:{back:"pattern",type:(null==(s=e.original.image)?void 0:s.icon)??"file"}},"k-icon",e.original.image,!1))],1)],1),n("k-input",{staticClass:"k-upload-item-input",attrs:{value:e.$helper.file.name(e.original.filename),disabled:!0,after:"."+t.extension,type:"text"}}),n("div",{staticClass:"k-upload-item-body"},[n("p",{staticClass:"k-upload-item-meta"},[e._v(" "+e._s(t.niceSize)+" "),t.progress?[e._v(" - "+e._s(t.progress)+"% ")]:e._e()],2),n("p",{staticClass:"k-upload-item-error"},[e._v(e._s(t.error))])]),n("div",{staticClass:"k-upload-item-progress"},[t.progress>0&&!t.error?n("k-progress",{attrs:{value:t.progress}}):e._e()],1),n("div",{staticClass:"k-upload-item-toggle"},[t.completed?n("k-button",{attrs:{icon:"check",theme:"positive"},on:{click:function(n){return e.$panel.upload.remove(t.id)}}}):t.progress?n("div",[n("k-loader")],1):e._e()],1)],1)}))],2)])}),[],!1,null,null,null,null).exports;const $t=R({mixins:[ut],computed:{emptyProps(){return{icon:"users",text:this.$t("dialog.users.empty")}}},methods:{item:t=>({...t,key:t.email,info:t.info!==t.text?t.info:null})}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-users-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[e("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.options.search?e("k-dialog-search",{attrs:{value:t.search},on:{search:function(e){t.search=e}}}):t._e(),e("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:n}){return[e("k-button",t._b({on:{click:function(e){return t.toggle(n)}}},"k-button",t.toggleBtn(n),!1))]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,null,null,null,null).exports,wt={install(t){t.use(st),t.component("k-dialog",ot),t.component("k-error-dialog",lt),t.component("k-fiber-dialog",rt),t.component("k-files-dialog",ct),t.component("k-form-dialog",dt),t.component("k-language-dialog",pt),t.component("k-page-create-dialog",ht),t.component("k-page-move-dialog",mt),t.component("k-pages-dialog",ft),t.component("k-remove-dialog",kt),t.component("k-search-dialog",bt),t.component("k-text-dialog",gt),t.component("k-upload-dialog",vt),t.component("k-upload-replace-dialog",yt),t.component("k-users-dialog",$t)}};const _t=R({},(function(){return(0,this._self._c)("div",{staticClass:"k-drawer-body scroll-y-auto"},[this._t("default")],2)}),[],!1,null,null,null,null).exports,xt={props:{empty:{type:String,default:()=>window.panel.$t("drawer.fields.empty")},fields:Object,novalidate:{type:Boolean,default:!0},value:Object}};const Ct=R({mixins:[xt],computed:{hasFields(){return this.$helper.object.length(this.fields)>0}}},(function(){var t=this,e=t._self._c;return t.hasFields?e("k-fieldset",{staticClass:"k-drawer-fields",attrs:{novalidate:t.novalidate,fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},invalid:function(e){return t.$emit("invalid",e)},submit:function(e){return t.$emit("submit",e)}}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports;const St=R({},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-drawer-header"},[t.$panel.drawer.breadcrumb.length<=1?e("h2",{staticClass:"k-drawer-title"},[e("k-icon",{attrs:{type:t.$panel.drawer.icon}}),t._v(" "+t._s(t.$panel.drawer.title)+" ")],1):e("ul",{staticClass:"k-drawer-breadcrumb"},t._l(t.$panel.drawer.breadcrumb,(function(n){return e("li",{key:n.id},[e("k-button",{attrs:{icon:n.icon,text:n.title},on:{click:function(e){return t.$panel.drawer.goTo(n.id)}}})],1)})),0),e("k-drawer-tabs",{attrs:{tab:t.$panel.drawer.tabId,tabs:t.$panel.drawer.tabs},on:{open:function(e){return t.$panel.drawer.openTab(e)}}}),e("nav",{staticClass:"k-drawer-options"},[t._t("default"),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"check",type:"submit"}})],2)],1)}),[],!1,null,null,null,null).exports;const Ot=R({},(function(){var t=this,e=t._self._c;return"drawer"===t.$panel.notification.context?e("k-notification",{staticClass:"k-drawer-notification"}):t._e()}),[],!1,null,null,null,null).exports;const At=R({mixins:[{props:{tab:{type:String},tabs:{default:()=>{},type:[Array,Object]}}}],computed:{hasTabs(){return this.$helper.object.length(this.tabs)>1}}},(function(){var t=this,e=t._self._c;return t.hasTabs?e("nav",{staticClass:"k-drawer-tabs"},t._l(t.tabs,(function(n){return e("k-button",{key:n.name,staticClass:"k-drawer-tab",attrs:{current:t.tab===n.name,text:n.label},on:{click:function(e){return t.$emit("open",n.name)}}})})),1):t._e()}),[],!1,null,null,null,null).exports,It={install(t){t.component("k-drawer-body",_t),t.component("k-drawer-fields",Ct),t.component("k-drawer-header",St),t.component("k-drawer-notification",Ot),t.component("k-drawer-tabs",At)}},Mt={props:{icon:String,id:String,options:{type:Array},tabs:{default:()=>{},type:[Array,Object]},title:String,visible:{default:!1,type:Boolean}},methods:{cancel(){this.$panel.drawer.cancel()},close(){this.$panel.drawer.close()},error(t){this.$panel.drawer.error(t)},focus(t){this.$panel.drawer.focus(t)},hide(){this.$refs.drawer.hide()},input(t){this.$panel.drawer.input(t)},open(){this.$panel.drawer.open(this)},ready(){this.$panel.drawer.emit("ready")},show(){this.$refs.drawer.show()},submit(){this.$panel.drawer.submit(this.$panel.value)},success(t){this.$panel.drawer.success(t)}}};const Tt=R({mixins:[Mt]},(function(){var t=this,e=t._self._c;return e("k-overlay",{ref:"drawer",attrs:{visible:t.visible,type:"drawer"},on:{cancel:t.cancel}},[e("form",{staticClass:"k-drawer",class:t.$vnode.data.staticClass,attrs:{method:"dialog"},on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[e("k-drawer-notification"),e("k-drawer-header",[t._t("options",(function(){return[t._l(t.options,(function(n,s){return[n.dropdown?[e("k-dropdown",{key:s},[e("k-button",t._b({staticClass:"k-drawer-option",on:{click:function(e){t.$refs["dropdown-"+s][0].toggle()}}},"k-button",n,!1)),e("k-dropdown-content",{ref:"dropdown-"+s,refInFor:!0,attrs:{options:n.dropdown,align:"right",theme:"light"}})],1)]:e("k-button",t._b({key:s,staticClass:"k-drawer-option"},"k-button",n,!1))]}))]}))],2),e("k-drawer-body",[t._t("default")],2)],1)])}),[],!1,null,null,null,null).exports;const jt=R({},(function(){var t=this;return(0,t._self._c)(t.$panel.drawer.component,t._b({key:t.$panel.drawer.timestamp,ref:"dialog",tag:"component",attrs:{disabled:t.$panel.drawer.isLoading,visible:!0}},"component",t.$panel.drawer.props,!1))}),[],!1,null,null,null,null).exports;const Et=R({mixins:[Mt,xt]},(function(){var t,e=this,n=e._self._c;return n("k-drawer",e._b({ref:"drawer",staticClass:"k-form-drawer",on:{cancel:e.cancel,submit:e.submit}},"k-drawer",e.$props,!1),[e._t("options",null,{slot:"options"}),n("k-drawer-fields",{attrs:{fields:null==(t=e.$panel.drawer.tab)?void 0:t.fields,value:e.value},on:{input:e.input,submit:e.submit}})],2)}),[],!1,null,null,null,null).exports,Dt={install(t){t.use(It),t.component("k-drawer",Tt),t.component("k-fiber-drawer",jt),t.component("k-form-drawer",Et)}};class Lt extends HTMLElement{connectedCallback(){this.style.display="block",this.textareas=this.querySelectorAll("textarea");for(const t of this.textareas)t.style.resize="none",t.style.overflowY="hidden",t.autosize=()=>{t.style.height=0,t.style.height=t.scrollHeight+"px"},t.addEventListener("input",(()=>t.autosize()));this.resizer=new ResizeObserver((()=>{this.textareas.forEach((t=>t.autosize()))})),this.resizer.observe(this)}disconnectedCallback(){this.resizer.unobserve(this)}}const Bt=R({props:{html:{type:Boolean,default:!1},limit:{type:Number,default:10},skip:{type:Array,default:()=>[]},options:Array,query:String},emits:["leave","search","select"],data:()=>({matches:[],selected:{text:null}}),methods:{close(){this.$refs.dropdown.close()},onSelect(t){this.$emit("select",t),this.$refs.dropdown.close()},search(t){if(t.length<1)return;const e=new RegExp(RegExp.escape(t),"ig");this.matches=this.options.filter((t=>!!t.text&&(-1===this.skip.indexOf(t.value)&&null!==t.text.match(e)))).slice(0,this.limit),this.$emit("search",t,this.matches),this.$refs.dropdown.open()}}},(function(){var t=this,e=t._self._c;return e("k-dropdown",{staticClass:"k-autocomplete"},[t._t("default"),e("k-dropdown-content",{ref:"dropdown",attrs:{autofocus:!0},on:{leave:function(e){return t.$emit("leave")}}},t._l(t.matches,(function(n,s){return e("k-dropdown-item",t._b({key:s,nativeOn:{mousedown:function(e){return t.onSelect(n)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:(e.preventDefault(),t.onSelect(n))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.onSelect(n))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:(e.preventDefault(),t.close.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)?null:(e.preventDefault(),t.close.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:(e.preventDefault(),t.close.apply(null,arguments))}]}},"k-dropdown-item",n,!1),[e("span",{domProps:{innerHTML:t._s(t.html?n.text:t.$esc(n.text))}})])})),1),t._v(" "+t._s(t.query)+" ")],2)}),[],!1,null,null,null,null).exports;const Pt=R({props:{disabled:Boolean,max:String,min:String,value:String},data(){return this.data(this.value)},computed:{numberOfDays(){return this.toDate().daysInMonth()},firstWeekday(){const t=this.toDate().day();return t>0?t:7},weekdays(){return["mon","tue","wed","thu","fri","sat","sun"].map((t=>this.$t("days."+t)))},weeks(){const t=this.firstWeekday-1;return Math.ceil((this.numberOfDays+t)/7)},monthnames(){return["january","february","march","april","may","june","july","august","september","october","november","december"].map((t=>this.$t("months."+t)))},months(){var t=[];return this.monthnames.forEach(((e,n)=>{const s=this.toDate(1,n);t.push({value:n,text:e,disabled:s.isBefore(this.current.min,"month")||s.isAfter(this.current.max,"month")})})),t},years(){var t,e;const n=(null==(t=this.current.min)?void 0:t.get("year"))??this.current.year-20,s=(null==(e=this.current.max)?void 0:e.get("year"))??this.current.year+20;return this.toOptions(n,s)}},watch:{value(t){const e=this.data(t);this.dt=e.dt,this.current=e.current}},methods:{data(t){const e=this.$library.dayjs.iso(t),n=this.$library.dayjs();return{dt:e,current:{month:(e??n).month(),year:(e??n).year(),min:this.$library.dayjs.iso(this.min),max:this.$library.dayjs.iso(this.max)}}},days(t){let e=[];const n=7*(t-1)+1,s=n+7;for(let i=n;ithis.numberOfDays;e.push(n?"":t)}return e},isDisabled(t){const e=this.toDate(t);return this.disabled||e.isBefore(this.current.min,"day")||e.isAfter(this.current.max,"day")},isSelected(t){return this.toDate(t).isSame(this.dt,"day")},isToday(t){const e=this.$library.dayjs();return this.toDate(t).isSame(e,"day")},onInput(){var t;this.$emit("input",(null==(t=this.dt)?void 0:t.toISO("date"))||null)},onNext(){const t=this.toDate().add(1,"month");this.show(t)},onPrev(){const t=this.toDate().subtract(1,"month");this.show(t)},select(t){const e="today"===t?this.$library.dayjs().merge(this.toDate(),"time"):this.toDate(t);this.dt=e,this.show(e),this.onInput()},show(t){this.current.year=t.year(),this.current.month=t.month()},toDate(t=1,e=this.current.month){return this.$library.dayjs(`${this.current.year}-${e+1}-${t}`)},toOptions(t,e){for(var n=[],s=t;s<=e;s++)n.push({value:s,text:this.$helper.pad(s)});return n}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-calendar-input"},[e("nav",[e("k-button",{attrs:{icon:"angle-left"},on:{click:t.onPrev}}),e("span",{staticClass:"k-calendar-selects"},[e("k-select-input",{attrs:{options:t.months,disabled:t.disabled,required:!0,value:t.current.month},on:{input:function(e){t.current.month=Number(e)}}}),e("k-select-input",{attrs:{options:t.years,disabled:t.disabled,required:!0,value:t.current.year},on:{input:function(e){t.current.year=Number(e)}}})],1),e("k-button",{attrs:{icon:"angle-right"},on:{click:t.onNext}})],1),e("table",{staticClass:"k-calendar-table"},[e("thead",[e("tr",t._l(t.weekdays,(function(n){return e("th",{key:"weekday_"+n},[t._v(" "+t._s(n)+" ")])})),0)]),e("tbody",t._l(t.weeks,(function(n){return e("tr",{key:"week_"+n},t._l(t.days(n),(function(n,s){return e("td",{key:"day_"+s,staticClass:"k-calendar-day",attrs:{"aria-current":!!t.isToday(n)&&"date","aria-selected":!!t.isSelected(n)&&"date"}},[n?e("k-button",{attrs:{disabled:t.isDisabled(n),text:n},on:{click:function(e){return t.select(n)}}}):t._e()],1)})),0)})),0),e("tfoot",[e("tr",[e("td",{staticClass:"k-calendar-today",attrs:{colspan:"7"}},[e("k-button",{attrs:{text:t.$t("today")},on:{click:function(e){return t.select("today")}}})],1)])])])])}),[],!1,null,null,null,null).exports;const Nt=R({props:{count:Number,min:Number,max:Number,required:{type:Boolean,default:!1}},computed:{valid(){return!1===this.required&&0===this.count||(!0!==this.required||0!==this.count)&&(!(this.min&&this.countthis.max))}}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-counter",attrs:{"data-invalid":!t.valid}},[e("span",[t._v(t._s(t.count))]),t.min&&t.max?e("span",{staticClass:"k-counter-rules"},[t._v("("+t._s(t.min)+"–"+t._s(t.max)+")")]):t.min?e("span",{staticClass:"k-counter-rules"},[t._v("≥ "+t._s(t.min))]):t.max?e("span",{staticClass:"k-counter-rules"},[t._v("≤ "+t._s(t.max))]):t._e()])}),[],!1,null,null,null,null).exports;const Ft=R({props:{disabled:Boolean,config:Object,fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},emits:["input","submit"],data:()=>({errors:{}}),methods:{focus(t){var e,n;null==(n=null==(e=this.$refs.fields)?void 0:e.focus)||n.call(e,t)},onFocus(t,e,n){this.$emit("focus",t,e,n)},onInput(t,e,n){this.$emit("input",t,e,n)},onInvalid(t){this.$emit("invalid",t)},onSubmit(){this.$emit("submit",this.value)},submit(){this.$refs.submitter.click()}}},(function(){var t=this,e=t._self._c;return e("form",{ref:"form",staticClass:"k-form",attrs:{method:"POST",autocomplete:"off",novalidate:""},on:{submit:function(e){return e.preventDefault(),t.onSubmit.apply(null,arguments)}}},[t._t("header"),t._t("default",(function(){return[e("k-fieldset",{ref:"fields",attrs:{disabled:t.disabled,fields:t.fields,novalidate:t.novalidate,value:t.value},on:{focus:t.onFocus,input:t.onInput,invalid:t.onInvalid,submit:t.onSubmit}})]})),t._t("footer"),e("input",{ref:"submitter",staticClass:"k-form-submitter",attrs:{type:"submit"}})],2)}),[],!1,null,null,null,null).exports;const qt=R({props:{lock:[Boolean,Object]},data:()=>({isRefreshing:null,isLocking:null}),computed:{api(){return[this.$panel.view.path+"/lock",null,null,!0]},hasChanges(){return this.$store.getters["content/hasChanges"]()},isDisabled(){return!1===this.$store.state.content.status.enabled},isLocked(){return"lock"===this.lockState},isUnlocked(){return"unlock"===this.lockState},mode(){return null!==this.lockState?this.lockState:!0===this.hasChanges?"changes":null},lockState(){return this.supportsLocking&&this.lock?this.lock.state:null},supportsLocking(){return!1!==this.lock},theme(){return"lock"===this.mode?"negative":"unlock"===this.mode?"info":"notice"}},watch:{hasChanges:{handler(t,e){!0===this.supportsLocking&&!1===this.isLocked&&!1===this.isUnlocked&&(!0===t?(this.onLock(),this.isLocking=setInterval(this.onLock,3e4)):e&&(clearInterval(this.isLocking),this.onLock(!1)))},immediate:!0},isLocked(t){!1===t&&this.$events.$emit("model.reload")}},created(){this.supportsLocking&&(this.isRefreshing=setInterval(this.check,1e4)),this.$events.$on("view.save",this.onSave)},destroyed(){clearInterval(this.isRefreshing),clearInterval(this.isLocking),this.$events.$off("view.save",this.onSave)},methods:{async check(){const{lock:t}=await this.$api.get(...this.api);Vue.set(this.$panel.view.props,"lock",t)},async onLock(t=!0){if(!0===t)try{await this.$api.patch(...this.api)}catch(e){clearInterval(this.isLocking),this.$store.dispatch("content/revert")}else clearInterval(this.isLocking),await this.$api.delete(...this.api)},onDownload(){let t="";const e=this.$store.getters["content/changes"]();Object.keys(e).forEach((n=>{t+=n+": \n\n"+e[n],t+="\n\n----\n\n"}));let n=document.createElement("a");n.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),n.setAttribute("download",this.$panel.view.path+".txt"),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)},async onResolve(){await this.onUnlock(!1),this.$store.dispatch("content/revert")},onRevert(){this.$refs.revert.open()},async onSave(t){var e;null==(e=t.preventDefault)||e.call(t),await this.$store.dispatch("content/save"),this.$events.$emit("model.update"),this.$panel.notification.success()},async onUnlock(t=!0){const e=[this.$panel.view.path+"/unlock",null,null,!0];!0===t?await this.$api.patch(...e):await this.$api.delete(...e),this.$reload({silent:!0})},revert(){this.$store.dispatch("content/revert"),this.$refs.revert.close()}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-form-buttons",attrs:{"data-theme":t.theme}},["unlock"===t.mode?e("k-view",[e("p",{staticClass:"k-form-lock-info"},[t._v(" "+t._s(t.$t("lock.isUnlocked"))+" ")]),e("span",{staticClass:"k-form-lock-buttons"},[e("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("download"),icon:"download"},on:{click:t.onDownload}}),e("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("confirm"),icon:"check"},on:{click:t.onResolve}})],1)]):"lock"===t.mode?e("k-view",[e("p",{staticClass:"k-form-lock-info"},[e("k-icon",{attrs:{type:"lock"}}),e("span",{domProps:{innerHTML:t._s(t.$t("lock.isLocked",{email:t.$esc(t.lock.data.email)}))}})],1),t.lock.data.unlockable?e("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("lock.unlock"),icon:"unlock"},on:{click:function(e){return t.onUnlock()}}}):e("k-icon",{staticClass:"k-form-lock-loader",attrs:{type:"loader"}})],1):"changes"===t.mode?e("k-view",[e("k-button",{staticClass:"k-form-button",attrs:{disabled:t.isDisabled,text:t.$t("revert"),icon:"undo"},on:{click:t.onRevert}}),e("k-button",{staticClass:"k-form-button",attrs:{disabled:t.isDisabled,text:t.$t("save"),icon:"check"},on:{click:t.onSave}})],1):t._e(),e("k-dialog",{ref:"revert",attrs:{"submit-button":t.$t("revert"),icon:"undo",theme:"negative"},on:{submit:t.revert}},[e("k-text",{attrs:{html:t.$t("revert.confirm")}})],1)],1)}),[],!1,null,null,null,null).exports;const Rt=R({data:()=>({isOpen:!1,options:[]}),computed:{hasChanges(){return this.ids.length>0},ids(){return Object.keys(this.store).filter((t=>{var e;return this.$helper.object.length(null==(e=this.store[t])?void 0:e.changes)>0}))},store(){return this.$store.state.content.models}},methods:{async toggle(){if(!1===this.$refs.list.isOpen)try{await this.$dropdown("changes",{method:"POST",body:{ids:this.ids}})((t=>{this.options=t}))}catch(t){return this.$panel.notification.success(this.$t("lock.unsaved.empty")),this.$store.dispatch("content/clear"),!1}this.$refs.list&&this.$refs.list.toggle()}}},(function(){var t=this,e=t._self._c;return t.hasChanges?e("k-dropdown",{staticClass:"k-form-indicator"},[e("k-button",{staticClass:"k-form-indicator-toggle k-topbar-button",attrs:{icon:"edit"},on:{click:t.toggle}}),e("k-dropdown-content",{ref:"list",attrs:{align:"right",theme:"light"}},[e("p",{staticClass:"k-form-indicator-info"},[t._v(t._s(t.$t("lock.unsaved"))+":")]),e("hr"),t._l(t.options,(function(n){return e("k-dropdown-item",t._b({key:n.id},"k-dropdown-item",n,!1),[t._v(" "+t._s(n.text)+" ")])}))],2)],1):t._e()}),[],!1,null,null,null,null).exports,zt={props:{after:String}},Yt={props:{autofocus:Boolean}},Ht={props:{before:String}},Ut={props:{disabled:Boolean}},Kt={props:{help:String}},Vt={props:{id:{type:[Number,String],default(){return this._uid}}}},Wt={props:{invalid:Boolean}},Jt={props:{label:String}},Gt={props:{name:[Number,String]}},Zt={props:{required:Boolean}},Qt={mixins:[Ut,Kt,Jt,Gt,Zt],props:{counter:[Boolean,Object],endpoints:Object,input:[String,Number],translate:Boolean,type:String}};const Xt=R({mixins:[Qt],inheritAttrs:!1,computed:{labelText(){return this.label||" "}}},(function(){var t=this,e=t._self._c;return e("div",{class:"k-field k-field-name-"+t.name,attrs:{"data-disabled":t.disabled,"data-translate":t.translate},on:{focusin:function(e){return t.$emit("focus",e)},focusout:function(e){return t.$emit("blur",e)}}},[t._t("header",(function(){return[e("header",{staticClass:"k-field-header"},[t._t("label",(function(){return[e("label",{staticClass:"k-field-label",attrs:{for:t.input}},[t._v(" "+t._s(t.labelText)+" "),t.required?e("abbr",{attrs:{title:t.$t("field.required")}},[t._v("*")]):t._e()])]})),t._t("options"),t._t("counter",(function(){return[t.counter?e("k-counter",t._b({staticClass:"k-field-counter",attrs:{required:t.required}},"k-counter",t.counter,!1)):t._e()]}))],2)]})),t._t("default"),t._t("footer",(function(){return[t.help||t.$slots.help?e("footer",{staticClass:"k-field-footer"},[t._t("help",(function(){return[t.help?e("k-text",{staticClass:"k-field-help",attrs:{theme:"help",html:t.help}}):t._e()]}))],2):t._e()]}))],2)}),[],!1,null,null,null,null).exports;const te=R({props:{config:Object,disabled:Boolean,fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},emits:["focus","input","invalid","submit"],data(){return{values:this.value,errors:{}}},watch:{value(t){this.values=t}},methods:{focus(t){if(t)return void(this.hasField(t)&&"function"==typeof this.$refs[t][0].focus&&this.$refs[t][0].focus());const e=Object.keys(this.$refs)[0];this.focus(e)},hasFieldType(t){return this.$helper.isComponent(`k-${t}-field`)},hasField(t){var e;return null==(e=this.$refs[t])?void 0:e[0]},onInvalid(t,e,n,s){this.errors[s]=e,this.$emit("invalid",this.errors)},onInput(t,e,n){this.values={...this.value,[n]:t},this.$emit("input",this.values,e,n)},hasErrors(){return this.$helper.object.length(this.errors)>0}}},(function(){var t=this,e=t._self._c;return e("fieldset",{staticClass:"k-fieldset"},[e("k-grid",[t._l(t.fields,(function(n,s){return[t.$helper.field.isVisible(n,t.value)?e("k-column",{key:n.signature,attrs:{width:n.width}},[e("k-error-boundary",[t.hasFieldType(n.type)?e("k-"+n.type+"-field",t._b({ref:s,refInFor:!0,tag:"component",attrs:{disabled:t.disabled||n.disabled,"form-data":t.value,name:s,novalidate:t.novalidate,value:t.values[s]},on:{input:function(e){return t.onInput(e,n,s)},focus:function(e){return t.$emit("focus",e,n,s)},invalid:(e,i)=>t.onInvalid(e,i,n,s),submit:function(e){return t.$emit("submit",e,n,s)}}},"component",n,!1)):e("k-box",{attrs:{theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[t._v(" "+t._s(t.$t("error.field.type.missing",{name:s,type:n.type}))+" ")])],1)],1)],1):t._e()]}))],2)],1)}),[],!1,null,null,null,null).exports,ee={mixins:[zt,Ht,Ut,Wt],props:{autofocus:Boolean,type:String,icon:[String,Boolean],theme:String,novalidate:{type:Boolean,default:!1},value:{type:[String,Boolean,Number,Object,Array],default:null}}};const ne=R({mixins:[ee],inheritAttrs:!1,data(){return{isInvalid:this.invalid,listeners:{...this.$listeners,invalid:(t,e)=>{this.isInvalid=t,this.$emit("invalid",t,e)}}}},computed:{inputProps(){return{...this.$props,...this.$attrs}}},watch:{invalid(){this.isInvalid=this.invalid}},methods:{blur(t){(null==t?void 0:t.relatedTarget)&&!1===this.$el.contains(t.relatedTarget)&&this.trigger(null,"blur")},focus(t){this.trigger(t,"focus")},select(t){this.trigger(t,"select")},trigger(t,e){var n,s,i;if("INPUT"===(null==(n=null==t?void 0:t.target)?void 0:n.tagName)&&"function"==typeof(null==(s=null==t?void 0:t.target)?void 0:s[e]))return void t.target[e]();if("function"==typeof(null==(i=this.$refs.input)?void 0:i[e]))return void this.$refs.input[e]();const o=this.$el.querySelector("input, select, textarea");"function"==typeof(null==o?void 0:o[e])&&o[e]()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-input",attrs:{"data-disabled":t.disabled,"data-invalid":!t.novalidate&&t.isInvalid,"data-theme":t.theme,"data-type":t.type}},[t.$slots.before||t.before?e("span",{staticClass:"k-input-before",on:{click:t.focus}},[t._t("before",(function(){return[t._v(t._s(t.before))]}))],2):t._e(),e("span",{staticClass:"k-input-element",on:{click:function(e){return e.stopPropagation(),t.focus.apply(null,arguments)}}},[t._t("default",(function(){return[e("k-"+t.type+"-input",t._g(t._b({ref:"input",tag:"component",attrs:{value:t.value}},"component",t.inputProps,!1),t.listeners))]}))],2),t.$slots.after||t.after?e("span",{staticClass:"k-input-after",on:{click:t.focus}},[t._t("after",(function(){return[t._v(t._s(t.after))]}))],2):t._e(),t.$slots.icon||t.icon?e("span",{staticClass:"k-input-icon",on:{click:t.focus}},[t._t("icon",(function(){return[e("k-icon",{attrs:{type:t.icon}})]}))],2):t._e()])}),[],!1,null,null,null,null).exports;const se=R({props:{methods:Array},data:()=>({currentForm:null,isLoading:!1,user:{email:"",password:"",remember:!1}}),computed:{canToggle(){return null!==this.codeMode&&!0===this.methods.includes("password")&&(!0===this.methods.includes("password-reset")||!0===this.methods.includes("code"))},codeMode(){return!0===this.methods.includes("password-reset")?"password-reset":!0===this.methods.includes("code")?"code":null},fields(){let t={email:{autofocus:!0,label:this.$t("email"),type:"email",required:!0,link:!1}};return"email-password"===this.form&&(t.password={label:this.$t("password"),type:"password",minLength:8,required:!0,autocomplete:"current-password",counter:!1}),t},form(){return this.currentForm?this.currentForm:"password"===this.methods[0]?"email-password":"email"},isResetForm(){return"password-reset"===this.codeMode&&"email"===this.form},toggleText(){return this.$t("login.toggleText."+this.codeMode+"."+this.formOpposite(this.form))}},methods:{formOpposite:t=>"email-password"===t?"email":"email-password",async login(){this.$emit("error",null),this.isLoading=!0;let t=Object.assign({},this.user);"email"===this.currentForm&&(t.password=null),!0===this.isResetForm&&(t.remember=!1);try{await this.$api.auth.login(t),this.$reload({globals:["$system","$translation"]})}catch(e){this.$emit("error",e)}finally{this.isLoading=!1}},toggleForm(){this.currentForm=this.formOpposite(this.form),this.$refs.fieldset.focus("email")}}},(function(){var t=this,e=t._self._c;return e("form",{staticClass:"k-login-form",on:{submit:function(e){return e.preventDefault(),t.login.apply(null,arguments)}}},[e("div",{staticClass:"k-login-fields"},[!0===t.canToggle?e("button",{staticClass:"k-login-toggler",attrs:{type:"button"},on:{click:t.toggleForm}},[t._v(" "+t._s(t.toggleText)+" ")]):t._e(),e("k-fieldset",{ref:"fieldset",attrs:{novalidate:!0,fields:t.fields,value:t.user},on:{input:function(e){t.user=e}}})],1),e("div",{staticClass:"k-login-buttons"},[!1===t.isResetForm?e("span",{staticClass:"k-login-checkbox"},[e("k-checkbox-input",{attrs:{value:t.user.remember,label:t.$t("login.remember")},on:{input:function(e){t.user.remember=e}}})],1):t._e(),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("login"+(t.isResetForm?".reset":"")))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)],1)])}),[],!1,null,null,null,null).exports;const ie=R({props:{methods:Array,pending:Object},data:()=>({code:"",isLoadingBack:!1,isLoadingLogin:!1}),computed:{mode(){return!0===this.methods.includes("password-reset")?"password-reset":"login"}},methods:{async back(){this.isLoadingBack=!0,this.$go("/logout")},async login(){this.$emit("error",null),this.isLoadingLogin=!0;try{await this.$api.auth.verifyCode(this.code),this.$panel.notification.success(this.$t("welcome")),"password-reset"===this.mode?this.$go("reset-password"):this.$reload()}catch(t){this.$emit("error",t)}finally{this.isLoadingLogin=!1}}}},(function(){var t=this,e=t._self._c;return e("form",{staticClass:"k-login-form k-login-code-form",on:{submit:function(e){return e.preventDefault(),t.login.apply(null,arguments)}}},[e("k-user-info",{attrs:{user:t.pending.email}}),e("k-text-field",{attrs:{autofocus:!0,counter:!1,help:t.$t("login.code.text."+t.pending.challenge),label:t.$t("login.code.label."+t.mode),novalidate:!0,placeholder:t.$t("login.code.placeholder."+t.pending.challenge),required:!0,value:t.code,autocomplete:"one-time-code",icon:"unlock",name:"code"},on:{input:function(e){t.code=e}}}),e("div",{staticClass:"k-login-buttons"},[e("k-button",{staticClass:"k-login-button k-login-back-button",attrs:{icon:"angle-left"},on:{click:t.back}},[t._v(" "+t._s(t.$t("back"))+" "),t.isLoadingBack?[t._v(" … ")]:t._e()],2),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("login"+("password-reset"===t.mode?".reset":"")))+" "),t.isLoadingLogin?[t._v(" … ")]:t._e()],2)],1)],1)}),[],!1,null,null,null,null).exports;const oe=R({props:{display:{type:String,default:"HH:mm"},value:String},computed:{day(){return this.formatTimes([6,7,8,9,10,11,"-",12,13,14,15,16,17])},night(){return this.formatTimes([18,19,20,21,22,23,"-",0,1,2,3,4,5])}},methods:{formatTimes(t){return t.map((t=>{if("-"===t)return t;const e=this.$library.dayjs(t+":00","H:mm");return{display:e.format(this.display),select:e.toISO("time")}}))},select(t){this.$emit("input",t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-times"},[e("div",{staticClass:"k-times-slot"},[e("k-icon",{attrs:{type:"sun"}}),e("ul",t._l(t.day,(function(n){return e("li",{key:n.select},["-"===n?e("hr"):e("k-button",{on:{click:function(e){return t.select(n.select)}}},[t._v(t._s(n.display))])],1)})),0)],1),e("div",{staticClass:"k-times-slot"},[e("k-icon",{attrs:{type:"moon"}}),e("ul",t._l(t.night,(function(n){return e("li",{key:n.select},["-"===n?e("hr"):e("k-button",{on:{click:function(e){return t.select(n.select)}}},[t._v(t._s(n.display))])],1)})),0)],1)])}),[],!1,null,null,null,null).exports;const le=R({props:{accept:{type:String,default:"*"},attributes:{type:Object},max:{type:Number},method:{type:String,default:"POST"},multiple:{type:Boolean,default:!0},url:{type:String}},methods:{open(t){this.$panel.upload.pick(this.params(t))},params(t){return{...this.$props,...t||{},on:{complete:(t,e)=>{this.$emit("success",t,e)}}}},select(t){this.$panel.upload.select(t.target.files)},drop(t,e){this.$panel.upload.open(t,this.params(e))},render(){},upload(t,e){this.$panel.upload.select(t,this.params(e)),this.$panel.upload.start()}}},null,null,!1,null,null,null,null).exports;const re=R({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-login-alert",on:{click:function(e){return t.$emit("click")}}},[e("span",[t._t("default")],2),e("k-icon",{attrs:{type:"alert"}})],1)}),[],!1,null,null,null,null).exports;const ae=R({props:{fields:Object,index:[Number,String],total:Number,value:Object},mounted(){this.$store.dispatch("content/disable"),this.$events.$on("keydown.cmd.s",this.onSubmit),this.$events.$on("keydown.esc",this.onDiscard)},destroyed(){this.$events.$off("keydown.cmd.s",this.onSubmit),this.$events.$off("keydown.esc",this.onDiscard),this.$store.dispatch("content/enable")},methods:{focus(t){this.$refs.form.focus(t)},onDiscard(){this.$emit("discard")},onInput(t){this.$emit("input",t)},onSubmit(){this.$emit("submit")}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-structure-form"},[e("div",{staticClass:"k-structure-backdrop",on:{click:t.onDiscard}}),e("section",[e("k-form",{ref:"form",staticClass:"k-structure-form-fields",attrs:{value:t.value,fields:t.fields},on:{input:t.onInput,submit:t.onSubmit}}),e("footer",{staticClass:"k-structure-form-buttons"},[e("k-button",{staticClass:"k-structure-form-cancel-button",attrs:{text:t.$t("cancel"),icon:"cancel"},on:{click:function(e){return t.$emit("close")}}}),"new"!==t.index?e("k-pagination",{attrs:{dropdown:!1,total:t.total,limit:1,page:t.index+1,details:!0},on:{paginate:function(e){return t.$emit("paginate",e)}}}):t._e(),e("k-button",{staticClass:"k-structure-form-submit-button",attrs:{text:t.$t("new"!==t.index?"confirm":"add"),icon:"check"},on:{click:t.onSubmit}})],1)],1)])}),[],!1,null,null,null,null).exports,ue=function(t){this.command("insert",((e,n)=>{let s=[];return n.split("\n").forEach(((e,n)=>{let i="ol"===t?n+1+".":"-";s.push(i+" "+e)})),s.join("\n")}))};const ce=R({layout:["headlines","bold","italic","|","link","email","file","|","code","ul","ol"],props:{buttons:{type:[Boolean,Array],default:!0},uploads:[Boolean,Object,Array]},data(){let t={},e={},n=[],s=this.commands();if(!1===this.buttons)return t;Array.isArray(this.buttons)&&(n=this.buttons),!0!==Array.isArray(this.buttons)&&(n=this.$options.layout),n.forEach(((n,i)=>{if("|"===n)t["divider-"+i]={divider:!0};else if(s[n]){let i=s[n];t[n]=i,i.shortcut&&(e[i.shortcut]=n)}}));const i=window.panel.plugins.textareaButtons??{};return!0===this.buttons&&this.$helper.object.length(i)>0&&(t["divider-custom-buttons"]={divider:!0}),Object.keys(i).forEach((n=>{const s=i[n];s.label&&s.icon&&(s.command||s.dropdown)&&(t[n]=s,s.shortcut&&(e[s.shortcut]=n))})),{layout:t,shortcuts:e}},methods:{command(t,e){"function"==typeof t?t.apply(this):this.$emit("command",t,e)},close(){for(const t in this.$refs){const e=this.$refs[t][0];"function"==typeof(null==e?void 0:e.close)&&e.close()}},fileCommandSetup(){let t={label:this.$t("toolbar.button.file"),icon:"attachment"};return!1===this.uploads?t.command="selectFile":t.dropdown={select:{label:this.$t("toolbar.button.file.select"),icon:"check",command:"selectFile"},upload:{label:this.$t("toolbar.button.file.upload"),icon:"upload",command:"uploadFile"}},t},commands(){return{headlines:{label:this.$t("toolbar.button.headings"),icon:"title",dropdown:{h1:{label:this.$t("toolbar.button.heading.1"),icon:"h1",command:"prepend",args:"#"},h2:{label:this.$t("toolbar.button.heading.2"),icon:"h2",command:"prepend",args:"##"},h3:{label:this.$t("toolbar.button.heading.3"),icon:"h3",command:"prepend",args:"###"}}},bold:{label:this.$t("toolbar.button.bold"),icon:"bold",command:"wrap",args:"**",shortcut:"b"},italic:{label:this.$t("toolbar.button.italic"),icon:"italic",command:"wrap",args:"*",shortcut:"i"},link:{label:this.$t("toolbar.button.link"),icon:"url",shortcut:"k",command:"dialog",args:"link"},email:{label:this.$t("toolbar.button.email"),icon:"email",shortcut:"e",command:"dialog",args:"email"},file:this.fileCommandSetup(),code:{label:this.$t("toolbar.button.code"),icon:"code",command:"wrap",args:"`"},ul:{label:this.$t("toolbar.button.ul"),icon:"list-bullet",command:()=>ue.apply(this,["ul"])},ol:{label:this.$t("toolbar.button.ol"),icon:"list-numbers",command:()=>ue.apply(this,["ol"])}}},shortcut(t,e){if(this.shortcuts[t]){const n=this.layout[this.shortcuts[t]];if(!n)return!1;e.preventDefault(),this.command(n.command,n.args)}}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-toolbar"},[t._l(t.layout,(function(n,s){return[n.divider?e("div",{key:s+"-divider",staticClass:"k-toolbar-divider"}):n.dropdown?e("k-dropdown",{key:s+"-dropdown"},[e("k-button",{key:s,staticClass:"k-toolbar-button",attrs:{icon:n.icon,tooltip:n.label,tabindex:"-1"},on:{click:function(e){t.$refs[s+"-dropdown"][0].toggle()}}}),e("k-dropdown-content",{ref:s+"-dropdown",refInFor:!0},t._l(n.dropdown,(function(n,s){return e("k-dropdown-item",{key:s,attrs:{icon:n.icon},on:{click:function(e){return t.command(n.command,n.args)}}},[t._v(" "+t._s(n.label)+" ")])})),1)],1):e("k-button",{key:s+"-button",staticClass:"k-toolbar-button",attrs:{icon:n.icon,tooltip:n.label,tabindex:"-1"},on:{click:function(e){return t.command(n.command,n.args)}}})]}))],2)}),[],!1,null,null,null,null).exports;const de=R({data(){return{value:{email:null,text:null},fields:{email:{label:this.$t("email"),type:"email"},text:{label:this.$t("link.text"),type:"text"}}}},computed:{kirbytext(){return this.$panel.config.kirbytext}},methods:{open(t,e){this.value.text=e,this.$refs.dialog.open()},cancel(){this.$emit("cancel")},createKirbytext(){var t;const e=this.value.email||"";return(null==(t=this.value.text)?void 0:t.length)>0?`(email: ${e} text: ${this.value.text})`:`(email: ${e})`},createMarkdown(){var t;const e=this.value.email||"";return(null==(t=this.value.text)?void 0:t.length)>0?`[${this.value.text}](mailto:${e})`:`<${e}>`},submit(){this.$emit("submit",this.kirbytext?this.createKirbytext():this.createMarkdown()),this.value={email:null,text:null},this.$refs.dialog.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",attrs:{"submit-button":t.$t("insert")},on:{close:t.cancel,submit:function(e){return t.$refs.form.submit()}}},[e("k-form",{ref:"form",attrs:{fields:t.fields,value:t.value},on:{input:function(e){t.value=e},submit:t.submit}})],1)}),[],!1,null,null,null,null).exports;const pe=R({data(){return{value:{url:null,text:null},fields:{url:{label:this.$t("link"),type:"link",placeholder:this.$t("url.placeholder"),icon:"url"},text:{label:this.$t("link.text"),type:"text"}}}},computed:{kirbytext(){return this.$panel.config.kirbytext}},methods:{open(t,e){this.value.text=e,this.$refs.dialog.open()},cancel(){this.$emit("cancel")},createKirbytext(){return this.value.text.length>0?`(link: ${this.value.url} text: ${this.value.text})`:`(link: ${this.value.url})`},createMarkdown(){return this.value.text.length>0?`[${this.value.text}](${this.value.url})`:`<${this.value.url}>`},submit(){this.$emit("submit",this.kirbytext?this.createKirbytext():this.createMarkdown()),this.value={url:null,text:null},this.$refs.dialog.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",attrs:{size:"medium","submit-button":t.$t("insert")},on:{close:t.cancel,submit:function(e){return t.$refs.form.submit()}}},[e("k-form",{ref:"form",attrs:{fields:t.fields,value:t.value},on:{input:function(e){t.value=e},submit:t.submit}})],1)}),[],!1,null,null,null,null).exports;const he=R({computed:{placeholder(){return this.field("code",{}).placeholder},languages(){return this.field("language",{options:[]}).options}},methods:{focus(){this.$refs.code.focus()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-code k-block-type-code-editor"},[e("k-input",{ref:"code",attrs:{buttons:!1,placeholder:t.placeholder,spellcheck:!1,value:t.content.code,type:"textarea"},on:{input:function(e){return t.update({code:e})}}}),t.languages.length?e("div",{staticClass:"k-block-type-code-editor-language"},[e("k-icon",{attrs:{type:"code"}}),e("k-input",{ref:"language",attrs:{empty:!1,options:t.languages,value:t.content.language,type:"select"},on:{input:function(e){return t.update({language:e})}}})],1):t._e()],1)}),[],!1,null,null,null,null).exports,me=Object.freeze(Object.defineProperty({__proto__:null,default:he},Symbol.toStringTag,{value:"Module"}));const fe=R({},(function(){var t=this;return(0,t._self._c)("k-block-title",{attrs:{content:t.content,fieldset:t.fieldset},nativeOn:{dblclick:function(e){return t.$emit("open")}}})}),[],!1,null,null,null,null).exports,ge=Object.freeze(Object.defineProperty({__proto__:null,default:fe},Symbol.toStringTag,{value:"Module"}));const ke=R({data(){return{tab:Object.keys(this.fieldset.tabs)[0]}},computed:{fields(){var t;return null==(t=this.fieldset.tabs[this.tab])?void 0:t.fields},values(){return Object.assign({},this.content)}}},(function(){var t=this,e=t._self._c;return e("div",{on:{dblclick:function(e){!t.fieldset.wysiwyg&&t.$emit("open")}}},[e("header",{staticClass:"k-block-type-fields-header"},[e("k-block-title",{attrs:{content:t.values,fieldset:t.fieldset},nativeOn:{dblclick:function(e){return t.$emit("open",t.tab)}}}),e("k-drawer-tabs",{attrs:{tab:t.tab,tabs:t.fieldset.tabs},on:{open:function(e){t.tab=e}}})],1),e("k-form",{ref:"form",staticClass:"k-block-type-fields-form",attrs:{autofocus:!0,disabled:!t.fieldset.wysiwyg,fields:t.fields,value:t.values},on:{input:function(e){return t.$emit("update",e)}}})],1)}),[],!1,null,null,null,null).exports,be=Object.freeze(Object.defineProperty({__proto__:null,default:ke},Symbol.toStringTag,{value:"Module"}));const ve=R({computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop},ratio(){return this.content.ratio}}},(function(){var t=this,e=t._self._c;return e("figure",[e("ul",{on:{dblclick:t.open}},[0===t.content.images.length?t._l(5,(function(n){return e("li",{key:n,staticClass:"k-block-type-gallery-placeholder"},[e("k-aspect-ratio",{attrs:{ratio:t.ratio}})],1)})):t._l(t.content.images,(function(n){return e("li",{key:n.id},[e("k-aspect-ratio",{attrs:{ratio:t.ratio,cover:t.crop}},[e("img",{attrs:{src:n.url,srcset:n.image.srcset,alt:n.alt}})])],1)}))],2),t.content.caption?e("figcaption",[e("k-writer",{attrs:{inline:!0,marks:t.captionMarks,value:t.content.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}})],1):t._e()])}),[],!1,null,null,null,null).exports,ye=Object.freeze(Object.defineProperty({__proto__:null,default:ve},Symbol.toStringTag,{value:"Module"}));const $e=R({computed:{isSplitable(){return this.content.text.length>0&&!1===this.$refs.input.isCursorAtStart&&!1===this.$refs.input.isCursorAtEnd},keys(){return{Enter:()=>!0===this.$refs.input.isCursorAtEnd?this.$emit("append","text"):this.split(),"Mod-Enter":this.split}},levels(){return this.field("level",{options:[]}).options},textField(){return this.field("text",{marks:!0})}},methods:{focus(){this.$refs.input.focus()},merge(t){this.update({text:t.map((t=>t.content.text)).join(" ")})},split(){var t,e;const n=null==(e=(t=this.$refs.input).getSplitContent)?void 0:e.call(t);n&&this.$emit("split",[{text:n[0]},{level:"h"+Math.min(parseInt(this.content.level.slice(1))+1,6),text:n[1]}])}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-heading-input",attrs:{"data-level":t.content.level}},[e("k-writer",{ref:"input",attrs:{inline:!0,keys:t.keys,marks:t.textField.marks,placeholder:t.textField.placeholder,value:t.content.text},on:{input:function(e){return t.update({text:e})}}}),t.levels.length>1?e("k-input",{ref:"level",staticClass:"k-block-type-heading-level",attrs:{empty:!1,options:t.levels,value:t.content.level,type:"select"},on:{input:function(e){return t.update({level:e})}}}):t._e()],1)}),[],!1,null,null,null,null).exports,we=Object.freeze(Object.defineProperty({__proto__:null,default:$e},Symbol.toStringTag,{value:"Module"}));const _e=R({computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop||!1},src(){var t;return"web"===this.content.location?this.content.src:!!(null==(t=this.content.image[0])?void 0:t.url)&&this.content.image[0].url},ratio(){return this.content.ratio||!1}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.image.placeholder")+" …","is-empty":!t.src,"empty-icon":"image"},on:{open:t.open,update:t.update}},[t.src?[t.ratio?e("k-aspect-ratio",{attrs:{ratio:t.ratio,cover:t.crop}},[e("img",{attrs:{alt:t.content.alt,src:t.src}})]):e("img",{staticClass:"k-block-type-image-auto",attrs:{alt:t.content.alt,src:t.src}})]:t._e()],2)}),[],!1,null,null,null,null).exports,xe=Object.freeze(Object.defineProperty({__proto__:null,default:_e},Symbol.toStringTag,{value:"Module"}));const Ce=R({},(function(){return this._self._c,this._m(0)}),[function(){var t=this._self._c;return t("div",[t("hr")])}],!1,null,null,null,null).exports,Se=Object.freeze(Object.defineProperty({__proto__:null,default:Ce},Symbol.toStringTag,{value:"Module"}));const Oe=R({computed:{isSplitable(){return this.content.text.length>0&&!1===this.input().isCursorAtStart&&!1===this.input().isCursorAtEnd},keys(){return{"Mod-Enter":this.split}},marks(){return this.field("text",{}).marks}},methods:{focus(){this.$refs.input.focus()},input(){return this.$refs.input.$refs.input.$refs.input},merge(t){this.update({text:t.map((t=>t.content.text)).join("").replaceAll("
    ","")})},split(){var t,e;const n=null==(e=(t=this.input()).getSplitContent)?void 0:e.call(t);n&&this.$emit("split",[{text:n[0].replace(/(
  • <\/p><\/li><\/ul>)$/,"

")},{text:n[1].replace(/^(
  • <\/p><\/li>)/,"

      ")}])}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-list-input",attrs:{keys:t.keys,marks:t.marks,value:t.content.text,type:"list"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,null,null,null,null).exports,Ae=Object.freeze(Object.defineProperty({__proto__:null,default:Oe},Symbol.toStringTag,{value:"Module"}));const Ie=R({computed:{placeholder(){return this.field("text",{}).placeholder}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-markdown-input",attrs:{buttons:!1,placeholder:t.placeholder,spellcheck:!1,value:t.content.text,type:"textarea"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,null,null,null,null).exports,Me=Object.freeze(Object.defineProperty({__proto__:null,default:Ie},Symbol.toStringTag,{value:"Module"}));const Te=R({computed:{citationField(){return this.field("citation",{})},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.text.focus()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-quote-editor"},[e("k-writer",{ref:"text",staticClass:"k-block-type-quote-text",attrs:{inline:t.textField.inline??!1,marks:t.textField.marks,placeholder:t.textField.placeholder,value:t.content.text},on:{input:function(e){return t.update({text:e})}}}),e("k-writer",{ref:"citation",staticClass:"k-block-type-quote-citation",attrs:{inline:t.citationField.inline??!0,marks:t.citationField.marks,placeholder:t.citationField.placeholder,value:t.content.citation},on:{input:function(e){return t.update({citation:e})}}})],1)}),[],!1,null,null,null,null).exports,je=Object.freeze(Object.defineProperty({__proto__:null,default:Te},Symbol.toStringTag,{value:"Module"}));const Ee=R({inheritAttrs:!1,computed:{columns(){return this.table.columns||this.fields},fields(){return this.table.fields||{}},rows(){return this.content.rows||[]},table(){let t=null;for(const e of Object.values(this.fieldset.tabs))e.fields.rows&&(t=e.fields.rows);return t||{}}}},(function(){var t=this;return(0,t._self._c)("k-table",{staticClass:"k-block-type-table-preview",attrs:{columns:t.columns,empty:t.$t("field.structure.empty"),rows:t.rows},nativeOn:{dblclick:function(e){return t.open.apply(null,arguments)}}})}),[],!1,null,null,null,null).exports,De=Object.freeze(Object.defineProperty({__proto__:null,default:Ee},Symbol.toStringTag,{value:"Module"}));const Le=R({computed:{component(){const t="k-"+this.textField.type+"-input";return this.$helper.isComponent(t)?t:"k-writer-input"},isSplitable(){return this.content.text.length>0&&!1===this.input().isCursorAtStart&&!1===this.input().isCursorAtEnd},keys(){const t={"Mod-Enter":this.split};return!0===this.textField.inline&&(t.Enter=this.split),t},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.input.focus()},input(){return this.$refs.input.$refs.input},merge(t){this.update({text:t.map((t=>t.content.text)).join(this.textField.inline?" ":"")})},split(){var t,e;const n=null==(e=(t=this.input()).getSplitContent)?void 0:e.call(t);n&&("writer"===this.textField.type&&(n[0]=n[0].replace(/(

      <\/p>)$/,""),n[1]=n[1].replace(/^(

      <\/p>)/,"")),this.$emit("split",n.map((t=>({text:t})))))}}},(function(){var t=this;return(0,t._self._c)(t.component,t._b({ref:"input",tag:"component",staticClass:"k-block-type-text-input",attrs:{keys:t.keys,value:t.content.text},on:{input:function(e){return t.update({text:e})}}},"component",t.textField,!1))}),[],!1,null,null,null,null).exports,Be=Object.freeze(Object.defineProperty({__proto__:null,default:Le},Symbol.toStringTag,{value:"Module"}));const Pe=R({computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},video(){return this.$helper.embed.video(this.content.url,!0)}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.video.placeholder")+" …","is-empty":!t.video,"empty-icon":"video"},on:{open:t.open,update:t.update}},[e("k-aspect-ratio",{attrs:{ratio:"16/9"}},[t.video?e("iframe",{attrs:{src:t.video,referrerpolicy:"strict-origin-when-cross-origin"}}):t._e()])],1)}),[],!1,null,null,null,null).exports,Ne=Object.freeze(Object.defineProperty({__proto__:null,default:Pe},Symbol.toStringTag,{value:"Module"}));const Fe=R({inheritAttrs:!1,props:{attrs:[Array,Object],content:[Array,Object],endpoints:Object,fieldset:Object,id:String,isBatched:Boolean,isFull:Boolean,isHidden:Boolean,isLastSelected:Boolean,isMergable:Boolean,isSelected:Boolean,name:String,next:Object,prev:Object,type:String},emits:["append","chooseToAppend","chooseToConvert","chooseToPrepend","close","copy","duplicate","focus","focusPrev","focusNext","hide","merge","open","paste","prepend","remove","selectDown","selectUp","show","sortDown","sortUp","split","submit","update","confirmToRemoveSelected"],data:()=>({skipFocus:!1}),computed:{className(){let t=["k-block-type-"+this.type];return this.fieldset.preview!==this.type&&t.push("k-block-type-"+this.fieldset.preview),!1===this.wysiwyg&&t.push("k-block-type-default"),t},customComponent(){return this.wysiwyg?this.wysiwygComponent:"k-block-type-default"},isEditable(){return!1!==this.fieldset.editable},listeners(){return{append:t=>this.$emit("append",t),chooseToAppend:t=>this.$emit("chooseToAppend",t),chooseToConvert:t=>this.$emit("chooseToConvert",t),chooseToPrepend:t=>this.$emit("chooseToPrepend",t),close:()=>this.$emit("close"),copy:()=>this.$emit("copy"),duplicate:()=>this.$emit("duplicate"),focus:()=>this.$emit("focus"),hide:()=>this.$emit("hide"),merge:()=>this.$emit("merge"),open:()=>this.open(),paste:()=>this.$emit("paste"),prepend:t=>this.$emit("prepend",t),remove:()=>this.remove(),removeSelected:()=>this.$emit("removeSelected"),show:()=>this.$emit("show"),sortDown:()=>this.$emit("sortDown"),sortUp:()=>this.$emit("sortUp"),split:t=>this.$emit("split",t),update:t=>this.$emit("update",t)}},tabs(){let t=this.fieldset.tabs;return Object.entries(t).forEach((([e,n])=>{Object.entries(n.fields).forEach((([n])=>{t[e].fields[n].section=this.name,t[e].fields[n].endpoints={field:this.endpoints.field+"/fieldsets/"+this.type+"/fields/"+n,section:this.endpoints.section,model:this.endpoints.model}}))})),t},wysiwyg(){return!1!==this.wysiwygComponent},wysiwygComponent(){const t=this.fieldset.preview;if(!1===t)return!1;let e;return t&&(e="k-block-type-"+t,this.$helper.isComponent(e))?e:(e="k-block-type-"+this.type,!!this.$helper.isComponent(e)&&e)}},methods:{close(){this.$refs.drawer.close()},focus(){!0!==this.skipFocus&&("function"==typeof this.$refs.editor.focus?this.$refs.editor.focus():this.$refs.container.focus())},goTo(t){t&&(this.skipFocus=!0,this.close(),this.$nextTick((()=>{t.$refs.container.focus(),t.open(),this.skipFocus=!1})))},isSplitable(){var t;return!!this.$refs.editor&&((this.$refs.editor.isSplitable??!0)&&"function"==typeof(null==(t=this.$refs.editor)?void 0:t.split))},onDrawerClose(){this.$emit("close"),this.focus()},onDrawerInput(t){this.$emit("update",t)},onDrawerOpen(){this.$emit("open")},onDrawerSubmit(){this.$emit("submit"),this.close()},onFocusIn(t){var e,n;(null==(n=null==(e=this.$refs.options)?void 0:e.$el)?void 0:n.contains(t.target))||this.$emit("focus",t)},open(t){var e;null==(e=this.$refs.drawer)||e.open(t)},remove(){if(this.isBatched)return this.$emit("removeSelected");this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm")},on:{submit:()=>{this.$panel.dialog.close(),this.$emit("remove",this.id)}}})},submit(){this.close()}}},(function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"k-block-container",class:"k-block-container-type-"+t.type,attrs:{"data-batched":t.isBatched,"data-disabled":t.fieldset.disabled,"data-hidden":t.isHidden,"data-id":t.id,"data-last-selected":t.isLastSelected,"data-selected":t.isSelected,"data-translate":t.fieldset.translate,tabindex:"0"},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"j",void 0,e.key,void 0)?null:e.metaKey?(e.preventDefault(),t.$emit("merge")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"j",void 0,e.key,void 0)?null:e.ctrlKey?(e.preventDefault(),t.$emit("merge")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.metaKey?e.ctrlKey||e.shiftKey||e.altKey?null:(e.preventDefault(),t.$emit("focusPrev")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.ctrlKey?e.shiftKey||e.altKey||e.metaKey?null:(e.preventDefault(),t.$emit("focusPrev")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.metaKey?e.ctrlKey||e.shiftKey||e.altKey?null:(e.preventDefault(),t.$emit("focusNext")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey?e.shiftKey||e.altKey||e.metaKey?null:(e.preventDefault(),t.$emit("focusNext")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.metaKey&&e.altKey?(e.preventDefault(),t.$emit("selectDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.altKey?(e.preventDefault(),t.$emit("selectDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.metaKey&&e.altKey?(e.preventDefault(),t.$emit("selectUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.ctrlKey&&e.altKey?(e.preventDefault(),t.$emit("selectUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.metaKey&&e.shiftKey?(e.preventDefault(),t.$emit("sortDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),t.$emit("sortDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.metaKey&&e.shiftKey?(e.preventDefault(),t.$emit("sortUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),t.$emit("sortUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)?null:e.metaKey?(e.preventDefault(),t.remove.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)?null:e.ctrlKey?(e.preventDefault(),t.remove.apply(null,arguments)):null}],focus:function(e){return t.$emit("focus")},focusin:t.onFocusIn}},[e("div",{staticClass:"k-block",class:t.className},[e(t.customComponent,t._g(t._b({ref:"editor",tag:"component"},"component",t.$props,!1),t.listeners))],1),e("k-block-options",t._g({ref:"options",attrs:{"is-batched":t.isBatched,"is-editable":t.isEditable,"is-full":t.isFull,"is-hidden":t.isHidden,"is-mergable":t.isMergable,"is-splitable":t.isSplitable()}},{...t.listeners,split:()=>t.$refs.editor.split()})),t.isEditable&&!t.isBatched?e("k-form-drawer",{ref:"drawer",staticClass:"k-block-drawer",attrs:{id:t.id,icon:t.fieldset.icon||"box",tabs:t.tabs,title:t.fieldset.name,value:t.content},on:{close:t.onDrawerClose,input:t.onDrawerInput,open:t.onDrawerOpen,submit:t.onDrawerSubmit},scopedSlots:t._u([{key:"options",fn:function(){return[t.isHidden?e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"hidden"},on:{click:function(e){return t.$emit("show")}}}):t._e(),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.prev,icon:"angle-left"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.goTo(t.prev)}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.goTo(t.next)}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.remove.apply(null,arguments)}}})]},proxy:!0}],null,!1,731710025)}):t._e()],1)}),[],!1,null,null,null,null).exports;const qe=R({inheritAttrs:!1,props:{autofocus:Boolean,empty:String,endpoints:Object,fieldsets:Object,fieldsetGroups:Object,group:String,max:{type:Number,default:null},value:{type:Array,default:()=>[]}},data(){return{isEditing:!1,isMultiSelectKey:!1,blocks:this.value,selected:[]}},computed:{draggableOptions(){return{id:this._uid,handle:".k-sort-handle",list:this.blocks,move:this.move,delay:10,data:{fieldsets:this.fieldsets,isFull:this.isFull},options:{group:this.group}}},hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.blocks.length},isFull(){return null!==this.max&&this.blocks.length>=this.max},isMergable(){if(this.selected.length<2)return!1;const t=this.selected.map((t=>this.find(t)));return!(new Set(t.map((t=>t.type))).size>1)&&"function"==typeof this.ref(t[0]).$refs.editor.merge}},watch:{value(){this.blocks=this.value}},created(){this.$events.$on("blur",this.onBlur),this.$events.$on("copy",this.onCopy),this.$events.$on("focus",this.onOutsideFocus),this.$events.$on("keydown",this.onKey),this.$events.$on("keyup",this.onKey),this.$events.$on("paste",this.onPaste)},destroyed(){this.$events.$off("blur",this.onBlur),this.$events.$off("copy",this.onCopy),this.$events.$off("focus",this.onOutsideFocus),this.$events.$off("keydown",this.onKey),this.$events.$off("keyup",this.onKey),this.$events.$off("paste",this.onPaste)},mounted(){!0===this.$props.autofocus&&setTimeout(this.focus,100)},methods:{async add(t="text",e){const n=await this.$api.get(this.endpoints.field+"/fieldsets/"+t);this.blocks.splice(e,0,n),this.save(),this.$nextTick((()=>this.focusOrOpen(n)))},choose(t){if(1===this.$helper.object.length(this.fieldsets)){const e=Object.values(this.fieldsets)[0].type;this.add(e,t)}else this.$refs.selector.open(t)},chooseToConvert(t){this.$refs.selector.open(t,{disabled:[t.type],headline:this.$t("field.blocks.changeType"),event:"convert"})},click(t){this.$emit("click",t)},copy(t){if(0===this.blocks.length)return!1;if(0===this.selected.length)return!1;let e=[];for(const n of this.blocks)this.selected.includes(n.id)&&e.push(n);if(0===e.length)return!1;this.$helper.clipboard.write(e,t),this.selected=e.map((t=>t.id)),this.$panel.notification.success(this.$t("copy.success",{count:e.length}))},copyAll(){this.selectAll(),this.copy(),this.deselectAll()},async convert(t,e){var n;const s=this.findIndex(e.id);if(-1===s)return!1;const i=t=>{let e={};for(const n of Object.values((null==t?void 0:t.tabs)??{}))e={...e,...n.fields};return e},o=this.blocks[s],l=await this.$api.get(this.endpoints.field+"/fieldsets/"+t),r=this.fieldsets[o.type],a=this.fieldsets[t];if(!a)return!1;let u=l.content;const c=i(a),d=i(r);for(const[p,h]of Object.entries(c)){const t=d[p];(null==t?void 0:t.type)===h.type&&(null==(n=null==o?void 0:o.content)?void 0:n[p])&&(u[p]=o.content[p])}this.blocks[s]={...l,id:o.id,content:u},this.save()},deselect(t){const e=this.selected.findIndex((e=>e===t.id));-1!==e&&this.selected.splice(e,1)},deselectAll(){this.selected=[]},async duplicate(t,e){const n={...this.$helper.clone(t),id:this.$helper.uuid()};this.blocks.splice(e+1,0,n),this.save()},fieldset(t){return this.fieldsets[t.type]||{icon:"box",name:t.type,tabs:{content:{fields:{}}},type:t.type}},find(t){return this.blocks.find((e=>e.id===t))},findIndex(t){return this.blocks.findIndex((e=>e.id===t))},focus(t){const e=this.ref(t);this.selected=[(null==t?void 0:t.id)??this.blocks[0]],null==e||e.focus(),null==e||e.$el.scrollIntoView({block:"nearest"})},focusNext(t){const e=this.blocks[Math.min(t+1,this.blocks.length-1)];this.focus(e)},focusPrev(t){const e=this.blocks[Math.max(0,t-1)];this.focus(e)},focusOrOpen(t){this.fieldsets[t.type].wysiwyg?this.focus(t):this.open(t)},hide(t){Vue.set(t,"isHidden",!0),this.save()},isInputEvent(){const t=document.querySelector(":focus");return null==t?void 0:t.matches("input, textarea, [contenteditable], .k-writer")},isLastSelected(t){const[e]=this.selected.slice(-1);return e&&t.id===e},isOnlyInstance:()=>1===document.querySelectorAll(".k-blocks").length,isSelected(t){return this.selected.includes(t.id)},merge(){if(this.isMergable){const t=this.selected.map((t=>this.find(t)));this.ref(t[0]).$refs.editor.merge(t);for(const e of t.slice(1))this.remove(e);this.$nextTick((()=>this.focus(t[0])))}},move(t){if(t.from!==t.to){const e=t.draggedContext.element,n=t.relatedContext.component.componentData||t.relatedContext.component.$parent.componentData;if(!1===Object.keys(n.fieldsets).includes(e.type))return!1;if(!0===n.isFull)return!1}return!0},onBlur(){0===this.selected.length&&(this.isMultiSelectKey=!1)},onClickBlock(t,e){e&&this.isMultiSelectKey&&this.onKey(e),this.isMultiSelectKey&&(this.isSelected(t)?this.deselect(t):this.select(t))},onCopy(t){return!1!==this.$el.contains(t.target)&&!0!==this.isEditing&&!0!==this.$panel.dialog.isOpen&&!0!==this.isInputEvent(t)&&this.copy(t)},onFocus(t){!1===this.isMultiSelectKey&&(this.selected=[t.id])},onKey(t){if(this.isMultiSelectKey=t.metaKey||t.ctrlKey||t.altKey,"Escape"===t.code&&this.selected.length>1){const t=this.find(this.selected[0]);this.$nextTick((()=>this.focus(t)))}},onOutsideFocus(t){if("function"==typeof t.target.closest&&t.target.closest(".k-dialog"))return;const e=document.querySelector(".k-overlay:last-of-type");if(!1!==this.$el.contains(t.target)||e&&!1!==e.contains(t.target)){if(e){const e=this.$el.closest(".k-layout-column");if(!1===(null==e?void 0:e.contains(t.target)))return void(this.selected=[])}}else this.selected=[]},onPaste(t){var e;return!0===(null==(e=this.$refs.selector)?void 0:e.isOpen())?this.paste(t):!0!==this.isInputEvent(t)&&(!0!==this.isEditing&&!0!==this.$panel.dialog.isOpen&&((0!==this.selectedOrBatched.length||!1!==this.$el.contains(t.target))&&this.paste(t)))},open(t){var e;null==(e=this.$refs["block-"+t.id])||e[0].open()},async paste(t){const e=this.$helper.clipboard.read(t),n=await this.$api.post(this.endpoints.field+"/paste",{html:e});let s=this.selected[this.selected.length-1],i=this.findIndex(s);-1===i&&(i=this.blocks.length),this.blocks.splice(i+1,0,...n),this.save(),this.$panel.notification.success(this.$t("paste.success",{count:n.length}))},pasteboard(){this.$refs.pasteboard.open()},prevNext(t){var e;if(this.blocks[t])return null==(e=this.$refs["block-"+this.blocks[t].id])?void 0:e[0]},ref(t){var e,n;return null==(n=this.$refs["block-"+((null==t?void 0:t.id)??(null==(e=this.blocks[0])?void 0:e.id))])?void 0:n[0]},remove(t){const e=this.findIndex(t.id);-1!==e&&(this.deselect(t),this.$delete(this.blocks,e),this.save())},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm.all"),submitButton:this.$t("delete.all")},on:{submit:()=>{this.selected=[],this.blocks=[],this.save(),this.$panel.dialog.close()}}})},removeSelected(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm.selected")},on:{submit:()=>{for(const t of this.selected){const e=this.findIndex(t);-1!==e&&this.$delete(this.blocks,e)}this.deselectAll(),this.save(),this.$panel.dialog.close()}}})},save(){this.$emit("input",this.blocks)},select(t){!1===this.isSelected(t)&&(this.selected.push(t.id),this.selected.sort(((t,e)=>this.findIndex(t)-this.findIndex(e))))},selectDown(){const t=this.selected[this.selected.length-1],e=this.findIndex(t)+1;e=0&&this.select(this.blocks[e])},selectAll(){this.selected=Object.values(this.blocks).map((t=>t.id))},show(t){Vue.set(t,"isHidden",!1),this.save()},sort(t,e,n){if(n<0)return;let s=this.$helper.clone(this.blocks);s.splice(e,1),s.splice(n,0,t),this.blocks=s,this.save(),this.$nextTick((()=>this.focus(t)))},async split(t,e,n){const s=this.$helper.clone(t);s.content={...s.content,...n[0]};const i=await this.$api.get(this.endpoints.field+"/fieldsets/"+t.type);i.content={...i.content,...s.content,...n[1]},this.blocks.splice(e,1,s,i),this.save(),this.$nextTick((()=>this.focus(i)))},update(t,e){const n=this.findIndex(t.id);if(-1!==n)for(const s in e)Vue.set(this.blocks[n].content,s,e[s]);this.save()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-blocks",attrs:{"data-empty":0===t.blocks.length,"data-multi-select-key":t.isMultiSelectKey}},[t.hasFieldsets?[e("k-draggable",t._b({staticClass:"k-blocks-list",on:{sort:t.save},scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-empty",{staticClass:"k-blocks-empty",attrs:{icon:"box"},on:{click:function(e){return t.choose(t.blocks.length)}}},[t._v(" "+t._s(t.empty||t.$t("field.blocks.empty"))+" ")])]},proxy:!0}],null,!1,2413899928)},"k-draggable",t.draggableOptions,!1),t._l(t.blocks,(function(n,s){return e("k-block",t._b({key:n.id,ref:"block-"+n.id,refInFor:!0,attrs:{endpoints:t.endpoints,fieldset:t.fieldset(n),"is-batched":t.isSelected(n)&&t.selected.length>1,"is-last-selected":t.isLastSelected(n),"is-full":t.isFull,"is-hidden":!0===n.isHidden,"is-mergable":t.isMergable,"is-selected":t.isSelected(n),next:t.prevNext(s+1),prev:t.prevNext(s-1)},on:{append:function(e){return t.add(e,s+1)},chooseToAppend:function(e){return t.choose(s+1)},chooseToConvert:function(e){return t.chooseToConvert(n)},chooseToPrepend:function(e){return t.choose(s)},close:function(e){t.isEditing=!1},copy:function(e){return t.copy()},duplicate:function(e){return t.duplicate(n,s)},focus:function(e){return t.onFocus(n)},focusPrev:function(e){return t.focusPrev(s)},focusNext:function(e){return t.focusNext(s)},hide:function(e){return t.hide(n)},merge:function(e){return t.merge()},open:function(e){t.isEditing=!0},paste:function(e){return t.pasteboard()},prepend:function(e){return t.add(e,s)},remove:function(e){return t.remove(n)},removeSelected:t.removeSelected,show:function(e){return t.show(n)},selectDown:t.selectDown,selectUp:t.selectUp,sortDown:function(e){return t.sort(n,s,s+1)},sortUp:function(e){return t.sort(n,s,s-1)},split:function(e){return t.split(n,s,e)},update:function(e){return t.update(n,e)}},nativeOn:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.onClickBlock(n,e)}}},"k-block",n,!1))})),1),e("k-block-selector",{ref:"selector",attrs:{fieldsets:t.fieldsets,"fieldset-groups":t.fieldsetGroups},on:{add:t.add,convert:t.convert,paste:function(e){return t.paste(e)}}}),e("k-block-pasteboard",{ref:"pasteboard",on:{paste:function(e){return t.paste(e)}}})]:[e("k-box",{attrs:{theme:"info"}},[t._v(" No fieldsets yet ")])]],2)}),[],!1,null,null,null,null).exports;const Re=R({inheritAttrs:!1,props:{caption:String,captionMarks:[Boolean,Array],cover:{type:Boolean,default:!0},isEmpty:Boolean,emptyIcon:String,emptyText:String,ratio:String},computed:{ratioPadding(){return this.$helper.ratio(this.ratio||"16/9")}}},(function(){var t=this,e=t._self._c;return e("figure",{staticClass:"k-block-figure"},[t.isEmpty?e("k-button",{staticClass:"k-block-figure-empty",attrs:{icon:t.emptyIcon,text:t.emptyText},on:{click:function(e){return t.$emit("open")}}}):e("span",{staticClass:"k-block-figure-container",on:{dblclick:function(e){return t.$emit("open")}}},[t._t("default")],2),t.caption?e("figcaption",[e("k-writer",{attrs:{inline:!0,marks:t.captionMarks,value:t.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;const ze=R({props:{isBatched:Boolean,isEditable:Boolean,isFull:Boolean,isHidden:Boolean,isMergable:Boolean,isSplitable:Boolean},methods:{open(){this.$refs.options.open()}}},(function(){var t=this,e=t._self._c;return e("k-dropdown",{staticClass:"k-block-options"},[t.isBatched?[e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("copy"),icon:"template"},on:{click:function(e){return t.$emit("copy")}}}),t.isMergable?e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("merge"),icon:"merge"},on:{click:function(e){return t.$emit("merge")}}}):t._e(),e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("remove"),icon:"trash"},on:{click:function(e){return t.$emit("removeSelected")}}})]:[t.isEditable?e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("edit"),icon:"edit"},on:{click:function(e){return t.$emit("open")}}}):t._e(),e("k-button",{staticClass:"k-block-options-button",attrs:{disabled:t.isFull,tooltip:t.$t("insert.after"),icon:"add"},on:{click:function(e){return t.$emit("chooseToAppend")}}}),e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("delete"),icon:"trash"},on:{click:function(e){return t.$emit("remove")}}}),e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("more"),icon:"dots"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-button",{staticClass:"k-block-options-button k-sort-handle",attrs:{tooltip:t.$t("sort"),icon:"sort"},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.$emit("sortUp"))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.$emit("sortDown"))}]}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"angle-up"},on:{click:function(e){return t.$emit("chooseToPrepend")}}},[t._v(" "+t._s(t.$t("insert.before"))+" ")]),e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"angle-down"},on:{click:function(e){return t.$emit("chooseToAppend")}}},[t._v(" "+t._s(t.$t("insert.after"))+" ")]),e("hr"),t.isEditable?e("k-dropdown-item",{attrs:{icon:"edit"},on:{click:function(e){return t.$emit("open")}}},[t._v(" "+t._s(t.$t("edit"))+" ")]):t._e(),e("k-dropdown-item",{attrs:{icon:"refresh"},on:{click:function(e){return t.$emit("chooseToConvert")}}},[t._v(" "+t._s(t.$t("field.blocks.changeType"))+" ")]),t.isSplitable?e("k-dropdown-item",{attrs:{icon:"split"},on:{click:function(e){return t.$emit("split")}}},[t._v(" "+t._s(t.$t("split"))+" ")]):t._e(),e("hr"),e("k-dropdown-item",{attrs:{icon:"template"},on:{click:function(e){return t.$emit("copy")}}},[t._v(" "+t._s(t.$t("copy"))+" ")]),e("k-dropdown-item",{attrs:{icon:"download"},on:{click:function(e){return t.$emit("paste")}}},[t._v(" "+t._s(t.$t("paste.after"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:t.isHidden?"preview":"hidden"},on:{click:function(e){return t.$emit(t.isHidden?"show":"hide")}}},[t._v(" "+t._s(!0===t.isHidden?t.$t("show"):t.$t("hide"))+" ")]),e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"copy"},on:{click:function(e){return t.$emit("duplicate")}}},[t._v(" "+t._s(t.$t("duplicate"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:"trash"},on:{click:function(e){return t.$emit("remove")}}},[t._v(" "+t._s(t.$t("delete"))+" ")])],1)]],2)}),[],!1,null,null,null,null).exports;const Ye=R({inheritAttrs:!1,computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{close(){this.$refs.dialog.close()},open(){this.$refs.dialog.open()},onPaste(t){this.$emit("paste",t),this.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-block-importer",attrs:{"cancel-button":!1,"submit-button":!1,size:"large"}},[e("label",{attrs:{for:"pasteboard"},domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}}),e("textarea",{attrs:{id:"pasteboard"},on:{paste:function(e){return e.preventDefault(),t.onPaste.apply(null,arguments)}}})])}),[],!1,null,null,null,null).exports;const He=R({inheritAttrs:!1,props:{endpoint:String,fieldsets:Object,fieldsetGroups:Object},data(){return{dialogIsOpen:!1,disabled:[],headline:null,payload:null,event:"add",groups:this.createGroups()}},computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{add(t){this.$emit(this.event,t,this.payload),this.$refs.dialog.close()},close(){this.$refs.dialog.close()},createGroups(){let t={},e=0;const n=this.fieldsetGroups||{blocks:{label:this.$t("field.blocks.fieldsets.label"),sets:Object.keys(this.fieldsets)}};return Object.keys(n).forEach((s=>{let i=n[s];i.open=!1!==i.open,i.fieldsets=i.sets.filter((t=>this.fieldsets[t])).map((t=>(e++,{...this.fieldsets[t],index:e}))),0!==i.fieldsets.length&&(t[s]=i)})),t},isOpen(){return this.dialogIsOpen},navigate(t){var e,n;null==(n=null==(e=this.$refs["fieldset-"+t])?void 0:e[0])||n.focus()},onClose(){this.dialogIsOpen=!1,this.$events.$off("paste",this.close)},onOpen(){this.dialogIsOpen=!0,this.$events.$on("paste",this.close)},open(t,e={}){const n={event:"add",disabled:[],headline:null,...e};this.event=n.event,this.disabled=n.disabled,this.headline=n.headline,this.payload=t,this.$refs.dialog.open()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-block-selector",attrs:{"cancel-button":!1,"submit-button":!1,size:"medium"},on:{open:t.onOpen,close:t.onClose}},[t.headline?e("k-headline",[t._v(" "+t._s(t.headline)+" ")]):t._e(),t._l(t.groups,(function(n,s){return e("details",{key:s,attrs:{open:n.open}},[e("summary",[t._v(t._s(n.label))]),e("div",{staticClass:"k-block-types"},t._l(n.fieldsets,(function(n){return e("k-button",{key:n.name,ref:"fieldset-"+n.index,refInFor:!0,attrs:{disabled:t.disabled.includes(n.type),icon:n.icon||"box",text:n.name},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:t.navigate(n.index-1)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:t.navigate(n.index+1)}],click:function(e){return t.add(n.type)}}})})),1)])})),e("p",{staticClass:"k-clipboard-hint",domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}})],2)}),[],!1,null,null,null,null).exports;const Ue=R({inheritAttrs:!1,props:{fieldset:Object,content:Object},computed:{icon(){return this.fieldset.icon||"box"},label(){if(!this.fieldset.label||0===this.fieldset.label.length)return!1;if(this.fieldset.label===this.fieldset.name)return!1;const t=this.$helper.string.template(this.fieldset.label,this.content);return"…"!==t&&this.$helper.string.stripHTML(t)},name(){return this.fieldset.name}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-title"},[e("k-icon",{staticClass:"k-block-icon",attrs:{type:t.icon}}),e("span",{staticClass:"k-block-name"},[t._v(" "+t._s(t.name)+" ")]),t.label?e("span",{staticClass:"k-block-label"},[t._v(" "+t._s(t.label)+" ")]):t._e()],1)}),[],!1,null,null,null,null).exports;const Ke=R({inheritAttrs:!1,props:{content:[Object,Array],fieldset:Object},methods:{field(t,e=null){let n=null;return Object.values(this.fieldset.tabs).forEach((e=>{e.fields[t]&&(n=e.fields[t])})),n||e},open(){this.$emit("open")},update(t){this.$emit("update",{...this.content,...t})}}},null,null,!1,null,null,null,null).exports,Ve={install(t){t.component("k-block",Fe),t.component("k-blocks",qe),t.component("k-block-figure",Re),t.component("k-block-options",ze),t.component("k-block-pasteboard",Ye),t.component("k-block-selector",He),t.component("k-block-title",Ue),t.component("k-block-type",Ke);const e=Object.assign({"./Types/Code.vue":me,"./Types/Default.vue":ge,"./Types/Fields.vue":be,"./Types/Gallery.vue":ye,"./Types/Heading.vue":we,"./Types/Image.vue":xe,"./Types/Line.vue":Se,"./Types/List.vue":Ae,"./Types/Markdown.vue":Me,"./Types/Quote.vue":je,"./Types/Table.vue":De,"./Types/Text.vue":Be,"./Types/Video.vue":Ne});for(const n in e){const s=n.match(/\/([a-zA-Z]*)\.vue/)[1].toLowerCase();let i=e[n].default;i.extends=Ke,t.component("k-block-type-"+s,i)}}},We=/^#([\da-f]{3}){1,2}$/i,Je=/^#([\da-f]{4}){1,2}$/i,Ge=/rgba?\(\s*(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?/i,Ze=/hsla?\(\s*(\d{1,3})(?:deg|rad|grad|turn)?(?:,|\s)+(\d{1,3})%(?:,|\s)+(\d{1,3})%(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?/i;function Qe(t){return"string"==typeof t&&(We.test(t)||Je.test(t))}function Xe(t){return H(t)&&"r"in t&&"g"in t&&"b"in t}function tn(t){return H(t)&&"h"in t&&"s"in t&&"l"in t}function en({h:t,s:e,v:n,a:s}){if(0===n)return{h:t,s:0,l:0,a:s};if(0===e&&1===n)return{h:t,s:1,l:1,a:s};const i=n*(2-e)/2;return{h:t,s:e=n*e/(1-Math.abs(2*i-1)),l:i,a:s}}function nn({h:t,s:e,l:n,a:s}){const i=e*(n<.5?n:1-n);return{h:t,s:e=0===i?0:2*i/(n+i),v:n+i,a:s}}function sn(t){if(!0===We.test(t)){3===(t=t.slice(1)).length&&(t=t.split("").reduce(((t,e)=>t+e+e),""));const e=parseInt(t,16);return{r:e>>16,g:e>>8&255,b:255&e,a:1}}if(!0===Je.test(t)){4===(t=t.slice(1)).length&&(t=t.split("").reduce(((t,e)=>t+e+e),""));const e=parseInt(t,16);return{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:Math.round((255&e)/255*100)/100}}throw new Error(`unknown hex color: ${t}`)}function on({r:t,g:e,b:n,a:s=1}){let i="#"+(1<<24|t<<16|e<<8|n).toString(16).slice(1);return s<1&&(i+=(256|Math.round(255*s)).toString(16).slice(1)),i}function ln({h:t,s:e,l:n,a:s}){const i=e*Math.min(n,1-n),o=(e,s=(e+t/30)%12)=>n-i*Math.max(Math.min(s-3,9-s,1),-1);return{r:255*o(0),g:255*o(8),b:255*o(4),a:s}}function rn({r:t,g:e,b:n,a:s}){t/=255,e/=255,n/=255;const i=Math.max(t,e,n),o=i-Math.min(t,e,n),l=1-Math.abs(i+i-o-1);let r=o&&(i==t?(e-n)/o:i==e?2+(n-t)/o:4+(t-e)/o);return r=60*(r<0?r+6:r),{h:r,s:l?o/l:0,l:(i+i-o)/2,a:s}}function an(t){return on(ln(t))}function un(t){return rn(sn(t))}function cn(t,e){if(!0===Qe(t))switch(e){case"hex":return t;case"rgb":return sn(t);case"hsl":return un(t);case"hsv":return nn(un(t))}if(!0===Xe(t))switch(e){case"hex":return on(t);case"rgb":return t;case"hsl":return rn(t);case"hsv":return function({r:t,g:e,b:n,a:s}){t/=255,e/=255,n/=255;const i=Math.max(t,e,n),o=i-Math.min(t,e,n);let l=o&&(i==t?(e-n)/o:i==e?2+(n-t)/o:4+(t-e)/o);return l=60*(l<0?l+6:l),{h:l,s:i&&o/i,v:i,a:s}}(t)}if(!0===tn(t))switch(e){case"hex":return an(t);case"rgb":return ln(t);case"hsl":return t;case"hsv":return nn(t)}if(!0===function(t){return H(t)&&"h"in t&&"s"in t&&"v"in t}(t))switch(e){case"hex":return an(en(t));case"rgb":return function({h:t,s:e,v:n,a:s}){const i=(s,i=(s+t/60)%6)=>n-n*e*Math.max(Math.min(i,4-i,1),0);return{r:255*i(5),g:255*i(3),b:255*i(1),a:s}}(t);case"hsl":return en(t);case"hsv":return t}throw new Error(`Invalid color conversion: ${JSON.stringify(t)} -> ${e}`)}function dn(t){let e;if(!t||"string"!=typeof t)return!1;if(Qe(t))return t;if(e=t.match(Ge)){const t={r:Number(e[1]),g:Number(e[3]),b:Number(e[5]),a:Number(e[7]||1)};return"%"===e[2]&&(t.r=Math.ceil(2.55*t.r)),"%"===e[4]&&(t.g=Math.ceil(2.55*t.g)),"%"===e[6]&&(t.b=Math.ceil(2.55*t.b)),"%"===e[8]&&(t.a=t.a/100),t}if(e=t.match(Ze)){const[t,n,s,i]=e.slice(1),o={h:Number(t),s:Number(n)/100,l:Number(s)/100,a:Number(i||1)};return"%"===e[5]&&(o.a=o.a/100),o}return null}const pn={convert:cn,parse:dn,parseAs:function(t,e){const n=dn(t);return n&&e?cn(n,e):n},toString:function(t,e,n=!0){var s,i;let o=t;if("string"==typeof o&&(o=dn(t)),o&&e&&(o=cn(o,e)),!0===Qe(o))return!0!==n&&(5===o.length?o=o.slice(0,4):o.length>7&&(o=o.slice(0,7))),o.toLowerCase();if(!0===Xe(o)){const t=o.r.toFixed(),e=o.g.toFixed(),i=o.b.toFixed(),l=null==(s=o.a)?void 0:s.toFixed(2);return n&&l&&l<1?`rgb(${t} ${e} ${i} / ${l})`:`rgb(${t} ${e} ${i})`}if(!0===tn(o)){const t=o.h.toFixed(),e=(100*o.s).toFixed(),s=(100*o.l).toFixed(),l=null==(i=o.a)?void 0:i.toFixed(2);return n&&l&&l<1?`hsl(${t} ${e}% ${s}% / ${l})`:`hsl(${t} ${e}% ${s}%)`}throw new Error(`Unsupported color: ${JSON.stringify(t)}`)}};class hn extends HTMLElement{constructor(){super(),this.color={h:0,s:1,v:1,a:1}}connectedCallback(){this.innerHTML="",this.classList.add("k-color"),this.coords=document.createElement("k-coords"),this.coords.addEventListener("input",this.onCoords.bind(this)),this.appendChild(this.coords),this.hue=document.createElement("input"),this.hue.type="range",this.hue.min=0,this.hue.max=360,this.hue.value=this.color.h,this.hue.setAttribute("data-variant","hue"),this.hue.addEventListener("input",this.onHue.bind(this)),this.appendChild(this.hue),this.hasAlpha&&(this.alpha=document.createElement("input"),this.alpha.type="range",this.alpha.min=0,this.alpha.max=1,this.alpha.step=.01,this.alpha.value=this.color.a,this.alpha.setAttribute("data-variant","alpha"),this.alpha.addEventListener("input",this.onAlpha.bind(this)),this.appendChild(this.alpha)),this.coords.value={x:0,y:0}}between(t,e,n){return Math.min(Math.max(t,e),n)}get hex(){return pn.toString(this.color,"hex")}get hsl(){return pn.toString(this.color,"hsl")}get hasAlpha(){return"true"===this.getAttribute("alpha","true")}onAlpha(t){this.onInput(t,{a:Number(t.target.value)})}onCoords(t){const e=Math.round(t.target.value.x),n=Math.round(t.target.value.y);this.onInput(t,{s:e/100,v:1-n/100})}onHue(t){this.onInput(t,{h:Number(t.target.value)})}onInput(t,e){t.stopPropagation(),this.value=e,this.dispatchEvent(new CustomEvent("input",{detail:this.color}))}get rgb(){return pn.toString(this.color,"rgb")}get value(){return this.color}set value(t){if("string"==typeof t){const e=pn.parseAs(t,"hsv");if(!e)return;t=e}t={...this.color,...t},this.color={h:this.between(t.h,0,360),s:this.between(t.s,0,1),v:this.between(t.v,0,1),a:this.hasAlpha?this.between(t.a,0,1):1};const e=pn.convert(this.color,"hsl");this.style.setProperty("--h",e.h),this.style.setProperty("--s",(100*e.s).toFixed()+"%"),this.style.setProperty("--l",(100*e.l).toFixed()+"%"),this.coords.value={x:100*this.color.s,y:100*(1-this.color.v)},this.hue.value=this.color.h,this.hasAlpha&&(this.style.setProperty("--a",e.a),this.alpha.value=this.color.a)}}class mn extends HTMLElement{static get observedAttributes(){return["x","y"]}constructor(){super(),this.x=0,this.y=0}attributeChangedCallback(){this.value={x:this.getAttribute("x")??0,y:this.getAttribute("y")??0}}connectedCallback(){this.classList.add("k-coords"),this.tabIndex=0,this.marker=document.createElement("button"),this.marker.type="button",this.marker.classList.add("k-coords-thumb"),this.addEventListener("mousedown",(t=>this.onDrag(t))),this.addEventListener("click",(t=>this.onMove(t))),this.addEventListener("keydown",(t=>this.onKeys(t))),this.appendChild(this.marker),void 0!==this.value.x&&void 0!==this.value.y&&this.setMarker()}getCoords(t,e){return{x:Math.min(Math.max(t.clientX-e.left,0),e.width),y:Math.min(Math.max(t.clientY-e.top,0),e.height)}}get disabled(){return this.hasAttribute("aria-disabled")&&!1!==this.getAttribute("aria-disabled")}onDrag(t){if(0!==t.button)return;const e=t=>this.onMove(t),n=()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",e),window.addEventListener("mouseup",n)}onMove(t){const e=this.getBoundingClientRect(),n=this.getCoords(t,e),s=n.x/e.width*100,i=n.y/e.height*100;this.onInput(t,{x:s,y:i})}onKeys(t){const e=t.shiftKey?10:1,n={ArrowUp:{y:this.y-e},ArrowDown:{y:this.y+e},ArrowLeft:{x:this.x-e},ArrowRight:{x:this.x+e}};n[t.key]&&this.onInput(t,n[t.key])}onInput(t,e){if(t.preventDefault(),t.stopPropagation(),this.disabled)return!1;this.value={...this.value,...e},this.dispatchEvent(new CustomEvent("input",{detail:this.value}))}parseValue(t){if("object"==typeof t)return t;const e={"top left":{x:0,y:0},"top center":{x:50,y:0},"top right":{x:100,y:0},"center left":{x:0,y:50},center:{x:50,y:50},"center center":{x:50,y:50},"center right":{x:100,y:50},"bottom left":{x:0,y:100},"bottom center":{x:50,y:100},"bottom right":{x:100,y:100}};if(e[t])return e[t];const n=t.split(",").map((t=>t.trim()));return{x:n[0],y:n[1]??0}}get value(){return{x:this.x,y:this.y}}set value(t){"object"!=typeof t&&(t=this.parseValue(t)),this.x=Math.min(Math.max(parseFloat(t.x??0),0),100),this.y=Math.min(Math.max(parseFloat(t.y??0),0),100),this.setMarker()}setMarker(){this.marker&&(this.marker.style.left=this.x+"%",this.marker.style.top=this.y+"%")}}const fn=R({props:{autofocus:String,form:String,id:String,max:Number,min:Number,name:String,required:Boolean,step:Number,value:Number,variant:String}},(function(){var t=this;return(0,t._self._c)("input",t._b({attrs:{"data-variant":t.variant,type:"range"}},"input",t.$props,!1))}),[],!1,null,null,null,null).exports,gn={install(t){customElements.define("k-color",hn),customElements.define("k-coords",mn),t.component("k-range",fn)}};const kn=R({mixins:[Qt],inheritAttrs:!1,props:{autofocus:Boolean,empty:String,fieldsets:Object,fieldsetGroups:Object,group:String,max:{type:Number,default:null},value:{type:Array,default:()=>[]}},data:()=>({opened:[]}),computed:{hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.value.length},isFull(){return null!==this.max&&this.value.length>=this.max}},methods:{focus(){this.$refs.blocks.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-blocks-field",scopedSlots:t._u([{key:"options",fn:function(){return[t.hasFieldsets?e("k-dropdown",[e("k-button",{attrs:{icon:"dots"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"add"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}},[t._v(" "+t._s(t.$t("add"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{disabled:t.isEmpty,icon:"template"},on:{click:function(e){return t.$refs.blocks.copyAll()}}},[t._v(" "+t._s(t.$t("copy.all"))+" ")]),e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"download"},on:{click:function(e){return t.$refs.blocks.pasteboard()}}},[t._v(" "+t._s(t.$t("paste"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{disabled:t.isEmpty,icon:"trash"},on:{click:function(e){return t.$refs.blocks.removeAll()}}},[t._v(" "+t._s(t.$t("delete.all"))+" ")])],1)],1):t._e()]},proxy:!0}])},"k-field",t.$props,!1),[e("k-blocks",t._g({ref:"blocks",attrs:{autofocus:t.autofocus,compact:!1,empty:t.empty,endpoints:t.endpoints,fieldsets:t.fieldsets,"fieldset-groups":t.fieldsetGroups,group:t.group,max:t.max,value:t.value},on:{close:function(e){t.opened=e},open:function(e){t.opened=e}}},t.$listeners)),t.isEmpty||t.isFull?t._e():e("k-button",{staticClass:"k-field-add-item-button",attrs:{icon:"add",tooltip:t.$t("add")},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}})],1)}),[],!1,null,null,null,null).exports,bn={mixins:[Yt,Ut,Vt,Zt],props:{columns:Number,max:Number,min:Number,options:Array,value:{type:[Array,Object],default:()=>[]}}};const vn=R({mixins:[bn],inheritAttrs:!1,data(){return{selected:this.toArray(this.value)}},watch:{value(t){this.selected=this.toArray(t)},selected(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},onInput(t,e){if(!0===e)this.selected.push(t);else{const e=this.selected.indexOf(t);-1!==e&&this.selected.splice(e,1)}this.$emit("input",this.selected)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()},toArray:t=>!0===Array.isArray(t)?t:"string"==typeof t?String(t).split(","):"object"==typeof t?Object.values(t):void 0},validations(){return{selected:{required:!this.required||t.required,min:!this.min||t.minLength(this.min),max:!this.max||t.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-checkboxes-input",style:"--columns:"+t.columns},[t.options.length?t._l(t.options,(function(n,s){return e("li",{key:s},[e("k-checkbox-input",{attrs:{id:t.id+"-"+s,label:n.text,value:-1!==t.selected.indexOf(n.value)},on:{input:function(e){return t.onInput(n.value,e)}}})],1)})):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.$t("options.none")))])],2)}),[],!1,null,null,null,null).exports,yn={props:{counter:{type:Boolean,default:!0}},computed:{counterOptions(){const t=this.counterValue??this.value;if(null===t||this.disabled||!1===this.counter)return!1;let e=0;return t&&(e=Array.isArray(t)?t.length:String(t).length),{count:e,min:this.min??this.minlength,max:this.max??this.maxlength}}}};const $n=R({mixins:[Qt,ee,bn,yn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-checkboxes-field",attrs:{counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"checkboxes"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,wn={mixins:[Yt,Ut,Vt,Gt,Zt],props:{alpha:{type:Boolean,default:!0},format:{type:String,default:"hex",validator:t=>["hex","rgb","hsl"].includes(t)},placeholder:String,value:String}};const _n=R({mixins:[wn],inheritAttrs:!1,watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.onBlur(),this.$props.autofocus&&this.focus()},methods:{convert(t){try{return this.$library.colors.toString(t,this.format,this.alpha)}catch(e){return t}},focus(){this.$refs.input.focus()},onBlur(){const t=this.convert(this.value);this.onInput(t)},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onPaste(t){t instanceof ClipboardEvent&&(t=this.$helper.clipboard.read(t,!0));const e=this.convert(t);this.onInput(e)},onSave(){this.onBlur(),this.$emit("submit")},select(){this.$refs.input.select()}},validations(){return{value:{color:t=>!t||null!==this.$library.colors.parse(t),required:!this.required||t.required}}}},(function(){var t=this;return(0,t._self._c)("input",t._b({ref:"input",staticClass:"k-text-input k-color-input",attrs:{autocomplete:"off",spellcheck:"false",type:"text"},on:{blur:t.onBlur,input:function(e){return t.onInput(e.target.value)},paste:t.onPaste,keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?(e.stopPropagation(),e.preventDefault(),t.onSave.apply(null,arguments)):null}}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,name:t.name,placeholder:t.placeholder,required:t.required,value:t.value},!1))}),[],!1,null,null,null,null).exports;const xn=R({mixins:[Qt,ee,wn],inheritAttrs:!1,props:{icon:{type:String,default:"pipette"},mode:{type:String,default:"picker",validator:t=>["picker","input","options"].includes(t)},options:{type:Array,default:()=>[]}},data:()=>({isInvalid:!1}),computed:{convertedOptions(){return this.options.map((t=>({...t,value:this.convert(t.value)})))},currentOption(){return this.convertedOptions.find((t=>t.value===this.value))}},methods:{convert(t){return this.$library.colors.toString(t,this.format,this.alpha)},onInput(t){this.setPicker(t),this.$emit("input",t)},onPicker(t){const e=this.convert(t);this.$emit("input",e)},onOption(t){const e=this.convert(t.value);e!==this.value||this.required?this.$emit("input",e):this.$emit("input","")},setPicker(t=this.value){this.$refs.color&&(this.$refs.color.value=this.$library.colors.parseAs(t,"hsv"))}}},(function(){var t,e=this,n=e._self._c;return n("k-field",e._b({staticClass:"k-color-field",attrs:{input:e._uid}},"k-field",e.$props,!1),["options"===e.mode?n("div",{staticClass:"k-color-field-options",staticStyle:{"--preview-width":"var(--field-input-height)"}},e._l(e.convertedOptions,(function(t){var s;return n("button",{key:t.value,staticClass:"k-color-preview",style:"color: "+t.value,attrs:{"aria-current":t.value===(null==(s=e.currentOption)?void 0:s.value),title:t.text??t.value,type:"button"},on:{click:function(n){return e.onOption(t)}}})})),0):n("k-input",e._b({ref:"input",attrs:{id:e._uid,theme:"field",type:"color"},on:{input:e.onInput,invalid:function(t){e.isInvalid=t??!1},submit:function(t){return e.$emit("submit")}},scopedSlots:e._u([{key:"before",fn:function(){return["picker"===e.mode?[n("k-dropdown",[n("button",{staticClass:"k-color-field-preview k-color-preview",style:e.isInvalid?null:"color: "+e.value,attrs:{type:"button"},on:{click:function(t){return e.$refs.picker.toggle()}}}),n("k-dropdown-content",{ref:"picker",staticClass:"k-color-field-picker",on:{open:function(t){return e.$nextTick(e.setPicker)}}},[n("k-color",{ref:"color",attrs:{alpha:e.alpha},on:{input:function(t){return e.onPicker(t.target.value)}}}),n("div",{staticClass:"k-color-field-options"},e._l(e.convertedOptions,(function(t){return n("button",{key:t.value,staticClass:"k-color-preview",style:"color: "+t.value,attrs:{title:t.text??t.value,type:"button"},on:{click:function(n){return e.$refs.input.$refs.input.onPaste(t.value)}}})})),0)],1)],1)]:n("div",{staticClass:"k-color-field-preview k-color-preview",style:e.isInvalid?null:"color: "+e.value})]},proxy:!0},(null==(t=e.currentOption)?void 0:t.text)?{key:"after",fn:function(){return[e._v(" "+e._s(e.currentOption.text)+" ")]},proxy:!0}:null,"picker"===e.mode?{key:"icon",fn:function(){return[n("k-button",{staticClass:"k-input-icon-button",attrs:{icon:e.icon},on:{click:function(t){return t.stopPropagation(),e.$refs.picker.toggle()}}})]},proxy:!0}:null],null,!0)},"k-input",e.$props,!1))],1)}),[],!1,null,null,null,null).exports,Cn={mixins:[Yt,Ut,Vt,Zt],props:{display:{type:String,default:"DD.MM.YYYY"},max:String,min:String,step:{type:Object,default:()=>({size:1,unit:"day"})},type:{type:String,default:"date"},value:String}};const Sn=R({mixins:[Cn],inheritAttrs:!1,data:()=>({dt:null,formatted:null}),computed:{inputType:()=>"date",pattern(){return this.$library.dayjs.pattern(this.display)},rounding(){return{...this.$options.props.step.default(),...this.step}}},watch:{value:{handler(t,e){if(t!==e){const e=this.toDatetime(t);this.commit(e)}},immediate:!0}},created(){this.$events.$on("keydown.cmd.s",this.onBlur)},destroyed(){this.$events.$off("keydown.cmd.s",this.onBlur)},methods:{alter(t){let e=this.parse()||this.round(this.$library.dayjs()),n=this.rounding.unit,s=this.rounding.size;const i=this.selection();null!==i&&("meridiem"===i.unit?(t="pm"===e.format("a")?"subtract":"add",n="hour",s=12):(n=i.unit,n!==this.rounding.unit&&(s=1))),e=e[t](s,n).round(this.rounding.unit,this.rounding.size),this.commit(e),this.emit(e),this.$nextTick((()=>this.select(i)))},commit(t){this.dt=t,this.formatted=this.pattern.format(t),this.$emit("invalid",this.$v.$invalid,this.$v)},emit(t){this.$emit("input",this.toISO(t))},focus(){this.$refs.input.focus()},onArrowDown(){this.alter("subtract")},onArrowUp(){this.alter("add")},onBlur(){const t=this.parse();this.commit(t),this.emit(t)},onEnter(){this.onBlur(),this.$nextTick((()=>this.$emit("submit")))},onInput(t){const e=this.parse(),n=this.pattern.format(e);if(!t||n==t)return this.commit(e),this.emit(e)},onTab(t){""!=this.$refs.input.value&&(this.onBlur(),this.$nextTick((()=>{const e=this.selection();if(this.$refs.input&&e.start===this.$refs.input.selectionStart&&e.end===this.$refs.input.selectionEnd-1)if(t.shiftKey){if(0===e.index)return;this.selectPrev(e.index)}else{if(e.index===this.pattern.parts.length-1)return;this.selectNext(e.index)}else{if(this.$refs.input&&this.$refs.input.selectionStart==e.end+1&&e.index==this.pattern.parts.length-1)return;if(this.$refs.input&&this.$refs.input.selectionEnd-1>e.end){const t=this.pattern.at(this.$refs.input.selectionEnd,this.$refs.input.selectionEnd);this.select(this.pattern.parts[t.index])}else this.select(this.pattern.parts[e.index])}t.preventDefault()})))},parse(){let t=this.$refs.input.value;return t=this.$library.dayjs.interpret(t,this.inputType),this.round(t)},round(t){return(null==t?void 0:t.round(this.rounding.unit,this.rounding.size))||null},select(t){var e;t||(t=this.selection()),null==(e=this.$refs.input)||e.setSelectionRange(t.start,t.end+1)},selectFirst(){this.select(this.pattern.parts[0])},selectLast(){this.select(this.pattern.parts[this.pattern.parts.length-1])},selectNext(t){this.select(this.pattern.parts[t+1])},selectPrev(t){this.select(this.pattern.parts[t-1])},selection(){return this.pattern.at(this.$refs.input.selectionStart,this.$refs.input.selectionEnd)},toDatetime(t){return this.round(this.$library.dayjs.iso(t,this.inputType))},toISO(t){return(null==t?void 0:t.toISO(this.inputType))||null}},validations(){return{value:{min:!this.dt||!this.min||(()=>this.dt.validate(this.min,"min",this.rounding.unit)),max:!this.dt||!this.max||(()=>this.dt.validate(this.max,"max",this.rounding.unit)),required:!this.required||(()=>!!this.dt)}}}},(function(){var t=this;return(0,t._self._c)("input",{directives:[{name:"direction",rawName:"v-direction"}],ref:"input",class:`k-text-input k-${t.type}-input`,attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled,placeholder:t.display,required:t.required,autocomplete:"off",spellcheck:"false",type:"text"},domProps:{value:t.formatted},on:{blur:t.onBlur,focus:function(e){return t.$emit("focus")},input:function(e){return t.onInput(e.target.value)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.stopPropagation(),e.preventDefault(),t.onArrowDown.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.stopPropagation(),e.preventDefault(),t.onArrowUp.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:t.onTab.apply(null,arguments)}]}})}),[],!1,null,null,null,null).exports;const On=R({mixins:[Qt,ee,Cn],inheritAttrs:!1,props:{calendar:{type:Boolean,default:!0},icon:{type:String,default:"calendar"},time:{type:[Boolean,Object],default:()=>({})},times:{type:Boolean,default:!0}},data(){return{isInvalid:!1,iso:this.toIso(this.value)}},computed:{isEmpty(){return this.time?null===this.iso.date&&this.iso.time:null===this.iso.date}},watch:{value(t,e){t!==e&&(this.iso=this.toIso(t))}},methods:{focus(){this.$refs.dateInput.focus()},now(){const t=this.$library.dayjs();return{date:t.toISO("date"),time:this.time?t.toISO("time"):"00:00:00"}},onInput(){if(this.isEmpty)return this.$emit("input","");const t=this.$library.dayjs.iso(this.iso.date+" "+this.iso.time);(t||null!==this.iso.date&&null!==this.iso.time)&&this.$emit("input",(null==t?void 0:t.toISO())||"")},onCalendarInput(t){var e;null==(e=this.$refs.calendar)||e.close(),this.onDateInput(t)},onDateInput(t){t&&!this.iso.time&&(this.iso.time=this.now().time),this.iso.date=t,this.onInput()},onDateInvalid(t){this.isInvalid=t},onTimeInput(t){t&&!this.iso.date&&(this.iso.date=this.now().date),this.iso.time=t,this.onInput()},onTimesInput(t){var e;null==(e=this.$refs.times)||e.close(),this.onTimeInput(t+":00")},toIso(t){const e=this.$library.dayjs.iso(t);return{date:(null==e?void 0:e.toISO("date"))||null,time:(null==e?void 0:e.toISO("time"))||null}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-date-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("div",{ref:"body",staticClass:"k-date-field-body",attrs:{"data-invalid":!t.novalidate&&t.isInvalid,"data-theme":"field"}},[e("k-input",t._b({ref:"dateInput",attrs:{id:t._uid,autofocus:t.autofocus,disabled:t.disabled,display:t.display,max:t.max,min:t.min,required:t.required,value:t.value,theme:"field",type:"date"},on:{invalid:t.onDateInvalid,input:t.onDateInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.calendar?{key:"icon",fn:function(){return[e("k-dropdown",[e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,tooltip:t.$t("date.select")},on:{click:function(e){return t.$refs.calendar.toggle()}}}),e("k-dropdown-content",{ref:"calendar",attrs:{align:"right"}},[e("k-calendar",{attrs:{value:t.value,min:t.min,max:t.max},on:{input:t.onCalendarInput}})],1)],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1)),t.time?e("k-input",{ref:"timeInput",attrs:{disabled:t.disabled,display:t.time.display,required:t.required,step:t.time.step,value:t.iso.time,icon:t.time.icon,theme:"field",type:"time"},on:{input:t.onTimeInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-dropdown",[e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.time.icon||"clock",tooltip:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{align:"right"}},[e("k-times",{attrs:{display:t.time.display,value:t.value},on:{input:t.onTimesInput}})],1)],1)]},proxy:!0}:null],null,!0)}):t._e()],1)])}),[],!1,null,null,null,null).exports,An={mixins:[Yt,Ut,Vt,Gt,Zt],props:{autocomplete:{type:[Boolean,String],default:"off"},maxlength:Number,minlength:Number,pattern:String,placeholder:String,preselect:Boolean,spellcheck:{type:[Boolean,String],default:"off"},type:{type:String,default:"text"},value:String}};const In=R({mixins:[An],inheritAttrs:!1,data(){return{listeners:{...this.$listeners,input:t=>this.onInput(t.target.value)}}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.$refs.input.select()}},validations(){return{value:{required:!this.required||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.maxLength(this.maxlength),email:"email"!==this.type||t.email,url:"url"!==this.type||t.url,pattern:!this.pattern||(t=>!this.required&&!t||!this.$refs.input.validity.patternMismatch)}}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-text-input"},"input",{autocomplete:t.autocomplete,autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,type:t.type,value:t.value},!1),t.listeners))}),[],!1,null,null,null,null).exports,Mn={mixins:[An],props:{autocomplete:{type:String,default:"email"},placeholder:{type:String,default:()=>window.panel.$t("email.placeholder")},type:{type:String,default:"email"}}};const Tn=R({extends:In,mixins:[Mn]},null,null,!1,null,null,null,null).exports;const jn=R({mixins:[Qt,ee,Mn],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"email"}},computed:{mailto(){var t;return(null==(t=this.value)?void 0:t.length)>0?"mailto:"+this.value:null}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-email-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"email"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.mailto,tooltip:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,En={mixins:[Qt],inheritAttrs:!1,props:{empty:String,info:String,link:Boolean,layout:{type:String,default:"list"},max:Number,multiple:Boolean,parent:String,search:Boolean,size:String,text:String,value:{type:Array,default:()=>[]}},data(){return{selected:this.value}},computed:{btnIcon(){return!this.multiple&&this.selected.length>0?"refresh":"add"},btnLabel(){return!this.multiple&&this.selected.length>0?this.$t("change"):this.$t("add")},collection(){return{empty:this.emptyProps,items:this.selected,layout:this.layout,link:this.link,size:this.size,sortable:!this.disabled&&this.selected.length>1}},isInvalid(){return!(!this.required||0!==this.selected.length)||(!!(this.min&&this.selected.lengththis.max))},items(){return this.models.map(this.item)},more(){return!this.max||this.max>this.selected.length}},watch:{value(t){this.selected=t}},methods:{focus(){},item:t=>t,onInput(){this.$emit("input",this.selected)},open(){if(this.disabled)return!1;this.$refs.selector.open({endpoint:this.endpoints.field,max:this.max,multiple:this.multiple,search:this.search,selected:this.selected.map((t=>t.id))})},remove(t){this.selected.splice(t,1),this.onInput()},removeById(t){this.selected=this.selected.filter((e=>e.id!==t)),this.onInput()},select(t){0!==t.length?(this.selected=this.selected.filter((e=>t.filter((t=>t.id===e.id)).length>0)),t.forEach((t=>{0===this.selected.filter((e=>t.id===e.id)).length&&this.selected.push(t)})),this.onInput()):this.selected=[]}}};const Dn=R({mixins:[En],props:{uploads:[Boolean,Object,Array]},computed:{canUpload(){return!this.disabled&&this.more&&this.uploads},emptyProps(){return{icon:"image",text:this.empty||this.$t("field.files.empty")}},options(){return this.uploads?{icon:this.btnIcon,text:this.btnLabel,options:[{icon:"check",text:this.$t("select"),click:"open"},{icon:"upload",text:this.$t("upload"),click:"upload"}]}:{options:[{icon:"check",text:this.$t("select"),click:()=>this.open()}]}},uploadOptions(){return{accept:this.uploads.accept,max:this.max,multiple:this.multiple,url:this.$panel.urls.api+"/"+this.endpoints.field+"/upload",on:{done:this.onUpload}}}},created(){this.$events.$on("file.delete",this.removeById)},destroyed(){this.$events.$off("file.delete",this.removeById)},methods:{drop(t){return!1!==this.uploads&&this.$panel.upload.open(t,this.uploadOptions)},isSelected(t){return this.selected.find((e=>e.id===t.id))},onAction(t){if(this.canUpload)switch(t){case"open":return this.open();case"upload":return this.$panel.upload.pick(this.uploadOptions)}},onUpload(t){!1===this.multiple&&(this.selected=[]);for(const e of t)this.isSelected(e)||this.selected.push(e);this.onInput(),this.$events.$emit("model.update")},prompt(){return!this.disabled&&(this.canUpload?this.$refs.options.toggle():void this.open())}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-files-field",scopedSlots:t._u([t.more&&!t.disabled?{key:"options",fn:function(){return[e("k-button-group",{staticClass:"k-field-options"},[e("k-options-dropdown",t._b({ref:"options",on:{action:t.onAction}},"k-options-dropdown",t.options,!1))],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-dropzone",{attrs:{disabled:!t.canUpload},on:{drop:t.drop}},[e("k-collection",t._b({on:{empty:t.prompt,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function({index:n}){return[t.disabled?t._e():e("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(n)}}})]}}])},"k-collection",t.collection,!1))],1),e("k-files-dialog",{ref:"selector",on:{submit:t.select}})],1)}),[],!1,null,null,null,null).exports;const Ln=R({},(function(){return(0,this._self._c)("div",{staticClass:"k-field k-gap-field"})}),[],!1,null,null,null,null).exports;const Bn=R({mixins:[Kt,Jt],props:{numbered:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-headline-field"},[e("k-headline",{attrs:{"data-numbered":t.numbered,size:"large"}},[t._v(" "+t._s(t.label)+" ")]),t.help?e("footer",{staticClass:"k-field-footer"},[e("k-text",{staticClass:"k-field-help",attrs:{html:t.help,theme:"help"}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;const Pn=R({mixins:[Kt,Jt],props:{text:String,theme:{type:String,default:"info"}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-field k-info-field"},[e("k-headline",[t._v(t._s(t.label))]),e("k-box",{attrs:{theme:t.theme}},[e("k-text",{attrs:{html:t.text}})],1),t.help?e("footer",{staticClass:"k-field-footer"},[e("k-text",{staticClass:"k-field-help",attrs:{html:t.help,theme:"help"}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;const Nn=R({mixins:[Qt],inheritAttrs:!1,props:{empty:String,fieldsetGroups:Object,fieldsets:Object,layouts:{type:Array,default:()=>[["1/1"]]},settings:Object,value:{type:Array,default:()=>[]}},computed:{isEmpty(){return 0===this.value.length}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-layout-field",scopedSlots:t._u([{key:"options",fn:function(){return[e("k-dropdown",[e("k-button",{attrs:{icon:"dots"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{icon:"add"},on:{click:function(e){return t.$refs.layouts.select(0)}}},[t._v(" "+t._s(t.$t("add"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{disabled:t.isEmpty,icon:"template"},on:{click:function(e){return t.$refs.layouts.copy()}}},[t._v(" "+t._s(t.$t("copy.all"))+" ")]),e("k-dropdown-item",{attrs:{icon:"download"},on:{click:function(e){return t.$refs.layouts.pasteboard()}}},[t._v(" "+t._s(t.$t("paste"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{disabled:t.isEmpty,icon:"trash"},on:{click:function(e){return t.$refs.layouts.removeAll()}}},[t._v(" "+t._s(t.$t("delete.all"))+" ")])],1)],1)]},proxy:!0}])},"k-field",t.$props,!1),[e("k-layouts",t._b({ref:"layouts",on:{input:function(e){return t.$emit("input",e)}}},"k-layouts",t.$props,!1))],1)}),[],!1,null,null,null,null).exports;const Fn=R({},(function(){return(0,this._self._c)("hr",{staticClass:"k-line-field"})}),[],!1,null,null,null,null).exports;const qn=R({mixins:[Qt,ee],inheritAttrs:!1,props:{value:{default:"",type:String}},data:()=>({model:null,linkType:null,linkValue:null,expanded:!1,isInvalid:!1}),computed:{currentType(){return this.types[this.linkType]??this.types.url},types(){return{url:{icon:"url",label:this.$t("url"),placeholder:this.$t("url.placeholder"),input:"url",value:t=>t},page:{icon:"page",label:this.$t("page"),placeholder:this.$t("select")+" …",input:"text",value:t=>t},file:{icon:"file",label:this.$t("file"),placeholder:this.$t("select")+" …",value:t=>t},email:{icon:"email",label:this.$t("email"),placeholder:this.$t("email.placeholder"),input:"email",value:t=>"mailto:"+t},tel:{icon:"phone",label:"Phone",pattern:"[+]{0,1}[0-9]+",placeholder:"Enter a phone number …",input:"tel",value:t=>"tel:"+t}}}},watch:{value:{handler(t,e){const n=this.detect(t);this.linkType=this.linkType??n.type,this.linkValue=n.link,t!==e&&this.preview()},immediate:!0}},methods:{clear(){this.$emit("input",""),this.expanded=!1},detect(t){return t=t??"",!0===this.isPageUUID(t)?{type:"page",link:t}:!0===this.isFileUUID(t)?{type:"file",link:t}:t.startsWith("tel:")?{type:"tel",link:t.replace(/^tel:/,"")}:t.startsWith("mailto:")?{type:"email",link:t.replace(/^mailto:/,"")}:{type:"url",link:t}},focus(){var t;null==(t=this.$refs.input)||t.focus()},getFileUUID:t=>t.replace("/@/file/","file://"),getPageUUID:t=>t.replace("/@/page/","page://"),isFileUUID:t=>!0===t.startsWith("file://")||!0===t.startsWith("/@/file/"),isPageUUID:t=>!0===t.startsWith("page://")||!0===t.startsWith("/@/page/"),onInput(t){const e=t.trim();if(!e.length)return this.$emit("input","");this.$emit("input",this.currentType.value(e))},onInvalid(t){this.isInvalid=t},async preview(){"page"===this.linkType&&this.linkValue?this.model=await this.previewForPage(this.linkValue):"file"===this.linkType&&this.linkValue?this.model=await this.previewForFile(this.linkValue):this.model=null},async previewForFile(t){try{const e=await this.$api.files.get(null,t,{select:"filename, panelImage"});return{label:e.filename,image:e.panelImage}}catch(e){return null}},async previewForPage(t){try{return{label:(await this.$api.pages.get(t,{select:"title"})).title}}catch(e){return null}},switchType(t){t!==this.linkType&&(this.isInvalid=!1,this.linkType=t,this.linkValue="","page"===this.linkType||"file"===this.linkType?this.expanded=!0:this.expanded=!1,this.$emit("input",""),this.$nextTick((()=>{this.focus()})))},toggle(){this.expanded=!this.expanded}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-link-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._b({attrs:{invalid:t.isInvalid,icon:!1,theme:"field"}},"k-input",t.$props,!1),[e("div",{staticClass:"k-link-input-header"},[e("k-dropdown",[e("k-button",{staticClass:"k-link-input-toggle",attrs:{icon:t.currentType.icon},on:{click:function(e){return t.$refs.types.toggle()}}},[t._v(" "+t._s(t.currentType.label)+" ")]),e("k-dropdown-content",{ref:"types"},t._l(t.types,(function(n,s){return e("k-dropdown-item",{key:s,attrs:{icon:n.icon},on:{click:function(e){return t.switchType(s)}}},[t._v(" "+t._s(n.label)+" ")])})),1)],1),"page"===t.linkType||"file"===t.linkType?e("div",{staticClass:"k-link-input-model",on:{click:t.toggle}},[t.model?e("k-tag",{staticClass:"k-link-input-model-preview",attrs:{removable:!0},on:{remove:t.clear}},[t.model.image?e("k-item-image",{staticClass:"k-link-input-model-preview-image",attrs:{image:{...t.model.image,cover:!0,back:"gray-200"}}}):t._e(),t._v(" "+t._s(t.model.label)+" ")],1):e("k-button",{staticClass:"k-link-input-model-placeholder"},[t._v(" "+t._s(t.currentType.placeholder)+" ")]),e("k-button",{staticClass:"k-link-input-model-toggle",attrs:{icon:"bars"}})],1):e("k-"+t.currentType.input+"-input",{ref:"input",tag:"component",attrs:{id:t._uid,pattern:t.currentType.pattern??null,placeholder:t.currentType.placeholder,value:t.linkValue},on:{invalid:t.onInvalid,input:t.onInput}})],1),"page"===t.linkType?e("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"k-link-input-body",attrs:{"data-type":"page"}},[e("div",{staticClass:"k-page-browser"},[e("k-page-tree",{attrs:{current:t.getPageUUID(t.value),root:!1},on:{select:function(e){return t.onInput(e.id)}}})],1)]):"file"===t.linkType?e("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"k-link-input-body",attrs:{"data-type":"file"}},[e("k-file-browser",{attrs:{selected:t.getFileUUID(t.value)},on:{select:function(e){return t.onInput(e.id)}}})],1):t._e()])],1)}),[],!1,null,null,null,null).exports;class Rn{constructor(t={}){this.options={...this.defaults,...t}}init(){return null}bindEditor(t=null){this.editor=t}get name(){return null}get type(){return"extension"}get defaults(){return{}}plugins(){return[]}inputRules(){return[]}pasteRules(){return[]}keys(){return{}}}class zn extends Rn{constructor(t={}){super(t)}get type(){return"node"}get schema(){return{}}commands(){return{}}}class Yn extends zn{get defaults(){return{inline:!1}}get name(){return"doc"}get schema(){return{content:this.options.inline?"inline*":"block+"}}}class Hn extends Yn{get schema(){return{content:this.options.nodes.join("|")}}}const Un={props:{autofocus:Boolean,keys:Object,nodes:{type:Array,default:()=>["bulletList","orderedList"]},marks:{type:[Array,Boolean],default:!0},value:String}};const Kn=R({mixins:[Un],inheritAttrs:!1,data(){return{list:this.value,html:this.value}},computed:{extensions(){return[new Hn({inline:!0,nodes:this.nodes})]}},watch:{value(t){t!==this.html&&(this.list=t,this.html=t)}},methods:{focus(){this.$refs.input.focus()},onInput(t){let e=(new DOMParser).parseFromString(t,"text/html").querySelector("ul, ol");e&&0!==e.textContent.trim().length?(this.list=t,this.html=t.replace(/(

      |<\/p>)/gi,""),this.$emit("input",this.html)):this.$emit("input",this.list="")}}},(function(){var t=this;return(0,t._self._c)("k-writer",t._b({ref:"input",staticClass:"k-list-input",attrs:{extensions:t.extensions,value:t.list},on:{input:t.onInput}},"k-writer",t.$props,!1))}),[],!1,null,null,null,null).exports;const Vn=R({mixins:[Qt,ee,Un],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-list-field",attrs:{input:t._uid,counter:!1}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{id:t._uid,type:"list",theme:"field"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,Wn={mixins:[Ut,Vt,Zt],props:{max:Number,min:Number,layout:String,options:Array,search:[Object,Boolean],separator:{type:String,default:","},sort:Boolean,value:{type:Array,required:!0,default:()=>[]}}};const Jn=R({mixins:[Wn],inheritAttrs:!1,data(){return{state:this.value,q:null,limit:!0,scrollTop:0}},computed:{draggable(){return this.state.length>1&&!this.sort},dragOptions(){return{disabled:!this.draggable,draggable:".k-tag",delay:1}},emptyLabel(){return this.q?this.$t("search.results.none"):this.$t("options.none")},filtered(){var t;return(null==(t=this.q)?void 0:t.length)>=(this.search.min||0)?this.options.filter((t=>this.isFiltered(t))).map((t=>({...t,text:this.toHighlightedString(t.text)}))):this.options},more(){return!this.max||this.state.lengththis.options.find((e=>e.value===t))));if(!1===this.sort)return t;const e=t=>this.options.findIndex((e=>e.value===t.value));return t.sort(((t,n)=>e(t)-e(n)))},visible(){return this.limit?this.filtered.slice(0,this.search.display||this.filtered.length):this.filtered}},watch:{value(t){this.state=t,this.onInvalid()}},mounted(){this.onInvalid(),this.$events.$on("click",this.close),this.$events.$on("keydown.cmd.s",this.close)},destroyed(){this.$events.$off("click",this.close),this.$events.$off("keydown.cmd.s",this.close)},methods:{add(t){!0===this.more&&(this.state.push(t.value),this.onInput())},blur(){this.close()},close(){var t;!0===(null==(t=this.$refs.dropdown)?void 0:t.isOpen)&&(this.$refs.dropdown.close(),this.limit=!0)},focus(){var t;null==(t=this.$refs.dropdown)||t.open()},index(t){return this.state.findIndex((e=>e===t.value))},isFiltered(t){return String(t.text).match(this.regex)||String(t.value).match(this.regex)},isSelected(t){return-1!==this.index(t)},navigate(t){var e,n,s;"prev"===t&&(t="previous"),null==(s=null==(n=null==(e=document.activeElement)?void 0:e[t+"Sibling"])?void 0:n.focus)||s.call(n)},onClose(){var t;!1===(null==(t=this.$refs.dropdown)?void 0:t.isOpen)&&(document.activeElement===this.$parent.$el&&(this.q=null),this.$parent.$el.focus())},onEscape(){this.q?this.q=null:this.close()},onInput(){this.$emit("input",this.state)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onOpen(){this.$nextTick((()=>{var t,e,n;null==(e=null==(t=this.$refs.search)?void 0:t.focus)||e.call(t),(null==(n=this.$refs.dropdown)?void 0:n.$el)&&(this.$refs.dropdown.$el.querySelector(".k-multiselect-options").scrollTop=this.scrollTop)}))},remove(t){const e=this.index(t);this.state.splice(e,1),this.onInput()},select(t){this.scrollTop=this.$refs.dropdown.$el.querySelector(".k-multiselect-options").scrollTop,this.isSelected(t)?this.remove(t):this.add(t)},toHighlightedString(t){return(t=this.$helper.string.stripHTML(t)).replace(this.regex,"$1")}},validations(){return{state:{required:!this.required||t.required,minLength:!this.min||t.minLength(this.min),maxLength:!this.max||t.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("k-draggable",{staticClass:"k-multiselect-input",attrs:{list:t.state,options:t.dragOptions,"data-layout":t.layout,element:"k-dropdown"},on:{end:t.onInput},nativeOn:{click:function(e){return t.$refs.dropdown.toggle.apply(null,arguments)}},scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-dropdown-content",{ref:"dropdown",on:{open:t.onOpen,close:t.onClose},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:(e.stopPropagation(),t.close.apply(null,arguments))}}},[t.search?e("k-dropdown-item",{staticClass:"k-multiselect-search",attrs:{icon:"search"}},[e("input",{ref:"search",attrs:{placeholder:t.search.min?t.$t("search.min",{min:t.search.min}):t.$t("search")+" …"},domProps:{value:t.q},on:{input:function(e){t.q=e.target.value},keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:(e.stopPropagation(),t.onEscape.apply(null,arguments))}}})]):t._e(),e("div",{staticClass:"k-multiselect-options scroll-y-auto"},[t._l(t.visible,(function(n){return e("k-dropdown-item",{key:n.value,class:{"k-multiselect-option":!0,selected:t.isSelected(n),disabled:!t.more},attrs:{icon:t.isSelected(n)?"check":"circle-outline"},on:{click:function(e){return e.preventDefault(),t.select(n)}},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),e.stopPropagation(),t.select(n))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:(e.preventDefault(),e.stopPropagation(),t.select(n))}]}},[e("span",{domProps:{innerHTML:t._s(n.text)}})])})),0===t.filtered.length?e("k-dropdown-item",{staticClass:"k-multiselect-option",attrs:{disabled:!0}},[t._v(" "+t._s(t.emptyLabel)+" ")]):t._e()],2),t.visible.lengththis.onInput(t.target.value),blur:this.onBlur}}},watch:{value(t){this.number=t},number:{immediate:!0,handler(){this.onInvalid()}}},mounted(){this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{decimals(){const t=Number(this.step||0);return Math.floor(t)===t?0:-1!==t.toString().indexOf("e")?parseInt(t.toFixed(16).split(".")[1].split("").reverse().join("")).toString().length:t.toString().split(".")[1].length||0},format(t){if(isNaN(t)||""===t)return"";const e=this.decimals();return t=e?parseFloat(t).toFixed(e):Number.isInteger(this.step)?parseInt(t):parseFloat(t)},clean(){this.number=this.format(this.number)},emit(t){t=parseFloat(t),isNaN(t)&&(t=""),t!==this.value&&this.$emit("input",t)},focus(){this.$refs.input.focus()},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.number=t,this.emit(t)},onBlur(){this.clean(),this.emit(this.number)},select(){this.$refs.input.select()}},validations(){return{value:{required:!this.required||t.required,min:!this.min||t.minValue(this.min),max:!this.max||t.maxValue(this.max)}}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({ref:"input",staticClass:"k-number-input",attrs:{step:t.stepNumber,type:"number"},domProps:{value:t.number},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.ctrlKey?t.clean.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?t.clean.apply(null,arguments):null}]}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,max:t.max,min:t.min,name:t.name,placeholder:t.placeholder,required:t.required},!1),t.listeners))}),[],!1,null,null,null,null).exports;const Xn=R({mixins:[Qt,ee,Zn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-number-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"number"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const ts=R({mixins:[Qt,ee],props:{empty:String,fields:Object,value:[String,Object]},data(){return{object:this.valueToObject(this.value)}},computed:{drawer(){return{icon:"box",tab:"object",tabs:{object:{fields:this.$helper.field.subfields(this,this.fields)}},title:this.label,value:this.object}},isEmpty(){return 0===this.$helper.object.length(this.object)},isInvalid(){return!0===this.required&&this.isEmpty}},watch:{value(t){this.object=this.valueToObject(t)}},methods:{onAdd(){this.object=this.$helper.field.form(this.fields),this.$emit("input",this.object),this.open()},onCellInput(t,e){Vue.set(this.object,t,e),this.$emit("input",this.object)},onDrawerInput(t){this.object=t,this.$emit("input",this.object)},onRemove(){this.object={},this.$emit("input",this.object)},open(t){if(this.disabled)return!1;this.$refs.drawer.open(null,t)},valueToObject:t=>"object"!=typeof t?null:t}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-object-field",scopedSlots:t._u([t.disabled?null:{key:"options",fn:function(){return[t.isEmpty?e("k-button",{attrs:{icon:"add"},on:{click:t.onAdd}}):e("k-button",{attrs:{icon:"remove"},on:{click:t.onRemove}})]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[t.isEmpty?e("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"box"},on:{click:t.onAdd}},[t._v(" "+t._s(t.empty||t.$t("field.object.empty"))+" ")]):e("table",{staticClass:"k-table k-object-field-table",attrs:{"data-invalid":t.isInvalid}},[e("tbody",[t._l(t.fields,(function(n){return[n.saveable&&t.$helper.field.isVisible(n,t.value)?e("tr",{key:n.name,on:{click:function(e){return t.open(n.name)}}},[e("th",{attrs:{"data-mobile":"true"}},[e("button",{attrs:{type:"button"}},[t._v(t._s(n.label))])]),e("k-table-cell",{attrs:{column:n,field:n,mobile:!0,value:t.object[n.name]},on:{input:function(e){return t.onCellInput(n.name,e)}}})],1):t._e()]}))],2)]),e("k-form-drawer",t._b({ref:"drawer",on:{input:t.onDrawerInput}},"k-form-drawer",t.drawer,!1))],1)}),[],!1,null,null,null,null).exports;const es=R({mixins:[En],computed:{emptyProps(){return{icon:"page",text:this.empty||this.$t("field.pages.empty")}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-pages-field",scopedSlots:t._u([{key:"options",fn:function(){return[e("k-button-group",{staticClass:"k-field-options"},[t.more&&!t.disabled?e("k-button",{staticClass:"k-field-options-button",attrs:{icon:t.btnIcon,text:t.btnLabel},on:{click:t.open}}):t._e()],1)]},proxy:!0}])},"k-field",t.$props,!1),[e("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function({index:n}){return[t.disabled?t._e():e("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(n)}}})]}}])},"k-collection",t.collection,!1)),e("k-pages-dialog",{ref:"selector",on:{submit:t.select}})],1)}),[],!1,null,null,null,null).exports,ns={mixins:[An],props:{autocomplete:{type:String,default:"new-password"},type:{type:String,default:"password"}}};const ss=R({extends:In,mixins:[ns]},null,null,!1,null,null,null,null).exports;const is=R({mixins:[Qt,ee,ns,yn],inheritAttrs:!1,props:{minlength:{type:Number,default:8},icon:{type:String,default:"key"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-password-field",attrs:{input:t._uid,counter:t.counterOptions},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"password"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,os={mixins:[Yt,Ut,Vt,Zt],props:{columns:Number,options:Array,value:[String,Number,Boolean]}};const ls=R({mixins:[os],inheritAttrs:!1,watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-radio-input",style:"--columns:"+t.columns},[t.options.length?t._l(t.options,(function(n,s){return e("li",{key:s},[e("input",{staticClass:"k-radio-input-native",attrs:{id:t.id+"-"+s,name:t.id,type:"radio"},domProps:{value:n.value,checked:t.value===n.value},on:{change:function(e){return t.onInput(n.value)}}}),n.info?e("label",{attrs:{for:t.id+"-"+s}},[e("span",{staticClass:"k-radio-input-text",domProps:{innerHTML:t._s(n.text)}}),e("span",{staticClass:"k-radio-input-info",domProps:{innerHTML:t._s(n.info)}})]):e("label",{attrs:{for:t.id+"-"+s},domProps:{innerHTML:t._s(n.text)}}),n.icon?e("k-icon",{attrs:{type:n.icon}}):t._e()],1)})):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.$t("options.none")))])],2)}),[],!1,null,null,null,null).exports;const rs=R({mixins:[Qt,ee,os],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-radio-field"},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"radio"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,as={mixins:[Yt,Ut,Vt,Gt,Zt],props:{default:[Number,String],max:{type:Number,default:100},min:{type:Number,default:0},step:{type:Number,default:1},tooltip:{type:[Boolean,Object],default:()=>({before:null,after:null})},value:[Number,String]}};const us=R({mixins:[as],inheritAttrs:!1,data(){return{listeners:{...this.$listeners,input:t=>this.onInput(t.target.value)}}},computed:{baseline(){return this.min<0?0:this.min},label(){return this.required||this.value||0===this.value?this.format(this.position):"–"},position(){return this.value||0===this.value?this.value:this.default||this.baseline}},watch:{position(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},format(t){const e=document.lang?document.lang.replace("_","-"):"en",n=this.step.toString().split("."),s=n.length>1?n[1].length:0;return new Intl.NumberFormat(e,{minimumFractionDigits:s}).format(t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.$emit("input",t)}},validations(){return{position:{required:!this.required||t.required,min:!this.min||t.minValue(this.min),max:!this.max||t.maxValue(this.max)}}}},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-range-input"},[e("input",t._g(t._b({ref:"input",staticClass:"k-range-input-native",style:`--min: ${t.min}; --max: ${t.max}; --value: ${t.position}`,attrs:{type:"range"},domProps:{value:t.position}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,max:t.max,min:t.min,name:t.name,required:t.required,step:t.step},!1),t.listeners)),t.tooltip?e("span",{staticClass:"k-range-input-tooltip"},[t.tooltip.before?e("span",{staticClass:"k-range-input-tooltip-before"},[t._v(t._s(t.tooltip.before))]):t._e(),e("span",{staticClass:"k-range-input-tooltip-text"},[t._v(t._s(t.label))]),t.tooltip.after?e("span",{staticClass:"k-range-input-tooltip-after"},[t._v(t._s(t.tooltip.after))]):t._e()]):t._e()])}),[],!1,null,null,null,null).exports;const cs=R({mixins:[ee,Qt,as],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-range-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"range"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,ds={mixins:[Yt,Ut,Vt,Gt,Zt],props:{ariaLabel:String,default:String,empty:{type:[Boolean,String],default:!0},placeholder:String,options:Array,value:{type:[String,Number,Boolean],default:""}}};const ps=R({mixins:[ds],inheritAttrs:!1,data(){return{selected:this.value,listeners:{...this.$listeners,click:t=>this.onClick(t),change:t=>this.onInput(t.target.value),input:()=>{}}}},computed:{emptyOption(){return this.placeholder||"—"},hasEmptyOption(){return!1!==this.empty&&!(this.required&&this.default)},label(){const t=this.text(this.selected);return""===this.selected||null===this.selected||null===t?this.emptyOption:t}},watch:{value(t){this.selected=t,this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onClick(t){t.stopPropagation(),this.$emit("click",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.selected=t,this.$emit("input",this.selected)},select(){this.focus()},text(t){let e=null;return this.options.forEach((n=>{n.value==t&&(e=n.text)})),e}},validations(){return{selected:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-select-input",attrs:{"data-disabled":t.disabled,"data-empty":""===t.selected}},[e("select",t._g({ref:"input",staticClass:"k-select-input-native",attrs:{id:t.id,autofocus:t.autofocus,"aria-label":t.ariaLabel,disabled:t.disabled,name:t.name,required:t.required},domProps:{value:t.selected}},t.listeners),[t.hasEmptyOption?e("option",{attrs:{disabled:t.required,value:""}},[t._v(" "+t._s(t.emptyOption)+" ")]):t._e(),t._l(t.options,(function(n){return e("option",{key:n.value,attrs:{disabled:n.disabled},domProps:{value:n.value}},[t._v(" "+t._s(n.text)+" ")])}))],2),t._v(" "+t._s(t.label)+" ")])}),[],!1,null,null,null,null).exports;const hs=R({mixins:[Qt,ee,ds],inheritAttrs:!1,props:{icon:{type:String,default:"angle-down"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-select-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"select"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,ms={mixins:[An],props:{allow:{type:String,default:""},formData:{type:Object,default:()=>({})},sync:{type:String}}};const fs=R({extends:In,mixins:[ms],data(){return{slug:this.sluggify(this.value),slugs:this.$language?this.$language.rules:this.$panel.system.slugs,syncValue:null}},watch:{formData:{handler(t){return!this.disabled&&(!(!this.sync||void 0===t[this.sync])&&(t[this.sync]!=this.syncValue&&(this.syncValue=t[this.sync],void this.onInput(this.sluggify(this.syncValue)))))},deep:!0,immediate:!0},value(t){(t=this.sluggify(t))!==this.slug&&(this.slug=t,this.$emit("input",this.slug))}},methods:{sluggify(t){return this.$helper.slug(t,[this.slugs,this.$panel.system.ascii],this.allow)},onInput(t){this.slug=this.sluggify(t),this.$emit("input",this.slug)}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-text-input",attrs:{autocomplete:"off",spellcheck:"false",type:"text"},domProps:{value:t.slug}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required},!1),t.listeners))}),[],!1,null,null,null,null).exports;const gs=R({mixins:[Qt,ee,ms],inheritAttrs:!1,props:{icon:{type:String,default:"url"},path:{type:String},wizard:{type:[Boolean,Object],default:!1}},data(){return{slug:this.value}},computed:{preview(){return void 0!==this.help?this.help:void 0!==this.path?this.path+this.value:null}},watch:{value(){this.slug=this.value}},methods:{focus(){this.$refs.input.focus()},onWizard(){var t;this.formData[null==(t=this.wizard)?void 0:t.field]&&(this.slug=this.formData[this.wizard.field])}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-slug-field",attrs:{input:t._uid,help:t.preview},scopedSlots:t._u([t.wizard&&t.wizard.text?{key:"options",fn:function(){return[e("k-button",{attrs:{text:t.wizard.text,icon:"wand"},on:{click:t.onWizard}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,value:t.slug,theme:"field",type:"slug"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const ks=R({mixins:[Qt],inheritAttrs:!1,props:{columns:Object,duplicate:{type:Boolean,default:!0},empty:String,fields:Object,limit:Number,max:Number,min:Number,prepend:{type:Boolean,default:!1},sortable:{type:Boolean,default:!0},sortBy:String,value:{type:Array,default:()=>[]}},data(){return{autofocus:null,items:this.toItems(this.value),currentIndex:null,currentModel:null,page:1}},computed:{dragOptions(){return{disabled:!this.isSortable,fallbackClass:"k-sortable-row-fallback"}},form(){return this.$helper.field.subfields(this,this.fields)},index(){return this.limit?(this.page-1)*this.limit+1:1},more(){return!0!==this.disabled&&!(this.max&&this.items.length>=this.max)},isInvalid(){return!0!==this.disabled&&(!!(this.min&&this.items.lengththis.max))},isSortable(){return!this.sortBy&&(!this.limit&&(!0!==this.disabled&&(!(this.items.length<=1)&&!1!==this.sortable)))},pagination(){let t=0;return this.limit&&(t=(this.page-1)*this.limit),{page:this.page,offset:t,limit:this.limit,total:this.items.length,align:"center",details:!0}},options(){if(this.disabled)return[];let t=[],e=this.duplicate&&this.more&&null===this.currentIndex;return t.push({icon:"edit",text:this.$t("edit"),click:"edit"}),e&&t.push({icon:"copy",text:this.$t("duplicate"),click:"duplicate"}),t.push({icon:"remove",text:e?this.$t("remove"):null,click:"remove"}),t},paginatedItems(){return this.limit?this.items.slice(this.pagination.offset,this.pagination.offset+this.limit):this.items}},watch:{value(t){t!=this.items&&(this.items=this.toItems(t))}},methods:{add(t){!0===this.prepend?this.items.unshift(t):this.items.push(t)},focus(){var t,e;null==(e=null==(t=this.$refs.add)?void 0:t.focus)||e.call(t)},jump(t,e){this.open(t+this.pagination.offset,e)},onAdd(){return!0!==this.disabled&&(null!==this.currentIndex?(this.onFormDiscard(),!1):(this.currentIndex="new",this.currentModel=this.$helper.field.form(this.fields),void this.onFormOpen()))},onFormClose(){this.currentIndex=null,this.currentModel=null},onFormDiscard(){if("new"===this.currentIndex){if(0===Object.values(this.currentModel).filter((t=>!1===this.$helper.object.isEmpty(t))).length)return void this.onFormClose()}this.onFormSubmit()},onFormOpen(t=this.autofocus){this.$nextTick((()=>{var e;null==(e=this.$refs.form)||e.focus(t)}))},async onFormPaginate(t){try{await this.save(),this.open(t)}catch(e){}},async onFormSubmit(){try{await this.save(),this.onFormClose()}catch(t){}},onInput(t=this.items){this.$emit("input",t)},onOption(t,e,n){switch(t){case"remove":this.onFormClose(),this.remove(n+this.pagination.offset);break;case"duplicate":this.add(this.items[n+this.pagination.offset]),this.onInput();break;case"edit":this.open(n)}},open(t,e){this.currentIndex=t,this.currentModel=this.$helper.clone(this.items[t]),this.onFormOpen(e)},paginate({page:t}){this.page=t},remove(t){this.disabled||null===t||this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.structure.delete.confirm")},on:{submit:()=>{this.items.splice(t,1),this.onInput(),this.$panel.dialog.close(),0===this.paginatedItems.length&&this.page>1&&this.page--,this.items=this.sort(this.items)}}})},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.structure.delete.confirm.all")},on:{submit:()=>{this.page=1,this.items=[],this.onInput(),this.$panel.dialog.close()}}})},sort(t){return this.sortBy?t.sortBy(this.sortBy):t},async save(){if(null!==this.currentIndex&&void 0!==this.currentIndex)try{return await this.validate(this.currentModel),"new"===this.currentIndex?this.add(this.currentModel):this.items[this.currentIndex]=this.currentModel,this.items=this.sort(this.items),this.onInput(),!0}catch(t){throw this.$panel.notification.error({message:this.$t("error.form.incomplete"),details:t}),t}},toItems(t){return!1===Array.isArray(t)?[]:this.sort(t)},async validate(t){const e=await this.$api.post(this.endpoints.field+"/validate",t);if(e.length>0)throw e;return!0},onFormInput(t){this.currentModel=t,this.$emit("formInput",t)}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-structure-field",nativeOn:{click:function(t){t.stopPropagation()}},scopedSlots:t._u([{key:"options",fn:function(){return[t.currentIndex?t._e():e("k-dropdown",[e("k-button",{attrs:{icon:"dots"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{disabled:!t.more,icon:"add"},on:{click:t.onAdd}},[t._v(" "+t._s(t.$t("add"))+" ")]),e("k-dropdown-item",{attrs:{disabled:0===t.items.length||t.disabled,icon:"trash"},on:{click:t.removeAll}},[t._v(" "+t._s(t.$t("delete.all"))+" ")])],1)],1)]},proxy:!0}])},"k-field",t.$props,!1),[null!==t.currentIndex?e("k-structure-form",{ref:"form",attrs:{fields:t.form,index:t.currentIndex,total:t.items.length,value:t.currentModel},on:{close:t.onFormClose,discard:t.onFormDiscard,input:t.onFormInput,paginate:function(e){return t.onFormPaginate(e.offset)},submit:t.onFormSubmit}}):0===t.items.length?e("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"list-bullet"},on:{click:t.onAdd}},[t._v(" "+t._s(t.empty||t.$t("field.structure.empty"))+" ")]):[e("k-table",{attrs:{columns:t.columns,disabled:t.disabled,fields:t.fields,empty:t.$t("field.structure.empty"),index:t.index,options:t.options,pagination:!!t.limit&&t.pagination,rows:t.paginatedItems,sortable:t.isSortable,"data-invalid":t.isInvalid},on:{cell:function(e){return t.jump(e.rowIndex,e.columnIndex)},input:t.onInput,option:t.onOption,paginate:t.paginate}}),t.more?e("k-button",{staticClass:"k-field-add-item-button",attrs:{icon:"add",tooltip:t.$t("add")},on:{click:t.onAdd}}):t._e()]],2)}),[],!1,null,null,null,null).exports,bs={mixins:[Yt,Ut,Vt,Gt,Zt],props:{accept:{type:String,default:"all"},icon:{type:[String,Boolean],default:"tag"},layout:String,max:Number,min:Number,options:{type:Array,default:()=>[]},separator:{type:String,default:","},value:{type:Array,default:()=>[]}}};const vs=R({mixins:[bs],inheritAttrs:!1,data(){return{tags:this.toValues(this.value),selected:null,newTag:null}},computed:{dragOptions(){return{delay:1,disabled:!this.draggable,draggable:".k-tag"}},draggable(){return this.tags.length>1},skip(){return this.tags.map((t=>t.value))}},watch:{value(t){this.tags=this.toValues(t),this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{addString(t,e=!0){if(!t)return;if(0===(t=t.trim()).length)return;if(!0===t.includes(this.separator)){for(const e of t.split(this.separator))this.addString(e);return}const n=this.toValue(t);n&&this.addTag(n,e)},addTag(t,e=!0){this.addTagToIndex(t),this.$refs.autocomplete.close(),e&&this.$refs.input.focus()},addTagToIndex(t){if("options"===this.accept){if(!this.options.find((e=>e.value===t.value)))return}-1===this.index(t)&&(!this.max||this.tags.length=this.tags.length)return;break;case"first":e=0;break;case"last":e=this.tags.length-1;break;default:e=t}let s=this.tags[e];if(s){let t=this.$refs[s.value];if(null==t?void 0:t[0])return{ref:t[0],tag:s,index:e}}return!1},index(t){return this.tags.findIndex((e=>e.value===t.value))},navigate(t){var e=this.get(t);e?(e.ref.focus(),this.selectTag(e.tag)):"next"===t&&(this.$refs.input.focus(),this.selectTag(null))},onBack(t){0===t.target.selectionStart&&t.target.selectionStart===t.target.selectionEnd&&0!==this.tags.length&&(this.$refs.autocomplete.close(),this.navigate("last"),t.preventDefault())},onBlur(t){var e;let n=t.relatedTarget||t.explicitOriginalTarget;(null==(e=this.$refs.autocomplete.$el)?void 0:e.contains(n))||this.addString(this.$refs.input.value,!1)},onEnter(t){if(!this.newTag||0===this.newTag.length)return!0;t.preventDefault(),this.addString(this.newTag)},onInput(){const t=this.tags.map((t=>t.value));this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onSubmit(t){t.preventDefault(),t.stopImmediatePropagation(),this.onBlur(t),this.$emit("submit",t)},onTab(t){var e;(null==(e=this.newTag)?void 0:e.length)>0&&(t.preventDefault(),this.addString(this.newTag))},onType(t){this.newTag=t,this.$refs.autocomplete.search(t)},remove(t){const e=this.get("prev"),n=this.get("next");this.tags.splice(this.index(t),1),this.onInput(),e?(this.selectTag(e.tag),e.ref.focus()):n?this.selectTag(n.tag):(this.selectTag(null),this.$refs.input.focus())},select(){this.focus()},selectTag(t){this.selected=t},toValue(t){const e=this.options.find((e=>e.value===t));return"options"===this.accept?e:e||("string"==typeof t&&(t={value:t}),{value:t.value,text:this.$helper.string.escapeHTML(t.text??t.value)})},toValues(t){return"object"==typeof t&&(t=Object.values(t)),!1===Array.isArray(t)?[]:t.map(this.toValue).filter((t=>t))}},validations(){return{tags:{required:!this.required||t.required,minLength:!this.min||t.minLength(this.min),maxLength:!this.max||t.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("k-draggable",{directives:[{name:"direction",rawName:"v-direction"}],staticClass:"k-tags-input",attrs:{list:t.tags,options:t.dragOptions,"data-layout":t.layout},on:{end:t.onInput},scopedSlots:t._u([{key:"footer",fn:function(){return[e("span",{staticClass:"k-tags-input-element"},[e("k-autocomplete",{ref:"autocomplete",attrs:{html:!0,options:t.options,skip:t.skip},on:{select:t.addTag,leave:function(e){return t.$refs.input.focus()}}},[e("input",{ref:"input",attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled||t.max&&t.tags.length>=t.max,name:t.name,autocomplete:"off",type:"text"},domProps:{value:t.newTag},on:{input:function(e){return t.onType(e.target.value)},blur:t.onBlur,keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?t.onSubmit.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.onBack.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.onEnter.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.onTab.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.onBack.apply(null,arguments)}]}})])],1)]},proxy:!0}])},t._l(t.tags,(function(n){return e("k-tag",{key:n.value,ref:n.value,refInFor:!0,attrs:{removable:!t.disabled,name:"tag"},on:{remove:function(e){return t.remove(n)}},nativeOn:{click:function(t){t.stopPropagation()},blur:function(e){return t.selectTag(null)},focus:function(e){return t.selectTag(n)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:t.navigate("prev")},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:t.navigate("next")}],dblclick:function(e){return t.edit(n)}}},[e("span",{domProps:{innerHTML:t._s(n.text)}})])})),1)}),[],!1,null,null,null,null).exports;const ys=R({mixins:[Qt,ee,bs,yn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-tags-field",attrs:{input:t._uid,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"tags"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,$s={mixins:[An],props:{autocomplete:{type:String,default:"tel"},type:{type:String,default:"tel"}}};const ws=R({extends:In,mixins:[$s]},null,null,!1,null,null,null,null).exports;const _s=R({mixins:[Qt,ee,$s],inheritAttrs:!1,props:{icon:{type:String,default:"phone"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-tel-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"tel"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const xs=R({mixins:[Qt,ee,An,yn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()},select(){this.$refs.input.select()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-text-field",attrs:{input:t._uid,counter:t.counterOptions},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,Cs={mixins:[Yt,Ut,Vt,Gt,Zt],props:{buttons:{type:[Boolean,Array],default:!0},endpoints:Object,font:String,maxlength:Number,minlength:Number,placeholder:String,preselect:Boolean,size:String,spellcheck:{type:[Boolean,String],default:"off"},theme:String,uploads:[Boolean,Object,Array],value:String}};const Ss=R({mixins:[Cs],inheritAttrs:!1,data:()=>({over:!1}),computed:{uploadOptions(){return{url:this.$panel.urls.api+"/"+this.endpoints.field+"/upload",multiple:!1,on:{done:this.insertUpload}}}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{cancel(){this.$refs.input.focus()},dialog(t){if(!this.$refs[t+"Dialog"])throw"Invalid toolbar dialog";this.$refs[t+"Dialog"].open(this.$refs.input,this.selection())},focus(){this.$refs.input.focus()},insert(t){const e=this.$refs.input,n=e.value;setTimeout((()=>{if(e.focus(),document.execCommand("insertText",!1,t),e.value===n){const n=e.value.slice(0,e.selectionStart)+t+e.value.slice(e.selectionEnd);e.value=n,this.$emit("input",n)}}))},insertFile(t){(null==t?void 0:t.length)>0&&this.insert(t.map((t=>t.dragText)).join("\n\n"))},insertUpload(t,e){this.insert(e.map((t=>t.dragText)).join("\n\n")),this.$events.$emit("model.update")},onCommand(t,e){"function"==typeof this[t]?"function"==typeof e?this[t](e(this.$refs.input,this.selection())):this[t](e):window.console.warn(t+" is not a valid command")},onDrop(t){if(this.uploads&&this.$helper.isUploadEvent(t))return this.$panel.upload.open(t.dataTransfer.files,this.uploadOptions);"text"===this.$panel.drag.type&&(this.focus(),this.insert(this.$panel.drag.data))},onFocus(t){this.$emit("focus",t)},onInput(t){this.$emit("input",t.target.value)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onOut(){this.$refs.input.blur(),this.over=!1},onOver(t){if(this.uploads&&this.$helper.isUploadEvent(t))return t.dataTransfer.dropEffect="copy",this.focus(),void(this.over=!0);"text"===this.$panel.drag.type&&(t.dataTransfer.dropEffect="copy",this.focus(),this.over=!0)},onShortcut(t){!1!==this.buttons&&"Meta"!==t.key&&"Control"!==t.key&&this.$refs.toolbar&&this.$refs.toolbar.shortcut(t.key,t)},onSubmit(t){return this.$emit("submit",t)},prepend(t){this.insert(t+" "+this.selection())},select(){this.$refs.select()},selectFile(){this.$refs.fileDialog.open({endpoint:this.endpoints.field+"/files",multiple:!1})},selection(){const t=this.$refs.input,e=t.selectionStart,n=t.selectionEnd;return t.value.substring(e,n)},uploadFile(){this.$panel.upload.pick(this.uploadOptions)},wrap(t){this.insert(t+this.selection()+t)}},validations(){return{value:{required:!this.required||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.maxLength(this.maxlength)}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-textarea-input",attrs:{"data-over":t.over,"data-size":t.size,"data-theme":t.theme}},[e("div",{staticClass:"k-textarea-input-wrapper"},[t.buttons&&!t.disabled?e("k-toolbar",{ref:"toolbar",attrs:{buttons:t.buttons,disabled:t.disabled,uploads:t.uploads},on:{command:t.onCommand},nativeOn:{mousedown:function(t){t.preventDefault()}}}):t._e(),e("k-autosize",[e("textarea",t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-textarea-input-native",attrs:{"data-font":t.font},on:{click:function(e){var n;null==(n=t.$refs.toolbar)||n.close()},focus:t.onFocus,input:t.onInput,keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.metaKey?t.onSubmit.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.ctrlKey?t.onSubmit.apply(null,arguments):null},function(e){return e.metaKey?t.onShortcut.apply(null,arguments):null},function(e){return e.ctrlKey?t.onShortcut.apply(null,arguments):null}],dragover:t.onOver,dragleave:t.onOut,drop:t.onDrop}},"textarea",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,value:t.value},!1))])],1),e("k-toolbar-email-dialog",{ref:"emailDialog",on:{cancel:t.cancel,submit:function(e){return t.insert(e)}}}),e("k-toolbar-link-dialog",{ref:"linkDialog",on:{cancel:t.cancel,submit:function(e){return t.insert(e)}}}),e("k-files-dialog",{ref:"fileDialog",on:{cancel:t.cancel,submit:function(e){return t.insertFile(e)}}})],1)}),[],!1,null,null,null,null).exports;const Os=R({mixins:[Qt,ee,Cs,yn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-textarea-field",attrs:{input:t._uid,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,type:"textarea",theme:"field"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,As={props:{display:{type:String,default:"HH:mm"},max:String,min:String,step:{type:Object,default:()=>({size:5,unit:"minute"})},type:{type:String,default:"time"},value:String}};const Is=R({mixins:[Sn,As],computed:{inputType:()=>"time"}},null,null,!1,null,null,null,null).exports;const Ms=R({mixins:[Qt,ee,As],inheritAttrs:!1,props:{icon:{type:String,default:"clock"},times:{type:Boolean,default:!0}},methods:{focus(){this.$refs.input.focus()},select(t){var e;this.$emit("input",t),null==(e=this.$refs.times)||e.close()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-time-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"time"},on:{input:function(e){return t.$emit("input",e||"")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-dropdown",[e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon||"clock",tooltip:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{align:"right"}},[e("k-times",{attrs:{display:t.display,value:t.value},on:{input:t.select}})],1)],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,Ts={props:{autofocus:Boolean,disabled:Boolean,id:[Number,String],text:{type:[Array,String]},required:Boolean,value:Boolean}};const js=R({mixins:[Ts],inheritAttrs:!1,computed:{label(){const t=this.text||[this.$t("off"),this.$t("on")];return Array.isArray(t)?this.value?t[1]:t[0]:t}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onEnter(t){"Enter"===t.key&&this.$refs.input.click()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.$refs.input.focus()}},validations(){return{value:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-toggle-input",attrs:{"data-disabled":t.disabled}},[e("input",{ref:"input",staticClass:"k-toggle-input-native",attrs:{id:t.id,disabled:t.disabled,type:"checkbox"},domProps:{checked:t.value},on:{change:function(e){return t.onInput(e.target.checked)}}}),e("span",{staticClass:"k-toggle-input-label",domProps:{innerHTML:t._s(t.label)}})])}),[],!1,null,null,null,null).exports;const Es=R({mixins:[Qt,ee,Ts],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-toggle-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"toggle"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,Ds={mixins:[Yt,Ut,Vt,Zt],props:{columns:Number,grow:Boolean,labels:Boolean,options:Array,reset:Boolean,value:[String,Number,Boolean]}};const Ls=R({mixins:[Ds],inheritAttrs:!1,watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){(this.$el.querySelector("input[checked]")||this.$el.querySelector("input")).focus()},onClick(t){t===this.value&&this.reset&&!this.required&&this.$emit("input","")},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-toggles-input",style:"--options:"+(t.columns||t.options.length),attrs:{"data-invalid":t.$v.$invalid,"data-labels":t.labels}},t._l(t.options,(function(n,s){return e("li",{key:s},[e("input",{staticClass:"input-hidden",attrs:{id:t.id+"-"+s,"aria-label":n.text,name:t.id,type:"radio"},domProps:{value:n.value,checked:t.value===n.value},on:{click:function(e){return t.onClick(n.value)},change:function(e){return t.onInput(n.value)}}}),e("label",{attrs:{for:t.id+"-"+s,title:n.text}},[n.icon?e("k-icon",{attrs:{type:n.icon}}):t._e(),t.labels||!n.icon?e("span",{staticClass:"k-toggles-text",domProps:{innerHTML:t._s(n.text)}}):t._e()],1)])})),0)}),[],!1,null,null,null,null).exports;const Bs=R({mixins:[Qt,ee,Ds],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-toggles-field"},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",class:{grow:t.grow},attrs:{id:t._uid,theme:"field",type:"toggles"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,Ps={mixins:[An],props:{autocomplete:{type:String,default:"url"},type:{type:String,default:"url"}}};const Ns=R({extends:In,mixins:[Ps]},null,null,!1,null,null,null,null).exports;const Fs=R({mixins:[Qt,ee,Ps],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"url"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-url-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"url"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.value,tooltip:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const qs=R({mixins:[En],computed:{emptyProps(){return{icon:"users",text:this.empty||this.$t("field.users.empty")}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-users-field",scopedSlots:t._u([{key:"options",fn:function(){return[e("k-button-group",{staticClass:"k-field-options"},[t.more&&!t.disabled?e("k-button",{staticClass:"k-field-options-button",attrs:{icon:t.btnIcon,text:t.btnLabel},on:{click:t.open}}):t._e()],1)]},proxy:!0}])},"k-field",t.$props,!1),[e("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function({index:n}){return[t.disabled?t._e():e("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(n)}}})]}}])},"k-collection",t.collection,!1)),e("k-users-dialog",{ref:"selector",on:{submit:t.select}})],1)}),[],!1,null,null,null,null).exports;const Rs=t=>({$from:e})=>((t,e)=>{for(let n=t.depth;n>0;n--){const s=t.node(n);if(e(s))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:s}}})(e,t),zs=t=>e=>{if((t=>t instanceof o)(e)){const{node:n,$from:s}=e;if(((t,e)=>Array.isArray(t)&&t.indexOf(e.type)>-1||e.type===t)(t,n))return{node:n,pos:s.pos,depth:s.depth}}},Ys=(t,e,n={})=>{const s=zs(e)(t.selection)||Rs((t=>t.type===e))(t.selection);return 0!==U(n)&&s?s.node.hasMarkup(e,{...s.node.attrs,...n}):!!s};function Hs(t=null,e=null){if(!t||!e)return!1;const n=t.parent.childAfter(t.parentOffset);if(!n.node)return!1;const s=n.node.marks.find((t=>t.type===e));if(!s)return!1;let i=t.index(),o=t.start()+n.offset,l=i+1,r=o+n.node.nodeSize;for(;i>0&&s.isInSet(t.parent.child(i-1).marks);)i-=1,o-=t.parent.child(i).nodeSize;for(;l{i=[...i,...t.marks]}));const o=i.find((t=>t.type.name===e.name));return o?o.attrs:{}},getNodeAttrs:function(t,e){const{from:n,to:s}=t.selection;let i=[];t.doc.nodesBetween(n,s,(t=>{i=[...i,t]}));const o=i.reverse().find((t=>t.type.name===e.name));return o?o.attrs:{}},markInputRule:function(t,n,s){return new e(t,((t,e,i,o)=>{const l=s instanceof Function?s(e):s,{tr:r}=t,a=e.length-1;let u=o,c=i;if(e[a]){const s=i+e[0].indexOf(e[a-1]),l=s+e[a-1].length-1,d=s+e[a-1].lastIndexOf(e[a]),p=d+e[a].length,h=function(t,e,n){let s=[];return n.doc.nodesBetween(t,e,((t,e)=>{s=[...s,...t.marks.map((n=>({start:e,end:e+t.nodeSize,mark:n})))]})),s}(i,o,t).filter((t=>{const{excluded:e}=t.mark.type;return e.find((t=>t.name===n.name))})).filter((t=>t.end>s));if(h.length)return!1;ps&&r.delete(s,d),c=s,u=c+e[a].length}return r.addMark(c,u,n.create(l)),r.removeStoredMark(n),r}))},markIsActive:function(t,e){const{from:n,$from:s,to:i,empty:o}=t.selection;return o?!!e.isInSet(t.storedMarks||s.marks()):!!t.doc.rangeHasMark(n,i,e)},markPasteRule:function(t,e,o){const l=(n,s)=>{const r=[];return n.forEach((n=>{var i;if(n.isText){const{text:l,marks:a}=n;let u,c=0;const d=!!a.filter((t=>"link"===t.type.name))[0];for(;!d&&null!==(u=t.exec(l));)if((null==(i=null==s?void 0:s.type)?void 0:i.allowsMarkType(e))&&u[1]){const t=u.index,s=t+u[0].length,i=t+u[0].indexOf(u[1]),l=i+u[1].length,a=o instanceof Function?o(u):o;t>0&&r.push(n.cut(c,t)),r.push(n.cut(i,l).mark(e.create(a).addToSet(n.marks))),c=s}cnew s(l(t.content),t.openStart,t.openEnd)}})},minMax:function(t=0,e=0,n=0){return Math.min(Math.max(parseInt(t,10),e),n)},nodeIsActive:Ys,nodeInputRule:function(t,n,s){return new e(t,((t,e,i,o)=>{const l=s instanceof Function?s(e):s,{tr:r}=t;return e[0]&&r.replaceWith(i-1,o,n.create(l)),r}))},pasteRule:function(t,e,o){const l=n=>{const s=[];return n.forEach((n=>{if(n.isText){const{text:i}=n;let l,r=0;do{if(l=t.exec(i),l){const t=l.index,i=t+l[0].length,a=o instanceof Function?o(l[0]):o;t>0&&s.push(n.cut(r,t)),s.push(n.cut(t,i).mark(e.create(a).addToSet(n.marks))),r=i}}while(l);rnew s(l(t.content),t.openStart,t.openEnd)}})},removeMark:function(t){return(e,n)=>{const{tr:s,selection:i}=e;let{from:o,to:l}=i;const{$from:r,empty:a}=i;if(a){const e=Hs(r,t);o=e.from,l=e.to}return s.removeMark(o,l,t),n(s)}},toggleBlockType:function(t,e,n={}){return(s,i,o)=>Ys(s,t,n)?l(e)(s,i,o):l(t,n)(s,i,o)},toggleList:function(t,e){return(n,s,i)=>{const{schema:o,selection:l}=n,{$from:u,$to:c}=l,d=u.blockRange(c);if(!d)return!1;const p=Rs((t=>Us(t,o)))(l);if(d.depth>=1&&p&&d.depth-p.depth<=1){if(p.node.type===t)return r(e)(n,s,i);if(Us(p.node,o)&&t.validContent(p.node.content)){const{tr:e}=n;return e.setNodeMarkup(p.pos,t),s&&s(e),!1}}return a(t)(n,s,i)}},updateMark:function(t,e){return(n,s)=>{const{tr:i,selection:o,doc:l}=n,{ranges:r,empty:a}=o;if(a){const{from:n,to:s}=Hs(o.$from,t);l.rangeHasMark(n,s,t)&&i.removeMark(n,s,t),i.addMark(n,s,t.create(e))}else r.forEach((n=>{const{$to:s,$from:o}=n;l.rangeHasMark(o.pos,s.pos,t)&&i.removeMark(o.pos,s.pos,t),i.addMark(o.pos,s.pos,t.create(e))}));return s(i)}}};class Vs{emit(t,...e){this._callbacks=this._callbacks||{};const n=this._callbacks[t];return n&&n.forEach((t=>t.apply(this,e))),this}off(t,e){if(arguments.length){const n=this._callbacks?this._callbacks[t]:null;n&&(e?this._callbacks[t]=n.filter((t=>t!==e)):delete this._callbacks[t])}else this._callbacks={};return this}on(t,e){return this._callbacks=this._callbacks||{},this._callbacks[t]=this._callbacks[t]||[],this._callbacks[t].push(e),this}}class Ws{constructor(t=[],e){t.forEach((t=>{t.bindEditor(e),t.init()})),this.extensions=t}commands({schema:t,view:e}){return this.extensions.filter((t=>t.commands)).reduce(((n,s)=>{const{name:i,type:o}=s,l={},r=s.commands({schema:t,utils:Ks,...["node","mark"].includes(o)?{type:t[`${o}s`][i]}:{}}),a=(t,n)=>{l[t]=t=>{if("function"!=typeof n||!e.editable)return!1;e.focus();const s=n(t);return"function"==typeof s?s(e.state,e.dispatch,e):s}};return"object"==typeof r?Object.entries(r).forEach((([t,e])=>{a(t,e)})):a(i,r),{...n,...l}}),{})}buttons(t="mark"){const e={};return this.extensions.filter((e=>e.type===t)).filter((t=>t.button)).forEach((t=>{Array.isArray(t.button)?t.button.forEach((t=>{e[t.id||t.name]=t})):e[t.name]=t.button})),e}getAllowedExtensions(t){return t instanceof Array||!t?t instanceof Array?this.extensions.filter((e=>!t.includes(e.name))):this.extensions:[]}getFromExtensions(t,e,n=this.extensions){return n.filter((t=>["extension"].includes(t.type))).filter((e=>e[t])).map((n=>n[t]({...e,utils:Ks})))}getFromNodesAndMarks(t,e,n=this.extensions){return n.filter((t=>["node","mark"].includes(t.type))).filter((e=>e[t])).map((n=>n[t]({...e,type:e.schema[`${n.type}s`][n.name],utils:Ks})))}inputRules({schema:t,excludedExtensions:e}){const n=this.getAllowedExtensions(e);return[...this.getFromExtensions("inputRules",{schema:t},n),...this.getFromNodesAndMarks("inputRules",{schema:t},n)].reduce(((t,e)=>[...t,...e]),[])}keymaps({schema:t}){return[...this.getFromExtensions("keys",{schema:t}),...this.getFromNodesAndMarks("keys",{schema:t})].map((t=>k(t)))}get marks(){return this.extensions.filter((t=>"mark"===t.type)).reduce(((t,{name:e,schema:n})=>({...t,[e]:n})),{})}get nodes(){return this.extensions.filter((t=>"node"===t.type)).reduce(((t,{name:e,schema:n})=>({...t,[e]:n})),{})}get options(){const{view:t}=this;return this.extensions.reduce(((e,n)=>({...e,[n.name]:new Proxy(n.options,{set(e,n,s){const i=e[n]!==s;return Object.assign(e,{[n]:s}),i&&t.updateState(t.state),!0}})})),{})}pasteRules({schema:t,excludedExtensions:e}){const n=this.getAllowedExtensions(e);return[...this.getFromExtensions("pasteRules",{schema:t},n),...this.getFromNodesAndMarks("pasteRules",{schema:t},n)].reduce(((t,e)=>[...t,...e]),[])}plugins({schema:t}){return[...this.getFromExtensions("plugins",{schema:t}),...this.getFromNodesAndMarks("plugins",{schema:t})].reduce(((t,e)=>[...t,...e]),[]).map((t=>t instanceof n?t:new n(t)))}}class Js extends zn{get button(){return{id:this.name,icon:"paragraph",label:window.panel.$t("toolbar.button.paragraph"),name:this.name,separator:!0}}commands({utils:t,type:e}){return{paragraph:()=>t.setBlockType(e)}}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}get name(){return"paragraph"}}let Gs=class extends zn{get name(){return"text"}get schema(){return{group:"inline"}}};class Zs extends Vs{constructor(t={}){super(),this.defaults={autofocus:!1,content:"",disableInputRules:!1,disablePasteRules:!1,editable:!0,element:null,extensions:[],emptyDocument:{type:"doc",content:[]},events:{},inline:!1,parseOptions:{},topNode:"doc",useBuiltInExtensions:!0},this.init(t)}blur(){this.view.dom.blur()}get builtInExtensions(){return this.options.useBuiltInExtensions?[new Yn({inline:this.options.inline}),new Gs,new Js]:[]}buttons(t){return this.extensions.buttons(t)}clearContent(t=!1){this.setContent(this.options.emptyDocument,t)}command(t,...e){var n,s;null==(s=(n=this.commands)[t])||s.call(n,...e)}createCommands(){return this.extensions.commands({schema:this.schema,view:this.view})}createDocument(t,e=this.options.parseOptions){if(null===t)return this.schema.nodeFromJSON(this.options.emptyDocument);if("object"==typeof t)try{return this.schema.nodeFromJSON(t)}catch(n){return window.console.warn("Invalid content.","Passed value:",t,"Error:",n),this.schema.nodeFromJSON(this.options.emptyDocument)}if("string"==typeof t){const n=`

      ${t}
      `,s=(new window.DOMParser).parseFromString(n,"text/html").body.firstElementChild;return b.fromSchema(this.schema).parse(s,e)}return!1}createEvents(){const t=this.options.events||{};return Object.entries(t).forEach((([t,e])=>{this.on(t,e)})),t}createExtensions(){return new Ws([...this.builtInExtensions,...this.options.extensions],this)}createFocusEvents(){const t=(t,e,n=!0)=>{this.focused=n,this.emit(n?"focus":"blur",{event:e,state:t.state,view:t});const s=this.state.tr.setMeta("focused",n);this.view.dispatch(s)};return new n({props:{attributes:{tabindex:0},handleDOMEvents:{focus:(e,n)=>{t(e,n,!0)},blur:(e,n)=>{t(e,n,!1)}}}})}createInputRules(){return this.extensions.inputRules({schema:this.schema,excludedExtensions:this.options.disableInputRules})}createKeymaps(){return this.extensions.keymaps({schema:this.schema})}createMarks(){return this.extensions.marks}createNodes(){return this.extensions.nodes}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createPlugins(){return this.extensions.plugins({schema:this.schema})}createSchema(){return new v({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return y.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,$({rules:this.inputRules}),...this.pasteRules,...this.keymaps,k({Backspace:C}),k(S),this.createFocusEvents()]})}createView(){return new w(this.element,{dispatchTransaction:this.dispatchTransaction.bind(this),editable:()=>this.options.editable,handlePaste:(t,e)=>{if("function"==typeof this.events.paste){const t=e.clipboardData.getData("text/html"),n=e.clipboardData.getData("text/plain");if(!0===this.events.paste(e,t,n))return!0}},handleDrop:(...t)=>{this.emit("drop",...t)},state:this.createState()})}destroy(){this.view&&this.view.destroy()}dispatchTransaction(t){const e=this.state,n=this.state.apply(t);this.view.updateState(n),this.setActiveNodesAndMarks();const s={editor:this,getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:t};this.emit("transaction",s),!t.docChanged&&t.getMeta("preventUpdate")||this.emit("update",s);const{from:i,to:o}=this.state.selection,l=!e||!e.selection.eq(n.selection);this.emit(n.selection.empty?"deselect":"select",{...s,from:i,hasChanged:l,to:o})}focus(t=null){if(this.view.focused&&null===t||!1===t)return;const{from:e,to:n}=this.selectionAtPosition(t);this.setSelection(e,n),setTimeout((()=>this.view.focus()),10)}getHTML(t=this.state.doc.content){const e=document.createElement("div"),n=_.fromSchema(this.schema).serializeFragment(t);return e.appendChild(n),this.options.inline&&e.querySelector("p")?e.querySelector("p").innerHTML:e.innerHTML}getHTMLStartToSelection(){const t=this.state.doc.slice(0,this.selection.head).content;return this.getHTML(t)}getHTMLSelectionToEnd(){const t=this.state.doc.slice(this.selection.head).content;return this.getHTML(t)}getHTMLStartToSelectionToEnd(){return[this.getHTMLStartToSelection(),this.getHTMLSelectionToEnd()]}getJSON(){return this.state.doc.toJSON()}getMarkAttrs(t=null){return this.activeMarkAttrs[t]}getSchemaJSON(){return JSON.parse(JSON.stringify({nodes:this.nodes,marks:this.marks}))}init(t={}){this.options={...this.defaults,...t},this.element=this.options.element,this.focused=!1,this.events=this.createEvents(),this.extensions=this.createExtensions(),this.nodes=this.createNodes(),this.marks=this.createMarks(),this.schema=this.createSchema(),this.keymaps=this.createKeymaps(),this.inputRules=this.createInputRules(),this.pasteRules=this.createPasteRules(),this.plugins=this.createPlugins(),this.view=this.createView(),this.commands=this.createCommands(),this.setActiveNodesAndMarks(),!1!==this.options.autofocus&&this.focus(this.options.autofocus),this.emit("init",{view:this.view,state:this.state}),this.extensions.view=this.view,this.setContent(this.options.content,!0)}isEditable(){return this.options.editable}isEmpty(){if(this.state)return 0===this.state.doc.textContent.length}get isActive(){return Object.entries({...this.activeMarks,...this.activeNodes}).reduce(((t,[e,n])=>({...t,[e]:(t={})=>n(t)})),{})}removeMark(t){if(this.schema.marks[t])return Ks.removeMark(this.schema.marks[t])(this.state,this.view.dispatch)}get selection(){return this.state.selection}get selectionAtEnd(){return x.atEnd(this.state.doc)}get selectionIsAtEnd(){return this.selection.head===this.selectionAtEnd.head}get selectionAtStart(){return x.atStart(this.state.doc)}get selectionIsAtStart(){return this.selection.head===this.selectionAtStart.head}selectionAtPosition(t=null){return null===t?this.selection:"start"===t||!0===t?this.selectionAtStart:"end"===t?this.selectionAtEnd:{from:t,to:t}}setActiveNodesAndMarks(){this.activeMarks=Object.values(this.schema.marks).filter((t=>Ks.markIsActive(this.state,t))).map((t=>t.name)),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce(((t,[e,n])=>({...t,[e]:Ks.getMarkAttrs(this.state,n)})),{}),this.activeNodes=Object.values(this.schema.nodes).filter((t=>Ks.nodeIsActive(this.state,t))).map((t=>t.name)),this.activeNodeAttrs=Object.entries(this.schema.nodes).reduce(((t,[e,n])=>({...t,[e]:Ks.getNodeAttrs(this.state,n)})),{})}setContent(t={},e=!1,n){const{doc:s,tr:i}=this.state,o=this.createDocument(t,n),l=i.replaceWith(0,s.content.size,o).setMeta("preventUpdate",!e);this.view.dispatch(l)}setSelection(t=0,e=0){const{doc:n,tr:s}=this.state,i=Ks.minMax(t,0,n.content.size),o=Ks.minMax(e,0,n.content.size),l=x.create(n,i,o),r=s.setSelection(l);this.view.dispatch(r)}get state(){return this.view?this.view.state:null}toggleMark(t){if(this.schema.marks[t])return Ks.toggleMark(this.schema.marks[t])(this.state,this.view.dispatch)}updateMark(t,e){if(this.schema.marks[t])return Ks.updateMark(this.schema.marks[t],e)(this.state,this.view.dispatch)}}class Qs extends Rn{constructor(t={}){super(t)}command(){return()=>{}}remove(){this.editor.removeMark(this.name)}get schema(){return{}}get type(){return"mark"}toggle(){return this.editor.toggleMark(this.name)}update(t){this.editor.updateMark(this.name,t)}}class Xs extends Qs{get button(){return{icon:"bold",label:window.panel.$t("toolbar.button.bold")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,t)]}keys(){return{"Mod-b":()=>this.toggle()}}get name(){return"bold"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g,t)]}get schema(){return{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM:()=>["strong",0]}}}class ti extends Qs{get button(){return{icon:"clear",label:window.panel.$t("toolbar.button.clear")}}commands(){return()=>this.clear()}clear(){const{state:t}=this.editor,{from:e,to:n}=t.tr.selection;for(const s of this.editor.activeMarks){const i=t.schema.marks[s],o=this.editor.state.tr.removeMark(e,n,i);this.editor.view.dispatch(o)}}get name(){return"clear"}}let ei=class extends Qs{get button(){return{icon:"code",label:window.panel.$t("toolbar.button.code")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:`)([^`]+)(?:`)$/,t)]}keys(){return{"Mod-`":()=>this.toggle()}}get name(){return"code"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/(?:`)([^`]+)(?:`)/g,t)]}get schema(){return{excludes:"_",parseDOM:[{tag:"code"}],toDOM:()=>["code",0]}}};class ni extends Qs{get button(){return{icon:"email",label:window.panel.$t("toolbar.button.email")}}commands(){return{email:t=>{if(t.altKey||t.metaKey)return this.remove();this.editor.emit("email")},insertEmail:(t={})=>{if(t.href)return this.update(t)},removeEmail:()=>this.remove(),toggleEmail:(t={})=>{var e;(null==(e=t.href)?void 0:e.length)>0?this.editor.command("insertEmail",t):this.editor.command("removeEmail")}}}get defaults(){return{target:null}}get name(){return"email"}pasteRules({type:t,utils:e}){return[e.pasteRule(/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/gi,t,(t=>({href:t})))]}plugins(){return[{props:{handleClick:(t,e,n)=>{const s=this.editor.getMarkAttrs("email");s.href&&!0===n.altKey&&n.target instanceof HTMLAnchorElement&&(n.stopPropagation(),window.open(s.href))}}}]}get schema(){return{attrs:{href:{default:null},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href^='mailto:']",getAttrs:t=>({href:t.getAttribute("href").replace("mailto:",""),title:t.getAttribute("title")})}],toDOM:t=>["a",{...t.attrs,href:"mailto:"+t.attrs.href},0]}}}class si extends Qs{get button(){return{icon:"italic",label:window.panel.$t("toolbar.button.italic")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,t),e.markInputRule(/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,t)]}keys(){return{"Mod-i":()=>this.toggle()}}get name(){return"italic"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/_([^_]+)_/g,t),e.markPasteRule(/\*([^*]+)\*/g,t)]}get schema(){return{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}}}let ii=class extends Qs{get button(){return{icon:"url",label:window.panel.$t("toolbar.button.link")}}commands(){return{link:t=>{if(t.altKey||t.metaKey)return this.remove();this.editor.emit("link",this.editor)},insertLink:(t={})=>{if(t.href)return this.update(t)},removeLink:()=>this.remove(),toggleLink:(t={})=>{var e;(null==(e=t.href)?void 0:e.length)>0?this.editor.command("insertLink",t):this.editor.command("removeLink")}}}get defaults(){return{target:null}}get name(){return"link"}pasteRules({type:t,utils:e}){return[e.pasteRule(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b([-a-zA-Z0-9@:%_+.~#?&//=,]*)/gi,t,(t=>({href:t})))]}plugins(){return[{props:{handleClick:(t,e,n)=>{const s=this.editor.getMarkAttrs("link");s.href&&!0===n.altKey&&n.target instanceof HTMLAnchorElement&&(n.stopPropagation(),window.open(s.href,s.target))}}}]}get schema(){return{attrs:{href:{default:null},target:{default:null},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]:not([href^='mailto:'])",getAttrs:t=>({href:t.getAttribute("href"),target:t.getAttribute("target"),title:t.getAttribute("title")})}],toDOM:t=>["a",{...t.attrs},0]}}};class oi extends Qs{get button(){return{icon:"strikethrough",label:window.panel.$t("toolbar.button.strike")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/~([^~]+)~$/,t)]}keys(){return{"Mod-d":()=>this.toggle()}}get name(){return"strike"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/~([^~]+)~/g,t)]}get schema(){return{parseDOM:[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",getAttrs:t=>"line-through"===t}],toDOM:()=>["s",0]}}}let li=class extends Qs{get button(){return{icon:"superscript",label:window.panel.$t("toolbar.button.sup")}}commands(){return()=>this.toggle()}get name(){return"sup"}get schema(){return{parseDOM:[{tag:"sup"}],toDOM:()=>["sup",0]}}};class ri extends Qs{get button(){return{icon:"subscript",label:window.panel.$t("toolbar.button.sub")}}commands(){return()=>this.toggle()}get name(){return"sub"}get schema(){return{parseDOM:[{tag:"sub"}],toDOM:()=>["sub",0]}}}class ai extends Qs{get button(){return{icon:"underline",label:window.panel.$t("toolbar.button.underline")}}commands(){return()=>this.toggle()}keys(){return{"Mod-u":()=>this.toggle()}}get name(){return"underline"}get schema(){return{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:t=>"underline"===t}],toDOM:()=>["u",0]}}}class ui extends zn{get button(){return{id:this.name,icon:"list-bullet",label:window.panel.$t("toolbar.button.ul"),name:this.name,when:["listItem","bulletList","orderedList"]}}commands({type:t,schema:e,utils:n}){return()=>n.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^\s*([-+*])\s$/,t)]}keys({type:t,schema:e,utils:n}){return{"Shift-Ctrl-8":n.toggleList(t,e.nodes.listItem)}}get name(){return"bulletList"}get schema(){return{content:"listItem+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]}}}class ci extends zn{commands({utils:t,type:e}){return()=>this.createHardBreak(t,e)}createHardBreak(t,e){return t.chainCommands(t.exitCode,((t,n)=>(n(t.tr.replaceSelectionWith(e.create()).scrollIntoView()),!0)))}get defaults(){return{enter:!1,text:!1}}keys({utils:t,type:e}){const n=this.createHardBreak(t,e);let s={"Mod-Enter":n,"Shift-Enter":n};return this.options.enter&&(s.Enter=n),s}get name(){return"hardBreak"}get schema(){return{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]}}}class di extends zn{get button(){const t=this.options.levels.map((t=>({id:`h${t}`,command:`h${t}`,icon:`h${t}`,label:window.panel.$t("toolbar.button.heading."+t),attrs:{level:t},name:this.name,when:["heading","paragraph"]})));return t[t.length-1].separator=!0,t}commands({type:t,schema:e,utils:n}){let s={toggleHeading:s=>n.toggleBlockType(t,e.nodes.paragraph,s)};return this.options.levels.forEach((i=>{s[`h${i}`]=()=>n.toggleBlockType(t,e.nodes.paragraph,{level:i})})),s}get defaults(){return{levels:[1,2,3,4,5,6]}}inputRules({type:t,utils:e}){return this.options.levels.map((n=>e.textblockTypeInputRule(new RegExp(`^(#{1,${n}})\\s$`),t,(()=>({level:n})))))}keys({type:t,utils:e}){return this.options.levels.reduce(((n,s)=>({...n,[`Shift-Ctrl-${s}`]:e.setBlockType(t,{level:s})})),{})}get name(){return"heading"}get schema(){return{attrs:{level:{default:1}},content:"inline*",group:"block",defining:!0,draggable:!1,parseDOM:this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}}))),toDOM:t=>[`h${t.attrs.level}`,0]}}}class pi extends zn{commands({type:t}){return()=>(e,n)=>n(e.tr.replaceSelectionWith(t.create()))}inputRules({type:t,utils:e}){return[e.nodeInputRule(/^(?:---|___\s|\*\*\*\s)$/,t)]}get name(){return"horizontalRule"}get schema(){return{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]}}}class hi extends zn{keys({type:t,utils:e}){return{Enter:e.splitListItem(t),"Shift-Tab":e.liftListItem(t),Tab:e.sinkListItem(t)}}get name(){return"listItem"}get schema(){return{content:"paragraph block*",defining:!0,draggable:!1,parseDOM:[{tag:"li"}],toDOM:()=>["li",0]}}}class mi extends zn{get button(){return{id:this.name,icon:"list-numbers",label:window.panel.$t("toolbar.button.ol"),name:this.name,when:["listItem","bulletList","orderedList"]}}commands({type:t,schema:e,utils:n}){return()=>n.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^(\d+)\.\s$/,t,(t=>({order:+t[1]})),((t,e)=>e.childCount+e.attrs.order===+t[1]))]}keys({type:t,schema:e,utils:n}){return{"Shift-Ctrl-9":n.toggleList(t,e.nodes.listItem)}}get name(){return"orderedList"}get schema(){return{attrs:{order:{default:1}},content:"listItem+",group:"block",parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1===t.attrs.order?["ol",0]:["ol",{start:t.attrs.order},0]}}}class fi extends Rn{commands(){return{undo:()=>O,redo:()=>A,undoDepth:()=>I,redoDepth:()=>M}}get defaults(){return{depth:"",newGroupDelay:""}}keys(){return{"Mod-z":O,"Mod-y":A,"Shift-Mod-z":A,"Mod-я":O,"Shift-Mod-я":A}}get name(){return"history"}plugins(){return[T({depth:this.options.depth,newGroupDelay:this.options.newGroupDelay})]}}class gi extends Rn{commands(){return{insertHtml:t=>(e,n)=>{let s=document.createElement("div");s.innerHTML=t.trim();const i=b.fromSchema(e.schema).parse(s);n(e.tr.replaceSelectionWith(i).scrollIntoView())}}}}class ki extends Rn{keys(){const t={};for(const e in this.options)t[e]=()=>(this.options[e](),!0);return t}}let bi=class extends Rn{constructor(t={}){super(t)}close(){this.visible=!1}init(){this.editor.on("blur",(()=>this.close())),this.editor.on("deselect",(()=>this.close())),this.editor.on("select",(({hasChanged:t})=>{!1!==t&&this.open()}))}open(){this.visible=!0,this.options.inline&&this.options.writer.$nextTick((()=>this.reposition()))}set position(t){this.options.inline&&(this.toolbar.style.bottom=t.bottom+"px",this.toolbar.style.left=t.left+"px")}reposition(){const{from:t,to:e}=this.editor.selection,n=this.editor.view.coordsAtPos(t),s=this.editor.view.coordsAtPos(e,!0),i=this.editor.element.getBoundingClientRect();let o=(n.left+s.left)/2-i.left,l=Math.round(i.bottom-n.top);const r=i.clientWidth,a=this.toolbar.clientWidth;o-a/2<0&&(o=o+(a/2-o)-20),o+a/2>r&&(o=o-(o+a/2-r)+20),this.position={bottom:l,left:o}}get toolbar(){return this.editor.element.querySelector(".k-writer-toolbar")}get type(){return"toolbar"}get visible(){var t;return"flex"===(null==(t=this.toolbar)?void 0:t.style.display)}set visible(t){this.options.inline&&this.toolbar&&(this.toolbar.style.display=t?"flex":"none")}};const vi={props:{autofocus:Boolean,breaks:Boolean,code:Boolean,disabled:Boolean,emptyDocument:{type:Object,default:()=>({type:"doc",content:[]})},extensions:Array,headings:[Array,Boolean],inline:Boolean,keys:Object,marks:{type:[Array,Boolean],default:!0},nodes:{type:[Array,Boolean],default:()=>["heading","bulletList","orderedList"]},paste:{type:Function,default:()=>()=>!1},placeholder:String,spellcheck:Boolean,toolbar:{type:Object,default:()=>({inline:!0})},value:{type:String,default:""}}};const yi=R({mixins:[vi],data(){return{editor:null,json:{},html:this.value,isEmpty:!0}},computed:{isCursorAtEnd(){return this.editor.selectionIsAtEnd},isCursorAtStart(){return this.editor.selectionIsAtStart},isParagraphNodeHidden(){return!0===Array.isArray(this.nodes)&&3!==this.nodes.length&&!1===this.nodes.includes("paragraph")}},watch:{value(t,e){t!==e&&t!==this.html&&(this.html=t,this.editor.setContent(this.html))}},mounted(){this.editor=new Zs({autofocus:this.autofocus,content:this.value,editable:!this.disabled,element:this.$el,emptyDocument:this.emptyDocument,events:{link:t=>{this.$refs.linkDialog.open(t.getMarkAttrs("link"))},email:()=>{this.$refs.emailDialog.open(this.editor.getMarkAttrs("email"))},paste:this.paste,update:t=>{if(!this.editor)return;const e=JSON.stringify(this.editor.getJSON());e!==JSON.stringify(this.json)&&(this.json=e,this.isEmpty=t.editor.isEmpty(),this.html=t.editor.getHTML(),this.isEmpty&&(0===t.editor.activeNodes.length||t.editor.activeNodes.includes("paragraph"))&&(this.html=""),this.$emit("input",this.html))}},extensions:[...this.createMarks(),...this.createNodes(),new ki(this.keys),new fi,new gi,new bi({writer:this,inline:this.toolbar.inline}),...this.extensions||[]],inline:this.inline}),this.isEmpty=this.editor.isEmpty(),this.json=this.editor.getJSON()},beforeDestroy(){this.editor.destroy()},methods:{command(t,...e){this.editor.command(t,...e)},createMarks(){return this.filterExtensions({bold:new Xs,italic:new si,underline:new ai,strike:new oi,sup:new li,sub:new ri,code:new ei,link:new ii,email:new ni,clear:new ti,...this.createMarksFromPanelPlugins()},this.marks)},createMarksFromPanelPlugins(){const t=window.panel.plugins.writerMarks??{};for(const e in t)Object.setPrototypeOf(t[e],new Qs);return t},createNodes(){const t=new ci({text:!0,enter:this.inline});return!0===this.inline?[t]:this.filterExtensions({bulletList:new ui,orderedList:new mi,heading:new di({levels:this.headings}),horizontalRule:new pi,listItem:new hi,...this.createNodesFromPanelPlugins()},this.nodes,((e,n)=>((e.includes("bulletList")||e.includes("orderedList"))&&n.push(new hi),n.push(t),n)))},createNodesFromPanelPlugins(){const t=window.panel.plugins.writerNodes??{};for(const e in t)Object.setPrototypeOf(t[e],new zn);return t},getHTML(){return this.editor.getHTML()},filterExtensions(t,e,n){!1===e?e=[]:!0!==e&&!1!==Array.isArray(e)||(e=Object.keys(t));let s=[];for(const i of e)t[i]&&s.push(t[i]);return"function"==typeof n&&(s=n(e,s)),s},focus(){this.editor.focus()},getSplitContent(){return this.editor.getHTMLStartToSelectionToEnd()},onCommand(t,...e){this.editor.command(t,...e)}}},(function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"direction",rawName:"v-direction"}],ref:"editor",staticClass:"k-writer",attrs:{"data-empty":t.isEmpty,"data-placeholder":t.placeholder,spellcheck:t.spellcheck}},[t.editor?[e("k-writer-toolbar",t._b({ref:"toolbar",attrs:{editor:t.editor,"active-marks":t.editor.activeMarks,"active-nodes":t.editor.activeNodes,"active-node-attrs":t.editor.activeNodeAttrs,"is-paragraph-node-hidden":t.isParagraphNodeHidden},on:{command:t.onCommand}},"k-writer-toolbar",t.toolbar,!1)),e("k-writer-link-dialog",{ref:"linkDialog",on:{close:function(e){return t.editor.focus()},submit:function(e){return t.editor.command("toggleLink",e)}}}),e("k-writer-email-dialog",{ref:"emailDialog",on:{close:function(e){return t.editor.focus()},submit:function(e){return t.editor.command("toggleEmail",e)}}})]:t._e()],2)}),[],!1,null,null,null,null).exports,$i={mixins:[Yt,Ut,Vt,Gt,Zt,vi],props:{maxlength:Number,minlength:Number},computed:{counterValue(){const t=this.$helper.string.stripHTML(this.value);return this.$helper.string.unescapeHTML(t)}}};const wi=R({mixins:[$i,vi],inheritAttrs:!1,watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)}},validations(){return{counterValue:{required:!this.required||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.maxLength(this.maxlength)}}}},(function(){var t=this;return(0,t._self._c)("k-writer",t._b({ref:"input",staticClass:"k-writer-input",on:{input:function(e){return t.$emit("input",e)}}},"k-writer",t.$props,!1))}),[],!1,null,null,null,null).exports;const _i=R({mixins:[Qt,ee,$i,yn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-writer-field",attrs:{input:t._uid,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{after:t.after,before:t.before,icon:t.icon,theme:"field"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,xi={install(t){t.component("k-blocks-field",kn),t.component("k-checkboxes-field",$n),t.component("k-color-field",xn),t.component("k-date-field",On),t.component("k-email-field",jn),t.component("k-files-field",Dn),t.component("k-gap-field",Ln),t.component("k-headline-field",Bn),t.component("k-info-field",Pn),t.component("k-layout-field",Nn),t.component("k-line-field",Fn),t.component("k-link-field",qn),t.component("k-list-field",Vn),t.component("k-multiselect-field",Gn),t.component("k-number-field",Xn),t.component("k-object-field",ts),t.component("k-pages-field",es),t.component("k-password-field",is),t.component("k-radio-field",rs),t.component("k-range-field",cs),t.component("k-select-field",hs),t.component("k-slug-field",gs),t.component("k-structure-field",ks),t.component("k-tags-field",ys),t.component("k-text-field",xs),t.component("k-textarea-field",Os),t.component("k-tel-field",_s),t.component("k-time-field",Ms),t.component("k-toggle-field",Es),t.component("k-toggles-field",Bs),t.component("k-url-field",Fs),t.component("k-users-field",qs),t.component("k-writer-field",_i)}};const Ci=R({mixins:[Yt,Ut,Vt,Jt,Zt],inheritAttrs:!1,props:{value:Boolean},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onChange(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-checkbox-input",on:{click:function(t){t.stopPropagation()}}},[e("input",{ref:"input",staticClass:"k-checkbox-input-native input-hidden",attrs:{id:t.id,disabled:t.disabled,type:"checkbox"},domProps:{checked:t.value},on:{change:function(e){return t.onChange(e.target.checked)}}}),e("span",{staticClass:"k-checkbox-input-icon",attrs:{"aria-hidden":"true"}},[e("svg",{attrs:{width:"12",height:"10",viewBox:"0 0 12 10",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{d:"M1 5l3.3 3L11 1","stroke-width":"2",fill:"none","fill-rule":"evenodd"}})])]),e("span",{staticClass:"k-checkbox-input-label",domProps:{innerHTML:t._s(t.label)}})])}),[],!1,null,null,null,null).exports,Si={install(t){t.component("k-checkbox-input",Ci),t.component("k-checkboxes-input",vn),t.component("k-color-input",_n),t.component("k-date-input",Sn),t.component("k-email-input",Tn),t.component("k-list-input",Kn),t.component("k-multiselect-input",Jn),t.component("k-number-input",Qn),t.component("k-password-input",ss),t.component("k-radio-input",ls),t.component("k-range-input",us),t.component("k-select-input",ps),t.component("k-slug-input",fs),t.component("k-tags-input",vs),t.component("k-tel-input",ws),t.component("k-text-input",In),t.component("k-textarea-input",Ss),t.component("k-time-input",Is),t.component("k-toggle-input",js),t.component("k-toggles-input",Ls),t.component("k-url-input",Ns),t.component("k-writer-input",wi)}};const Oi=R({props:{attrs:[Array,Object],columns:Array,disabled:Boolean,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean,settings:Object},computed:{tabs(){let t=this.settings.tabs;return Object.entries(t).forEach((([e,n])=>{Object.entries(n.fields).forEach((([n])=>{t[e].fields[n].endpoints={field:this.endpoints.field+"/fields/"+n,section:this.endpoints.section,model:this.endpoints.model}}))})),t}},methods:{remove(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.layout.delete.confirm")},on:{submit:()=>{this.$emit("remove"),this.$panel.dialog.close()}}})}}},(function(){var t=this,e=t._self._c;return e("section",{staticClass:"k-layout",attrs:{"data-selected":t.isSelected,tabindex:"0"},on:{click:function(e){return t.$emit("select")}}},[e("k-grid",{staticClass:"k-layout-columns"},t._l(t.columns,(function(n,s){return e("k-layout-column",t._b({key:n.id,attrs:{endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets},on:{input:function(e){return t.$emit("updateColumn",{column:n,columnIndex:s,blocks:e})}}},"k-layout-column",n,!1))})),1),t.disabled?t._e():e("nav",{staticClass:"k-layout-toolbar"},[t.settings?e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{tooltip:t.$t("settings"),icon:"settings"},on:{click:function(e){return t.$refs.drawer.open()}}}):t._e(),e("k-dropdown",[e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{icon:"angle-down"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{icon:"angle-up"},on:{click:function(e){return t.$emit("prepend")}}},[t._v(" "+t._s(t.$t("insert.before"))+" ")]),e("k-dropdown-item",{attrs:{icon:"angle-down"},on:{click:function(e){return t.$emit("append")}}},[t._v(" "+t._s(t.$t("insert.after"))+" ")]),e("hr"),t.settings?e("k-dropdown-item",{attrs:{icon:"settings"},on:{click:function(e){return t.$refs.drawer.open()}}},[t._v(" "+t._s(t.$t("settings"))+" ")]):t._e(),e("k-dropdown-item",{attrs:{icon:"copy"},on:{click:function(e){return t.$emit("duplicate")}}},[t._v(" "+t._s(t.$t("duplicate"))+" ")]),e("k-dropdown-item",{attrs:{icon:"dashboard"},on:{click:function(e){return t.$emit("change")}}},[t._v(" "+t._s(t.$t("field.layout.change"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:"template"},on:{click:function(e){return t.$emit("copy")}}},[t._v(" "+t._s(t.$t("copy"))+" ")]),e("k-dropdown-item",{attrs:{icon:"download"},on:{click:function(e){return t.$emit("paste")}}},[t._v(" "+t._s(t.$t("paste.after"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:"trash"},on:{click:t.remove}},[t._v(" "+t._s(t.$t("field.layout.delete"))+" ")])],1)],1),e("k-sort-handle")],1),t.settings?e("k-form-drawer",{ref:"drawer",staticClass:"k-layout-drawer",attrs:{tabs:t.tabs,title:t.$t("settings"),value:t.attrs,icon:"settings"},on:{input:function(e){return t.$emit("updateAttrs",e)}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const Ai=R({props:{blocks:Array,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean,width:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column k-layout-column",attrs:{id:t.id,"data-width":t.width,tabindex:"0"},on:{dblclick:function(e){return t.$refs.blocks.choose(t.blocks.length)}}},[e("k-blocks",{ref:"blocks",attrs:{endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets,value:t.blocks,group:"layout"},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{dblclick:function(t){t.stopPropagation()}}})],1)}),[],!1,null,null,null,null).exports;const Ii=R({props:{disabled:Boolean,empty:String,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,layouts:Array,max:Number,settings:Object,value:Array},data(){return{current:null,nextIndex:null,rows:this.value,selected:null}},computed:{draggableOptions(){return{id:this._uid,handle:!0,list:this.rows}}},watch:{value(){this.rows=this.value}},methods:{copy(t,e){if(0===this.rows.length)return!1;const n=void 0!==e?this.rows[e]:this.rows;this.$helper.clipboard.write(JSON.stringify(n),t),this.$panel.notification.success(this.$t("copy.success",{count:n.length??1}))},change(t,e){const n=e.columns.map((t=>t.width)),s=this.layouts.findIndex((t=>t.toString()===n.toString()));this.$refs.selector.open({rowIndex:t,layoutIndex:s,layout:e})},duplicate(t,e){let n={...this.$helper.clone(e),id:this.$helper.uuid()};n=this.updateIds(n),this.rows.splice(t+1,0,n),this.save()},async onAdd(t){let e=await this.$api.post(this.endpoints.field+"/layout",{columns:t});this.rows.splice(this.nextIndex,0,e),this.layouts.length>1&&this.$refs.selector.close(),this.save()},async onChange(t,e,n){if(e===n.layoutIndex)return this.$refs.selector.close();const s=n.layout,i=await this.$api.post(this.endpoints.field+"/layout",{columns:t}),o=s.columns.filter((t=>{var e;return(null==(e=null==t?void 0:t.blocks)?void 0:e.length)>0})),l=[];if(0===o.length)l.push(i);else{const t=Math.ceil(o.length/i.columns.length)*i.columns.length;for(let e=0;e{var s;return t.blocks=(null==(s=o[n+e])?void 0:s.blocks)??[],t})),t.columns.filter((t=>{var e;return null==(e=null==t?void 0:t.blocks)?void 0:e.length})).length&&l.push(t)}}this.rows.splice(n.rowIndex,1,...l),this.save(),this.$refs.selector.close()},async onPaste(t){const e=this.$helper.clipboard.read(t),n=this.current??this.rows.length;let s=await this.$api.post(this.endpoints.field+"/layout/paste",{json:e});s.length&&(this.rows.splice(n,0,...s),this.save()),this.$panel.notification.success(this.$t("paste.success",{count:s.length}))},async onSelect(t,e,n){return n?this.onChange(t,e,n):this.onAdd(t)},pasteboard(t){this.current=t,this.$refs.pasteboard.open()},remove(t){const e=this.rows.findIndex((e=>e.id===t.id));-1!==e&&this.$delete(this.rows,e),this.save()},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.layout.delete.confirm.all")},on:{submit:()=>{this.rows=[],this.save(),this.$panel.dialog.close()}}})},save(){this.$emit("input",this.rows)},select(t){if(this.nextIndex=t,1===this.layouts.length)return this.onAdd(this.layouts[0]);this.$refs.selector.open()},updateAttrs(t,e){this.rows[t].attrs=e,this.save()},updateColumn(t){this.rows[t.index].columns[t.columnIndex].blocks=t.blocks,this.save()},updateIds(t){return!1===Array.isArray(t)&&(t=[t]),t.map((t=>(t.id=this.$helper.uuid(),t.columns=t.columns.map((t=>(t.id=this.$helper.uuid(),t.blocks=t.blocks.map((t=>(t.id=this.$helper.uuid(),t))),t))),t)))}}},(function(){var t=this,e=t._self._c;return e("div",[t.rows.length?[e("k-draggable",t._b({staticClass:"k-layouts",on:{sort:t.save}},"k-draggable",t.draggableOptions,!1),t._l(t.rows,(function(n,s){return e("k-layout",t._b({key:n.id,attrs:{disabled:t.disabled,endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets,"is-selected":t.selected===n.id,settings:t.settings},on:{append:function(e){return t.select(s+1)},change:function(e){return t.change(s,n)},copy:function(e){return t.copy(e,s)},duplicate:function(e){return t.duplicate(s,n)},paste:function(e){return t.pasteboard(s+1)},prepend:function(e){return t.select(s)},remove:function(e){return t.remove(n)},select:function(e){t.selected=n.id},updateAttrs:function(e){return t.updateAttrs(s,e)},updateColumn:function(e){return t.updateColumn({layout:n,index:s,...e})}}},"k-layout",n,!1))})),1),t.disabled?t._e():e("k-button",{staticClass:"k-field-add-item-button",attrs:{icon:"add",tooltip:t.$t("add")},on:{click:function(e){return t.select(t.rows.length)}}})]:[e("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"},on:{click:function(e){return t.select(0)}}},[t._v(" "+t._s(t.empty||t.$t("field.layout.empty"))+" ")])],e("k-layout-selector",{ref:"selector",attrs:{layouts:t.layouts},on:{select:t.onSelect}}),e("k-block-pasteboard",{ref:"pasteboard",on:{paste:t.onPaste}})],2)}),[],!1,null,null,null,null).exports;const Mi=R({inheritAttrs:!1,props:{layouts:Array},data:()=>({payload:null}),methods:{close(){this.$refs.dialog.close()},isCurrent(t){var e;return t===(null==(e=this.payload)?void 0:e.layoutIndex)},onSelect(t,e){this.$emit("select",t,e,this.payload)},open(t){this.payload=t,this.$refs.dialog.open()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-layout-selector",attrs:{"cancel-button":!1,"submit-button":!1,size:"medium"}},[e("k-headline",[t._v(t._s(t.$t("field.layout.select")))]),e("ul",t._l(t.layouts,(function(n,s){return e("li",{key:s,staticClass:"k-layout-selector-option",attrs:{"aria-current":t.isCurrent(s)}},[e("k-grid",{nativeOn:{click:function(e){return t.onSelect(n,s)}}},t._l(n,(function(t,n){return e("k-column",{key:n,attrs:{width:t}})})),1)],1)})),0)],1)}),[],!1,null,null,null,null).exports,Ti={install(t){t.component("k-layout",Oi),t.component("k-layout-column",Ai),t.component("k-layouts",Ii),t.component("k-layout-selector",Mi)}},ji={inheritAttrs:!1,props:{column:{type:Object,default:()=>({})},field:Object,value:{}}};const Ei=R({mixins:[ji],inheritAttrs:!1,props:{value:[Array,String]},computed:{bubbles(){var t,e;let n=this.value;const s=(null==(t=this.column)?void 0:t.options)||(null==(e=this.field)?void 0:e.options)||[];return"string"==typeof n&&(n=n.split(",")),n.map((t=>{"string"==typeof t&&(t={value:t,text:t});for(const e of s)e.value===t.value&&(t.text=e.text);return{back:"light",color:"black",...t}}))}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-bubbles-field-preview",class:t.$options.class},[e("k-bubbles",{attrs:{bubbles:t.bubbles}})],1)}),[],!1,null,null,null,null).exports;const Di=R({extends:Ei,inheritAttrs:!1,class:"k-array-field-preview",computed:{bubbles(){return[{text:1===this.value.length?`1 ${this.$t("entry")}`:`${this.value.length} ${this.$t("entries")}`}]}}},null,null,!1,null,null,null,null).exports;const Li=R({mixins:[ji],inheritAttrs:!1,computed:{text(){return this.value}}},(function(){var t=this;return(0,t._self._c)("p",{staticClass:"k-text-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),t._t("default",(function(){return[t._v(t._s(t.text))]})),t._v(" "+t._s(t.column.after)+" ")],2)}),[],!1,null,null,null,null).exports;const Bi=R({extends:Li,inheritAttrs:!1,props:{value:String},class:"k-date-field-preview",computed:{text(){var t,e,n,s,i,o;if("string"!=typeof this.value)return"";const l=this.$library.dayjs(this.value);if(!l)return"";let r=(null==(t=this.column)?void 0:t.display)||(null==(e=this.field)?void 0:e.display)||"YYYY-MM-DD",a=(null==(s=null==(n=this.column)?void 0:n.time)?void 0:s.display)||(null==(o=null==(i=this.field)?void 0:i.time)?void 0:o.display);return a&&(r+=" "+a),l.format(r)}}},null,null,!1,null,null,null,null).exports;const Pi=R({mixins:[ji],props:{value:[String,Object]},computed:{link(){return"object"==typeof this.value?this.value.href:this.value},text(){return"object"==typeof this.value?this.value.text:this.link}}},(function(){var t=this,e=t._self._c;return e("p",{staticClass:"k-url-field-preview",class:t.$options.class,attrs:{"data-link":t.link}},[t._v(" "+t._s(t.column.before)+" "),e("k-link",{attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[t._v(" "+t._s(t.text)+" ")]),t._v(" "+t._s(t.column.after)+" ")],1)}),[],!1,null,null,null,null).exports;const Ni=R({extends:Pi,class:"k-email-field-preview"},null,null,!1,null,null,null,null).exports;const Fi=R({extends:Ei,inheritAttrs:!1,class:"k-files-field-preview",computed:{bubbles(){return this.value.map((t=>({text:t.filename,link:t.link,image:t.image})))}}},null,null,!1,null,null,null,null).exports;const qi=R({mixins:[ji],inheritAttrs:!1,props:{value:Object}},(function(){var t=this;return(0,t._self._c)("k-status-icon",t._b({staticClass:"k-flag-field-preview"},"k-status-icon",t.value,!1))}),[],!1,null,null,null,null).exports;const Ri=R({mixins:[ji],inheritAttrs:!1,props:{value:String},computed:{html(){return this.value}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-html-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),e("div",{domProps:{innerHTML:t._s(t.html)}}),t._v(" "+t._s(t.column.after)+" ")])}),[],!1,null,null,null,null).exports;const zi=R({mixins:[ji],inheritAttrs:!1,props:{value:[Object]}},(function(){return(0,this._self._c)("k-item-image",{staticClass:"k-image-field-preview",attrs:{image:this.value,layout:"list"}})}),[],!1,null,null,null,null).exports;const Yi=R({extends:Ei,inheritAttrs:!1,class:"k-object-field-preview",props:{value:[Array,Object]},computed:{bubbles:()=>[{text:"{ ... }"}]}},null,null,!1,null,null,null,null).exports;const Hi=R({extends:Ei,inheritAttrs:!1,class:"k-pages-field-preview"},null,null,!1,null,null,null,null).exports;const Ui=R({extends:Li,inheritAttrs:!1,props:{value:String},class:"k-time-field-preview",computed:{text(){const t=this.$library.dayjs.iso(this.value,"time");return(null==t?void 0:t.format(this.field.display))||""}}},null,null,!1,null,null,null,null).exports;const Ki=R({props:{field:Object,value:Boolean,column:Object},computed:{text(){return!1!==this.column.text?this.field.text:null}}},(function(){var t=this;return(0,t._self._c)("k-input",{staticClass:"k-toggle-field-preview",attrs:{text:t.text,value:t.value,type:"toggle"},on:{input:function(e){return t.$emit("input",e)}}})}),[],!1,null,null,null,null).exports;const Vi=R({extends:Ei,inheritAttrs:!1,class:"k-users-field-preview",computed:{bubble(){return this.value.map((t=>({text:t.username,link:t.link,image:t.image})))}}},null,null,!1,null,null,null,null).exports,Wi={install(t){t.component("k-array-field-preview",Di),t.component("k-bubbles-field-preview",Ei),t.component("k-date-field-preview",Bi),t.component("k-email-field-preview",Ni),t.component("k-files-field-preview",Fi),t.component("k-flag-field-preview",qi),t.component("k-html-field-preview",Ri),t.component("k-image-field-preview",zi),t.component("k-object-field-preview",Yi),t.component("k-pages-field-preview",Hi),t.component("k-text-field-preview",Li),t.component("k-toggle-field-preview",Ki),t.component("k-time-field-preview",Ui),t.component("k-url-field-preview",Pi),t.component("k-users-field-preview",Vi),t.component("k-list-field-preview",Ri),t.component("k-writer-field-preview",Ri),t.component("k-checkboxes-field-preview",Ei),t.component("k-multiselect-field-preview",Ei),t.component("k-radio-field-preview",Ei),t.component("k-select-field-preview",Ei),t.component("k-tags-field-preview",Ei),t.component("k-toggles-field-preview",Ei)}};const Ji=R({data:()=>({link:{href:"",title:null,target:!1}}),computed:{fields(){return{href:{label:this.$t("link"),type:"link",icon:"url"},title:{label:this.$t("title"),type:"text",icon:"title"},target:{label:this.$t("open.newWindow"),type:"toggle",text:[this.$t("no"),this.$t("yes")]}}}},methods:{open(t){this.link={href:"",title:null,target:!1,...t},this.link.target=Boolean(this.link.target),this.$refs.dialog.open()},submit(){const t=this.link.href.replace("file://","/@/file/").replace("page://","/@/page/");this.$emit("submit",{...this.link,href:t,target:this.link.target?"_blank":null}),this.$refs.dialog.close()}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",{ref:"dialog",attrs:{fields:t.fields,"submit-button":t.$t("confirm"),value:t.link,size:"medium"},on:{close:function(e){return t.$emit("close")},input:function(e){t.link=e},submit:t.submit}})}),[],!1,null,null,null,null).exports;const Gi=R({data:()=>({email:{email:null,title:null}}),computed:{fields(){return{href:{label:this.$t("email"),type:"email",icon:"email"},title:{label:this.$t("title"),type:"text",icon:"title"}}}},methods:{open(t){this.email={title:null,...t},this.$refs.dialog.open()},submit(){this.$emit("submit",this.email),this.$refs.dialog.close()}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",{ref:"dialog",attrs:{fields:t.fields,"submit-button":t.$t("confirm"),value:t.email,size:"medium"},on:{input:function(e){t.email=e},close:function(e){return t.$emit("close")},submit:t.submit}})}),[],!1,null,null,null,null).exports;const Zi=R({props:{activeMarks:Array,activeNodes:Array,activeNodeAttrs:{type:[Array,Object],default:()=>[]},editor:{type:Object,required:!0},inline:{type:Boolean,default:!0},isParagraphNodeHidden:Boolean,marks:{type:[Array,Boolean],default:!0},nodes:{type:[Array,Boolean],default:!0}},computed:{activeNodeButton(){return Object.values(this.nodeButtons).find((t=>this.isButtonActive(t)))||!1},hasVisibleMarkButtons(){return this.$helper.object.length(this.markButtons)>0},hasVisibleNodeButtons(){return this.$helper.object.length(this.nodeButtons)>1},markButtons(){if(!1===this.marks)return{};const t=this.editor.buttons("mark");if(!0===this.marks)return t;const e={};for(const[n,s]of this.marks.entries())"|"===s?e["divider"+n]="|":t[s]&&(e[s]=t[s]);return e},nodeButtons(){if(!1===this.nodes)return{};const t=this.editor.buttons("node");if(!0===this.isParagraphNodeHidden&&t.paragraph&&delete t.paragraph,!0===this.nodes)return t;const e={};for(const n of this.nodes.entries())t[n]&&(e[n]=t[n]);return e}},methods:{command(t,...e){this.$emit("command",t,...e)},isButtonActive(t){if("paragraph"===t.name)return 1===this.activeNodes.length&&this.activeNodes.includes(t.name);let e=!0;if(t.attrs){const n=Object.values(this.activeNodeAttrs).find((e=>JSON.stringify(e)===JSON.stringify(t.attrs)));e=Boolean(n||!1)}return!0===e&&this.activeNodes.includes(t.name)}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-toolbar k-writer-toolbar",style:t.inline?"display: none":null,attrs:{"data-inline":t.inline}},[t.hasVisibleNodeButtons?e("k-dropdown",{nativeOn:{mousedown:function(t){t.preventDefault()}}},[e("k-button",{staticClass:"k-toolbar-button k-writer-toolbar-nodes",attrs:{current:!!t.activeNodeButton,icon:t.activeNodeButton.icon||"title"},on:{click:function(e){return t.$refs.nodes.toggle()}}}),e("k-dropdown-content",{ref:"nodes"},[t._l(t.nodeButtons,(function(n,s){var i,o,l;return[e("k-dropdown-item",{key:s,attrs:{current:(null==(i=t.activeNodeButton)?void 0:i.id)===n.id,disabled:!1===(null==(l=null==(o=t.activeNodeButton)?void 0:o.when)?void 0:l.includes(n.name)),icon:n.icon},on:{click:function(e){return t.command(n.command||s)}}},[t._v(" "+t._s(n.label)+" ")]),!0===n.separator?e("hr",{key:s+"-divider"}):t._e()]}))],2)],1):t._e(),t.hasVisibleNodeButtons&&t.hasVisibleMarkButtons?e("div",{staticClass:"k-toolbar-divider"}):t._e(),t._l(t.markButtons,(function(n,s){return["|"===n?e("div",{key:s,staticClass:"k-toolbar-divider"}):e("k-button",{key:s,staticClass:"k-toolbar-button",attrs:{current:t.activeMarks.includes(s),icon:n.icon,tooltip:n.label},nativeOn:{mousedown:function(e){return e.preventDefault(),t.command(n.command||s,e)}}})]}))],2)}),[],!1,null,null,null,null).exports,Qi={install(t){t.component("k-writer-email-dialog",Gi),t.component("k-writer-link-dialog",Ji),t.component("k-writer-toolbar",Zi),t.component("k-writer",yi)}},Xi={install(t){customElements.define("k-autosize",Lt),t.component("k-calendar",Pt),t.component("k-counter",Nt),t.component("k-autocomplete",Bt),t.component("k-form",Ft),t.component("k-form-buttons",qt),t.component("k-form-indicator",Rt),t.component("k-field",Xt),t.component("k-fieldset",te),t.component("k-input",ne),t.component("k-login",se),t.component("k-login-code",ie),t.component("k-times",oe),t.component("k-upload",le),t.component("k-login-alert",re),t.component("k-structure-form",ae),t.component("k-toolbar",ce),t.component("k-toolbar-email-dialog",de),t.component("k-toolbar-link-dialog",pe),t.use(Ve),t.use(gn),t.use(Si),t.use(xi),t.use(Ti),t.use(Wi),t.use(Qi)}};const to=R({props:{cover:Boolean,ratio:String},computed:{ratioPadding(){return this.$helper.ratio(this.ratio)}}},(function(){var t=this;return(0,t._self._c)("span",{staticClass:"k-aspect-ratio",style:{"padding-bottom":t.ratioPadding},attrs:{"data-cover":t.cover}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const eo=R({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-bar"},[t.$slots.left?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"left"}},[t._t("left")],2):t._e(),t.$slots.center?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"center"}},[t._t("center")],2):t._e(),t.$slots.right?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"right"}},[t._t("right")],2):t._e()])}),[],!1,null,null,null,null).exports;const no=R({props:{theme:{type:String,default:"none"},text:String,html:{type:Boolean,default:!1}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-box",attrs:{"data-theme":t.theme}},[t._t("default",(function(){return[t.html?e("k-text",{attrs:{html:t.text}}):e("k-text",[t._v(" "+t._s(t.text)+" ")])]}))],2)}),[],!1,null,null,null,null).exports;const so=R({inheritAttrs:!1,props:{back:String,color:String,element:{type:String,default:"li"},image:Object,link:String,text:String}},(function(){var t=this,e=t._self._c;return e(t.link?"k-link":"p",{tag:"component",staticClass:"k-bubble",style:{color:t.$helper.color(t.color),background:t.$helper.color(t.back)},attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[t.image?e("k-item-image",{attrs:{image:t.image,layout:"list"}}):t._e(),t._v(" "+t._s(t.text)+" ")],1)}),[],!1,null,null,null,null).exports;const io=R({inheritAttrs:!1,props:{bubbles:Array},computed:{items(){let t=this.bubbles;return"string"==typeof t&&(t=t.split(",")),t.map((t=>"string"==typeof t?{text:t}:t))}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-bubbles"},t._l(t.items,(function(n,s){return e("li",{key:s},[e("k-bubble",t._b({},"k-bubble",n,!1))],1)})),0)}),[],!1,null,null,null,null).exports;const oo=R({props:{columns:{type:[Object,Array],default:()=>({})},empty:Object,help:String,items:{type:[Array,Object],default:()=>[]},layout:{type:String,default:"list"},link:{type:Boolean,default:!0},size:String,sortable:Boolean,pagination:{type:[Boolean,Object],default:!1}},computed:{hasPagination(){return!1!==this.pagination&&(!0!==this.paginationOptions.hide&&!(this.pagination.total<=this.pagination.limit))},hasFooter(){return!(!this.hasPagination&&!this.help)},paginationOptions(){return{limit:10,details:!0,keys:!1,total:0,hide:!1,..."object"!=typeof this.pagination?{}:this.pagination}}},watch:{$props(){this.$forceUpdate()}},methods:{onEmpty(t){t.stopPropagation(),this.$emit("empty")},onOption(...t){this.$emit("action",...t),this.$emit("option",...t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-collection"},[t.items.length?e("k-items",{attrs:{columns:t.columns,items:t.items,layout:t.layout,link:t.link,size:t.size,sortable:t.sortable},on:{change:function(e){return t.$emit("change",e)},item:function(e){return t.$emit("item",e)},option:t.onOption,sort:function(e){return t.$emit("sort",e)}},scopedSlots:t._u([{key:"options",fn:function({item:e,itemIndex:n}){return[t._t("options",null,null,{item:e,index:n})]}}],null,!0)}):e("k-empty",t._g(t._b({attrs:{layout:t.layout}},"k-empty",t.empty,!1),t.$listeners.empty?{click:t.onEmpty}:{})),t.hasFooter?e("footer",{staticClass:"k-collection-footer"},[t.help?e("k-text",{staticClass:"k-collection-help",attrs:{theme:"help",html:t.help}}):t._e(),e("div",{staticClass:"k-collection-pagination"},[t.hasPagination?e("k-pagination",t._b({on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.paginationOptions,!1)):t._e()],1)],1):t._e()],1)}),[],!1,null,null,null,null).exports;const lo=R({props:{width:String,sticky:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column",attrs:{"data-width":t.width,"data-sticky":t.sticky}},[e("div",[t._t("default")],2)])}),[],!1,null,null,null,null).exports;const ro=R({props:{disabled:{type:Boolean,default:!1}},data:()=>({files:[],dragging:!1,over:!1}),methods:{cancel(){this.reset()},reset(){this.dragging=!1,this.over=!1},onDrop(t){return!0===this.disabled||!1===this.$helper.isUploadEvent(t)?this.reset():(this.$events.$emit("dropzone.drop"),this.files=t.dataTransfer.files,this.$emit("drop",this.files),void this.reset())},onEnter(t){!1===this.disabled&&this.$helper.isUploadEvent(t)&&(this.dragging=!0)},onLeave(){this.reset()},onOver(t){!1===this.disabled&&this.$helper.isUploadEvent(t)&&(t.dataTransfer.dropEffect="copy",this.over=!0)}}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-dropzone",attrs:{"data-dragging":t.dragging,"data-over":t.over},on:{dragenter:t.onEnter,dragleave:t.onLeave,dragover:t.onOver,drop:t.onDrop}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const ao=R({props:{text:String,icon:String,layout:{type:String,default:"list"}},computed:{element(){return void 0!==this.$listeners.click?"button":"div"}}},(function(){var t=this,e=t._self._c;return e(t.element,t._g({tag:"component",staticClass:"k-empty",attrs:{"data-layout":t.layout,type:"button"===t.element&&"button"}},t.$listeners),[t.icon?e("k-icon",{attrs:{type:t.icon}}):t._e(),e("p",[t._t("default",(function(){return[t._v(t._s(t.text))]}))],2)],1)}),[],!1,null,null,null,null).exports;const uo=R({props:{details:Array,focusable:Boolean,image:Object,url:String},computed:{focus(){const t=this.$store.getters["content/values"]().focus;if(!t)return;const[e,n]=t.replaceAll("%","").split(" ");return{x:parseFloat(e),y:parseFloat(n)}},hasFocus(){var t,e;return void 0!==(null==(t=this.focus)?void 0:t.x)&&void 0!==(null==(e=this.focus)?void 0:e.y)},options(){const t=[{icon:"open",text:this.$t("open"),link:this.url,target:"_blank"}];return this.focusable&&this.image.src&&(this.hasFocus?t.push({icon:"cancel",text:this.$t("file.focus.reset"),disabled:!this.hasFocus,click:this.setFocus}):t.push({icon:"preview",text:this.$t("file.focus.placeholder"),click:()=>this.setFocus("50% 50%")})),t},storeId(){return this.$store.getters["content/id"](null,!0)}},methods:{setFocus(t){!0===this.$helper.object.isObject(t)&&(t=`${t.x.toFixed(1)}% ${t.y.toFixed(1)}%`),this.$store.dispatch("content/update",["focus",t])}}},(function(){var t,e,n=this,s=n._self._c;return s("div",{staticClass:"k-file-preview",attrs:{"data-has-focus":n.hasFocus}},[s("k-view",{staticClass:"k-file-preview-layout"},[s("div",{staticClass:"k-file-preview-thumb"},[n.image.src?[s("k-coords",{attrs:{"aria-disabled":!n.focusable,x:null==(t=n.focus)?void 0:t.x,y:null==(e=n.focus)?void 0:e.y},on:{input:function(t){return n.setFocus(t.detail)}}},[s("img",n._b({on:{dragstart:function(t){t.preventDefault()}}},"img",n.image,!1))]),s("k-dropdown",[s("k-button",{staticStyle:{color:"var(--color-gray-500)"},attrs:{icon:"dots",size:"xs"},on:{click:function(t){return n.$refs.dropdown.toggle()}}}),s("k-dropdown-content",{ref:"dropdown",attrs:{options:n.options,theme:"light"}})],1)]:s("k-icon",{staticClass:"k-item-icon",attrs:{color:n.$helper.color(n.image.color),type:n.image.icon}})],2),s("div",{staticClass:"k-file-preview-details"},[s("dl",[n._l(n.details,(function(t){return s("div",{key:t.title},[s("dt",[n._v(n._s(t.title))]),s("dd",[t.link?s("k-link",{attrs:{to:t.link,tabindex:"-1",target:"_blank"}},[n._v(" /"+n._s(t.text)+" ")]):[n._v(" "+n._s(t.text)+" ")]],2)])})),n.image.src?s("div",{staticClass:"k-file-preview-focus-info"},[s("dt",[n._v(n._s(n.$t("file.focus.title")))]),s("dd",[n.focusable?s("k-button",{attrs:{icon:n.hasFocus?"cancel-small":"preview",title:n.hasFocus?n.$t("file.focus.reset"):void 0,size:"xs",variant:"filled"},on:{click:function(t){return n.setFocus(n.hasFocus?void 0:"50% 50%")}}},[n.hasFocus?[n._v(" "+n._s(n.focus.x)+"% "+n._s(n.focus.y)+"% ")]:n.focusable?[n._v(" "+n._s(n.$t("file.focus.placeholder"))+" ")]:n._e()],2):n.hasFocus?[n._v(" "+n._s(n.focus.x)+"% "+n._s(n.focus.y)+"% ")]:[n._v("–")]],2)]):n._e()],2)])])],1)}),[],!1,null,null,null,null).exports;const co=R({props:{gutter:String}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-grid",attrs:{"data-gutter":t.gutter}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const po=R({props:{editable:Boolean,tab:String,tabs:{type:Array,default:()=>[]}},computed:{tabsWithBadges(){const t=Object.keys(this.$store.getters["content/changes"]());return this.tabs.map((e=>{let n=[];return Object.values(e.columns).forEach((t=>{Object.values(t.sections).forEach((t=>{"fields"===t.type&&Object.keys(t.fields).forEach((t=>{n.push(t)}))}))})),e.badge=n.filter((e=>t.includes(e.toLowerCase()))).length,e}))}}},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-header",attrs:{"data-editable":t.editable,"data-tabs":t.tabsWithBadges.length>1}},[e("k-headline",{attrs:{tag:"h1",size:"huge"},on:{click:function(e){t.editable&&t.$emit("edit")}}},[t._t("default"),e("k-icon",{attrs:{type:"edit"}})],2),t.$slots.left||t.$slots.right?e("k-bar",{staticClass:"k-header-buttons",scopedSlots:t._u([{key:"left",fn:function(){return[t._t("left")]},proxy:!0},{key:"right",fn:function(){return[t._t("right")]},proxy:!0}],null,!0)}):t._e(),e("k-tabs",{attrs:{tab:t.tab,tabs:t.tabsWithBadges,theme:"notice"}})],1)}),[],!1,null,null,null,null).exports;const ho=R({inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-panel",{staticClass:"k-panel-inside",attrs:{tabindex:"0"}},[e("header",{staticClass:"k-panel-header"},[e("k-topbar",{attrs:{breadcrumb:t.$panel.view.breadcrumb,license:t.$panel.license,menu:t.$panel.menu,view:t.$panel.view}})],1),e("main",{staticClass:"k-panel-view scroll-y"},[t._t("default")],2),t._t("footer")],2)}),[],!1,null,null,null,null).exports;const mo=R({inheritAttrs:!1,props:{data:Object,flag:Object,image:[Object,Boolean],info:String,layout:{type:String,default:"list"},link:{type:[Boolean,String,Function]},options:{type:[Array,Function,String]},sortable:Boolean,target:String,text:String,width:String},computed:{hasFigure(){return!1!==this.image&&this.$helper.object.length(this.image)>0},title(){return this.text||"-"}},methods:{onOption(t){this.$emit("action",t),this.$emit("option",t)}}},(function(){var t=this,e=t._self._c;return e("article",t._b({staticClass:"k-item",class:!!t.layout&&"k-"+t.layout+"-item",attrs:{"data-has-figure":t.hasFigure,"data-has-flag":Boolean(t.flag),"data-has-info":Boolean(t.info),"data-has-options":Boolean(t.options),tabindex:"-1"},on:{click:function(e){return t.$emit("click",e)},dragstart:function(e){return t.$emit("drag",e)}}},"article",t.data,!1),[t._t("image",(function(){return[t.hasFigure?e("k-item-image",{attrs:{image:t.image,layout:t.layout,width:t.width}}):t._e()]})),t.sortable?e("k-sort-handle",{staticClass:"k-item-sort-handle"}):t._e(),e("header",{staticClass:"k-item-content"},[t._t("default",(function(){return[e("h3",{staticClass:"k-item-title"},[!1!==t.link?e("k-link",{staticClass:"k-item-title-link",attrs:{target:t.target,to:t.link}},[e("span",{domProps:{innerHTML:t._s(t.title)}})]):e("span",{domProps:{innerHTML:t._s(t.title)}})],1),t.info?e("p",{staticClass:"k-item-info",domProps:{innerHTML:t._s(t.info)}}):t._e()]}))],2),t.flag||t.options||t.$slots.options?e("footer",{staticClass:"k-item-footer"},[e("nav",{staticClass:"k-item-buttons",on:{click:function(t){t.stopPropagation()}}},[t.flag?e("k-status-icon",t._b({},"k-status-icon",t.flag,!1)):t._e(),t._t("options",(function(){return[t.options?e("k-options-dropdown",{staticClass:"k-item-options-dropdown",attrs:{options:t.options},on:{option:t.onOption}}):t._e()]}))],2)]):t._e()],2)}),[],!1,null,null,null,null).exports;const fo=R({inheritAttrs:!1,props:{image:[Object,Boolean],layout:{type:String,default:"list"},width:String},computed:{back(){return this.image.back||"black"},ratio(){return"cards"===this.layout&&this.image.ratio||"1/1"},size(){switch(this.layout){case"cards":return"large";case"cardlets":return"medium";default:return"regular"}},sizes(){switch(this.width){case"1/2":case"2/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 44em, 27em";case"1/3":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 29.333em, 27em";case"1/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 22em, 27em";case"2/3":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 27em, 27em";case"3/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 66em, 27em";default:return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 88em, 27em"}}}},(function(){var t=this,e=t._self._c;return t.image?e("div",{staticClass:"k-item-figure",style:{background:t.$helper.color(t.back)}},[t.image.src?e("k-image",{staticClass:"k-item-image",attrs:{cover:t.image.cover,ratio:t.ratio,sizes:t.sizes,src:t.image.src,srcset:t.image.srcset}}):e("k-aspect-ratio",{attrs:{ratio:t.ratio}},[e("k-icon",{staticClass:"k-item-icon",attrs:{color:t.$helper.color(t.image.color),type:t.image.icon}})],1)],1):t._e()}),[],!1,null,null,null,null).exports;const go=R({inheritAttrs:!1,props:{columns:{type:[Object,Array],default:()=>[]},items:{type:Array,default:()=>[]},layout:{type:String,default:"list"},link:{type:Boolean,default:!0},image:{type:[Object,Boolean],default:()=>({})},sortable:Boolean,empty:{type:[String,Object]},size:{type:String,default:"default"}},computed:{dragOptions(){return{sort:this.sortable,disabled:!1===this.sortable,draggable:".k-draggable-item"}},table(){return{columns:this.columns,rows:this.items,sortable:this.sortable}}},methods:{onDragStart(t,e){this.$panel.drag.start("text",e)},onOption(t,e,n){this.$emit("option",t,e,n)},imageOptions(t){let e=this.image,n=t.image;return!1!==e&&!1!==n&&("object"!=typeof e&&(e={}),"object"!=typeof n&&(n={}),{...n,...e})}}},(function(){var t=this,e=t._self._c;return"table"===t.layout?e("k-table",t._b({on:{change:function(e){return t.$emit("change",e)},sort:function(e){return t.$emit("sort",e)},option:t.onOption}},"k-table",t.table,!1)):e("k-draggable",{staticClass:"k-items",class:"k-"+t.layout+"-items",attrs:{handle:!0,options:t.dragOptions,"data-layout":t.layout,"data-size":t.size,list:t.items},on:{change:function(e){return t.$emit("change",e)},end:function(e){return t.$emit("sort",t.items,e)}}},[t._l(t.items,(function(n,s){return[t._t("default",(function(){return[e("k-item",t._b({key:n.id||s,class:{"k-draggable-item":t.sortable&&n.sortable},attrs:{image:t.imageOptions(n),layout:t.layout,link:!!t.link&&n.link,sortable:t.sortable&&n.sortable,width:n.column},on:{click:function(e){return t.$emit("item",n,s)},drag:function(e){return t.onDragStart(e,n.dragText)},option:function(e){return t.onOption(e,n,s)}},nativeOn:{mouseover:function(e){return t.$emit("hover",e,n,s)}},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options",null,null,{item:n,itemIndex:s})]},proxy:!0}],null,!0)},"k-item",n,!1))]}),null,{item:n,itemIndex:s})]}))],2)}),[],!1,null,null,null,null).exports;const ko=R({mixins:[{props:{autofocus:{default:!0,type:Boolean},centered:{default:!1,type:Boolean},dimmed:{default:!0,type:Boolean},loading:{default:!1,type:Boolean},type:{default:"overlay",type:String},visible:{default:!1,type:Boolean}}}],inheritAttrs:!0,data:()=>({isOpen:!1,scrollTop:0}),watch:{visible:{handler(t){!0===t?this.open():this.close()},immediate:!0}},mounted(){this.visible&&this.open()},methods:{cancel(){this.$emit("cancel"),this.close()},click(t){t.target===this.$refs.overlay&&this.cancel()},close(){!1!==this.isOpen&&(this.isOpen=!1,this.$emit("close"),this.restoreScrollPosition(),this.$events.$off("keydown.esc",this.cancel))},focus(){this.$helper.focus(this.$refs.overlay)},hide(){this.close()},open(){!0!==this.isOpen&&(this.storeScrollPosition(),this.isOpen=!0,this.$emit("open"),this.$events.$on("keydown.esc",this.cancel),setTimeout((()=>{!0===this.autofocus&&this.focus(),this.$emit("ready")})))},restoreScrollPosition(){const t=document.querySelector(".k-panel-view");(null==t?void 0:t.scrollTop)&&(t.scrollTop=this.scrollTop)},show(){this.open()},storeScrollPosition(){const t=document.querySelector(".k-panel-view");(null==t?void 0:t.scrollTop)?this.scrollTop=t.scrollTop:this.scrollTop=0}}},(function(){var t=this,e=t._self._c;return t.isOpen?e("portal",{attrs:{to:t.type}},[e("div",{ref:"overlay",staticClass:"k-overlay",class:"k-"+t.type+"-overlay",attrs:{"data-centered":t.loading||t.centered,"data-dimmed":t.dimmed,"data-loading":t.loading,dir:t.$panel.direction},on:{click:t.click}},[t.loading?e("k-loader",{staticClass:"k-overlay-loader"}):t._t("default",null,{close:t.close,isOpen:t.isOpen})],2)]):t._e()}),[],!1,null,null,null,null).exports;const bo=R({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-panel",attrs:{"data-dragging":t.$panel.drag.isDragging,"data-loading":t.$panel.isLoading,"data-language":t.$panel.language.code,"data-language-default":t.$panel.language.isDefault,"data-role":t.$panel.user.role,"data-translation":t.$panel.translation.code,"data-user":t.$panel.user.id,dir:t.$panel.direction}},[t._t("default"),t.$panel.dialog.isOpen&&!t.$panel.dialog.legacy?e("k-fiber-dialog"):t._e(),t.$panel.drawer.isOpen&&!t.$panel.drawer.legacy?e("k-fiber-drawer"):t._e(),t.$panel.notification.isFatal&&t.$panel.notification.isOpen?e("k-fatal",{attrs:{html:t.$panel.notification.message}}):t._e(),!1===t.$panel.system.isLocal?e("k-offline-warning"):t._e(),e("k-icons"),e("portal-target",{staticClass:"k-drawer-portal k-portal",attrs:{name:"drawer",multiple:""}}),e("portal-target",{staticClass:"k-dialog-portal k-portal",attrs:{name:"dialog",multiple:""}}),e("portal-target",{staticClass:"k-overlay-portal k-portal",attrs:{name:"overlay",multiple:""}})],2)}),[],!1,null,null,null,null).exports;const vo=R({props:{reports:Array,size:{type:String,default:"large"}},methods:{component(t){return null!==this.target(t)?"k-link":"div"},target(t){return t.link?t.link:t.click?t.click:t.dialog?()=>this.$dialog(t.dialog):null}}},(function(){var t=this,e=t._self._c;return e("dl",{staticClass:"k-stats",attrs:{"data-size":t.size}},t._l(t.reports,(function(n,s){return e(t.component(n),{key:s,tag:"component",staticClass:"k-stat",attrs:{"data-theme":n.theme,to:t.target(n)}},[e("dt",{staticClass:"k-stat-label"},[t._v(t._s(n.label))]),e("dd",{staticClass:"k-stat-value"},[t._v(t._s(n.value))]),e("dd",{staticClass:"k-stat-info"},[t._v(t._s(n.info))])])})),1)}),[],!1,null,null,null,null).exports;const yo=R({inheritAttrs:!1,props:{columns:Object,disabled:Boolean,fields:{type:Object,default:()=>({})},empty:String,index:{type:[Number,Boolean],default:1},rows:Array,options:[Array,Function],pagination:[Object,Boolean],sortable:Boolean},data(){return{values:this.rows}},computed:{colspan(){let t=this.columnsCount;return this.hasIndexColumn&&t++,this.hasOptions&&t++,t},columnsCount(){return this.$helper.object.length(this.columns)},dragOptions(){return{disabled:!this.sortable,fallbackClass:"k-table-row-fallback",ghostClass:"k-table-row-ghost"}},hasIndexColumn(){return this.sortable||!1!==this.index},hasOptions(){var t;return(null==(t=this.options)?void 0:t.length)>0||Object.values(this.values).filter((t=>t.options)).length>0}},watch:{rows(){this.values=this.rows}},methods:{isColumnEmpty(t){return 0===this.rows.filter((e=>!1===this.$helper.object.isEmpty(e[t]))).length},label(t,e){return t.label||this.$helper.string.ucfirst(e)},onChange(t){this.$emit("change",t)},onCell(t){this.$emit("cell",t)},onCellUpdate({columnIndex:t,rowIndex:e,value:n}){this.values[e][t]=n,this.$emit("input",this.values)},onHeader(t){this.$emit("header",t)},onOption(t,e,n){this.$emit("option",t,e,n)},onSort(){this.$emit("input",this.values),this.$emit("sort",this.values)},width(t){return"string"!=typeof t?"auto":!1===t.includes("/")?t:this.$helper.ratio(t,"auto",!1)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-table"},[e("table",{attrs:{"data-disabled":t.disabled,"data-indexed":t.hasIndexColumn}},[e("thead",[e("tr",[t.hasIndexColumn?e("th",{staticClass:"k-table-index-column",attrs:{"data-mobile":""}},[t._v(" # ")]):t._e(),t._l(t.columns,(function(n,s){return e("th",{key:s+"-header",staticClass:"k-table-column",style:"width:"+t.width(n.width),attrs:{"data-align":n.align,"data-mobile":n.mobile},on:{click:function(e){return t.onHeader({column:n,columnIndex:s})}}},[t._t("header",(function(){return[t._v(" "+t._s(t.label(n,s))+" ")]}),null,{column:n,columnIndex:s,label:t.label(n,s)})],2)})),t.hasOptions?e("th",{staticClass:"k-table-options-column",attrs:{"data-mobile":""}}):t._e()],2)]),e("k-draggable",{attrs:{list:t.values,options:t.dragOptions,handle:!0,element:"tbody"},on:{change:t.onChange,end:t.onSort}},[0===t.rows.length?e("tr",[e("td",{staticClass:"k-table-empty",attrs:{colspan:t.columnsCount}},[t._v(" "+t._s(t.empty)+" ")])]):t._l(t.values,(function(n,s){return e("tr",{key:s},[t.hasIndexColumn?e("td",{staticClass:"k-table-index-column",attrs:{"data-sortable":t.sortable&&!1!==n.sortable,"data-mobile":""}},[t._t("index",(function(){return[e("div",{staticClass:"k-table-index",domProps:{textContent:t._s(t.index+s)}})]}),null,{row:n,rowIndex:s}),t.sortable&&!1!==n.sortable?e("k-sort-handle",{staticClass:"k-table-sort-handle"}):t._e()],2):t._e(),t._l(t.columns,(function(i,o){return e("k-table-cell",{key:s+"-"+o,staticClass:"k-table-column",style:"width:"+t.width(i.width),attrs:{column:i,field:t.fields[o],row:n,mobile:i.mobile,value:n[o]},on:{input:function(e){return t.onCellUpdate({columnIndex:o,rowIndex:s,value:e})}},nativeOn:{click:function(e){return t.onCell({row:n,rowIndex:s,column:i,columnIndex:o})}}})})),t.hasOptions?e("td",{staticClass:"k-table-options-column",attrs:{"data-mobile":""}},[t._t("options",(function(){return[e("k-options-dropdown",{attrs:{options:n.options||t.options,text:(n.options||t.options).length>1},on:{option:function(e){return t.onOption(e,n,s)}}})]}),null,{row:n,rowIndex:s,options:t.options})],2):t._e()],2)}))],2)],1),t.pagination?e("k-pagination",t._b({staticClass:"k-table-pagination",on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.pagination,!1)):t._e()],1)}),[],!1,null,null,null,null).exports;const $o=R({inheritAttrs:!1,props:{column:Object,field:Object,mobile:{type:Boolean,default:!1},row:Object,value:{default:""}},computed:{component(){return this.$helper.isComponent(`k-${this.type}-field-preview`)?`k-${this.type}-field-preview`:this.$helper.isComponent(`k-table-${this.type}-cell`)?`k-table-${this.type}-cell`:Array.isArray(this.value)?"k-array-field-preview":"object"==typeof this.value?"k-object-field-preview":"k-text-field-preview"},type(){var t;return this.column.type||(null==(t=this.field)?void 0:t.type)}}},(function(){var t=this,e=t._self._c;return e("td",{attrs:{"data-align":t.column.align,"data-mobile":t.mobile}},[!1===t.$helper.object.isEmpty(t.value)?[e(t.component,{tag:"component",attrs:{column:t.column,field:t.field,row:t.row,value:t.value},on:{input:function(e){return t.$emit("input",e)}}})]:t._e()],2)}),[],!1,null,null,null,null).exports;const wo=R({props:{value:[String,Object]}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-table-update-status-cell"},["string"==typeof t.value?e("span",{staticClass:"k-table-update-status-cell-version"},[t._v(" "+t._s(t.value)+" ")]):e("k-dropdown",{attrs:{"data-theme":t.value.theme}},[e("k-button",{staticClass:"k-table-update-status-cell-button",attrs:{icon:t.value.icon,href:t.value.url},on:{click:function(e){return t.$refs.dropdown.toggle()}}},[t._v(" "+t._s(t.value.currentVersion)+" ")]),e("k-dropdown-content",{ref:"dropdown",attrs:{align:"right"}},[e("dl",{staticClass:"k-plugin-info"},[e("div",[e("dt",[t._v(t._s(t.$t("plugin")))]),e("dd",[t._v(t._s(t.value.pluginName))])]),e("div",[e("dt",[t._v(t._s(t.$t("version.current")))]),e("dd",[t._v(t._s(t.value.currentVersion))])]),e("div",[e("dt",[t._v(t._s(t.$t("version.latest")))]),e("dd",[t._v(t._s(t.value.latestVersion))])]),e("div",[e("dt",[t._v(t._s(t.$t("system.updateStatus")))]),e("dd",{attrs:{"data-theme":t.value.theme}},[t._v(t._s(t.value.label))])])]),t.value.url?e("k-dropdown-item",{attrs:{icon:"open",link:t.value.url}},[t._v(" "+t._s(t.$t("versionInformation"))+" ")]):t._e()],1)],1)],1)}),[],!1,null,null,null,null).exports;const _o=R({props:{tab:String,tabs:Array,theme:String},data(){return{size:null,visibleTabs:this.tabs,invisibleTabs:[]}},computed:{current(){return(this.tabs.find((t=>t.name===this.tab))||this.tabs[0]||{}).name}},watch:{tabs:{handler(t){this.visibleTabs=t,this.invisibleTabs=[],this.resize(!0)},immediate:!0}},created(){window.addEventListener("resize",this.resize)},destroyed(){window.removeEventListener("resize",this.resize)},methods:{resize(t){if(this.tabs&&!(this.tabs.length<=1)){if(this.tabs.length<=3)return this.visibleTabs=this.tabs,void(this.invisibleTabs=[]);if(window.innerWidth>=700){if("large"===this.size&&!t)return;this.visibleTabs=this.tabs,this.invisibleTabs=[],this.size="large"}else{if("small"===this.size&&!t)return;this.visibleTabs=this.tabs.slice(0,2),this.invisibleTabs=this.tabs.slice(2),this.size="small"}}}}},(function(){var t=this,e=t._self._c;return t.tabs&&t.tabs.length>1?e("div",{staticClass:"k-tabs",attrs:{"data-theme":t.theme}},[e("nav",[t._l(t.visibleTabs,(function(n){return e("k-button",{key:n.name,staticClass:"k-tab-button",attrs:{link:n.link,current:t.current===n.name,icon:n.icon,tooltip:n.label}},[t._v(" "+t._s(n.label||n.text||n.name)+" "),n.badge?e("span",{staticClass:"k-tabs-badge"},[t._v(" "+t._s(n.badge)+" ")]):t._e()])})),t.invisibleTabs.length?e("k-button",{staticClass:"k-tab-button k-tabs-dropdown-button",attrs:{text:t.$t("more"),icon:"dots"},on:{click:function(e){return e.stopPropagation(),t.$refs.more.toggle()}}}):t._e()],2),t.invisibleTabs.length?e("k-dropdown-content",{ref:"more",staticClass:"k-tabs-dropdown",attrs:{align:"right"}},t._l(t.invisibleTabs,(function(n){return e("k-dropdown-item",{key:"more-"+n.name,attrs:{link:n.link,current:t.tab===n.name,icon:n.icon,tooltip:n.label}},[t._v(" "+t._s(n.label||n.text||n.name)+" ")])})),1):t._e()],1):t._e()}),[],!1,null,null,null,null).exports;const xo=R({props:{align:String}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-view",attrs:{"data-align":t.align}},[t._t("default")],2)}),[],!1,null,null,null,null).exports,Co={install(t){t.component("k-aspect-ratio",to),t.component("k-bar",eo),t.component("k-box",no),t.component("k-bubble",so),t.component("k-bubbles",io),t.component("k-collection",oo),t.component("k-column",lo),t.component("k-dropzone",ro),t.component("k-empty",ao),t.component("k-file-preview",uo),t.component("k-grid",co),t.component("k-header",po),t.component("k-inside",ho),t.component("k-item",mo),t.component("k-item-image",fo),t.component("k-items",go),t.component("k-overlay",ko),t.component("k-panel",bo),t.component("k-stats",vo),t.component("k-table",yo),t.component("k-table-cell",$o),t.component("k-table-update-status-cell",wo),t.component("k-tabs",_o),t.component("k-view",xo)}};const So=R({components:{draggable:()=>F((()=>import("./vuedraggable.js")),[])},props:{data:Object,element:String,handle:[String,Boolean],list:[Array,Object],move:Function,options:Object},emits:["change","end","sort","start"],computed:{dragOptions(){let t=!1;return t=!0===this.handle?".k-sort-handle":this.handle,{fallbackClass:"k-sortable-fallback",fallbackOnBody:!0,forceFallback:!0,ghostClass:"k-sortable-ghost",handle:t,scroll:document.querySelector(".k-panel-view"),...this.options}}},methods:{onStart(t){this.$panel.drag.start("data",{}),this.$emit("start",t)},onEnd(t){this.$panel.drag.stop(),this.$emit("end",t)}}},(function(){var t=this;return(0,t._self._c)("draggable",t._b({staticClass:"k-draggable",attrs:{"component-data":t.data,tag:t.element,list:t.list,move:t.move},on:{change:function(e){return t.$emit("change",e)},end:t.onEnd,sort:function(e){return t.$emit("sort",e)},start:t.onStart},scopedSlots:t._u([{key:"footer",fn:function(){return[t._t("footer")]},proxy:!0}],null,!0)},"draggable",t.dragOptions,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Oo=R({data:()=>({error:null}),errorCaptured(t){return this.$panel.debug&&window.console.warn(t),this.error=t,!1},render(){return this.error?this.$slots.error?this.$slots.error[0]:this.$scopedSlots.error?this.$scopedSlots.error({error:this.error}):Vue.h("k-box",{attrs:{theme:"negative"}},this.error.message||this.error):this.$slots.default[0]}},null,null,!1,null,null,null,null).exports;const Ao=R({props:{html:String},mounted(){try{let t=this.$refs.iframe.contentWindow.document;t.open(),t.write(this.html),t.close()}catch(t){console.error(t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-fatal"},[e("div",{staticClass:"k-fatal-box"},[e("k-bar",{scopedSlots:t._u([{key:"left",fn:function(){return[e("k-headline",[t._v(" The JSON response could not be parsed ")])]},proxy:!0},{key:"right",fn:function(){return[e("k-button",{attrs:{icon:"cancel",text:"Close"},on:{click:function(e){return t.$panel.notification.close()}}})]},proxy:!0}])}),e("iframe",{ref:"iframe",staticClass:"k-fatal-iframe"})],1)])}),[],!1,null,null,null,null).exports;const Io=R({props:{alt:String,color:String,back:String,size:String,type:String},computed:{isEmoji(){return this.$helper.string.hasEmoji(this.type)}}},(function(){var t=this,e=t._self._c;return e("span",{class:"k-icon k-icon-"+t.type,style:{background:t.$helper.color(t.back)},attrs:{"aria-label":t.alt,role:t.alt?"img":null,"aria-hidden":!t.alt,"data-back":t.back,"data-size":t.size}},[t.isEmoji?e("span",{staticClass:"k-icon-emoji"},[t._v(t._s(t.type))]):e("svg",{style:{color:t.$helper.color(t.color)},attrs:{viewBox:"0 0 16 16"}},[e("use",{attrs:{"xlink:href":"#icon-"+t.type}})])])}),[],!1,null,null,null,null).exports;const Mo=R({icons:window.panel.plugins.icons},(function(){var t=this,e=t._self._c;return e("svg",{staticClass:"k-icons",attrs:{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",overflow:"hidden"}},[e("defs",t._l(t.$options.icons,(function(n,s){return e("symbol",{key:s,attrs:{id:"icon-"+s,viewBox:"0 0 16 16"},domProps:{innerHTML:t._s(n)}})})),0)])}),[],!1,null,null,null,null).exports;const To=R({props:{alt:String,back:String,cover:Boolean,ratio:String,sizes:String,src:String,srcset:String},data:()=>({loaded:{type:Boolean,default:!1},error:{type:Boolean,default:!1}}),computed:{ratioPadding(){return this.$helper.ratio(this.ratio||"1/1")}},created(){let t=new Image;t.onload=()=>{this.loaded=!0,this.$emit("load")},t.onerror=()=>{this.error=!0,this.$emit("error")},t.src=this.src}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-image",attrs:{"data-ratio":t.ratio,"data-back":t.back,"data-cover":t.cover}},[e("span",{style:{"padding-bottom":t.ratioPadding}},[t.loaded?e("img",{key:t.src,attrs:{alt:t.alt||"",src:t.src,srcset:t.srcset,sizes:t.sizes},on:{dragstart:function(t){t.preventDefault()}}}):t._e(),t.loaded||t.error?t._e():e("k-loader",{attrs:{position:"center",theme:"light"}}),!t.loaded&&t.error?e("k-icon",{staticClass:"k-image-error",attrs:{type:"cancel"}}):t._e()],1)])}),[],!1,null,null,null,null).exports;const jo=R({},(function(){var t=this._self._c;return t("span",{staticClass:"k-loader"},[t("k-icon",{staticClass:"k-loader-icon",attrs:{type:"loader"}})],1)}),[],!1,null,null,null,null).exports;const Eo=R({},(function(){var t=this,e=t._self._c;return t.$panel.notification.isOpen?e("div",{staticClass:"k-notification",attrs:{"data-theme":t.$panel.notification.type}},[e("p",[t._v(t._s(t.$panel.notification.message))]),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return t.$panel.notification.close()}}})],1):t._e()}),[],!1,null,null,null,null).exports;const Do=R({data:()=>({offline:!1}),created(){this.$events.$on("offline",this.isOffline),this.$events.$on("online",this.isOnline)},destroyed(){this.$events.$off("offline",this.isOffline),this.$events.$off("online",this.isOnline)},methods:{isOnline(){this.offline=!1},isOffline(){this.offline=!0}}},(function(){var t=this,e=t._self._c;return t.offline?e("div",{staticClass:"k-offline-warning"},[e("p",[e("k-icon",{attrs:{type:"bolt"}}),t._v(" "+t._s(t.$t("error.offline")))],1)]):t._e()}),[],!1,null,null,null,null).exports,Lo=(t,e=!1)=>{if(t>=0&&t<=100)return!0;if(e)throw new Error("value has to be between 0 and 100");return!1};const Bo=R({props:{value:{type:Number,default:0,validator:Lo}},data(){return{state:this.value}},watch:{value(t){this.state=t}},methods:{set(t){Lo(t,!0),this.state=t}}},(function(){var t=this;return(0,t._self._c)("progress",{staticClass:"k-progress",attrs:{max:"100"},domProps:{value:t.state}},[t._v(t._s(t.state)+"%")])}),[],!1,null,null,null,null).exports;const Po=R({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-registration"},[e("p",[t._v(t._s(t.$t("license.unregistered")))]),e("k-button",{staticClass:"k-topbar-button",attrs:{responsive:!0,tooltip:t.$t("license.unregistered"),icon:"key"},on:{click:function(e){return t.$dialog("registration")}}},[t._v(" "+t._s(t.$t("license.register"))+" ")]),e("k-button",{staticClass:"k-topbar-button",attrs:{responsive:!0,link:"https://getkirby.com/buy",target:"_blank",icon:"cart"}},[t._v(" "+t._s(t.$t("license.buy"))+" ")])],1)}),[],!1,null,null,null,null).exports;const No=R({props:{icon:{type:String,default:"sort"}}},(function(){return(0,this._self._c)("k-icon",{staticClass:"k-sort-handle",attrs:{type:this.icon,"aria-hidden":"true"}})}),[],!1,null,null,null,null).exports;const Fo=R({props:{click:{type:Function,default:()=>{}},disabled:Boolean,responsive:Boolean,status:String,text:String,tooltip:String},computed:{icon(){return"draft"===this.status?"circle-outline":"unlisted"===this.status?"circle-half":"circle"},theme(){return"draft"===this.status?"negative":"unlisted"===this.status?"info":"positive"},title(){let t=this.tooltip||this.text;return this.disabled&&(t+=` (${this.$t("disabled")})`),t}},methods:{onClick(){this.click(),this.$emit("click")}}},(function(){var t=this;return(0,t._self._c)("k-button",{class:"k-status-icon k-status-icon-"+t.status,attrs:{disabled:t.disabled,icon:t.icon,responsive:t.responsive,text:t.text,theme:t.theme,tooltip:t.title},on:{click:t.onClick}})}),[],!1,null,null,null,null).exports;const qo=R({props:{user:[Object,String]}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-user-info"},[t.user.avatar?e("k-image",{attrs:{cover:!0,src:t.user.avatar.url,ratio:"1/1"}}):e("k-icon",{attrs:{type:"user"}}),t._v(" "+t._s(t.user.name||t.user.email||t.user)+" ")],1)}),[],!1,null,null,null,null).exports,Ro={install(t){t.component("k-draggable",So),t.component("k-error-boundary",Oo),t.component("k-fatal",Ao),t.component("k-icon",Io),t.component("k-icons",Mo),t.component("k-image",To),t.component("k-loader",jo),t.component("k-notification",Eo),t.component("k-offline-warning",Do),t.component("k-progress",Bo),t.component("k-registration",Po),t.component("k-status-icon",Fo),t.component("k-sort-handle",No),t.component("k-user-info",qo)}};const zo=R({props:{crumbs:{type:Array,default:()=>[]},label:{type:String,default:"Breadcrumb"},view:Object},computed:{dropdown(){return this.segments.map((t=>({...t,text:t.label,icon:"angle-right"})))},segments(){return[{link:this.view.link,label:this.view.breadcrumbLabel,icon:this.view.icon,loading:this.$panel.isLoading},...this.crumbs]}},methods:{isLast(t){return this.crumbs.length-1===t}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-breadcrumb",attrs:{"aria-label":t.label}},[e("k-dropdown",{staticClass:"k-breadcrumb-dropdown"},[e("k-button",{attrs:{icon:"road-sign"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.dropdown,theme:"light"}})],1),e("ol",t._l(t.segments,(function(n,s){return e("li",{key:s},[e("k-link",{staticClass:"k-breadcrumb-link",attrs:{title:n.text||n.label,to:n.link,"aria-current":!!t.isLast(s)&&"page"}},[n.loading?e("k-loader",{staticClass:"k-breadcrumb-icon"}):n.icon?e("k-icon",{staticClass:"k-breadcrumb-icon",attrs:{type:n.icon}}):t._e(),e("span",{staticClass:"k-breadcrumb-link-text"},[t._v(" "+t._s(n.text||n.label)+" ")])],1)],1)})),0)],1)}),[],!1,null,null,null,null).exports;const Yo=R({props:{items:{type:Array},name:{default:"items",type:String},selected:{type:String},type:{default:"radio",type:String}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-browser"},[e("div",{staticClass:"k-browser-items"},t._l(t.items,(function(n){return e("label",{key:n.value,staticClass:"k-browser-item"},[e("input",{attrs:{name:t.name,type:t.type},domProps:{checked:t.selected===n.value},on:{change:function(e){return t.$emit("select",n)}}}),n.image?e("k-item-image",{staticClass:"k-browser-item-image",attrs:{image:{...n.image,cover:!0,back:"black"}}}):t._e(),e("span",{staticClass:"k-browser-item-info"},[t._v(" "+t._s(n.label)+" ")])],1)})),0)])}),[],!1,null,null,null,null).exports;const Ho=R({inheritAttrs:!1,props:{autofocus:Boolean,click:Function,current:[String,Boolean],disabled:Boolean,icon:String,id:[String,Number],link:String,responsive:Boolean,rel:String,role:String,target:String,tabindex:String,text:[String,Number],theme:String,tooltip:String,type:{type:String,default:"button"}},emits:["click"],computed:{component(){return!0===this.disabled?"k-button-disabled":this.link?"k-button-link":"k-button-native"}},methods:{focus(){this.$refs.button.focus&&this.$refs.button.focus()},tab(){this.$refs.button.tab&&this.$refs.button.tab()},untab(){this.$refs.button.untab&&this.$refs.button.untab()}}},(function(){var t=this;return(0,t._self._c)(t.component,t._b({ref:"button",tag:"component",nativeOn:{click:function(e){return t.$emit("click",e)}}},"component",t.$props,!1),[t.text?[t._v(" "+t._s(t.text)+" ")]:t._t("default")],2)}),[],!1,null,null,null,null).exports;const Uo=R({inheritAttrs:!1,props:{icon:String,id:[String,Number],responsive:Boolean,theme:String,tooltip:String}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-button",attrs:{id:t.id,"data-disabled":!0,"data-responsive":t.responsive,"data-theme":t.theme,title:t.tooltip}},[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports;const Ko=R({props:{buttons:Array}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-button-group"},[t.$slots.default?t._t("default"):t._l(t.buttons,(function(n,s){return e("k-button",t._b({key:s},"k-button",n,!1))}))],2)}),[],!1,null,null,null,null).exports;const Vo=R({inheritAttrs:!1,props:{autofocus:Boolean,current:[String,Boolean],icon:String,id:[String,Number],link:String,rel:String,responsive:Boolean,role:String,target:String,tabindex:String,theme:String,tooltip:String},methods:{focus(){this.$el.focus()}}},(function(){var t=this,e=t._self._c;return e("k-link",{staticClass:"k-button",attrs:{id:t.id,"aria-current":t.current,autofocus:t.autofocus,"data-theme":t.theme,"data-responsive":t.responsive,rel:t.rel,role:t.role,tabindex:t.tabindex,target:t.target,title:t.tooltip,to:t.link}},[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports,Wo={mounted(){this.$el.addEventListener("keyup",this.onTab,!0),this.$el.addEventListener("blur",this.onUntab,!0)},destroyed(){this.$el.removeEventListener("keyup",this.onTab,!0),this.$el.removeEventListener("blur",this.onUntab,!0)},methods:{focus(){this.$el.focus&&this.$el.focus()},onTab(t){9===t.keyCode&&this.$el.setAttribute("data-tabbed",!0)},onUntab(){this.$el.removeAttribute("data-tabbed")},tab(){this.$el.focus(),this.$el.setAttribute("data-tabbed",!0)},untab(){this.$el.removeAttribute("data-tabbed")}}};const Jo=R({mixins:[Wo],inheritAttrs:!1,props:{autofocus:Boolean,click:{type:Function,default:()=>{}},current:[String,Boolean],icon:String,id:[String,Number],responsive:Boolean,role:String,tabindex:String,theme:String,tooltip:String,type:{type:String,default:"button"}}},(function(){var t=this,e=t._self._c;return e("button",{staticClass:"k-button",attrs:{id:t.id,"aria-current":t.current,autofocus:t.autofocus,"data-theme":t.theme,"data-responsive":t.responsive,role:t.role,tabindex:t.tabindex,title:t.tooltip,type:t.type},on:{click:t.click}},[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports;const Go=R({},(function(){return(0,this._self._c)("span",{staticClass:"k-dropdown",on:{click:function(t){t.stopPropagation()}}},[this._t("default")],2)}),[],!1,null,null,null,null).exports;let Zo=null;const Qo=R({props:{align:{type:String,default:"left"},options:[Array,Function,String],theme:{type:String,default:"dark"}},emits:["action","close","leave","open"],data:()=>({current:-1,dropup:!1,isOpen:!1,items:[]}),methods:{async fetchOptions(t){if(!this.options)return t(this.items);"string"==typeof this.options?this.$dropdown(this.options)(t):"function"==typeof this.options?this.options(t):Array.isArray(this.options)&&t(this.options)},onOptionClick(t){"function"==typeof t.click?t.click.call(this):t.click&&this.$emit("action",t.click)},open(){this.reset(),Zo&&Zo!==this&&Zo.close(),this.fetchOptions((t=>{this.$events.$on("keydown",this.navigate),this.$events.$on("click",this.close),this.items=t,this.isOpen=!0,Zo=this,this.onOpen(),this.$emit("open")}))},reset(){this.current=-1,this.$events.$off("keydown",this.navigate),this.$events.$off("click",this.close)},close(){this.reset(),this.isOpen=Zo=!1,this.$emit("close")},toggle(){this.isOpen?this.close():this.open()},focus(t=0){var e;(null==(e=this.$children[t])?void 0:e.focus)&&(this.current=t,this.$children[t].focus())},onOpen(){this.dropup=!1,this.$nextTick((()=>{if(this.$el){let t=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,e=50,n=this.$el.getBoundingClientRect().top||0,s=this.$el.clientHeight;n+s>t-e&&s+2*ethis.$children.length-1){const t=this.$children.filter((t=>!1===t.disabled));this.current=this.$children.indexOf(t[t.length-1]);break}if(!1===(null==(n=this.$children[this.current])?void 0:n.disabled)){this.focus(this.current);break}}break;case"Tab":for(;;){if(this.current++,this.current>this.$children.length-1){this.close(),this.$emit("leave",t.code);break}if(!1===(null==(s=this.$children[this.current])?void 0:s.disabled))break}}}}},(function(){var t=this,e=t._self._c;return t.isOpen?e("div",{staticClass:"k-dropdown-content",attrs:{"data-align":t.align,"data-dropup":t.dropup,"data-theme":t.theme}},[t._t("default",(function(){return[t._l(t.items,(function(n,s){return["-"===n?e("hr",{key:t._uid+"-item-"+s}):e("k-dropdown-item",t._b({key:t._uid+"-item-"+s,ref:t._uid+"-item-"+s,refInFor:!0,on:{click:function(e){return t.onOptionClick(n)}}},"k-dropdown-item",n,!1),[t._v(" "+t._s(n.text)+" ")])]}))]}))],2):t._e()}),[],!1,null,null,null,null).exports;const Xo=R({inheritAttrs:!1,props:{disabled:Boolean,icon:String,image:[String,Object],link:String,target:String,theme:String,upload:String,current:[String,Boolean]},emit:["click"],methods:{focus(){this.$refs.button.focus()},onClick(t){this.$parent.close(),this.$emit("click",t)},tab(){this.$refs.button.tab()}}},(function(){var t=this;return(0,t._self._c)("k-button",t._b({ref:"button",staticClass:"k-dropdown-item",on:{click:t.onClick}},"k-button",t.$props,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const tl=R({props:{selected:{type:String}},data:()=>({files:[],page:null,view:"tree"}),methods:{selectFile(t){this.$emit("select",t)},async selectPage(t){this.page=t;const e="site://"===t.id?"/site/files":"/pages/"+this.$api.pages.id(t.id)+"/files",{data:n}=await this.$api.get(e,{select:"filename,panelImage,uuid"});this.files=n.map((t=>({label:t.filename,image:t.panelImage,id:t.uuid,value:t.uuid}))),this.view="files"},togglePage(){this.$nextTick((()=>{this.$refs.tree.scrollIntoView({behaviour:"smooth",block:"nearest",inline:"nearest"})}))}}},(function(){var t,e=this,n=e._self._c;return n("div",{staticClass:"k-file-browser",attrs:{"data-view":e.view}},[n("div",{staticClass:"k-file-browser-layout"},[n("aside",{ref:"tree",staticClass:"k-file-browser-tree"},[n("k-page-tree",{attrs:{current:null==(t=e.page)?void 0:t.id},on:{select:e.selectPage,toggleBranch:e.togglePage}})],1),n("div",{ref:"items",staticClass:"k-file-browser-items"},[n("k-button",{staticClass:"k-file-browser-back-button",attrs:{icon:"angle-left",text:e.page.label},on:{click:function(t){e.view="tree"}}}),e.files.length?n("k-browser",{attrs:{items:e.files,selected:e.selected},on:{select:e.selectFile}}):e._e()],1)])])}),[],!1,null,null,null,null).exports;const el=R({mixins:[Wo],props:{disabled:Boolean,rel:String,tabindex:[String,Number],target:String,title:String,to:[String,Function]},emits:["click"],computed:{href(){return"function"==typeof this.to?"":"/"!==this.to[0]||this.target?!0===this.to.includes("@")&&!1===this.to.includes("/")&&!1===this.to.startsWith("mailto:")?"mailto:"+this.to:this.to:this.$url(this.to)},relAttr(){return"_blank"===this.target?"noreferrer noopener":this.rel}},methods:{isRoutable(t){if(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)return!1;if(t.defaultPrevented)return!1;if(void 0!==t.button&&0!==t.button)return!1;if(this.target)return!1;if("string"==typeof this.href){if(this.href.includes("://")||this.href.startsWith("//"))return!1;if(this.href.includes("mailto:"))return!1}return!0},onClick(t){if(!0===this.disabled)return t.preventDefault(),!1;"function"==typeof this.to&&(t.preventDefault(),this.to()),this.isRoutable(t)&&(t.preventDefault(),this.$go(this.to)),this.$emit("click",t)}}},(function(){var t=this,e=t._self._c;return t.to&&!t.disabled?e("a",{ref:"link",staticClass:"k-link",attrs:{href:t.href,rel:t.relAttr,tabindex:t.tabindex,target:t.target,title:t.title},on:{click:t.onClick}},[t._t("default")],2):e("span",{staticClass:"k-link",attrs:{title:t.title,"data-disabled":""}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const nl=R({computed:{defaultLanguage(){return this.$panel.languages.find((t=>!0===t.default))},language(){return this.$panel.language},languages(){return this.$panel.languages.filter((t=>!1===t.default))}},methods:{change(t){this.$reload({query:{language:t.code}})}}},(function(){var t=this,e=t._self._c;return t.languages.length?e("k-dropdown",{staticClass:"k-languages-dropdown"},[e("k-button",{attrs:{text:t.language.name,responsive:!0,icon:"globe"},on:{click:function(e){return t.$refs.languages.toggle()}}}),t.languages?e("k-dropdown-content",{ref:"languages"},[e("k-dropdown-item",{on:{click:function(e){return t.change(t.defaultLanguage)}}},[t._v(" "+t._s(t.defaultLanguage.name)+" ")]),e("hr"),t._l(t.languages,(function(n){return e("k-dropdown-item",{key:n.code,on:{click:function(e){return t.change(n)}}},[t._v(" "+t._s(n.name)+" ")])}))],2):t._e()],1):t._e()}),[],!1,null,null,null,null).exports;const sl=R({props:{align:{type:String,default:"right"},icon:{type:String,default:"dots"},options:{type:[Array,Function,String],default:()=>[]},text:{type:[Boolean,String],default:!0},theme:{type:String,default:"dark"}},computed:{hasSingleOption(){return Array.isArray(this.options)&&1===this.options.length}},methods:{onAction(t,e,n){"function"==typeof t?t.call(this):(this.$emit("action",t,e,n),this.$emit("option",t,e,n))},toggle(){this.$refs.options.toggle()}}},(function(){var t=this,e=t._self._c;return t.hasSingleOption?e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{icon:t.options[0].icon||t.icon,tooltip:t.options[0].tooltip||t.options[0].text},on:{click:function(e){return t.onAction(t.options[0].option||t.options[0].click,t.options[0],0)}}},[!0===t.text?[t._v(" "+t._s(t.options[0].text)+" ")]:!1!==t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2):t.options.length?e("k-dropdown",{staticClass:"k-options-dropdown"},[e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{icon:t.icon,tooltip:t.$t("options")},on:{click:function(e){return t.$refs.options.toggle()}}},[t.text&&!0!==t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2),e("k-dropdown-content",{ref:"options",staticClass:"k-options-dropdown-content",attrs:{align:t.align,options:t.options},on:{action:t.onAction}})],1):t._e()}),[],!1,null,null,null,null).exports;const il=R({name:"k-tree",inheritAttrs:!1,props:{element:{type:String,default:"k-tree"},current:{type:String},items:{type:[Array,Object]},level:{default:0,type:Number}},data(){return{state:this.items}},methods:{select(t){this.$emit("select",t)},toggle(t){this.$emit("toggle",t)}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-tree",class:t.$options.name,style:{"--tree-level":t.level}},t._l(t.state,(function(n,s){return e("li",{key:s,attrs:{"aria-expanded":n.open,"aria-current":n.id===t.current}},[e("p",{staticClass:"k-tree-branch"},[e("button",{staticClass:"k-tree-toggle",attrs:{disabled:!n.hasChildren,type:"button"},on:{click:function(e){return t.toggle(n)}}},[e("k-icon",{attrs:{type:n.open?"angle-down":"angle-right"}})],1),e("button",{staticClass:"k-tree-folder",attrs:{type:"button"},on:{click:function(e){return t.select(n)},dblclick:function(e){return t.toggle(n)}}},[e("k-icon",{attrs:{type:n.icon??"folder"}}),e("span",[t._v(t._s(n.label))])],1)]),n.hasChildren&&n.open?[e(t.$options.name,t._b({tag:"component",attrs:{items:n.children,level:t.level+1},on:{select:t.select,toggle:t.toggle}},"component",t.$props,!1))]:t._e()],2)})),0)}),[],!1,null,null,null,null).exports;const ol=R({name:"k-page-tree",extends:il,inheritAttrs:!1,props:{root:{default:!0,type:Boolean},current:{default:"/site",type:String},identifier:{default:"uuid",type:String,validator:t=>["id","uuid"].includes(t)},items:{type:String}},data:()=>({state:[]}),async created(){this.items?this.state=await this.load(this.items):!1===this.root?this.state=await this.load("/site"):this.state=[{icon:"home",id:"site://",label:this.$t("view.site"),hasChildren:!0,children:"/site",open:!0}]},methods:{async load(t){const{data:e}=await this.$api.get(t+"/children",{select:"hasChildren,id,panelImage,title,uuid",status:"all"}),n={};return e.forEach((t=>{const e=t[this.identifier];n[e]={id:e,icon:t.panelImage.icon,label:t.title,hasChildren:t.hasChildren,children:"/pages/"+this.$api.pages.id(t.id),open:!1}})),n},toggle(t){t.open=!t.open,this.$emit("toggleBranch",t)}}},null,null,!1,null,null,null,null).exports;const ll=R({props:{align:{type:String,default:"left"},details:Boolean,dropdown:Boolean,keys:Boolean,limit:{type:Number,default:10},page:{type:Number,default:1},pageLabel:String,total:{type:Number,default:0},prevLabel:String,nextLabel:String,validate:{type:Function,default:()=>Promise.resolve()}},data(){return{current:this.page}},computed:{detailsText(){return 1===this.limit?this.start+" / ":this.start+"-"+this.end+" / "},end(){return Math.min(this.start-1+this.limit,this.total)},hasPages(){return this.total>this.limit},isVisible(){return this.pages>1},nextBtn(){return{disabled:this.end>=this.total,tooltip:this.nextLabel??this.$t("next"),icon:"angle-right",click:this.next}},offset(){return this.start-1},pages(){return Math.ceil(this.total/this.limit)},prevBtn(){return{disabled:this.start<=1,tooltip:this.prevLabel??this.$t("prev"),icon:"angle-left",click:this.prev}},start(){return(this.current-1)*this.limit+1}},watch:{page(t){this.current=parseInt(t)}},created(){!0===this.keys&&window.addEventListener("keydown",this.onKey,!1)},destroyed(){window.removeEventListener("keydown",this.onKey,!1)},methods:{async goTo(t){var e;try{await this.validate(t),null==(e=this.$refs.dropdown)||e.close();const n=((t=Math.max(1,Math.min(t,this.pages)))-1)*this.limit+1;this.$emit("paginate",{page:t,start:n,end:Math.min(n-1+this.limit,this.total),limit:this.limit,offset:n-1,total:this.total})}catch(n){}},prev(){this.goTo(this.current-1)},next(){this.goTo(this.current+1)},onKey(t){switch(t.code){case"ArrowLeft":return this.prev();case"ArrowRight":return this.next()}}}},(function(){var t=this,e=t._self._c;return t.isVisible?e("nav",{staticClass:"k-pagination",attrs:{"data-align":t.align}},[e("k-button",t._b({},"k-button",t.prevBtn,!1)),t.details?e("k-dropdown",[e("k-button",{staticClass:"k-pagination-details",attrs:{disabled:!t.hasPages},on:{click:function(e){var n;null==(n=t.$refs.dropdown)||n.toggle()}}},[t.total>1?[t._v(" "+t._s(t.detailsText)+" ")]:t._e(),t._v(" "+t._s(t.total)+" ")],2),t.dropdown?e("k-dropdown-content",{ref:"dropdown",staticClass:"k-pagination-selector",on:{open:function(e){t.$nextTick((()=>t.$refs.page.focus()))}}},[e("div",{staticClass:"k-pagination-settings"},[e("label",{attrs:{for:"k-pagination-page"}},[e("span",[t._v(t._s(t.pageLabel??t.$t("pagination.page"))+":")]),e("select",{ref:"page",attrs:{id:"k-pagination-page"}},t._l(t.pages,(function(n){return e("option",{key:n,domProps:{selected:t.page===n,value:n}},[t._v(" "+t._s(n)+" ")])})),0)]),e("k-button",{attrs:{icon:"check"},on:{click:function(e){return t.goTo(t.$refs.page.value)}}})],1)]):t._e()],1):t._e(),e("k-button",t._b({},"k-button",t.nextBtn,!1))],1):t._e()}),[],!1,null,null,null,null).exports;const rl=R({props:{prev:{type:[Boolean,Object],default:!1},next:{type:[Boolean,Object],default:!1}},computed:{buttons(){return[{...this.button(this.prev),icon:"angle-left"},{...this.button(this.next),icon:"angle-right"}]}},methods:{button:t=>t||{disabled:!0,link:"#"}}},(function(){return(0,this._self._c)("k-button-group",{staticClass:"k-prev-next",attrs:{buttons:this.buttons}})}),[],!1,null,null,null,null).exports;const al=R({props:{removable:Boolean},methods:{remove(){this.removable&&this.$emit("remove")},focus(){this.$refs.button.focus()}}},(function(){var t=this,e=t._self._c;return e("span",{ref:"button",staticClass:"k-tag",attrs:{tabindex:"0"},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:(e.preventDefault(),t.remove.apply(null,arguments))}}},[e("span",{staticClass:"k-tag-text"},[t._t("default")],2),t.removable?e("k-icon",{staticClass:"k-tag-toggle",attrs:{type:"cancel-small"},nativeOn:{click:function(e){return t.remove.apply(null,arguments)}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const ul=R({props:{breadcrumb:Array,license:Boolean,menu:Array,title:String,view:Object},computed:{notification(){return"view"===this.$panel.notification.context?this.$panel.notification:null}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-topbar"},[e("k-view",[e("div",{staticClass:"k-topbar-wrapper"},[e("k-dropdown",{staticClass:"k-topbar-menu"},[e("k-button",{staticClass:"k-topbar-button k-topbar-menu-button",attrs:{tooltip:t.$t("menu"),icon:"bars"},on:{click:function(e){return t.$refs.menu.toggle()}}},[e("k-icon",{attrs:{type:"angle-down"}})],1),e("k-dropdown-content",{ref:"menu",staticClass:"k-topbar-menu",attrs:{options:t.menu,theme:"light"}})],1),e("k-breadcrumb",{staticClass:"k-topbar-breadcrumb",attrs:{crumbs:t.breadcrumb,view:t.view}}),e("div",{staticClass:"k-topbar-signals"},[t.notification&&"error"!==t.notification.type?e("k-button",{staticClass:"k-topbar-notification k-topbar-button",attrs:{icon:t.notification.icon,text:t.notification.message,theme:t.notification.theme},on:{click:function(e){return t.notification.close()}}}):t.license?t._e():e("k-registration"),e("k-form-indicator"),e("k-button",{staticClass:"k-topbar-button",attrs:{tooltip:t.$t("search"),icon:"search"},on:{click:function(e){return t.$panel.search()}}})],1)],1)])],1)}),[],!1,null,null,null,null).exports,cl={install(t){t.component("k-breadcrumb",zo),t.component("k-browser",Yo),t.component("k-button",Ho),t.component("k-button-disabled",Uo),t.component("k-button-group",Ko),t.component("k-button-link",Vo),t.component("k-button-native",Jo),t.component("k-dropdown",Go),t.component("k-dropdown-content",Qo),t.component("k-dropdown-item",Xo),t.component("k-file-browser",tl),t.component("k-languages-dropdown",nl),t.component("k-link",el),t.component("k-options-dropdown",sl),t.component("k-page-tree",ol),t.component("k-pagination",ll),t.component("k-prev-next",rl),t.component("k-tag",al),t.component("k-topbar",ul),t.component("k-tree",il)}};const dl=R({props:{empty:String,blueprint:String,lock:[Boolean,Object],parent:String,tab:Object},computed:{content(){return this.$store.getters["content/values"]()}},methods:{exists(t){return this.$helper.isComponent(`k-${t}-section`)}}},(function(){var t=this,e=t._self._c;return 0===t.tab.columns.length?e("k-box",{attrs:{html:!0,text:t.empty,theme:"info"}}):e("k-grid",{staticClass:"k-sections",attrs:{gutter:"large"}},t._l(t.tab.columns,(function(n,s){return e("k-column",{key:t.parent+"-column-"+s,attrs:{width:n.width,sticky:n.sticky}},[t._l(n.sections,(function(i,o){return[t.$helper.field.isVisible(i,t.content)?[t.exists(i.type)?e("k-"+i.type+"-section",t._b({key:t.parent+"-column-"+s+"-section-"+o+"-"+t.blueprint,tag:"component",class:"k-section k-section-name-"+i.name,attrs:{column:n.width,lock:t.lock,name:i.name,parent:t.parent,timestamp:t.$panel.view.timestamp},on:{submit:function(e){return t.$emit("submit",e)}}},"component",i,!1)):[e("k-box",{key:t.parent+"-column-"+s+"-section-"+o,attrs:{text:t.$t("error.section.type.invalid",{type:i.type}),theme:"negative"}})]]:t._e()]}))],2)})),1)}),[],!1,null,null,null,null).exports,pl={props:{blueprint:String,lock:[Boolean,Object],help:String,name:String,parent:String,timestamp:Number},methods:{load(){return this.$api.get(this.parent+"/sections/"+this.name)}}};const hl=R({mixins:[pl],inheritAttrs:!1,data:()=>({fields:{},isLoading:!0,issue:null}),computed:{values(){return this.$store.getters["content/values"]()}},watch:{timestamp(){this.fetch()}},created(){this.onInput=at(this.onInput,50),this.fetch()},methods:{async fetch(){try{const t=await this.load();this.fields=t.fields;for(const e in this.fields)this.fields[e].section=this.name,this.fields[e].endpoints={field:this.parent+"/fields/"+e,section:this.parent+"/sections/"+this.name,model:this.parent}}catch(t){this.issue=t}finally{this.isLoading=!1}},onInput(t,e,n){this.$store.dispatch("content/update",[n,t[n]])},onSubmit(t){this.$store.dispatch("content/update",[null,t]),this.$events.$emit("keydown.cmd.s",t)}}},(function(){var t=this,e=t._self._c;return t.isLoading?t._e():e("section",{staticClass:"k-fields-section"},[t.issue?[e("k-headline",{staticClass:"k-fields-issue-headline"},[t._v(" Error ")]),e("k-box",{attrs:{text:t.issue.message,html:!1,theme:"negative"}})]:t._e(),e("k-form",{attrs:{fields:t.fields,validate:!0,value:t.values,disabled:t.lock&&"lock"===t.lock.state},on:{input:t.onInput,submit:t.onSubmit}})],2)}),[],!1,null,null,null,null).exports;const ml=R({inheritAttrs:!1,props:{blueprint:String,column:String,parent:String,name:String,timestamp:Number},data:()=>({data:[],error:null,isLoading:!1,isProcessing:!1,options:{columns:{},empty:null,headline:null,help:null,layout:"list",link:null,max:null,min:null,size:null,sortable:null},pagination:{page:null},searchterm:null,searching:!1}),computed:{addIcon:()=>"add",buttons(){let t=[];return this.canSearch&&t.push({icon:"filter",text:this.$t("search"),click:this.onSearchToggle,responsive:!0}),this.canAdd&&t.push({icon:this.addIcon,text:this.$t("add"),click:this.onAdd}),t},canAdd:()=>!0,canDrop:()=>!1,canSearch(){return this.options.search},collection(){return{columns:this.options.columns,empty:this.emptyPropsWithSearch,layout:this.options.layout,help:this.options.help,items:this.items,pagination:this.pagination,sortable:!this.isProcessing&&this.options.sortable,size:this.options.size}},emptyProps(){return{icon:"page",text:this.$t("pages.empty")}},emptyPropsWithSearch(){return{...this.emptyProps,text:this.searching?this.$t("search.results.none"):this.options.empty||this.emptyProps.text}},items(){return this.data},isInvalid(){var t;return!((null==(t=this.searchterm)?void 0:t.length)>0)&&(!!(this.options.min&&this.data.lengththis.options.max))},paginationId(){return"kirby$pagination$"+this.parent+"/"+this.name},type:()=>"models"},watch:{searchterm:at((function(){this.pagination.page=0,this.reload()}),200),timestamp(){this.reload()}},created(){this.load()},methods:{async load(t){this.isProcessing=!0,t||(this.isLoading=!0);const e=this.pagination.page??localStorage.getItem(this.paginationId)??1;try{const t=await this.$api.get(this.parent+"/sections/"+this.name,{page:e,searchterm:this.searchterm});this.options=t.options,this.pagination=t.pagination,this.data=t.data}catch(n){this.error=n.message}finally{this.isProcessing=!1,this.isLoading=!1}},onAction(){},onAdd(){},onChange(){},onDrop(){},onSort(){},onPaginate(t){localStorage.setItem(this.paginationId,t.page),this.pagination=t,this.reload()},onSearchToggle(){this.searching=!this.searching,this.searchterm=null},async reload(){await this.load(!0)},update(){this.reload(),this.$events.$emit("model.update")}}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("section",{class:`k-models-section k-${t.type}-section`,attrs:{"data-processing":t.isProcessing}},[e("header",{staticClass:"k-section-header"},[e("k-headline",{attrs:{link:t.options.link}},[t._v(" "+t._s(t.options.headline||" ")+" "),t.options.min?e("abbr",{attrs:{title:t.$t("section.required")}},[t._v("*")]):t._e()]),e("k-button-group",{attrs:{buttons:t.buttons}})],1),t.error?e("k-box",{attrs:{theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[e("strong",[t._v(" "+t._s(t.$t("error.section.notLoaded",{name:t.name}))+": ")]),t._v(" "+t._s(t.error)+" ")])],1):[e("k-dropzone",{attrs:{disabled:!t.canDrop},on:{drop:t.onDrop}},[t.searching&&t.options.search?e("k-input",{staticClass:"k-models-section-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",value:t.searchterm,type:"text"},on:{input:function(e){t.searchterm=e},keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.onSearchToggle.apply(null,arguments)}}}):t._e(),e("k-collection",t._g(t._b({attrs:{"data-invalid":t.isInvalid},on:{action:t.onAction,change:t.onChange,sort:t.onSort,paginate:t.onPaginate}},"k-collection",t.collection,!1),t.canAdd?{empty:t.onAdd}:{}))],1)]],2):t._e()}),[],!1,null,null,null,null).exports;const fl=R({extends:ml,computed:{addIcon:()=>"upload",canAdd(){return this.$panel.permissions.files.create&&!1!==this.options.upload},canDrop(){return!1!==this.canAdd},emptyProps(){return{icon:"image",text:this.$t("files.empty")}},items(){return this.data.map((t=>(t.sortable=this.options.sortable,t.column=this.column,t.options=this.$dropdown(t.link,{query:{view:"list",update:this.options.sortable,delete:this.data.length>this.options.min}}),t.data={"data-id":t.id,"data-template":t.template},t)))},type:()=>"files",uploadOptions(){return{...this.options.upload,url:this.$panel.urls.api+"/"+this.options.upload.api,on:{complete:()=>{this.$panel.notification.success({context:"view"})}}}}},created(){this.$events.$on("model.update",this.reload),this.$events.$on("file.sort",this.reload)},destroyed(){this.$events.$off("model.update",this.reload),this.$events.$off("file.sort",this.reload)},methods:{onAction(t,e){"replace"===t&&this.replace(e)},onAdd(){this.canAdd&&this.$panel.upload.pick(this.uploadOptions)},onDrop(t){this.canAdd&&this.$panel.upload.open(t,this.uploadOptions)},async onSort(t){if(!1===this.options.sortable)return!1;this.isProcessing=!0;try{await this.$api.patch(this.options.apiUrl+"/files/sort",{files:t.map((t=>t.id)),index:this.pagination.offset}),this.$panel.notification.success(),this.$events.$emit("file.sort")}catch(e){this.$panel.error(e),this.reload()}finally{this.isProcessing=!1}},replace(t){this.$panel.upload.replace(t,this.uploadOptions)}}},null,null,!1,null,null,null,null).exports;const gl=R({mixins:[pl],data:()=>({label:null,text:null,theme:null}),async created(){const t=await this.load();this.label=t.label,this.text=t.text,this.theme=t.theme||"info"}},(function(){var t=this,e=t._self._c;return e("section",{staticClass:"k-info-section"},[e("k-headline",{staticClass:"k-info-section-label"},[t._v(" "+t._s(t.label)+" ")]),e("k-box",{attrs:{theme:t.theme}},[e("k-text",{attrs:{html:t.text}})],1)],1)}),[],!1,null,null,null,null).exports;const kl=R({extends:ml,computed:{canAdd(){return this.options.add&&this.$panel.permissions.pages.create},items(){return this.data.map((t=>{const e=!1!==t.permissions.changeStatus;return t.flag={status:t.status,tooltip:this.$t("page.status")+": "+this.$t("page.status."+t.status),disabled:!e,click:()=>this.$dialog(t.link+"/changeStatus")},t.sortable=t.permissions.sort&&this.options.sortable,t.deletable=this.data.length>this.options.min,t.column=this.column,t.options=this.$dropdown(t.link,{query:{view:"list",delete:t.deletable,sort:t.sortable}}),t.data={"data-id":t.id,"data-status":t.status,"data-template":t.template},t}))}},created(){this.$events.$on("page.changeStatus",this.reload),this.$events.$on("page.sort",this.reload)},destroyed(){this.$events.$off("page.changeStatus",this.reload),this.$events.$off("page.sort",this.reload)},methods:{onAdd(){this.canAdd&&this.$dialog("pages/create",{query:{parent:this.options.link||this.parent,view:this.parent,section:this.name}})},async onChange(t){let e=null;if(t.added&&(e="added"),t.moved&&(e="moved"),e){this.isProcessing=!0;const s=t[e].element,i=t[e].newIndex+1+this.pagination.offset;try{await this.$api.pages.changeStatus(s.id,"listed",i),this.$panel.notification.success(),this.$events.$emit("page.sort",s)}catch(n){this.$panel.error({message:n.message,details:n.details}),await this.reload()}finally{this.isProcessing=!1}}}}},null,null,!1,null,null,null,null).exports;const bl=R({mixins:[pl],data:()=>({isLoading:!0,headline:null,reports:null,size:null}),async created(){const t=await this.load();this.isLoading=!1,this.headline=t.headline,this.reports=t.reports,this.size=t.size},methods:{}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("section",{staticClass:"k-stats-section"},[e("header",{staticClass:"k-section-header"},[e("k-headline",[t._v(" "+t._s(t.headline)+" ")])],1),t.reports.length>0?e("k-stats",{attrs:{reports:t.reports,size:t.size}}):e("k-empty",{attrs:{icon:"chart"}},[t._v(" "+t._s(t.empty||t.$t("stats.empty")))])],1):t._e()}),[],!1,null,null,null,null).exports,vl={install(t){t.component("k-sections",dl),t.component("k-fields-section",hl),t.component("k-files-section",fl),t.component("k-info-section",gl),t.component("k-pages-section",kl),t.component("k-stats-section",bl)}};const yl=R({},(function(){var t=this._self._c;return t("pre",{staticClass:"k-code"},[t("code",[this._t("default")],2)])}),[],!1,null,null,null,null).exports;const $l=R({props:{link:String,size:{type:String},tag:{type:String,default:"h2"},theme:{type:String}},emits:["click"]},(function(){var t=this,e=t._self._c;return e(t.tag,{tag:"component",staticClass:"k-headline",attrs:{"data-theme":t.theme,"data-size":t.size},on:{click:function(e){return t.$emit("click",e)}}},[t.link?e("k-link",{attrs:{to:t.link}},[t._t("default")],2):t._t("default")],2)}),[],!1,null,null,null,null).exports;const wl=R({props:{align:String,html:String,size:String,theme:String},computed:{attrs(){return{class:"k-text","data-align":this.align,"data-size":this.size,"data-theme":this.theme}}}},(function(){var t=this,e=t._self._c;return t.html?e("div",t._b({domProps:{innerHTML:t._s(t.html)}},"div",t.attrs,!1)):e("div",t._b({},"div",t.attrs,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports,_l={install(t){t.component("k-code",yl),t.component("k-headline",$l),t.component("k-text",wl)}};const xl=R({props:{blueprint:String,next:Object,prev:Object,permissions:{type:Object,default:()=>({})},lock:{type:[Boolean,Object]},model:{type:Object,default:()=>({})},tab:{type:Object,default:()=>({columns:[]})},tabs:{type:Array,default:()=>[]}},computed:{id(){return this.model.link},isLocked(){var t;return"lock"===(null==(t=this.lock)?void 0:t.state)},protectedFields:()=>[]},watch:{"$panel.view.timestamp":{handler(){this.$store.dispatch("content/create",{id:this.id,api:this.id,content:this.model.content,ignore:this.protectedFields})},immediate:!0}},created(){this.$events.$on("model.reload",this.$reload),this.$events.$on("keydown.left",this.toPrev),this.$events.$on("keydown.right",this.toNext)},destroyed(){this.$events.$off("model.reload",this.$reload),this.$events.$off("keydown.left",this.toPrev),this.$events.$off("keydown.right",this.toNext)},methods:{toPrev(t){this.prev&&"body"===t.target.localName&&this.$go(this.prev.link)},toNext(t){this.next&&"body"===t.target.localName&&this.$go(this.next.link)}}},null,null,!1,null,null,null,null).exports;const Cl=R({extends:xl,computed:{avatarOptions(){return[{icon:"upload",text:this.$t("change"),click:()=>this.$panel.upload.pick(this.uploadOptions)},{icon:"trash",text:this.$t("delete"),click:this.deleteAvatar}]},buttons(){return[{icon:"email",text:`${this.$t("email")}: ${this.model.email}`,disabled:!this.permissions.changeEmail||this.isLocked,click:()=>this.$dialog(this.id+"/changeEmail")},{icon:"bolt",text:`${this.$t("role")}: ${this.model.role}`,disabled:!this.permissions.changeRole||this.isLocked,click:()=>this.$dialog(this.id+"/changeRole")},{icon:"globe",text:`${this.$t("language")}: ${this.model.language}`,disabled:!this.permissions.changeLanguage||this.isLocked,click:()=>this.$dialog(this.id+"/changeLanguage")}]},uploadOptions(){return{url:this.$panel.urls.api+"/"+this.id+"/avatar",accept:"image/*",immediate:!0,multiple:!1}}},methods:{async deleteAvatar(){await this.$api.users.deleteAvatar(this.model.id),this.avatar=null,this.$panel.notification.success(),this.$reload()},onAvatar(){this.model.avatar?this.$refs.picture.toggle():this.$panel.upload.pick(this.uploadOptions)}}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("div",{staticClass:"k-user-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[e("div",{staticClass:"k-user-profile"},[e("k-view",[e("k-dropdown",[e("k-button",{staticClass:"k-user-view-image",attrs:{tooltip:t.$t("avatar"),disabled:t.isLocked},on:{click:t.onAvatar}},[t.model.avatar?e("k-image",{attrs:{cover:!0,src:t.model.avatar,ratio:"1/1"}}):e("k-icon",{attrs:{back:"gray-900",color:"gray-200",type:"user"}})],1),t.model.avatar?e("k-dropdown-content",{ref:"picture",attrs:{options:t.avatarOptions}}):t._e()],1),e("k-button-group",{attrs:{buttons:t.buttons}})],1)],1),e("k-view",[e("k-header",{attrs:{editable:t.permissions.changeName&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[e("k-dropdown",{staticClass:"k-user-view-options"},[e("k-button",{attrs:{disabled:t.isLocked,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)}})],1),e("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[t.model.account?t._e():e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[t.model.name&&0!==t.model.name.length?[t._v(" "+t._s(t.model.name)+" ")]:e("span",{staticClass:"k-user-name-placeholder"},[t._v(" "+t._s(t.$t("name"))+" … ")])],2),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("user.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}})],1)],1)])}),[],!1,null,null,null,null).exports;const Sl=R({extends:Cl,prevnext:!1},null,null,!1,null,null,null,null).exports;const Ol=R({props:{error:String,layout:String}},(function(){var t=this,e=t._self._c;return e(`k-${t.layout}`,{tag:"component"},[e("k-view",{staticClass:"k-error-view"},[e("div",{staticClass:"k-error-view-content"},[e("k-text",[e("p",[e("k-icon",{staticClass:"k-error-view-icon",attrs:{type:"alert"}})],1),t._t("default",(function(){return[e("p",[t._v(" "+t._s(t.error)+" ")])]}))],2)],1)])],1)}),[],!1,null,null,null,null).exports;const Al=R({extends:xl,props:{preview:Object},computed:{isFocusable(){return!this.isLocked&&this.permissions.update&&(!window.panel.multilang||0===window.panel.languages.length||window.panel.language.default)}},methods:{action(t){if("replace"===t)return this.$panel.upload.replace({...this.preview,...this.model})}}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("div",{staticClass:"k-file-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[e("k-file-preview",t._b({attrs:{focusable:t.isFocusable}},"k-file-preview",t.preview,!1)),e("k-view",{staticClass:"k-file-content"},[e("k-header",{attrs:{editable:t.permissions.changeName&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[e("k-button",{attrs:{link:t.preview.url,icon:"open",target:"_blank"}},[t._v(" "+t._s(t.$t("open"))+" ")]),e("k-dropdown",{staticClass:"k-file-view-options"},[e("k-button",{attrs:{disabled:t.isLocked,responsive:!0,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)},on:{action:t.action}})],1),e("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[t._v(" "+t._s(t.model.filename)+" ")]),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("file.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}})],1)],1)])}),[],!1,null,null,null,null).exports;const Il=R({props:{isInstallable:Boolean,isInstalled:Boolean,isOk:Boolean,requirements:Object,translations:Array},data(){return{user:{name:"",email:"",language:this.$panel.translation.code,password:"",role:"admin"}}},computed:{fields(){return{email:{label:this.$t("email"),type:"email",link:!1,autofocus:!0,required:!0},password:{label:this.$t("password"),type:"password",placeholder:this.$t("password")+" …",required:!0},language:{label:this.$t("language"),type:"select",options:this.translations,icon:"globe",empty:!1,required:!0}}},isReady(){return this.isOk&&this.isInstallable},isComplete(){return this.isOk&&this.isInstalled}},methods:{async install(){try{await this.$api.system.install(this.user),await this.$reload({globals:["$system","$translation"]}),this.$panel.notification.success(this.$t("welcome")+"!")}catch(t){this.$panel.error(t)}}}},(function(){var t=this,e=t._self._c;return e("k-panel",[e("k-view",{staticClass:"k-installation-view",attrs:{align:"center"}},[t.isComplete?e("k-text",[e("k-headline",[t._v(t._s(t.$t("installation.completed")))]),e("k-link",{attrs:{to:"/login"}},[t._v(" "+t._s(t.$t("login"))+" ")])],1):t.isReady?e("form",{on:{submit:function(e){return e.preventDefault(),t.install.apply(null,arguments)}}},[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("installation"))+" ")]),e("k-fieldset",{attrs:{fields:t.fields,novalidate:!0,value:t.user},on:{input:function(e){t.user=e}}}),e("k-button",{attrs:{text:t.$t("install"),type:"submit",icon:"check"}})],1):e("div",[e("k-headline",[t._v(" "+t._s(t.$t("installation.issues.headline"))+" ")]),e("ul",{staticClass:"k-installation-issues"},[!1===t.isInstallable?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.disabled"))}})],1):t._e(),!1===t.requirements.php?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.php"))}})],1):t._e(),!1===t.requirements.server?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.server"))}})],1):t._e(),!1===t.requirements.mbstring?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.mbstring"))}})],1):t._e(),!1===t.requirements.curl?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.curl"))}})],1):t._e(),!1===t.requirements.accounts?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.accounts"))}})],1):t._e(),!1===t.requirements.content?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.content"))}})],1):t._e(),!1===t.requirements.media?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.media"))}})],1):t._e(),!1===t.requirements.sessions?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.sessions"))}})],1):t._e()]),e("k-button",{attrs:{text:t.$t("retry"),icon:"refresh"},on:{click:t.$reload}})],1)],1)],1)}),[],!1,null,null,null,null).exports;const Ml=R({props:{code:String,deletable:Boolean,direction:String,id:String,info:Array,next:Object,name:String,prev:Object,translations:Array,url:String},methods:{createTranslation(){this.$panel.dialog.open(`dialogs/languages/${this.id}/translations/create`)},option(t,e){this.$panel.dialog.open(`dialogs/languages/${this.id}/translations/${e.key}/${t}`)},remove(){this.$panel.dialog.open(`dialogs/languages/${this.id}/delete`)},update(t){this.$panel.dialog.open(`dialogs/languages/${this.id}/update`,{on:{ready:()=>{this.$panel.dialog.focus(t)}}})},updateTranslation({row:t}){this.$dialog(`languages/${this.id}/translations/${t.key}/update`)}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-language-view"},[e("k-header",{attrs:{editable:!0},on:{edit:function(e){return t.update()}},scopedSlots:t._u([{key:"right",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[t._v(" "+t._s(t.name)+" "),e("k-button-group",{attrs:{slot:"left"},slot:"left"},[e("k-button",{attrs:{link:t.url,icon:"open",text:"Open"}}),e("k-button",{attrs:{text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.update()}}}),e("k-button",{attrs:{disabled:!t.deletable,text:t.$t("delete"),icon:"trash"},on:{click:function(e){return t.remove()}}})],1)],1),e("section",[e("k-bar",[e("k-headline",{staticStyle:{"margin-bottom":"var(--spacing-3)"},attrs:{slot:"left"},slot:"left"},[t._v("Language settings")])],1),e("k-stats",{attrs:{reports:t.info,size:"small"}})],1),e("section",[e("k-bar",[e("k-headline",{attrs:{slot:"left"},slot:"left"},[t._v("Language variables")]),e("k-button-group",{attrs:{slot:"right"},slot:"right"},[e("k-button",{attrs:{icon:"add",text:t.$t("add")},on:{click:function(e){return t.createTranslation()}}})],1)],1),t.translations.length?[e("k-table",{attrs:{columns:{key:{label:"Key",mobile:!0,width:"1/4"},value:{label:"Value",mobile:!0}},rows:t.translations},on:{cell:t.updateTranslation,option:t.option}})]:[e("k-empty",{on:{click:t.createTranslation}},[t._v("No translations yet")])]],2)],1)],1)}),[],!1,null,null,null,null).exports;const Tl=R({props:{languages:{type:Array,default:()=>[]}},computed:{languagesCollection(){return this.languages.map((t=>({...t,image:{back:"black",color:"gray",icon:"globe"},link:()=>{this.$go(`languages/${t.id}`)},options:[{icon:"edit",text:this.$t("edit"),click(){this.$go(`languages/${t.id}`)}},{icon:"cog",text:this.$t("settings"),click(){this.$dialog(`languages/${t.id}/update`)}},{icon:"trash",text:this.$t("delete"),disabled:!1===t.deletable,click(){this.$dialog(`languages/${t.id}/delete`)}}]})))},primaryLanguage(){return this.languagesCollection.filter((t=>t.default))},secondaryLanguages(){return this.languagesCollection.filter((t=>!1===t.default))}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-languages-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.languages"))+" "),e("k-button-group",{attrs:{slot:"left"},slot:"left"},[e("k-button",{attrs:{text:t.$t("language.create"),icon:"add"},on:{click:function(e){return t.$dialog("languages/create")}}})],1)],1),e("section",{staticClass:"k-languages"},[t.languages.length>0?[e("section",{staticClass:"k-languages-view-section"},[e("header",{staticClass:"k-languages-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("languages.default")))])],1),e("k-collection",{attrs:{items:t.primaryLanguage}})],1),e("section",{staticClass:"k-languages-view-section"},[e("header",{staticClass:"k-languages-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("languages.secondary")))])],1),t.secondaryLanguages.length?e("k-collection",{attrs:{items:t.secondaryLanguages}}):e("k-empty",{attrs:{icon:"globe"},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.secondary.empty"))+" ")])],1)]:0===t.languages.length?[e("k-empty",{attrs:{icon:"globe"},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.empty"))+" ")])]:t._e()],2)],1)],1)}),[],!1,null,null,null,null).exports;const jl=R({components:{"k-login-plugin":window.panel.plugins.login||se},props:{methods:Array,pending:Object},data:()=>({issue:""}),computed:{form(){return this.pending.email?"code":"login"},viewClass(){return"code"===this.form?"k-login-code-view":"k-login-view"}},created(){this.$store.dispatch("content/clear")},methods:{async onError(t){null!==t?(!0===t.details.challengeDestroyed&&await this.$reload({globals:["$system"]}),this.issue=t.message):this.issue=null}}},(function(){var t=this,e=t._self._c;return e("k-panel",[e("k-view",{class:t.viewClass,attrs:{align:"center"}},[e("div",[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("login"))+" ")]),t.issue?e("k-login-alert",{on:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),"code"===t.form?e("k-login-code",t._b({on:{error:t.onError}},"k-login-code",t.$props,!1)):e("k-login-plugin",{attrs:{methods:t.methods},on:{error:t.onError}})],1)])],1)}),[],!1,null,null,null,null).exports;const El=R({extends:xl,props:{status:Object},computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("k-view",{staticClass:"k-page-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[e("k-header",{attrs:{editable:t.permissions.changeTitle&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeTitle")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[t.permissions.preview&&t.model.previewUrl?e("k-button",{staticClass:"k-page-view-preview",attrs:{link:t.model.previewUrl,responsive:!0,text:t.$t("open"),icon:"open",target:"_blank"}}):t._e(),t.status?e("k-status-icon",{attrs:{status:t.model.status,disabled:!t.permissions.changeStatus||t.isLocked,responsive:!0,text:t.status.label},on:{click:function(e){return t.$dialog(t.id+"/changeStatus")}}}):t._e(),e("k-dropdown",{staticClass:"k-page-view-options"},[e("k-button",{attrs:{disabled:!0===t.isLocked,responsive:!0,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)}})],1),e("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[t.model.id?e("k-prev-next",{attrs:{prev:t.prev,next:t.next}}):t._e()]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("page.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}})],1)],1)}),[],!1,null,null,null,null).exports;const Dl=R({props:{id:String},computed:{view(){return"k-"+this.id+"-plugin-view"}}},(function(){var t=this._self._c;return t("k-inside",[t(this.view,{tag:"component"})],1)}),[],!1,null,null,null,null).exports;const Ll=R({data:()=>({isLoading:!1,issue:"",values:{password:null,passwordConfirmation:null}}),computed:{fields(){return{password:{autofocus:!0,label:this.$t("user.changePassword.new"),icon:"key",type:"password"},passwordConfirmation:{label:this.$t("user.changePassword.new.confirm"),icon:"key",type:"password"}}}},mounted(){this.$panel.title=this.$t("view.resetPassword")},methods:{async submit(){if(!this.values.password||this.values.password.length<8)return this.issue=this.$t("error.user.password.invalid"),!1;if(this.values.password!==this.values.passwordConfirmation)return this.issue=this.$t("error.user.password.notSame"),!1;this.isLoading=!0;try{await this.$api.users.changePassword(this.$panel.user.id,this.values.password),this.$panel.notification.success(),this.$go("/")}catch(t){this.issue=t.message}finally{this.isLoading=!1}}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-password-reset-view",attrs:{align:"center"}},[e("k-form",{attrs:{fields:t.fields,"submit-button":t.$t("change"),value:t.values},on:{input:function(e){t.values=e},submit:t.submit},scopedSlots:t._u([{key:"header",fn:function(){return[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("view.resetPassword"))+" ")]),t.issue?e("k-login-alert",{on:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),e("k-user-info",{attrs:{user:t.$panel.user}})]},proxy:!0},{key:"footer",fn:function(){return[e("div",{staticClass:"k-login-buttons"},[e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("change"))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)],1)]},proxy:!0}])})],1)],1)}),[],!1,null,null,null,null).exports;const Bl=R({props:{type:{default:"pages",type:String}},data(){return{items:[],query:this.getQuery(),pagination:{}}},watch:{query:{handler(t){this.search(t)},immediate:!0},type(){this.search(this.query)}},updated(){this.query=this.getQuery(),this.focus()},methods:{focus(){var t;null==(t=this.$refs.input)||t.focus()},getQuery:()=>new URLSearchParams(window.location.search).get("query"),onPaginate(t){this.search(this.query,t.page)},async search(t,e){this.$panel.isLoading=!0,e||(e=new URLSearchParams(window.location.search).get("page")??1);const n=this.$panel.url(window.location,{type:this.type,query:this.query,page:e>1?e:null});window.history.pushState("","",n.toString());try{if(null===t||t.length<2)throw Error("Empty query");const n=await this.$search(this.type,t,{page:e,limit:15});this.items=n.results,this.pagination=n.pagination}catch(s){this.items=[],this.pagination={}}finally{this.$panel.isLoading=!1}}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-search-view"},[e("k-header",[t._v("Search")]),e("div",{staticClass:"k-search-view-layout"},[e("k-input",{ref:"input",staticClass:"k-search-view-input",attrs:{"aria-label":t.$t("search"),autofocus:!0,placeholder:t.$t("search")+" …",value:t.query,icon:"search",type:"text"},on:{input:function(e){t.query=e}}}),e("aside",{staticClass:"k-search-view-types"},[e("nav",t._l(t.$panel.searches,(function(n,s){return e("k-button",{key:s,staticClass:"k-search-view-type",attrs:{current:t.type===s,icon:n.icon,link:"/search/?type="+s+"&query="+t.query}},[t._v(" "+t._s(n.label)+" ")])})),1)]),e("div",{staticClass:"k-search-view-results"},[t.query?e("k-collection",{attrs:{items:t.items,empty:{icon:"search",text:t.$t("search.results.none")},pagination:t.pagination},on:{paginate:t.onPaginate}}):t._e()],1)],1)],1)],1)}),[],!1,null,null,null,null).exports;const Pl=R({extends:xl,computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("k-view",{staticClass:"k-site-view",attrs:{"data-locked":t.isLocked,"data-id":"/","data-template":"site"}},[e("k-header",{attrs:{editable:t.permissions.changeTitle&&!t.isLocked,tabs:t.tabs,tab:t.tab.name},on:{edit:function(e){return t.$dialog("site/changeTitle")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-site-view-preview",attrs:{link:t.model.previewUrl,responsive:!0,text:t.$t("open"),icon:"open",target:"_blank"}}),e("k-languages-dropdown")],1)]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("site.blueprint"),lock:t.lock,tab:t.tab,parent:"site"},on:{submit:function(e){return t.$emit("submit",e)}}})],1)],1)}),[],!1,null,null,null,null).exports;const Nl=R({props:{environment:Array,exceptions:Array,plugins:Array,security:Array,urls:Object},data:()=>({accessible:[]}),computed:{securityIssues(){const t=this.accessible.map((t=>({id:t,text:this.$t("system.issues."+t),link:"https://getkirby.com/security/"+t,icon:"folder"})));return this.security.concat(t).map((t=>({image:{back:"var(--color-red-200)",icon:t.icon||"alert",color:"var(--color-red)"},...t})))}},async created(){this.exceptions.length>0&&(console.info("The following errors occurred during the update check of Kirby and/or plugins:"),this.exceptions.map((t=>console.warn(t))),console.info("End of errors from the update check.")),console.info("Running system health checks for the Panel system view; failed requests in the following console output are expected behavior.");const t=(Promise.allSettled||Promise.all).bind(Promise),e=Object.entries(this.urls).map(this.check);await t(e),console.info(`System health checks ended. ${this.accessible.length} issues with accessible files/folders found (see the security list in the system view).`)},methods:{async check([t,e]){if(!e)return!1;!0===await this.isAccessible(e)&&this.accessible.push(t)},isAccessible:async t=>(await fetch(t,{cache:"no-store"})).status<400,retry(){this.$go(window.location.href)}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-system-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.system"))+" ")]),e("section",{staticClass:"k-system-view-section"},[e("header",{staticClass:"k-system-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("environment")))])],1),e("k-stats",{staticClass:"k-system-info",attrs:{reports:t.environment,size:"medium"}})],1),t.securityIssues.length?e("section",{staticClass:"k-system-view-section"},[e("header",{staticClass:"k-system-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("security")))]),e("k-button",{attrs:{tooltip:t.$t("retry"),icon:"refresh"},on:{click:t.retry}})],1),e("k-items",{attrs:{items:t.securityIssues}})],1):t._e(),t.plugins.length?e("section",{staticClass:"k-system-view-section"},[e("header",{staticClass:"k-system-view-section-header"},[e("k-headline",{attrs:{link:"https://getkirby.com/plugins"}},[t._v(" "+t._s(t.$t("plugins"))+" ")])],1),e("k-table",{attrs:{index:!1,columns:{name:{label:t.$t("name"),type:"url",mobile:!0},author:{label:t.$t("author")},license:{label:t.$t("license")},version:{label:t.$t("version"),type:"update-status",mobile:!0,width:"10rem"}},rows:t.plugins}})],1):t._e()],1)],1)}),[],!1,null,null,null,null).exports;const Fl=R({props:{role:Object,roles:Array,search:String,title:String,users:Object},computed:{items(){return this.users.data.map((t=>(t.options=this.$dropdown(t.link),t)))}},methods:{paginate(t){this.$reload({query:{page:t.page}})}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-users-view"},[e("k-header",{scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",{attrs:{buttons:[{disabled:!1===t.$panel.permissions.users.create,text:t.$t("user.create"),icon:"add",click:()=>t.$dialog("users/create")}]}})]},proxy:!0},t.roles.length>1?{key:"right",fn:function(){return[e("k-button-group",[e("k-dropdown",[e("k-button",{attrs:{responsive:!0,text:`${t.$t("role")}: ${t.role?t.role.title:t.$t("role.all")}`,icon:"funnel"},on:{click:function(e){return t.$refs.roles.toggle()}}}),e("k-dropdown-content",{ref:"roles",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{icon:"bolt",link:"/users"}},[t._v(" "+t._s(t.$t("role.all"))+" ")]),e("hr"),t._l(t.roles,(function(n){return e("k-dropdown-item",{key:n.id,attrs:{link:"/users/?role="+n.id,icon:"bolt"}},[t._v(" "+t._s(n.title)+" ")])}))],2)],1)],1)]},proxy:!0}:null],null,!0)},[t._v(" "+t._s(t.$t("view.users"))+" ")]),t.users.data.length>0?[e("k-collection",{attrs:{items:t.items,pagination:t.users.pagination},on:{paginate:t.paginate}})]:0===t.users.pagination.total?[e("k-empty",{attrs:{icon:"users"}},[t._v(" "+t._s(t.$t("role.empty"))+" ")])]:t._e()],2)],1)}),[],!1,null,null,null,null).exports,ql={install(t){t.component("k-account-view",Sl),t.component("k-error-view",Ol),t.component("k-file-view",Al),t.component("k-installation-view",Il),t.component("k-language-view",Ml),t.component("k-languages-view",Tl),t.component("k-login-view",jl),t.component("k-page-view",El),t.component("k-plugin-view",Dl),t.component("k-reset-password-view",Ll),t.component("k-search-view",Bl),t.component("k-site-view",Pl),t.component("k-system-view",Nl),t.component("k-users-view",Fl),t.component("k-user-view",Cl)}},Rl={install(t){t.use(wt),t.use(Dt),t.use(Xi),t.use(Co),t.use(Ro),t.use(cl),t.use(vl),t.use(_l),t.use(ql),t.use(j)}},zl={install(t){window.onunhandledrejection=t=>{t.preventDefault(),window.panel.error(t.reason)},t.config.errorHandler=window.panel.error.bind(window.panel)}},Yl=t=>{var e=(t=t||{}).desc?-1:1,n=-e,s=/^0/,i=/\s+/g,o=/^\s+|\s+$/g,l=/[^\x00-\x80]/,r=/^0x[0-9a-f]+$/i,a=/(0x[\da-fA-F]+|(^[\+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|\d+)/g,u=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=t.insensitive?function(t){return function(t){if(t.toLocaleLowerCase)return t.toLocaleLowerCase();return t.toLowerCase()}(""+t).replace(o,"")}:function(t){return(""+t).replace(o,"")};function d(t){return t.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0")}function p(t,e){return(!t.match(s)||1===e)&&parseFloat(t)||t.replace(i," ").replace(o,"")||0}return function(t,s){var i=c(t),o=c(s);if(!i&&!o)return 0;if(!i&&o)return n;if(i&&!o)return e;var a=d(i),h=d(o),m=parseInt(i.match(r),16)||1!==a.length&&Date.parse(i),f=parseInt(o.match(r),16)||m&&o.match(u)&&Date.parse(o)||null;if(f){if(mf)return e}for(var g=a.length,k=h.length,b=0,v=Math.max(g,k);b0)return e;if(w<0)return n;if(b===v-1)return 0}else{if(y<$)return n;if(y>$)return e}}return 0}};Array.fromObject=function(t){return Array.isArray(t)?t:Object.values(t??{})},Array.prototype.sortBy=function(t){const e=t.split(" "),n=e[0],s=e[1]||"asc";return this.sort(((t,e)=>{const i=String(t[n]).toLowerCase(),o=String(e[n]).toLowerCase();return Yl("desc"===s?o:i)}))},Array.wrap=function(t){return Array.isArray(t)?t:[t]};const Hl={read:function(t,e=!1){if(!t)return null;if("string"==typeof t)return t;if(t instanceof ClipboardEvent){if(t.preventDefault(),!0===e)return t.clipboardData.getData("text/plain");const n=t.clipboardData.getData("text/html")||t.clipboardData.getData("text/plain")||null;if(n)return n.replace(/\u00a0/g," ")}return null},write:function(t,e){if("string"!=typeof t&&(t=JSON.stringify(t,null,2)),e&&e instanceof ClipboardEvent)return e.preventDefault(),e.clipboardData.setData("text/plain",t),!0;const n=document.createElement("textarea");if(n.value=t,document.body.append(n),navigator.userAgent.match(/ipad|ipod|iphone/i)){n.contentEditable=!0,n.readOnly=!0;const t=document.createRange();t.selectNodeContents(n);const e=window.getSelection();e.removeAllRanges(),e.addRange(t),n.setSelectionRange(0,999999)}else n.select();return document.execCommand("copy"),n.remove(),!0}};function Ul(t){if("string"==typeof t){if("pattern"===(t=t.toLowerCase()))return"var(--color-gray-800) var(--bg-pattern)";if(!1===t.startsWith("#")&&!1===t.startsWith("var(")){const e="--color-"+t;if(window.getComputedStyle(document.documentElement).getPropertyValue(e))return`var(${e})`}return t}}function Kl(t,e=!1){if(!t.match("youtu"))return!1;let n=null;try{n=new URL(t)}catch(d){return!1}const s=n.pathname.split("/").filter((t=>""!==t)),i=s[0],o=s[1],l="https://"+(!0===e?"www.youtube-nocookie.com":n.host)+"/embed",r=t=>!!t&&null!==t.match(/^[a-zA-Z0-9_-]+$/);let a=n.searchParams,u=null;switch(s.join("/")){case"embed/videoseries":case"playlist":r(a.get("list"))&&(u=l+"/videoseries");break;case"watch":r(a.get("v"))&&(u=l+"/"+a.get("v"),a.has("t")&&a.set("start",a.get("t")),a.delete("v"),a.delete("t"));break;default:n.host.includes("youtu.be")&&r(i)?(u=!0===e?"https://www.youtube-nocookie.com/embed/"+i:"https://www.youtube.com/embed/"+i,a.has("t")&&a.set("start",a.get("t")),a.delete("t")):["embed","shorts"].includes(i)&&r(o)&&(u=l+"/"+o)}if(!u)return!1;const c=a.toString();return c.length&&(u+="?"+c),u}function Vl(t,e=!1){let n=null;try{n=new URL(t)}catch(a){return!1}const s=n.pathname.split("/").filter((t=>""!==t));let i=n.searchParams,o=null;switch(!0===e&&i.append("dnt",1),n.host){case"vimeo.com":case"www.vimeo.com":o=s[0];break;case"player.vimeo.com":o=s[1]}if(!o||!o.match(/^[0-9]*$/))return!1;let l="https://player.vimeo.com/video/"+o;const r=i.toString();return r.length&&(l+="?"+r),l}const Wl={youtube:Kl,vimeo:Vl,video:function(t,e=!1){return t.includes("youtu")?Kl(t,e):!!t.includes("vimeo")&&Vl(t,e)}};const Jl={form:function(t){const e={};for(const n in t)e[n]=Y(t[n].default);return e},isVisible:function(t,e){if("hidden"===t.type||!0===t.hidden)return!1;if(!t.when)return!0;for(const n in t.when){const s=e[n.toLowerCase()],i=t.when[n];if((void 0!==s||""!==i&&i!==[])&&s!==i)return!1}return!0},subfields:function(t,e){let n={};return Object.keys(e).forEach((s=>{let i=e[s];i.section=t.name,i.endpoints={field:t.endpoints.field+"+"+s,section:t.endpoints.section,model:t.endpoints.model},n[s]=i})),n}},Gl=t=>t.split(".").slice(-1).join(""),Zl=t=>t.split(".").slice(0,-1).join("."),Ql=t=>Intl.NumberFormat("en",{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow"}).format(t),Xl={extension:Gl,name:Zl,niceSize:Ql};function tr(t,e){if("string"==typeof t&&(t=document.querySelector(t)),!t)return!1;const n=["[autofocus]","[data-autofocus]","input","textarea","select","[contenteditable=true]","[type=submit]","button"];e&&n.unshift(`[name="${e}"]`);const s=function(t,e){for(const n of e){const e=t.querySelector(n);if(!0===er(e))return e}return null}(t,n);return s?(s.focus(),s):!0===er(t)&&(t.focus(),t)}function er(t){return!!t&&(!t.matches("[disabled], [aria-disabled], input[type=hidden]")&&"function"==typeof t.focus)}const nr=t=>"function"==typeof window.Vue.options.components[t],sr=t=>!!t.dataTransfer&&(!!t.dataTransfer.types&&(!0===t.dataTransfer.types.includes("Files")&&!1===t.dataTransfer.types.includes("text/plain")));const ir={metaKey:function(){return window.navigator.userAgent.indexOf("Mac")>-1?"cmd":"ctrl"}},or=(t="3/2",e="100%",n=!0)=>{const s=String(t).split("/");if(2!==s.length)return e;const i=Number(s[0]),o=Number(s[1]);let l=100;return 0!==i&&0!==o&&(l=n?l/i*o:l/o*i,l=parseFloat(String(l)).toFixed(2)),l+"%"};RegExp.escape=function(t){return t.replace(new RegExp("[-/\\\\^$*+?.()[\\]{}]","gu"),"\\$&")};const lr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function rr(t){return String(t).replace(/[&<>"'`=/]/g,(t=>lr[t]))}function ar(t){return!t||0===String(t).length}function ur(t){const e=String(t);return e.charAt(0).toLowerCase()+e.slice(1)}function cr(t="",e=""){const n=new RegExp(`^(${e})+`,"g");return t.replace(n,"")}function dr(t="",e=""){const n=new RegExp(`(${e})+$`,"g");return t.replace(n,"")}function pr(t,e={}){const n=(t,e={})=>{const s=e[rr(t.shift())]??"…";return"…"===s||0===t.length?s:n(t,s)},s="[{]{1,2}[\\s]?",i="[\\s]?[}]{1,2}";return(t=t.replace(new RegExp(`${s}(.*?)${i}`,"gi"),((t,s)=>n(s.split("."),e)))).replace(new RegExp(`${s}.*${i}`,"gi"),"…")}function hr(t){const e=String(t);return e.charAt(0).toUpperCase()+e.slice(1)}function mr(){let t,e,n="";for(t=0;t<32;t++)e=16*Math.random()|0,8!=t&&12!=t&&16!=t&&20!=t||(n+="-"),n+=(12==t?4:16==t?3&e|8:e).toString(16);return n}const fr={camelToKebab:function(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()},escapeHTML:rr,hasEmoji:function(t){if("string"!=typeof t)return!1;const e=t.match(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c\ude32-\ude3a]|[\ud83c\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/i);return null!==e&&null!==e.length},isEmpty:ar,lcfirst:ur,ltrim:cr,pad:function(t,e=2){t=String(t);let n="";for(;n.length]+)>)/gi,"")},template:pr,ucfirst:hr,ucwords:function(t){return String(t).split(/ /g).map((t=>hr(t))).join(" ")},unescapeHTML:function(t){for(const e in lr)t=String(t).replaceAll(lr[e],e);return t},uuid:mr},gr=(t,e)=>{const n={url:"/",field:"file",method:"POST",filename:t.name,attributes:{},complete:function(){},error:function(){},success:function(){},progress:function(){}},s=Object.assign(n,e),i=new FormData;i.append(s.field,t,s.filename),s.attributes&&Object.keys(s.attributes).forEach((t=>{i.append(t,s.attributes[t])}));const o=new XMLHttpRequest,l=e=>{if(!e.lengthComputable||!s.progress)return;let n=Math.max(0,Math.min(100,e.loaded/e.total*100));s.progress(o,t,Math.ceil(n))};o.upload.addEventListener("loadstart",l),o.upload.addEventListener("progress",l),o.addEventListener("load",(e=>{let n=null;try{n=JSON.parse(e.target.response)}catch(i){n={status:"error",message:"The file could not be uploaded"}}"error"===n.status?s.error(o,t,n):(s.success(o,t,n),s.progress(o,t,100))})),o.addEventListener("error",(e=>{const n=JSON.parse(e.target.response);s.error(o,t,n),s.progress(o,t,100)})),o.open(s.method,s.url,!0),s.headers&&Object.keys(s.headers).forEach((t=>{const e=s.headers[t];o.setRequestHeader(t,e)})),o.send(i)};function kr(){var t;return new URL((null==(t=document.querySelector("base"))?void 0:t.href)||window.location.origin)}function br(t={},e={}){e instanceof URL&&(e=e.search);const n=new URLSearchParams(e);return Object.entries(t).forEach((([t,e])=>{null!==e&&n.set(t,e)})),n}function vr(t="",e={},n){return(t=xr(t,n)).search=br(e,t.search),t}function yr(t){return null!==String(t).match(/^https?:\/\//)}function $r(t){return xr(t).origin===window.location.origin}function wr(t){if(t instanceof URL||t instanceof Location)return!0;if("string"!=typeof t)return!1;try{return new URL(t,window.location),!0}catch(e){return!1}}function _r(t,e){return!0===yr(t)?t:(e=e||kr(),(e=String(e).replaceAll(/\/$/g,""))+"/"+(t=String(t).replaceAll(/^\//g,"")))}function xr(t,e){return t instanceof URL?t:new URL(_r(t,e))}const Cr={base:kr,buildUrl:vr,buildQuery:br,isAbsolute:yr,isSameOrigin:$r,isUrl:wr,makeAbsolute:_r,toObject:xr},Sr={install(t){t.prototype.$helper={clipboard:Hl,clone:V.clone,color:Ul,embed:Wl,focus:tr,isComponent:nr,isUploadEvent:sr,debounce:at,field:Jl,file:Xl,keyboard:ir,object:V,pad:fr.pad,ratio:or,slug:fr.slug,sort:Yl,string:fr,upload:gr,url:Cr,uuid:fr.uuid},t.prototype.$esc=fr.escapeHTML}},Or={install(t){t.directive("direction",{inserted(t,e,n){!0!==n.context.disabled?t.dir=window.panel.translation.direction:t.dir=null}})}},Ar=async(t,e={})=>("string"==typeof t&&(t=`/dialogs/${t}`),window.panel.dialog.open(t,e)),Ir=(t,e={})=>("string"==typeof t&&(t=`/dropdowns/${t}`),async n=>{await window.panel.dropdown.open(t,e);const s=window.panel.dropdown.options();if(0===s.length)throw Error("The dropdown is empty");n(s)}),Mr={install(t){window.panel.deprecated=window.panel.notification.deprecated.bind(window.panel.notification),window.panel.redirect=window.panel.redirect.bind(window.panel),window.panel.reload=window.panel.reload.bind(window.panel),window.panel.request=window.panel.request.bind(window.panel),window.panel.search=window.panel.search.bind(window.panel);const e=["api","config","direction","events","language","languages","license","menu","multilang","permissions","search","searches","system","t","translation","url","urls","user","view","vue"];for(const n of e){const e=`$${n}`;t.prototype[e]=window.panel[e]=window.panel[n]}t.prototype.$dialog=Ar,t.prototype.$dropdown=Ir}};E.extend(D),E.extend(((t,e,n)=>{n.interpret=(t,e="date")=>{const s={date:{"YYYY-MM-DD":!0,"YYYY-MM-D":!0,"YYYY-MM-":!0,"YYYY-MM":!0,"YYYY-M-DD":!0,"YYYY-M-D":!0,"YYYY-M-":!0,"YYYY-M":!0,"YYYY-":!0,YYYYMMDD:!0,"MMM DD YYYY":!1,"MMM D YYYY":!1,"MMM DD YY":!1,"MMM D YY":!1,"MMM YYYY":!0,"MMM DD":!1,"MMM D":!1,"MM YYYY":!0,"M YYYY":!0,"DD MMMM YYYY":!1,"DD MMMM YY":!1,"DD MMMM":!1,"D MMMM YYYY":!1,"D MMMM YY":!1,"D MMMM":!1,"DD MMM YYYY":!1,"D MMM YYYY":!1,"DD MMM YY":!1,"D MMM YY":!1,"DD MMM":!1,"D MMM":!1,"DD MM YYYY":!1,"DD M YYYY":!1,"D MM YYYY":!1,"D M YYYY":!1,"DD MM YY":!1,"D MM YY":!1,"DD M YY":!1,"D M YY":!1,YYYY:!0,MMMM:!0,MMM:!0,"DD MM":!1,"DD M":!1,"D MM":!1,"D M":!1,DD:!1,D:!1},time:{"HH:mm:ss a":!1,"HH:mm:ss":!1,"HH:mm a":!1,"HH:mm":!1,"HH a":!1,HH:!1}};if("string"==typeof t&&""!==t)for(const i in s[e]){const o=n(t,i,s[e][i]);if(!0===o.isValid())return o}return null}})),E.extend(((t,e,n)=>{const s=t=>"date"===t?"YYYY-MM-DD":"time"===t?"HH:mm:ss":"YYYY-MM-DD HH:mm:ss";e.prototype.toISO=function(t="datetime"){return this.format(s(t))},n.iso=function(t,e="datetime"){const i=n(t,s(e));return i&&i.isValid()?i:null}})),E.extend(((t,e)=>{e.prototype.merge=function(t,e="date"){let n=this.clone();if(!t||!t.isValid())return this;if("string"==typeof e){const t={date:["year","month","date"],time:["hour","minute","second"]};if(!1===Object.hasOwn(t,e))throw new Error("Invalid merge unit alias");e=t[e]}for(const s of e)n=n.set(s,t.get(s));return n}})),E.extend(((t,e,n)=>{n.pattern=t=>new class{constructor(t,e){this.dayjs=t,this.pattern=e;const n={year:["YY","YYYY"],month:["M","MM","MMM","MMMM"],day:["D","DD"],hour:["h","hh","H","HH"],minute:["m","mm"],second:["s","ss"],meridiem:["a"]};this.parts=this.pattern.split(/\W/).map(((t,e)=>{const s=this.pattern.indexOf(t);return{index:e,unit:Object.keys(n)[Object.values(n).findIndex((e=>e.includes(t)))],start:s,end:s+(t.length-1)}}))}at(t,e=t){const n=this.parts.filter((n=>n.start<=t&&n.end>=e-1));return n[0]?n[0]:this.parts.filter((e=>e.start<=t)).pop()}format(t){return t&&t.isValid()?t.format(this.pattern):null}}(n,t)})),E.extend(((t,e)=>{e.prototype.round=function(t="date",e=1){const n=["second","minute","hour","date","month","year"];if("day"===t&&(t="date"),!1===n.includes(t))throw new Error("Invalid rounding unit");if(["date","month","year"].includes(t)&&1!==e||"hour"===t&&24%e!=0||["second","minute"].includes(t)&&60%e!=0)throw"Invalid rounding size for "+t;let s=this.clone();const i=n.indexOf(t),o=n.slice(0,i),l=o.pop();if(o.forEach((t=>s=s.startOf(t))),l){const e={month:12,date:s.daysInMonth(),hour:24,minute:60,second:60}[l];Math.round(s.get(l)/e)*e===e&&(s=s.add(1,"date"===t?"day":t)),s=s.startOf(t)}return s=s.set(t,Math.round(s.get(t)/e)*e),s}})),E.extend(((t,e,n)=>{e.prototype.validate=function(t,e,s="day"){if(!this.isValid())return!1;if(!t)return!0;t=n.iso(t);const i={min:"isAfter",max:"isBefore"}[e];return this.isSame(t,s)||this[i](t,s)}}));const Tr={install(t){t.prototype.$library={colors:pn,dayjs:E}}},jr=t=>({async changeName(e,n,s){return t.patch(this.url(e,n,"name"),{name:s})},async delete(e,n){return t.delete(this.url(e,n))},async get(e,n,s){let i=await t.get(this.url(e,n),s);return!0===Array.isArray(i.content)&&(i.content={}),i},id:t=>!0===t.startsWith("/@/file/")?t.replace("/@/file/","@"):!0===t.startsWith("file://")?t.replace("file://","@"):t,link(t,e,n){return"/"+this.url(t,e,n)},async update(e,n,s){return t.patch(this.url(e,n),s)},url(t,e,n){let s="files/"+this.id(e);return t&&(s=t+"/"+s),n&&(s+="/"+n),s}}),Er=t=>({async blueprint(e){return t.get("pages/"+this.id(e)+"/blueprint")},async blueprints(e,n){return t.get("pages/"+this.id(e)+"/blueprints",{section:n})},async changeSlug(e,n){return t.patch("pages/"+this.id(e)+"/slug",{slug:n})},async changeStatus(e,n,s){return t.patch("pages/"+this.id(e)+"/status",{status:n,position:s})},async changeTemplate(e,n){return t.patch("pages/"+this.id(e)+"/template",{template:n})},async changeTitle(e,n){return t.patch("pages/"+this.id(e)+"/title",{title:n})},async children(e,n){return t.post("pages/"+this.id(e)+"/children/search",n)},async create(e,n){return null===e||"/"===e?t.post("site/children",n):t.post("pages/"+this.id(e)+"/children",n)},async delete(e,n){return t.delete("pages/"+this.id(e),n)},async duplicate(e,n,s){return t.post("pages/"+this.id(e)+"/duplicate",{slug:n,children:s.children||!1,files:s.files||!1})},async get(e,n){let s=await t.get("pages/"+this.id(e),n);return!0===Array.isArray(s.content)&&(s.content={}),s},id:t=>!0===t.startsWith("/@/page/")?t.replace("/@/page/","@"):!0===t.startsWith("page://")?t.replace("page://","@"):t.replace(/\//g,"+"),async files(e,n){return t.post("pages/"+this.id(e)+"/files/search",n)},link(t){return"/"+this.url(t)},async preview(t){return(await this.get(this.id(t),{select:"previewUrl"})).previewUrl},async search(e,n){return e?t.post("pages/"+this.id(e)+"/children/search?select=id,title,hasChildren",n):t.post("site/children/search?select=id,title,hasChildren",n)},async update(e,n){return t.patch("pages/"+this.id(e),n)},url(t,e){let n=null===t?"pages":"pages/"+String(t).replace(/\//g,"+");return e&&(n+="/"+e),n}});class Dr extends Error{constructor(t,{request:e,response:n,cause:s}){super(n.json.message||t,{cause:s}),this.request=e,this.response=n}state(){return this.response.json}}class Lr extends Dr{}class Br extends Dr{state(){return{message:this.message,text:this.response.text}}}const Pr=t=>(window.location.href=_r(t),!1),Nr=async(t,e={})=>{var n;(e={cache:"no-store",credentials:"same-origin",mode:"same-origin",...e}).body=((n=e.body)instanceof HTMLFormElement&&(n=new FormData(n)),n instanceof FormData&&(n=Object.fromEntries(n)),"object"==typeof n?JSON.stringify(n):n),e.headers=((t={},e={})=>{return{"content-type":"application/json","x-csrf":e.csrf??!1,"x-fiber":!0,"x-fiber-globals":(n=e.globals,!!n&&(!1===Array.isArray(n)?String(n):n.join(","))),"x-fiber-referrer":e.referrer??!1,...K(t)};var n})(e.headers,e),e.url=vr(t,e.query);const s=new Request(e.url,e);return!1===$r(s.url)?Pr(s.url):await Fr(s,await fetch(s))},Fr=async(t,e)=>{var n;if(!1===e.headers.get("Content-Type").includes("application/json"))return Pr(e.url);try{e.text=await e.text(),e.json=JSON.parse(e.text)}catch(s){throw new Br("Invalid JSON response",{cause:s,request:t,response:e})}if(401===e.status)throw new Lr("Unauthenticated",{request:t,response:e});if("error"===(null==(n=e.json)?void 0:n.status))throw e.json;if(!1===e.ok)throw new Dr(`The request to ${e.url} failed`,{request:t,response:e});return{request:t,response:e}},qr=t=>({blueprint:async e=>t.get("users/"+e+"/blueprint"),blueprints:async(e,n)=>t.get("users/"+e+"/blueprints",{section:n}),changeEmail:async(e,n)=>t.patch("users/"+e+"/email",{email:n}),changeLanguage:async(e,n)=>t.patch("users/"+e+"/language",{language:n}),changeName:async(e,n)=>t.patch("users/"+e+"/name",{name:n}),changePassword:async(e,n)=>t.patch("users/"+e+"/password",{password:n}),changeRole:async(e,n)=>t.patch("users/"+e+"/role",{role:n}),create:async e=>t.post("users",e),delete:async e=>t.delete("users/"+e),deleteAvatar:async e=>t.delete("users/"+e+"/avatar"),link(t,e){return"/"+this.url(t,e)},async list(e){return t.post(this.url(null,"search"),e)},get:async(e,n)=>t.get("users/"+e,n),async roles(e){return(await t.get(this.url(e,"roles"))).data.map((t=>({info:t.description||`(${window.panel.$t("role.description.placeholder")})`,text:t.title,value:t.name})))},search:async e=>t.post("users/search",e),update:async(e,n)=>t.patch("users/"+e,n),url(t,e){let n=t?"users/"+t:"users";return e&&(n+="/"+e),n}}),Rr=t=>{const e={csrf:t.system.csrf,endpoint:dr(t.urls.api,"/"),methodOverwrite:!0,ping:null,requests:[],running:0},n=()=>{clearInterval(e.ping),e.ping=setInterval(e.auth.ping,3e5)};return e.request=async(s,i={},o=!1)=>{const l=s+"/"+JSON.stringify(i);e.requests.push(l),!1===o&&(t.isLoading=!0),e.language=t.language.code;try{return await(t=>async(e,n={})=>{n={cache:"no-store",credentials:"same-origin",mode:"same-origin",headers:{"content-type":"application/json","x-csrf":t.csrf,"x-language":t.language,...K(n.headers??{})},...n},t.methodOverwrite&&"GET"!==n.method&&"POST"!==n.method&&(n.headers["x-http-method-override"]=n.method,n.method="POST"),n.url=dr(t.endpoint,"/")+"/"+cr(e,"/");const s=new Request(n.url,n),{response:i}=await Fr(s,await fetch(s));let o=i.json;return o.data&&"model"===o.type&&(o=o.data),o})(e)(s,i)}finally{n(),e.requests=e.requests.filter((t=>t!==l)),0===e.requests.length&&(t.isLoading=!1)}},e.auth=(t=>({async login(e){const n={long:e.remember||!1,email:e.email,password:e.password};return t.post("auth/login",n)},logout:async()=>t.post("auth/logout"),ping:async()=>t.post("auth/ping"),user:async e=>t.get("auth",e),verifyCode:async e=>t.post("auth/code",{code:e})}))(e),e.delete=(t=>async(e,n,s,i=!1)=>t.post(e,n,s,"DELETE",i))(e),e.files=jr(e),e.get=(t=>async(e,n,s,i=!1)=>(n&&(e+="?"+Object.keys(n).filter((t=>void 0!==n[t]&&null!==n[t])).map((t=>t+"="+n[t])).join("&")),t.request(e,Object.assign(s||{},{method:"GET"}),i)))(e),e.languages=(t=>({create:async e=>t.post("languages",e),delete:async e=>t.delete("languages/"+e),get:async e=>t.get("languages/"+e),list:async()=>t.get("languages"),update:async(e,n)=>t.patch("languages/"+e,n)}))(e),e.pages=Er(e),e.patch=(t=>async(e,n,s,i=!1)=>t.post(e,n,s,"PATCH",i))(e),e.post=(t=>async(e,n,s,i="POST",o=!1)=>t.request(e,Object.assign(s||{},{method:i,body:JSON.stringify(n)}),o))(e),e.roles=(t=>({list:async e=>t.get("roles",e),get:async e=>t.get("roles/"+e)}))(e),e.system=(t=>({get:async(e={view:"panel"})=>t.get("system",e),install:async e=>(await t.post("system/install",e)).user,register:async e=>t.post("system/register",e)}))(e),e.site=(t=>({blueprint:async()=>t.get("site/blueprint"),blueprints:async()=>t.get("site/blueprints"),changeTitle:async e=>t.patch("site/title",{title:e}),children:async e=>t.post("site/children/search",e),get:async(e={view:"panel"})=>t.get("site",e),update:async e=>t.post("site",e)}))(e),e.translations=(t=>({list:async()=>t.get("translations"),get:async e=>t.get("translations/"+e)}))(e),e.users=qr(e),n(),e},zr=()=>({addEventListener(t,e){"function"==typeof e&&(this.on[t]=e)},addEventListeners(t){if(!1!==H(t))for(const e in t)this.addEventListener(e,t[e])},emit(t,...e){return this.hasEventListener(t)?this.on[t](...e):()=>{}},hasEventListener(t){return"function"==typeof this.on[t]},on:{}}),Yr=(t,e={})=>({...e,key:()=>t,defaults:()=>e,reset(){return this.set(this.defaults())},set(t){this.validateState(t);for(const e in this.defaults())this[e]=t[e]??this.defaults()[e];return this.state()},state(){const t={};for(const e in this.defaults())t[e]=this[e]??this.defaults()[e];return t},validateState(t){if(!1===H(t))throw new Error(`Invalid ${this.key()} state`);return!0}}),Hr=(t,e,n)=>{const s=Yr(e,n);return{...s,...zr(),hasSubmitter(){return!0===this.hasEventListener("submit")||"string"==typeof this.path},async load(e,n={}){return!0!==n.silent&&(this.isLoading=!0),await t.open(e,n),this.isLoading=!1,this.addEventListeners(n.on),this.state()},async open(t,e={}){return"function"==typeof e&&(e={on:{submit:e}}),!0===wr(t)?this.load(t,e):(this.set(t),this.addEventListeners(e.on),this.emit("open",t,e),this.state())},async post(e,n={}){var s;if(!this.path)throw new Error(`The ${this.key()} cannot be posted`);this.isLoading=!0,e=e??(null==(s=this.props)?void 0:s.value)??{};try{return await t.post(this.path,e,n)}catch(i){t.error(i)}finally{this.isLoading=!1}return!1},async refresh(e={}){e.url=e.url??this.url();const n=(await t.get(e.url,e))["$"+this.key()];if(n&&n.component===this.component)return this.props=n.props,this.state()},async reload(t={}){if(!this.path)return!1;this.open(this.url(),t)},set(t){return s.set.call(this,t),this.on={},this.addEventListeners(t.on??{}),this.state()},url(){return t.url(this.path,this.query)}}},Ur=(t,e,n)=>{const s=Hr(t,e,n);return{...s,async cancel(){this.isOpen&&this.emit("cancel"),this.close()},async close(){var t;null==(t=this.ref)||t.hide(),this.isOpen&&this.emit("close"),this.reset()},focus(t){tr(`.k-${this.key()}-portal`,t)},input(t){!1!==this.isOpen&&(this.props.value=t,this.emit("input",t))},async open(t,e={}){return t instanceof window.Vue?this.openComponent(t):this.openState(t,e)},async openComponent(t){const e=await this.openState({component:t.$options._componentTag,legacy:!0,props:{...t.$attrs,...t.$props},on:t.$listeners,ref:t});return t.show(),e},async openState(e,n){return!1===this.isOpen&&t.notification.close(),await s.open.call(this,e,n),this.isOpen=!0,this.state()},async submit(t,e={}){if(!1===this.hasSubmitter())return console.warn(`There's no ${this.key()} submitter`),this.close();let n;return n=this.hasEventListener("submit")?await this.emit("submit",t??this.value,e):await this.post(t??this.value,e),!1===H(n)?n:this.success(n["$"+this.key()]??{})},success(e){return"string"==typeof e&&t.notification.success(e),this.close(),this.successNotification(e),this.successEvents(e),this.successDispatch(e),e.route||e.redirect?this.successRedirect(e):t.view.reload(e.reload),e},successDispatch(e){if(!1!==H(e.dispatch))for(const n in e.dispatch){const s=e.dispatch[n];t.app.$store.dispatch(n,!0===Array.isArray(s)?[...s]:s)}},successEvents(e){if(e.event){const n=Array.wrap(e.event);for(const s of n)"string"==typeof s&&t.events.emit(s,e)}!1!==e.emit&&t.events.emit("success",e)},successNotification(e){e.message&&t.notification.success(e.message)},successRedirect(e){const n=e.route??e.redirect;return!!n&&("string"==typeof n?t.open(n):t.open(n.url,n.options))},get value(){var t;return null==(t=this.props)?void 0:t.value}}},Kr=()=>({...Yr("drag",{type:null,data:{}}),get isDragging(){return null!==this.type},start(t,e){this.type=t,this.data=e},stop(){this.type=null,this.data={}}}),Vr=t=>{const e=Ur(t,"drawer",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,isOpen:!1,legacy:!1,ref:null,parent:null,tabId:null});return t.events.on("drawer.save",(e=>{e.preventDefault(),t.drawer.submit()})),{...e,get breadcrumb(){const t=[];let e=this;for(;null!==e;)t.push(e.props),e=e.parent;return t.reverse()},goTo(t){let e=this;for(;null!==e;){if(e.props.id===t)return this.openState(e);e=e.parent}},get icon(){return this.props.icon??"box"},async open(t,n={}){const s=!0===this.isOpen?this.state():null;return await e.open.call(this,t,n),this.path!==(null==s?void 0:s.path)&&(this.parent=s),this.openTab(),this.state()},openTab(t){if(!(t=t||Object.keys(this.tabs)[0]))return!1;this.tabId=t,this.emit("openTab",t)},get tab(){return this.tabs[this.tabId]??null},get tabs(){var t;return(null==(t=this.props)?void 0:t.tabs)??{}},get title(){return this.props.title}}},Wr=t=>{const e=Hr(t,"dropdown",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null});return{...e,close(){this.emit("close"),this.reset()},options(){return!1===Array.isArray(this.props.options)?[]:this.props.options.map((e=>e.dialog?(e.click=()=>{const n="string"==typeof e.dialog?e.dialog:e.dialog.url,s="object"==typeof e.dialog?e.dialog:{};return t.app.$dialog(n,s)},e):e))},set(t){return t.options&&(t.props={options:t.options}),e.set.call(this,t)}}},Jr=t=>{const e=L();e.on("keydown.cmd.s",(n=>{e.emit(t.context+".save",n)})),e.on("keydown.cmd.shift.f",(()=>t.search())),e.on("keydown.cmd./",(()=>t.search()));const n={document:{blur:!0,click:!1,copy:!0,focus:!0,paste:!0},window:{dragenter:!1,dragexit:!1,dragleave:!1,dragover:!1,drop:!1,keydown:!1,keyup:!1,offline:!1,online:!1,popstate:!1}};return{blur(t){this.emit("blur",t)},click(t){this.emit("click",t)},copy(t){this.emit("copy",t)},dragenter(t){this.entered=t.target,this.prevent(t),this.emit("dragenter",t)},dragexit(t){this.prevent(t),this.entered=null,this.emit("dragexit",t)},dragleave(t){this.prevent(t),this.entered===t.target&&(this.entered=null,this.emit("dragleave",t))},dragover(t){this.prevent(t),this.emit("dragover",t)},drop(t){this.prevent(t),this.entered=null,this.emit("drop",t)},emit:e.emit,entered:null,focus(t){this.emit("focus",t)},keychain(t,e){let n=[t];(e.metaKey||e.ctrlKey)&&n.push("cmd"),!0===e.altKey&&n.push("alt"),!0===e.shiftKey&&n.push("shift");let s=e.key?ur(e.key):null;const i={escape:"esc",arrowUp:"up",arrowDown:"down",arrowLeft:"left",arrowRight:"right"};return i[s]&&(s=i[s]),s&&!1===["alt","control","shift","meta"].includes(s)&&n.push(s),n.join(".")},keydown(t){this.emit(this.keychain("keydown",t),t),this.emit("keydown",t)},keyup(t){this.emit(this.keychain("keyup",t),t),this.emit("keyup",t)},off:e.off,offline(t){this.emit("offline",t)},on:e.on,online(t){this.emit("online",t)},paste(t){this.emit("paste",t)},popstate(t){this.emit("popstate",t)},prevent(t){t.stopPropagation(),t.preventDefault()},subscribe(){for(const t in n.document)document.addEventListener(t,this[t].bind(this),n.document[t]);for(const t in n.window)window.addEventListener(t,this[t].bind(this),n.window[t])},unsubscribe(){for(const t in n.document)document.removeEventListener(t,this[t]);for(const t in n.window)window.removeEventListener(t,this[t])},$on:e.on,$emit:e.emit,$off:e.off}},Gr={interval:null,start(t,e){this.stop(),t&&(this.interval=setInterval(e,t))},stop(){clearInterval(this.interval),this.interval=null}},Zr=(t={})=>({...Yr("notification",{context:null,details:null,isOpen:!1,message:null,timeout:null,type:null}),close(){return this.timer.stop(),this.reset(),this.state()},deprecated(t){console.warn("Deprecated: "+t)},error(e){if(e instanceof Lr&&t.user.id)return t.redirect("logout");if(e instanceof Br)return this.fatal(e);if(e instanceof Dr){const t=Object.values(e.response.json).find((t=>"string"==typeof(null==t?void 0:t.error)));t&&(e.message=t.error)}return"string"==typeof e&&(e={message:e,type:"error"}),e={message:e.message??"Something went wrong",details:e.details??{}},"view"===t.context&&t.dialog.open({component:"k-error-dialog",props:e,type:"error"}),this.open({message:e.message,type:"error"})},get icon(){return"success"===this.type?"check":"alert"},get isFatal(){return"fatal"===this.type},fatal(t){return"string"==typeof t?this.open({message:t,type:"fatal"}):t instanceof Br?this.open({message:t.response.text,type:"fatal"}):this.open({message:t.message??"Something went wrong",type:"fatal"})},open(e){return this.timer.stop(),"string"==typeof e?this.success(e):(this.set({context:t.context,...e}),this.isOpen=!0,this.timer.start(this.timeout,(()=>this.close())),this.state())},success(t){return t||(t={}),"string"==typeof t&&(t={message:t}),this.open({timeout:4e3,type:"success",...t})},get theme(){return"error"===this.type?"negative":"positive"},timer:Gr}),Qr=()=>({...Yr("language",{code:null,default:!1,direction:"ltr",name:null,rules:[]}),get isDefault(){return this.default}}),Xr=(t,e,n)=>{if(!n.template&&!n.render&&!n.extends)throw new Error(`Neither template nor render method provided. Nor extending a component when loading plugin component "${e}". The component has not been registered.`);return(n=ta(t,e,n)).template&&(n.render=null),n=ea(n),!0===nr(e)&&window.console.warn(`Plugin is replacing "${e}"`),t.component(e,n),n},ta=(t,e,n)=>"string"!=typeof(null==n?void 0:n.extends)?n:!1===nr(n.extends)?(window.console.warn(`Problem with plugin trying to register component "${e}": cannot extend non-existent component "${n.extends}"`),n.extends=null,n):(n.extends=t.options.components[n.extends].extend({options:n,components:{...t.options.components,...n.components??{}}}),n),ea=t=>{if(!1===Array.isArray(t.mixins))return t;const e={section:pl};return t.mixins=t.mixins.map((t=>"string"==typeof t?e[t]:t)),t},na=(t,e={})=>((e={components:{},created:[],icons:{},login:null,textareaButtons:{},use:[],thirdParty:{},writerMarks:{},writerNodes:{},...e}).use=((t,e)=>{if(!1===Array.isArray(e))return[];for(const n of e)t.use(n);return e})(t,e.use),e.components=((t,e)=>{if(!1===H(e))return;const n={};for(const[i,o]of Object.entries(e))try{n[i]=Xr(t,i,o)}catch(s){window.console.warn(s.message)}return n})(t,e.components),e),sa=()=>{const t=Yr("translation",{code:null,data:{},direction:"ltr",name:null});return{...t,set(e){return t.set.call(this,e),document.documentElement.lang=this.code,document.body.dir=this.direction,this.state()},translate(t,e,n=null){if("string"!=typeof t)return;const s=this.data[t]??n;return"string"!=typeof s?s:pr(s,e)}}},ia=t=>{const e=Yr("upload",{accept:"*",attributes:{},files:[],max:null,multiple:!0,replacing:null,url:null});return{...e,...zr(),input:null,cancel(){this.emit("cancel"),this.completed.length>0&&(this.emit("complete",this.completed),t.view.reload()),this.reset()},get completed(){return this.files.filter((t=>t.completed)).map((t=>t.model))},done(){t.dialog.close(),this.completed.length>0&&(this.emit("done",this.completed),t.notification.success({context:"view"}),t.view.reload()),this.reset()},file(t){const e=URL.createObjectURL(t);return{completed:!1,error:null,extension:Gl(t.name),filename:t.name,id:mr(),model:null,name:Zl(t.name),niceSize:Ql(t.size),progress:0,size:t.size,src:t,type:t.type,url:e}},open(e,n){e instanceof FileList?(this.set(n),this.select(e)):this.set(e);const s={component:"k-upload-dialog",on:{cancel:()=>this.cancel(),submit:()=>this.start()}};this.replacing&&(s.component="k-upload-replace-dialog",s.props={original:this.replacing}),t.dialog.open(s)},pick(t){this.set(t),this.input=document.createElement("input"),this.input.type="file",this.input.classList.add("sr-only"),this.input.value=null,this.input.accept=this.accept,this.input.multiple=this.multiple,this.input.click(),this.input.addEventListener("change",(e=>{!0===t.immediate?(this.set(t),this.select(e.target.files),this.start()):this.open(e.target.files,t),this.input.remove()}))},remove(t){this.files=this.files.filter((e=>e.id!==t))},replace(e,n){this.pick({...n,url:t.urls.api+"/"+e.link,accept:"."+e.extension+","+e.mime,multiple:!1,replacing:e})},reset(){e.reset.call(this),this.files.splice(0)},select(t,e){if(this.set(e),t instanceof Event&&(t=t.target.files),t instanceof FileList==!1)throw new Error("Please provide a FileList");t=[...t],this.files=t.map((t=>this.file(t))),null!==this.max&&(this.files=this.files.slice(0,this.max)),this.emit("select",this.files)},set(t){if(t)return e.set.call(this,t),this.on={},this.addEventListeners(t.on||{}),1===this.max&&(this.multiple=!1),!1===this.multiple&&(this.max=1),this.state()},start(){var e;if(!this.url)throw new Error("The upload URL is missing");if(0!==this.files.length){if(this.files.length===this.completed.length)return this.done();for(const n of this.files){if(!0===n.completed)continue;n.error=null,n.progress=0;this.files.filter((t=>t.name===n.name&&t.extension===n.extension)).length>1?n.error=t.t("error.file.name.unique"):(gr(n.src,{attributes:this.attributes,headers:{"x-csrf":t.system.csrf},filename:n.name+"."+n.extension,url:this.url,error:(e,s,i)=>{t.error(i,!1),n.error=i.message,n.progress=0},progress:(t,e,s)=>{n.progress=s},success:(t,e,s)=>{n.completed=!0,n.model=s.data,this.files.length===this.completed.length&&this.done()}}),void 0!==(null==(e=this.attributes)?void 0:e.sort)&&this.attributes.sort++)}}}}},oa=t=>{const e=Hr(t,"view",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,breadcrumb:[],breadcrumbLabel:null,icon:null,id:null,link:null,search:"pages",title:null});return{...e,set(n){e.set.call(this,n),t.title=this.title;const s=this.url().toString();window.location.toString()!==s&&window.history.pushState(null,null,s)},async submit(){throw new Error("Not yet implemented")}}},la={config:{},languages:[],license:!1,menu:[],multilang:!1,permissions:{},searches:{},urls:{}},ra=["dialog","drawer"],aa=["dropdown","language","notification","system","translation","user"],ua={create(t={}){var e;return this.isLoading=!1,this.drag=Kr(),this.events=Jr(this),this.upload=ia(this),this.language=Qr(),this.notification=Zr(this),this.system=Yr("system",{ascii:{},csrf:null,isLocal:null,locales:{},slugs:[],title:null}),this.translation=sa(),this.user=Yr("user",{email:null,id:null,language:null,role:null,username:null}),this.dropdown=Wr(this),this.view=oa(this),this.drawer=Vr(this),this.dialog=((e=this).events.on("dialog.save",(t=>{var n;null==(n=null==t?void 0:t.preventDefault)||n.call(t),e.dialog.submit()})),Ur(e,"dialog",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,isOpen:!1,legacy:!1,ref:null})),this.redirect=Pr,this.reload=this.view.reload.bind(this.view),this.t=this.translation.translate.bind(this.translation),this.plugins=na(window.Vue,t),this.set(window.fiber),this.api=Rr(this),Vue.reactive(this)},get context(){return this.dialog.isOpen?"dialog":this.drawer.isOpen?"drawer":"view"},get debug(){return!0===this.config.debug},get direction(){return this.translation.direction},error(t,e=!0){if(!0===this.debug&&console.error(t),!0===e)return this.notification.error(t)},async get(t,e={}){const{response:n}=await this.request(t,{method:"GET",...e});return n.json},async open(t,e={}){try{if(!1===wr(t))this.set(t);else{this.isLoading=!0;const n=await this.get(t,e);this.set(n),this.isLoading=!1}return this.state()}catch(n){return this.error(n)}},async post(t,e={},n={}){const{response:s}=await this.request(t,{method:"POST",body:e,...n});return s.json},async request(t,e={}){return Nr(t,{referrer:this.view.path,csrf:this.system.csrf,...e})},async search(t,e,n){if(!t&&!e)return this.dialog.open({component:"k-search-dialog"});const{$search:s}=await this.get(`/search/${t}`,{query:{query:e,...n}});return s},set(t={}){t=Object.fromEntries(Object.entries(t).map((([t,e])=>[t.replace("$",""),e])));for(const e in la){const n=t[e]??this[e]??la[e];typeof n==typeof la[e]&&(this[e]=n)}for(const e of aa)!0===H(t[e])&&this[e].set(t[e]);for(const e of ra)!0===H(t[e])?this[e].open(t[e]):void 0!==t[e]&&this[e].close(t[e]);!0===H(t.dropdown)?this.dropdown.open(t.dropdown):void 0!==t.dropdown&&this.dropdown.close(),!0===H(t.view)&&this.view.open(t.view)},state(){const t={};for(const e in la)t[e]=this[e]??la[e];for(const e of aa)t[e]=this[e].state();for(const e of ra)t[e]=this[e].state();return t.dropdown=this.dropdown.state(),t.view=this.view.state(),t},get title(){return document.title},set title(t){!1===ar(this.system.title)&&(t+=" | "+this.system.title),document.title=t},url:(t="",e={},n)=>vr(t,e,n)},ca=(t,e)=>{localStorage.setItem("kirby$content$"+t,JSON.stringify(e))},da={namespaced:!0,state:{current:null,models:{},status:{enabled:!0}},getters:{exists:t=>e=>Object.hasOwn(t.models,e),hasChanges:(t,e)=>t=>U(e.model(t).changes)>0,isCurrent:t=>e=>t.current===e,id:t=>e=>(e=e||t.current)+"?language="+window.panel.language.code,model:(t,e)=>n=>(n=n||t.current,!0===e.exists(n)?t.models[n]:{api:null,originals:{},values:{},changes:{}}),originals:(t,e)=>t=>Y(e.model(t).originals),values:(t,e)=>t=>({...e.originals(t),...e.changes(t)}),changes:(t,e)=>t=>Y(e.model(t).changes)},mutations:{CLEAR(t){Object.keys(t.models).forEach((e=>{t.models[e].changes={}})),Object.keys(localStorage).forEach((t=>{t.startsWith("kirby$content$")&&localStorage.removeItem(t)}))},CREATE(t,[e,n]){if(!n)return!1;let s=t.models[e]?t.models[e].changes:n.changes;Vue.set(t.models,e,{api:n.api,originals:n.originals,changes:s||{}})},CURRENT(t,e){t.current=e},MOVE(t,[e,n]){const s=Y(t.models[e]);Vue.del(t.models,e),Vue.set(t.models,n,s);const i=localStorage.getItem("kirby$content$"+e);localStorage.removeItem("kirby$content$"+e),localStorage.setItem("kirby$content$"+n,i)},REMOVE(t,e){Vue.del(t.models,e),localStorage.removeItem("kirby$content$"+e)},REVERT(t,e){t.models[e]&&(Vue.set(t.models[e],"changes",{}),localStorage.removeItem("kirby$content$"+e))},STATUS(t,e){Vue.set(t.status,"enabled",e)},UPDATE(t,[e,n,s]){if(!t.models[e])return!1;void 0===s&&(s=null),s=Y(s);const i=JSON.stringify(s);JSON.stringify(t.models[e].originals[n]??null)==i?Vue.del(t.models[e].changes,n):Vue.set(t.models[e].changes,n,s),ca(e,{api:t.models[e].api,originals:t.models[e].originals,changes:t.models[e].changes})}},actions:{init(t){Object.keys(localStorage).filter((t=>t.startsWith("kirby$content$"))).map((t=>t.split("kirby$content$")[1])).forEach((e=>{const n=localStorage.getItem("kirby$content$"+e);t.commit("CREATE",[e,JSON.parse(n)])})),Object.keys(localStorage).filter((t=>t.startsWith("kirby$form$"))).map((t=>t.split("kirby$form$")[1])).forEach((e=>{const n=localStorage.getItem("kirby$form$"+e);let s=null;try{s=JSON.parse(n)}catch(o){}if(!s||!s.api)return localStorage.removeItem("kirby$form$"+e),!1;const i={api:s.api,originals:s.originals,changes:s.values};t.commit("CREATE",[e,i]),ca(e,i),localStorage.removeItem("kirby$form$"+e)}))},clear(t){t.commit("CLEAR")},create(t,e){const n=Y(e.content);Array.isArray(e.ignore)&&e.ignore.forEach((t=>delete n[t])),e.id=t.getters.id(e.id);const s={api:e.api,originals:n,changes:{}};t.commit("CREATE",[e.id,s]),t.dispatch("current",e.id)},current(t,e){t.commit("CURRENT",e)},disable(t){t.commit("STATUS",!1)},enable(t){t.commit("STATUS",!0)},move(t,[e,n]){e=t.getters.id(e),n=t.getters.id(n),t.commit("MOVE",[e,n])},remove(t,e){t.commit("REMOVE",e),t.getters.isCurrent(e)&&t.commit("CURRENT",null)},revert(t,e){e=e||t.state.current,t.commit("REVERT",e)},async save(t,e){if(e=e||t.state.current,t.getters.isCurrent(e)&&!1===t.state.status.enabled)return!1;t.dispatch("disable");const n=t.getters.model(e),s={...n.originals,...n.changes};try{await window.panel.api.patch(n.api,s),t.commit("CREATE",[e,{...n,originals:s}]),t.dispatch("revert",e)}finally{t.dispatch("enable")}},update(t,[e,n,s]){if(s=s||t.state.current,null===e)for(const i in n)t.commit("UPDATE",[s,i,n[i]]);else t.commit("UPDATE",[s,e,n])}}},pa={namespaced:!0,actions:{close(t,e){window.panel.drawer.close(e)},goto(t,e){window.panel.drawer.goto(e)},open(t,e){window.panel.drawer.goto(e)}}},ha={namespaced:!0,actions:{close(){window.panel.notification.close()},deprecated(t,e){window.panel.notification.deprecated(e)},error(t,e){window.panel.notification.error(e)},open(t,e){window.panel.notification.open(e)},success(t,e){window.panel.notification.success(e)}}};Vue.use(B);const ma=new B.Store({strict:!1,actions:{dialog(t,e){window.panel.dialog.open(e)},drag(t,e){window.panel.drag.start(...e)},fatal(t,e){window.panel.notification.fatal(e)},isLoading(t,e){window.panel.isLoading=e},navigate(){window.panel.dialog.close(),window.panel.drawer.close()}},modules:{content:da,drawers:pa,notification:ha}});Vue.config.productionTip=!1,Vue.config.devtools=!0,Vue.use(Sr),Vue.use(Tr),Vue.use(P),Vue.use(Rl),window.panel=Vue.prototype.$panel=ua.create(window.panel.plugins),Vue.prototype.$go=window.panel.view.open.bind(window.panel.view),Vue.prototype.$reload=window.panel.reload.bind(window.panel),window.panel.app=new Vue({store:ma,render:()=>Vue.h(q)}),Vue.use(Or),Vue.use(zl),Vue.use(Mr),!1===CSS.supports("selector(:has(*))")&&F((()=>import("./css-has-polyfill.js")),[]).then((({default:t})=>{t(document)})),!1===CSS.supports("container")&&F((()=>import("./container-query-polyfill.modern.js")),[]),window.panel.app.$mount("#app"); +import{v as t,I as e,P as n,S as s,F as i,N as o,s as l,l as r,w as a,c as u,e as c,t as d,a as p,b as h,d as m,f,g,k,D as b,h as v,E as y,i as $,j as w,m as _,T as x,u as C,n as S,o as O,r as A,p as I,q as M,x as T,y as j,z as E,A as L,B as D,V as B,C as P}from"./vendor.js";const F={},N=function(t,e,n){if(!e||0===e.length)return t();const s=document.getElementsByTagName("link");return Promise.all(e.map((t=>{if((t=function(t){return"/"+t}(t))in F)return;F[t]=!0;const e=t.endsWith(".css"),i=e?'[rel="stylesheet"]':"";if(!!n)for(let n=s.length-1;n>=0;n--){const i=s[n];if(i.href===t&&(!e||"stylesheet"===i.rel))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;const o=document.createElement("link");return o.rel=e?"stylesheet":"modulepreload",e||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),e?new Promise(((e,n)=>{o.addEventListener("load",e),o.addEventListener("error",(()=>n(new Error(`Unable to preload CSS for ${t}`))))})):void 0}))).then((()=>t()))},q={created(){this.$panel.events.subscribe(),this.$panel.plugins.created.forEach((t=>{t(this)})),this.$panel.events.on("popstate",(()=>{this.$panel.open(window.location.href)})),this.$panel.events.on("drop",(()=>{this.$panel.drag.stop()})),this.$store.dispatch("content/init")},destroyed(){this.$panel.events.unsubscribe()},render(t){if(this.$panel.view.component)return t(this.$panel.view.component,{key:this.$panel.view.component,props:this.$panel.view.props})}};function R(t,e,n,s,i,o,l,r){var a,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),s&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),l?(a=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(l)},u._ssrRegister=a):i&&(a=r?function(){i.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:i),a)if(u.functional){u._injectStyles=a;var c=u.render;u.render=function(t,e){return a.call(e),c(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,a):[a]}return{exports:t,options:u}}const z=R({},(function(){return(0,this._self._c)("div",{staticClass:"k-dialog-body scroll-y-auto"},[this._t("default")],2)}),[],!1,null,null,null,null).exports;function Y(t){if(void 0!==t)return JSON.parse(JSON.stringify(t))}function H(t){return"object"==typeof t&&(null==t?void 0:t.constructor)===Object}function U(t){return Object.keys(t||{}).length}function V(t){return Object.keys(t).reduce(((e,n)=>(e[n.toLowerCase()]=t[n],e)),{})}const K={clone:Y,isEmpty:function(t){return null==t||""===t||(!(!H(t)||0!==U(t))||0===t.length)},isObject:H,length:U,merge:function t(e,n){for(const s of Object.keys(n))n[s]instanceof Object&&Object.assign(n[s],t(e[s]||{},n[s]));return Object.assign(e||{},n),e},toLowerKeys:V},W={props:{cancelButton:{default:!0,type:[Boolean,String,Object]},disabled:{default:!1,type:Boolean},icon:{default:"check",type:String},submitButton:{type:[Boolean,String,Object],default:!0},theme:{default:"positive",type:String}}};const J=R({mixins:[W],computed:{buttons(){return[this.button(this.cancelButton,{click:()=>{this.$emit("cancel")},class:"k-dialog-button-cancel",icon:"cancel",text:this.$t("cancel")}),this.button(this.submitButton,{class:"k-dialog-button-submit",disabled:this.disabled,icon:this.icon,text:this.$t("confirm"),theme:this.theme,type:"submit"})].filter((t=>!1!==t))}},methods:{button:(t,e)=>"string"==typeof t?{...e,text:t}:!1!==t&&(!1===H(t)?e:{...e,...t})}},(function(){return(0,this._self._c)("k-button-group",{staticClass:"k-dialog-buttons",attrs:{buttons:this.buttons}})}),[],!1,null,null,null,null).exports,G={props:{empty:{default:()=>window.panel.$t("dialog.fields.empty"),type:String},fields:{default:()=>[],type:[Array,Object]},novalidate:{default:!0,type:Boolean},value:{default:()=>({}),type:Object}}};const Z=R({mixins:[G],computed:{hasFields(){return this.$helper.object.length(this.fields)>0}}},(function(){var t=this,e=t._self._c;return t.hasFields?e("k-fieldset",{staticClass:"k-dialog-fields",attrs:{novalidate:t.novalidate,fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports;const Q=R({},(function(){return(0,this._self._c)("footer",{staticClass:"k-dialog-footer"},[this._t("default")],2)}),[],!1,null,null,null,null).exports;const X=R({},(function(){var t=this,e=t._self._c;return"dialog"===t.$panel.notification.context?e("k-notification",{staticClass:"k-dialog-notification"}):t._e()}),[],!1,null,null,null,null).exports;const tt=R({props:{autofocus:{default:!0,type:Boolean},placeholder:{default:()=>window.panel.$t("search")+" …",type:String},value:{type:String}}},(function(){var t=this;return(0,t._self._c)("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:t.autofocus,placeholder:t.placeholder,value:t.value,icon:"search",type:"text"},on:{input:function(e){return t.$emit("search",e)}}})}),[],!1,null,null,null,null).exports,et={props:{empty:{type:String,default:()=>window.panel.$t("dialog.text.empty")},text:{type:String}}};const nt=R({mixins:[et]},(function(){var t=this,e=t._self._c;return t.text?e("k-text",{attrs:{html:t.text}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports,st={install(t){t.component("k-dialog-body",z),t.component("k-dialog-buttons",J),t.component("k-dialog-fields",Z),t.component("k-dialog-footer",Q),t.component("k-dialog-notification",X),t.component("k-dialog-search",tt),t.component("k-dialog-text",nt)}},it={mixins:[W],props:{size:{default:"default",type:String},visible:{default:!1,type:Boolean}},methods:{cancel(){this.$panel.dialog.cancel()},close(){this.$panel.dialog.close()},error(t){this.$panel.dialog.error(t)},focus(t){this.$panel.dialog.focus(t)},hide(){this.$refs.dialog.hide()},input(t){this.$panel.dialog.input(t)},open(){this.$panel.dialog.open(this)},ready(){this.$panel.dialog.emit("ready")},show(){this.$refs.dialog.show()},submit(){this.$panel.dialog.submit(this.$panel.value)},success(t){this.$panel.dialog.success(t)}}};const ot=R({mixins:[it]},(function(){var t=this,e=t._self._c;return e("k-overlay",{ref:"dialog",attrs:{centered:!0,dimmed:!0,visible:t.visible,type:"dialog"},on:{cancel:t.cancel,ready:t.ready}},[e("form",{staticClass:"k-dialog",class:t.$vnode.data.staticClass,attrs:{"data-size":t.size,method:"dialog"},on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[e("k-dialog-notification"),e("k-dialog-body",[t._t("default")],2),t._t("footer",(function(){return[t.cancelButton||t.submitButton?e("k-dialog-footer",[e("k-dialog-buttons",{attrs:{"cancel-button":t.cancelButton,disabled:t.disabled,icon:t.icon,"submit-button":t.submitButton,theme:t.theme},on:{cancel:t.cancel,submit:t.submit}})],1):t._e()]}))],2)])}),[],!1,null,null,null,null).exports;const lt=R({mixins:[it],props:{details:[Object,Array],message:String,size:{default:"medium",type:String}},computed:{detailsList(){return Array.fromObject(this.details)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-error-dialog",attrs:{"cancel-button":!1,"submit-button":!1,size:t.size,visible:t.visible}},[e("k-text",[t._v(t._s(t.message))]),t.detailsList.length?e("dl",{staticClass:"k-error-details"},[t._l(t.detailsList,(function(n,s){return[e("dt",{key:"detail-label-"+s},[t._v(" "+t._s(n.label)+" ")]),e("dd",{key:"detail-message-"+s},["object"==typeof n.message?[e("ul",t._l(n.message,(function(n,s){return e("li",{key:s},[t._v(" "+t._s(n)+" ")])})),0)]:[t._v(" "+t._s(n.message)+" ")]],2)]}))],2):t._e()],1)}),[],!1,null,null,null,null).exports;const rt=R({},(function(){var t=this;return(0,t._self._c)(t.$panel.dialog.component,t._b({key:t.$panel.dialog.timestamp,ref:"dialog",tag:"component",attrs:{disabled:t.$panel.dialog.isLoading,visible:!0}},"component",t.$panel.dialog.props,!1))}),[],!1,null,null,null,null).exports,at=(t,e)=>{let n=null;return function(){clearTimeout(n),n=setTimeout((()=>t.apply(this,arguments)),e)}},ut={data:()=>({models:[],issue:null,selected:{},options:{endpoint:null,max:null,multiple:!0,parent:null,selected:[],search:!0},search:null,pagination:{limit:20,page:1,total:0}}),computed:{checkedIcon(){return!0===this.multiple?"check":"circle-filled"},collection(){return{empty:this.emptyProps,items:this.items,link:!1,layout:"list",pagination:{details:!0,dropdown:!1,align:"center",...this.pagination},sortable:!1}},items(){return this.models.map(this.item)},multiple(){return!0===this.options.multiple&&1!==this.options.max}},watch:{search(){this.updateSearch()}},created(){this.updateSearch=at(this.updateSearch,200)},methods:{async fetch(){const t={page:this.pagination.page,search:this.search,...this.fetchData||{}};try{const e=await this.$api.get(this.options.endpoint,t);this.models=e.data,this.pagination=e.pagination,this.onFetched&&this.onFetched(e)}catch(e){this.$panel.error(e,!1),this.models=[],this.issue=e.message}},async open(t,e){this.pagination.page=0,this.search=null;let n=!0;Array.isArray(t)?(this.models=t,n=!1):(this.models=[],e=t),this.options={...this.options,...e},this.selected={},this.options.selected.forEach((t=>{Vue.set(this.selected,t,{id:t})})),n&&await this.fetch(),this.$refs.dialog.open()},paginate(t){this.pagination.page=t.page,this.pagination.limit=t.limit,this.fetch()},submit(){this.$emit("submit",Object.values(this.selected)),this.$refs.dialog.close()},isSelected(t){return void 0!==this.selected[t.id]},item:t=>t,toggle(t){!1!==this.options.multiple&&1!==this.options.max||(this.selected={}),!0!==this.isSelected(t)?this.options.max&&this.options.max<=U(this.selected)||Vue.set(this.selected,t.id,t):this.$delete(this.selected,t.id)},toggleBtn(t){const e=this.isSelected(t);return{icon:e?this.checkedIcon:"circle-outline",tooltip:e?this.$t("remove"):this.$t("select"),theme:e?"positive":null}},updateSearch(){this.pagination.page=0,this.fetch()}}};const ct=R({mixins:[ut],computed:{emptyProps(){return{icon:"image",text:this.$t("dialog.files.empty")}}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-files-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[e("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.options.search?e("k-dialog-search",{attrs:{value:t.search},on:{search:function(e){t.search=e}}}):t._e(),e("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:n}){return[e("k-button",t._b({on:{click:function(e){return t.toggle(n)}}},"k-button",t.toggleBtn(n),!1))]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,null,null,null,null).exports;const dt=R({mixins:[it,G],props:{size:{default:"medium",type:String},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("save")},text:{type:String}},data(){return{model:this.value}},watch:{value(t){this.model=t}},methods:{input(t){this.model=t,this.$panel.dialog.input(t)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:t.cancel,submit:t.submit}},"k-dialog",t.$props,!1),[t._t("default",(function(){return[t.text?e("k-dialog-text",{attrs:{text:t.text}}):t._e(),e("k-dialog-fields",{attrs:{fields:t.fields,novalidate:t.novalidate,value:t.model},on:{input:t.input,submit:t.submit}})]}))],2)}),[],!1,null,null,null,null).exports;const pt=R({extends:dt,watch:{"model.name"(t){this.fields.code.disabled||this.onNameChanges(t)},"model.code"(t){this.fields.code.disabled||(this.model.code=this.$helper.slug(t,[this.$panel.system.ascii]),this.onCodeChanges(this.model.code))}},methods:{onCodeChanges(t){if(!t)return this.model.locale=null;if(t.length>=2)if(-1!==t.indexOf("-")){let e=t.split("-"),n=[e[0],e[1].toUpperCase()];this.model.locale=n.join("_")}else{let e=this.$panel.system.locales??[];this.model.locale=null==e?void 0:e[t]}},onNameChanges(t){this.model.code=this.$helper.slug(t,[this.model.rules,this.$panel.system.ascii]).substr(0,2)}}},null,null,!1,null,null,null,null).exports;const ht=R({mixins:[dt],props:{blueprints:{type:Array},size:{default:"medium",type:String},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("save")},template:{type:String}},data(){return{model:this.value}},computed:{templates(){return this.blueprints.map((t=>({text:t.title,value:t.name})))}},methods:{pick(t){this.$panel.dialog.reload({query:{...this.$panel.dialog.query,slug:this.value.slug,template:t,title:this.value.title}})}}},(function(){var t=this,e=t._self._c;return e("k-form-dialog",t._b({ref:"dialog",staticClass:"k-page-create-dialog",on:{cancel:t.cancel,submit:t.submit}},"k-form-dialog",t.$props,!1),[t.templates.length>1?e("k-select-field",{staticClass:"k-page-template-switch",attrs:{empty:!1,label:t.$t("template"),options:t.templates,required:!0,value:t.template},on:{input:function(e){return t.pick(e)}}}):t._e(),e("k-dialog-fields",{attrs:{fields:t.fields,novalidate:t.novalidate,value:t.value},on:{input:t.input,submit:t.submit}})],1)}),[],!1,null,null,null,null).exports;const mt=R({mixins:[it],methods:{select(t){this.$panel.dialog.input({parent:t.id})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-page-move-dialog",attrs:{"submit-button":{icon:"road-sign",text:t.$t("move")},size:"medium"}},"k-dialog",t.$props,!1),[e("k-headline",[t._v(t._s(t.$t("page.move")))]),e("div",{staticClass:"k-page-move-parent",attrs:{tabindex:"0","data-autofocus":""}},[e("k-page-tree",{attrs:{current:t.$panel.dialog.value.parent,identifier:"id"},on:{select:t.select}})],1)],1)}),[],!1,null,null,null,null).exports;const ft=R({mixins:[ut],data(){const t=ut.data();return{...t,model:{title:null,parent:null},options:{...t.options,parent:null}}},computed:{emptyProps(){return{icon:"page",text:this.$t("dialog.pages.empty")}},fetchData(){return{parent:this.options.parent}}},methods:{back(){this.options.parent=this.model.parent,this.pagination.page=1,this.fetch()},go(t){this.options.parent=t.id,this.pagination.page=1,this.fetch()},onFetched(t){this.model=t.model}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-pages-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[e("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.model?e("header",{staticClass:"k-pages-dialog-navbar"},[e("k-button",{attrs:{disabled:!t.model.id,tooltip:t.$t("back"),icon:"angle-left"},on:{click:t.back}}),e("k-headline",[t._v(t._s(t.model.title))])],1):t._e(),t.options.search?e("k-dialog-search",{attrs:{value:t.search},on:{search:function(e){t.search=e}}}):t._e(),e("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:n}){return[e("k-button",t._b({on:{click:function(e){return t.toggle(n)}}},"k-button",t.toggleBtn(n),!1)),t.model?e("k-button",{attrs:{disabled:!n.hasChildren,tooltip:t.$t("open"),icon:"angle-right"},on:{click:function(e){return e.stopPropagation(),t.go(n)}}}):t._e()]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,null,null,null,null).exports;const gt=R({mixins:[{mixins:[it,et]}]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:t.cancel,submit:t.submit}},"k-dialog",t.$props,!1),[t._t("default",(function(){return[e("k-dialog-text",{attrs:{text:t.text}})]}))],2)}),[],!1,null,null,null,null).exports;const kt=R({mixins:[gt],props:{icon:{default:"trash",type:String},submitButton:{default:()=>window.panel.$t("delete"),type:String},theme:{default:"negative",type:String}}},(function(){var t=this;return(0,t._self._c)("k-text-dialog",t._b({ref:"dialog",on:{cancel:t.cancel,submit:t.submit}},"k-text-dialog",t.$props,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const bt=R({mixins:[it],data(){return{isLoading:!1,items:[],pagination:{},q:null,selected:-1,type:this.$panel.view.search}},computed:{currentType(){return this.$panel.searches[this.type]??Object.values(this.$panel.searches)[0]}},watch:{type(){this.search(this.q)}},created(){this.search=at(this.search,250)},methods:{clear(){this.items=[],this.q=null},focus(){var t;null==(t=this.$refs.input)||t.focus()},navigate(t){t&&(this.$go(t.link),this.close())},onDown(){this.selected=0&&this.select(this.selected-1)},async search(t){var e,n;this.q=t,this.isLoading=!0,null==(e=this.$refs.types)||e.close(),null==(n=this.select)||n.call(this,-1);try{if(null===t||t.length<2)throw Error("Empty query");const e=await this.$search(this.type,t);this.items=e.results,this.pagination=e.pagination}catch(s){this.items=[],this.pagination={}}finally{this.isLoading=!1}},select(t){var e;this.selected=t;const n=(null==(e=this.$refs.items)?void 0:e.$el.querySelectorAll(".k-item"))??[];[...n].forEach((t=>delete t.dataset.selected)),t>=0&&(n[t].dataset.selected=!0)}}},(function(){var t,e=this,n=e._self._c;return n("k-overlay",{ref:"dialog",attrs:{dimmed:!0,visible:e.visible,type:"dialog"},on:{cancel:e.cancel,ready:e.ready}},[n("form",{staticClass:"k-search-dialog k-dialog",attrs:{"data-size":"medium",method:"dialog",role:"search"},on:{submit:function(t){return t.preventDefault(),e.submit.apply(null,arguments)}}},[n("div",{staticClass:"k-search-dialog-input"},[n("k-dropdown",{staticClass:"k-search-dialog-types"},[n("k-button",{attrs:{icon:e.currentType.icon,text:e.currentType.label},on:{click:function(t){return e.$refs.types.toggle()}}}),n("k-dropdown-content",{ref:"types"},e._l(e.$panel.searches,(function(t,s){return n("k-dropdown-item",{key:s,attrs:{icon:t.icon},on:{click:function(t){e.type=s,e.focus()}}},[e._v(" "+e._s(t.label)+" ")])})),1)],1),n("input",{ref:"input",attrs:{"aria-label":e.$t("search"),autofocus:!0,placeholder:e.$t("search")+" …",type:"text"},domProps:{value:e.q},on:{input:function(t){return e.search(t.target.value)},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),e.onDown.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),e.onUp.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"tab",9,t.key,"Tab")?null:(t.preventDefault(),e.onTab.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.onEnter.apply(null,arguments)},function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;e.clear(),e.close()}]}}),n("k-button",{staticClass:"k-search-dialog-close",attrs:{icon:e.isLoading?"loader":"cancel",tooltip:e.$t("close")},on:{click:e.close}})],1),(null==(t=e.q)?void 0:t.length)>1?n("div",{staticClass:"k-search-dialog-results"},[e.items.length?n("k-collection",{ref:"items",attrs:{items:e.items},nativeOn:{mouseout:function(t){return e.select(-1)}}}):e._e(),n("footer",{staticClass:"k-search-dialog-footer"},[e.items.length?e.items.length({icon:"upload",text:window.panel.$t("upload")})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-upload-dialog",attrs:{disabled:t.disabled||0===t.$panel.upload.files.length},on:{submit:t.submit}},"k-dialog",t.$props,!1),[e("k-dropzone",{on:{drop:function(e){return t.$panel.upload.select(e)}}},[0===t.$panel.upload.files.length?[e("k-empty",{attrs:{icon:"upload",layout:"cards"},on:{click:function(e){return t.$panel.upload.pick()}}},[t._v(" "+t._s(t.$t("files.empty"))+" ")])]:[e("ul",{staticClass:"k-upload-items"},t._l(t.$panel.upload.files,(function(n){return e("li",{key:n.id,staticClass:"k-upload-item",attrs:{"data-completed":n.completed}},[e("a",{staticClass:"k-upload-item-preview",attrs:{href:n.url,target:"_blank"}},[n.type.match("(jpg|jpeg|gif|png|webp|avif)")?e("k-image",{attrs:{cover:!0,src:n.url,back:"pattern"}}):e("k-aspect-ratio",{attrs:{ratio:"1/1"}},[e("k-icon",{attrs:{back:"pattern",type:"file"}})],1)],1),e("k-input",{staticClass:"k-upload-item-input",attrs:{disabled:n.completed,after:"."+n.extension,novalidate:!0,required:!0,type:"slug"},model:{value:n.name,callback:function(e){t.$set(n,"name",e)},expression:"file.name"}}),e("div",{staticClass:"k-upload-item-body"},[e("p",{staticClass:"k-upload-item-meta"},[t._v(" "+t._s(n.niceSize)+" "),n.progress?[t._v(" - "+t._s(n.progress)+"% ")]:t._e()],2),e("p",{staticClass:"k-upload-item-error"},[t._v(t._s(n.error))])]),e("div",{staticClass:"k-upload-item-progress"},[n.progress>0&&!n.error?e("k-progress",{attrs:{value:n.progress}}):t._e()],1),e("div",{staticClass:"k-upload-item-toggle"},[n.completed||n.progress?n.completed?e("k-button",{attrs:{icon:"check",theme:"positive"},on:{click:function(e){return t.$panel.upload.remove(n.id)}}}):e("div",[e("k-loader")],1):e("k-button",{attrs:{icon:"remove"},on:{click:function(e){return t.$panel.upload.remove(n.id)}}})],1)],1)})),0)]],2)],1)}),[],!1,null,null,null,null).exports;const yt=R({extends:vt,props:{original:Object,submitButton:{type:[String,Boolean,Object],default:()=>({icon:"upload",text:window.panel.$t("replace")})}}},(function(){var t,e=this,n=e._self._c;return n("k-dialog",e._b({ref:"dialog",staticClass:"k-upload-dialog k-upload-replace-dialog",on:{submit:e.submit}},"k-dialog",e.$props,!1),[n("ul",{staticClass:"k-upload-items"},[n("li",{staticClass:"k-upload-original"},[e.original.url.match("(jpg|jpeg|gif|png|webp|avif)")?n("k-image",{attrs:{cover:!0,src:e.original.url,back:"black"}}):n("k-aspect-ratio",{attrs:{ratio:"1/1"}},[n("k-icon",e._b({attrs:{back:"pattern",type:(null==(t=e.original.image)?void 0:t.icon)??"file"}},"k-icon",e.original.image,!1))],1)],1),n("li",[e._v("←")]),e._l(e.$panel.upload.files,(function(t){var s;return n("li",{key:t.id,staticClass:"k-upload-item",attrs:{"data-completed":t.completed}},[n("a",{staticClass:"k-upload-item-preview",attrs:{href:t.url,target:"_blank"}},[t.type.match("(jpg|jpeg|gif|png|webp|avif)")?n("k-image",{attrs:{cover:!0,src:t.url,back:"pattern"}}):n("k-aspect-ratio",{attrs:{ratio:"1/1"}},[n("k-icon",e._b({attrs:{back:"pattern",type:(null==(s=e.original.image)?void 0:s.icon)??"file"}},"k-icon",e.original.image,!1))],1)],1),n("k-input",{staticClass:"k-upload-item-input",attrs:{value:e.$helper.file.name(e.original.filename),disabled:!0,after:"."+t.extension,type:"text"}}),n("div",{staticClass:"k-upload-item-body"},[n("p",{staticClass:"k-upload-item-meta"},[e._v(" "+e._s(t.niceSize)+" "),t.progress?[e._v(" - "+e._s(t.progress)+"% ")]:e._e()],2),n("p",{staticClass:"k-upload-item-error"},[e._v(e._s(t.error))])]),n("div",{staticClass:"k-upload-item-progress"},[t.progress>0&&!t.error?n("k-progress",{attrs:{value:t.progress}}):e._e()],1),n("div",{staticClass:"k-upload-item-toggle"},[t.completed?n("k-button",{attrs:{icon:"check",theme:"positive"},on:{click:function(n){return e.$panel.upload.remove(t.id)}}}):t.progress?n("div",[n("k-loader")],1):e._e()],1)],1)}))],2)])}),[],!1,null,null,null,null).exports;const $t=R({mixins:[ut],computed:{emptyProps(){return{icon:"users",text:this.$t("dialog.users.empty")}}},methods:{item:t=>({...t,key:t.email,info:t.info!==t.text?t.info:null})}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-users-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[e("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.options.search?e("k-dialog-search",{attrs:{value:t.search},on:{search:function(e){t.search=e}}}):t._e(),e("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:n}){return[e("k-button",t._b({on:{click:function(e){return t.toggle(n)}}},"k-button",t.toggleBtn(n),!1))]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,null,null,null,null).exports,wt={install(t){t.use(st),t.component("k-dialog",ot),t.component("k-error-dialog",lt),t.component("k-fiber-dialog",rt),t.component("k-files-dialog",ct),t.component("k-form-dialog",dt),t.component("k-language-dialog",pt),t.component("k-page-create-dialog",ht),t.component("k-page-move-dialog",mt),t.component("k-pages-dialog",ft),t.component("k-remove-dialog",kt),t.component("k-search-dialog",bt),t.component("k-text-dialog",gt),t.component("k-upload-dialog",vt),t.component("k-upload-replace-dialog",yt),t.component("k-users-dialog",$t)}};const _t=R({},(function(){return(0,this._self._c)("div",{staticClass:"k-drawer-body scroll-y-auto"},[this._t("default")],2)}),[],!1,null,null,null,null).exports,xt={props:{empty:{type:String,default:()=>window.panel.$t("drawer.fields.empty")},fields:Object,novalidate:{type:Boolean,default:!0},value:Object}};const Ct=R({mixins:[xt],computed:{hasFields(){return this.$helper.object.length(this.fields)>0}}},(function(){var t=this,e=t._self._c;return t.hasFields?e("k-fieldset",{staticClass:"k-drawer-fields",attrs:{novalidate:t.novalidate,fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},invalid:function(e){return t.$emit("invalid",e)},submit:function(e){return t.$emit("submit",e)}}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports;const St=R({},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-drawer-header"},[t.$panel.drawer.breadcrumb.length<=1?e("h2",{staticClass:"k-drawer-title"},[e("k-icon",{attrs:{type:t.$panel.drawer.icon}}),t._v(" "+t._s(t.$panel.drawer.title)+" ")],1):e("ul",{staticClass:"k-drawer-breadcrumb"},t._l(t.$panel.drawer.breadcrumb,(function(n){return e("li",{key:n.id},[e("k-button",{attrs:{icon:n.icon,text:n.title},on:{click:function(e){return t.$panel.drawer.goTo(n.id)}}})],1)})),0),e("k-drawer-tabs",{attrs:{tab:t.$panel.drawer.tabId,tabs:t.$panel.drawer.tabs},on:{open:function(e){return t.$panel.drawer.openTab(e)}}}),e("nav",{staticClass:"k-drawer-options"},[t._t("default"),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"check",type:"submit"}})],2)],1)}),[],!1,null,null,null,null).exports;const Ot=R({},(function(){var t=this,e=t._self._c;return"drawer"===t.$panel.notification.context?e("k-notification",{staticClass:"k-drawer-notification"}):t._e()}),[],!1,null,null,null,null).exports;const At=R({mixins:[{props:{tab:{type:String},tabs:{default:()=>{},type:[Array,Object]}}}],computed:{hasTabs(){return this.$helper.object.length(this.tabs)>1}}},(function(){var t=this,e=t._self._c;return t.hasTabs?e("nav",{staticClass:"k-drawer-tabs"},t._l(t.tabs,(function(n){return e("k-button",{key:n.name,staticClass:"k-drawer-tab",attrs:{current:t.tab===n.name,text:n.label},on:{click:function(e){return t.$emit("open",n.name)}}})})),1):t._e()}),[],!1,null,null,null,null).exports,It={install(t){t.component("k-drawer-body",_t),t.component("k-drawer-fields",Ct),t.component("k-drawer-header",St),t.component("k-drawer-notification",Ot),t.component("k-drawer-tabs",At)}},Mt={props:{icon:String,id:String,options:{type:Array},tabs:{default:()=>{},type:[Array,Object]},title:String,visible:{default:!1,type:Boolean}},methods:{cancel(){this.$panel.drawer.cancel()},close(){this.$panel.drawer.close()},error(t){this.$panel.drawer.error(t)},focus(t){this.$panel.drawer.focus(t)},hide(){this.$refs.drawer.hide()},input(t){this.$panel.drawer.input(t)},open(){this.$panel.drawer.open(this)},ready(){this.$panel.drawer.emit("ready")},show(){this.$refs.drawer.show()},submit(){this.$panel.drawer.submit(this.$panel.value)},success(t){this.$panel.drawer.success(t)}}};const Tt=R({mixins:[Mt]},(function(){var t=this,e=t._self._c;return e("k-overlay",{ref:"drawer",attrs:{visible:t.visible,type:"drawer"},on:{cancel:t.cancel}},[e("form",{staticClass:"k-drawer",class:t.$vnode.data.staticClass,attrs:{method:"dialog"},on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[e("k-drawer-notification"),e("k-drawer-header",[t._t("options",(function(){return[t._l(t.options,(function(n,s){return[n.dropdown?[e("k-dropdown",{key:s},[e("k-button",t._b({staticClass:"k-drawer-option",on:{click:function(e){t.$refs["dropdown-"+s][0].toggle()}}},"k-button",n,!1)),e("k-dropdown-content",{ref:"dropdown-"+s,refInFor:!0,attrs:{options:n.dropdown,align:"right",theme:"light"}})],1)]:e("k-button",t._b({key:s,staticClass:"k-drawer-option"},"k-button",n,!1))]}))]}))],2),e("k-drawer-body",[t._t("default")],2)],1)])}),[],!1,null,null,null,null).exports;const jt=R({},(function(){var t=this;return(0,t._self._c)(t.$panel.drawer.component,t._b({key:t.$panel.drawer.timestamp,ref:"dialog",tag:"component",attrs:{disabled:t.$panel.drawer.isLoading,visible:!0}},"component",t.$panel.drawer.props,!1))}),[],!1,null,null,null,null).exports;const Et=R({mixins:[Mt,xt]},(function(){var t,e=this,n=e._self._c;return n("k-drawer",e._b({ref:"drawer",staticClass:"k-form-drawer",on:{cancel:e.cancel,submit:e.submit}},"k-drawer",e.$props,!1),[e._t("options",null,{slot:"options"}),n("k-drawer-fields",{attrs:{fields:null==(t=e.$panel.drawer.tab)?void 0:t.fields,value:e.value},on:{input:e.input,submit:e.submit}})],2)}),[],!1,null,null,null,null).exports,Lt={install(t){t.use(It),t.component("k-drawer",Tt),t.component("k-fiber-drawer",jt),t.component("k-form-drawer",Et)}};class Dt extends HTMLElement{connectedCallback(){this.style.display="block",this.textareas=this.querySelectorAll("textarea");for(const t of this.textareas)t.style.resize="none",t.style.overflowY="hidden",t.autosize=()=>{t.style.height=0,t.style.height=t.scrollHeight+"px"},t.addEventListener("input",(()=>t.autosize()));this.resizer=new ResizeObserver((()=>{this.textareas.forEach((t=>t.autosize()))})),this.resizer.observe(this)}disconnectedCallback(){this.resizer.unobserve(this)}}const Bt=R({props:{html:{type:Boolean,default:!1},limit:{type:Number,default:10},skip:{type:Array,default:()=>[]},options:Array,query:String},emits:["leave","search","select"],data:()=>({matches:[],selected:{text:null}}),methods:{close(){this.$refs.dropdown.close()},onSelect(t){this.$emit("select",t),this.$refs.dropdown.close()},search(t){if(t.length<1)return;const e=new RegExp(RegExp.escape(t),"ig");this.matches=this.options.filter((t=>!!t.text&&(-1===this.skip.indexOf(t.value)&&null!==t.text.match(e)))).slice(0,this.limit),this.$emit("search",t,this.matches),this.$refs.dropdown.open()}}},(function(){var t=this,e=t._self._c;return e("k-dropdown",{staticClass:"k-autocomplete"},[t._t("default"),e("k-dropdown-content",{ref:"dropdown",attrs:{autofocus:!0},on:{leave:function(e){return t.$emit("leave")}}},t._l(t.matches,(function(n,s){return e("k-dropdown-item",t._b({key:s,nativeOn:{mousedown:function(e){return t.onSelect(n)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:(e.preventDefault(),t.onSelect(n))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.onSelect(n))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:(e.preventDefault(),t.close.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)?null:(e.preventDefault(),t.close.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:(e.preventDefault(),t.close.apply(null,arguments))}]}},"k-dropdown-item",n,!1),[e("span",{domProps:{innerHTML:t._s(t.html?n.text:t.$esc(n.text))}})])})),1),t._v(" "+t._s(t.query)+" ")],2)}),[],!1,null,null,null,null).exports;const Pt=R({props:{disabled:Boolean,max:String,min:String,value:String},data(){return this.data(this.value)},computed:{numberOfDays(){return this.toDate().daysInMonth()},firstWeekday(){const t=this.toDate().day();return t>0?t:7},weekdays(){return["mon","tue","wed","thu","fri","sat","sun"].map((t=>this.$t("days."+t)))},weeks(){const t=this.firstWeekday-1;return Math.ceil((this.numberOfDays+t)/7)},monthnames(){return["january","february","march","april","may","june","july","august","september","october","november","december"].map((t=>this.$t("months."+t)))},months(){var t=[];return this.monthnames.forEach(((e,n)=>{const s=this.toDate(1,n);t.push({value:n,text:e,disabled:s.isBefore(this.current.min,"month")||s.isAfter(this.current.max,"month")})})),t},years(){var t,e;const n=(null==(t=this.current.min)?void 0:t.get("year"))??this.current.year-20,s=(null==(e=this.current.max)?void 0:e.get("year"))??this.current.year+20;return this.toOptions(n,s)}},watch:{value(t){const e=this.data(t);this.dt=e.dt,this.current=e.current}},methods:{data(t){const e=this.$library.dayjs.iso(t),n=this.$library.dayjs();return{dt:e,current:{month:(e??n).month(),year:(e??n).year(),min:this.$library.dayjs.iso(this.min),max:this.$library.dayjs.iso(this.max)}}},days(t){let e=[];const n=7*(t-1)+1,s=n+7;for(let i=n;ithis.numberOfDays;e.push(n?"":t)}return e},isDisabled(t){const e=this.toDate(t);return this.disabled||e.isBefore(this.current.min,"day")||e.isAfter(this.current.max,"day")},isSelected(t){return this.toDate(t).isSame(this.dt,"day")},isToday(t){const e=this.$library.dayjs();return this.toDate(t).isSame(e,"day")},onInput(){var t;this.$emit("input",(null==(t=this.dt)?void 0:t.toISO("date"))||null)},onNext(){const t=this.toDate().add(1,"month");this.show(t)},onPrev(){const t=this.toDate().subtract(1,"month");this.show(t)},select(t){const e="today"===t?this.$library.dayjs().merge(this.toDate(),"time"):this.toDate(t);this.dt=e,this.show(e),this.onInput()},show(t){this.current.year=t.year(),this.current.month=t.month()},toDate(t=1,e=this.current.month){return this.$library.dayjs(`${this.current.year}-${e+1}-${t}`)},toOptions(t,e){for(var n=[],s=t;s<=e;s++)n.push({value:s,text:this.$helper.pad(s)});return n}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-calendar-input"},[e("nav",[e("k-button",{attrs:{icon:"angle-left"},on:{click:t.onPrev}}),e("span",{staticClass:"k-calendar-selects"},[e("k-select-input",{attrs:{options:t.months,disabled:t.disabled,required:!0,value:t.current.month},on:{input:function(e){t.current.month=Number(e)}}}),e("k-select-input",{attrs:{options:t.years,disabled:t.disabled,required:!0,value:t.current.year},on:{input:function(e){t.current.year=Number(e)}}})],1),e("k-button",{attrs:{icon:"angle-right"},on:{click:t.onNext}})],1),e("table",{staticClass:"k-calendar-table"},[e("thead",[e("tr",t._l(t.weekdays,(function(n){return e("th",{key:"weekday_"+n},[t._v(" "+t._s(n)+" ")])})),0)]),e("tbody",t._l(t.weeks,(function(n){return e("tr",{key:"week_"+n},t._l(t.days(n),(function(n,s){return e("td",{key:"day_"+s,staticClass:"k-calendar-day",attrs:{"aria-current":!!t.isToday(n)&&"date","aria-selected":!!t.isSelected(n)&&"date"}},[n?e("k-button",{attrs:{disabled:t.isDisabled(n),text:n},on:{click:function(e){return t.select(n)}}}):t._e()],1)})),0)})),0),e("tfoot",[e("tr",[e("td",{staticClass:"k-calendar-today",attrs:{colspan:"7"}},[e("k-button",{attrs:{text:t.$t("today")},on:{click:function(e){return t.select("today")}}})],1)])])])])}),[],!1,null,null,null,null).exports;const Ft=R({props:{count:Number,min:Number,max:Number,required:{type:Boolean,default:!1}},computed:{valid(){return!1===this.required&&0===this.count||(!0!==this.required||0!==this.count)&&(!(this.min&&this.countthis.max))}}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-counter",attrs:{"data-invalid":!t.valid}},[e("span",[t._v(t._s(t.count))]),t.min&&t.max?e("span",{staticClass:"k-counter-rules"},[t._v("("+t._s(t.min)+"–"+t._s(t.max)+")")]):t.min?e("span",{staticClass:"k-counter-rules"},[t._v("≥ "+t._s(t.min))]):t.max?e("span",{staticClass:"k-counter-rules"},[t._v("≤ "+t._s(t.max))]):t._e()])}),[],!1,null,null,null,null).exports;const Nt=R({props:{disabled:Boolean,config:Object,fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},emits:["input","submit"],data:()=>({errors:{}}),methods:{focus(t){var e,n;null==(n=null==(e=this.$refs.fields)?void 0:e.focus)||n.call(e,t)},onFocus(t,e,n){this.$emit("focus",t,e,n)},onInput(t,e,n){this.$emit("input",t,e,n)},onInvalid(t){this.$emit("invalid",t)},onSubmit(){this.$emit("submit",this.value)},submit(){this.$refs.submitter.click()}}},(function(){var t=this,e=t._self._c;return e("form",{ref:"form",staticClass:"k-form",attrs:{method:"POST",autocomplete:"off",novalidate:""},on:{submit:function(e){return e.preventDefault(),t.onSubmit.apply(null,arguments)}}},[t._t("header"),t._t("default",(function(){return[e("k-fieldset",{ref:"fields",attrs:{disabled:t.disabled,fields:t.fields,novalidate:t.novalidate,value:t.value},on:{focus:t.onFocus,input:t.onInput,invalid:t.onInvalid,submit:t.onSubmit}})]})),t._t("footer"),e("input",{ref:"submitter",staticClass:"k-form-submitter",attrs:{type:"submit"}})],2)}),[],!1,null,null,null,null).exports;const qt=R({props:{lock:[Boolean,Object]},data:()=>({isRefreshing:null,isLocking:null}),computed:{api(){return[this.$panel.view.path+"/lock",null,null,!0]},hasChanges(){return this.$store.getters["content/hasChanges"]()},isDisabled(){return!1===this.$store.state.content.status.enabled},isLocked(){return"lock"===this.lockState},isUnlocked(){return"unlock"===this.lockState},mode(){return null!==this.lockState?this.lockState:!0===this.hasChanges?"changes":null},lockState(){return this.supportsLocking&&this.lock?this.lock.state:null},supportsLocking(){return!1!==this.lock},theme(){return"lock"===this.mode?"negative":"unlock"===this.mode?"info":"notice"}},watch:{hasChanges:{handler(t,e){!0===this.supportsLocking&&!1===this.isLocked&&!1===this.isUnlocked&&(!0===t?(this.onLock(),this.isLocking=setInterval(this.onLock,3e4)):e&&(clearInterval(this.isLocking),this.onLock(!1)))},immediate:!0},isLocked(t){!1===t&&this.$events.$emit("model.reload")}},created(){this.supportsLocking&&(this.isRefreshing=setInterval(this.check,1e4)),this.$events.$on("view.save",this.onSave)},destroyed(){clearInterval(this.isRefreshing),clearInterval(this.isLocking),this.$events.$off("view.save",this.onSave)},methods:{async check(){const{lock:t}=await this.$api.get(...this.api);Vue.set(this.$panel.view.props,"lock",t)},async onLock(t=!0){if(!0===t)try{await this.$api.patch(...this.api)}catch(e){clearInterval(this.isLocking),this.$store.dispatch("content/revert")}else clearInterval(this.isLocking),await this.$api.delete(...this.api)},onDownload(){let t="";const e=this.$store.getters["content/changes"]();Object.keys(e).forEach((n=>{t+=n+": \n\n"+e[n],t+="\n\n----\n\n"}));let n=document.createElement("a");n.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),n.setAttribute("download",this.$panel.view.path+".txt"),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)},async onResolve(){await this.onUnlock(!1),this.$store.dispatch("content/revert")},onRevert(){this.$refs.revert.open()},async onSave(t){var e;null==(e=t.preventDefault)||e.call(t),await this.$store.dispatch("content/save"),this.$events.$emit("model.update"),this.$panel.notification.success()},async onUnlock(t=!0){const e=[this.$panel.view.path+"/unlock",null,null,!0];!0===t?await this.$api.patch(...e):await this.$api.delete(...e),this.$reload({silent:!0})},revert(){this.$store.dispatch("content/revert"),this.$refs.revert.close()}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-form-buttons",attrs:{"data-theme":t.theme}},["unlock"===t.mode?e("k-view",[e("p",{staticClass:"k-form-lock-info"},[t._v(" "+t._s(t.$t("lock.isUnlocked"))+" ")]),e("span",{staticClass:"k-form-lock-buttons"},[e("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("download"),icon:"download"},on:{click:t.onDownload}}),e("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("confirm"),icon:"check"},on:{click:t.onResolve}})],1)]):"lock"===t.mode?e("k-view",[e("p",{staticClass:"k-form-lock-info"},[e("k-icon",{attrs:{type:"lock"}}),e("span",{domProps:{innerHTML:t._s(t.$t("lock.isLocked",{email:t.$esc(t.lock.data.email)}))}})],1),t.lock.data.unlockable?e("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("lock.unlock"),icon:"unlock"},on:{click:function(e){return t.onUnlock()}}}):e("k-icon",{staticClass:"k-form-lock-loader",attrs:{type:"loader"}})],1):"changes"===t.mode?e("k-view",[e("k-button",{staticClass:"k-form-button",attrs:{disabled:t.isDisabled,text:t.$t("revert"),icon:"undo"},on:{click:t.onRevert}}),e("k-button",{staticClass:"k-form-button",attrs:{disabled:t.isDisabled,text:t.$t("save"),icon:"check"},on:{click:t.onSave}})],1):t._e(),e("k-dialog",{ref:"revert",attrs:{"submit-button":t.$t("revert"),icon:"undo",theme:"negative"},on:{submit:t.revert}},[e("k-text",{attrs:{html:t.$t("revert.confirm")}})],1)],1)}),[],!1,null,null,null,null).exports;const Rt=R({data:()=>({isOpen:!1,options:[]}),computed:{hasChanges(){return this.ids.length>0},ids(){return Object.keys(this.store).filter((t=>{var e;return this.$helper.object.length(null==(e=this.store[t])?void 0:e.changes)>0}))},store(){return this.$store.state.content.models}},methods:{async toggle(){if(!1===this.$refs.list.isOpen)try{await this.$dropdown("changes",{method:"POST",body:{ids:this.ids}})((t=>{this.options=t}))}catch(t){return this.$panel.notification.success(this.$t("lock.unsaved.empty")),this.$store.dispatch("content/clear"),!1}this.$refs.list&&this.$refs.list.toggle()}}},(function(){var t=this,e=t._self._c;return t.hasChanges?e("k-dropdown",{staticClass:"k-form-indicator"},[e("k-button",{staticClass:"k-form-indicator-toggle k-topbar-button",attrs:{icon:"edit"},on:{click:t.toggle}}),e("k-dropdown-content",{ref:"list",attrs:{align:"right",theme:"light"}},[e("p",{staticClass:"k-form-indicator-info"},[t._v(t._s(t.$t("lock.unsaved"))+":")]),e("hr"),t._l(t.options,(function(n){return e("k-dropdown-item",t._b({key:n.id},"k-dropdown-item",n,!1),[t._v(" "+t._s(n.text)+" ")])}))],2)],1):t._e()}),[],!1,null,null,null,null).exports,zt={props:{after:String}},Yt={props:{autofocus:Boolean}},Ht={props:{before:String}},Ut={props:{disabled:Boolean}},Vt={props:{help:String}},Kt={props:{id:{type:[Number,String],default(){return this._uid}}}},Wt={props:{invalid:Boolean}},Jt={props:{label:String}},Gt={props:{name:[Number,String]}},Zt={props:{required:Boolean}},Qt={mixins:[Ut,Vt,Jt,Gt,Zt],props:{counter:[Boolean,Object],endpoints:Object,input:[String,Number],translate:Boolean,type:String}};const Xt=R({mixins:[Qt],inheritAttrs:!1,computed:{labelText(){return this.label||" "}}},(function(){var t=this,e=t._self._c;return e("div",{class:"k-field k-field-name-"+t.name,attrs:{"data-disabled":t.disabled,"data-translate":t.translate},on:{focusin:function(e){return t.$emit("focus",e)},focusout:function(e){return t.$emit("blur",e)}}},[t._t("header",(function(){return[e("header",{staticClass:"k-field-header"},[t._t("label",(function(){return[e("label",{staticClass:"k-field-label",attrs:{for:t.input}},[t._v(" "+t._s(t.labelText)+" "),t.required?e("abbr",{attrs:{title:t.$t("field.required")}},[t._v("*")]):t._e()])]})),t._t("options"),t._t("counter",(function(){return[t.counter?e("k-counter",t._b({staticClass:"k-field-counter",attrs:{required:t.required}},"k-counter",t.counter,!1)):t._e()]}))],2)]})),t._t("default"),t._t("footer",(function(){return[t.help||t.$slots.help?e("footer",{staticClass:"k-field-footer"},[t._t("help",(function(){return[t.help?e("k-text",{staticClass:"k-field-help",attrs:{theme:"help",html:t.help}}):t._e()]}))],2):t._e()]}))],2)}),[],!1,null,null,null,null).exports;const te=R({props:{config:Object,disabled:Boolean,fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},emits:["focus","input","invalid","submit"],data(){return{values:this.value,errors:{}}},watch:{value(t){this.values=t}},methods:{focus(t){if(t)return void(this.hasField(t)&&"function"==typeof this.$refs[t][0].focus&&this.$refs[t][0].focus());const e=Object.keys(this.$refs)[0];this.focus(e)},hasFieldType(t){return this.$helper.isComponent(`k-${t}-field`)},hasField(t){var e;return null==(e=this.$refs[t])?void 0:e[0]},onInvalid(t,e,n,s){this.errors[s]=e,this.$emit("invalid",this.errors)},onInput(t,e,n){this.values={...this.value,[n]:t},this.$emit("input",this.values,e,n)},hasErrors(){return this.$helper.object.length(this.errors)>0}}},(function(){var t=this,e=t._self._c;return e("fieldset",{staticClass:"k-fieldset"},[e("k-grid",[t._l(t.fields,(function(n,s){return[t.$helper.field.isVisible(n,t.value)?e("k-column",{key:n.signature,attrs:{width:n.width}},[e("k-error-boundary",[t.hasFieldType(n.type)?e("k-"+n.type+"-field",t._b({ref:s,refInFor:!0,tag:"component",attrs:{disabled:t.disabled||n.disabled,"form-data":t.value,name:s,novalidate:t.novalidate,value:t.values[s]},on:{input:function(e){return t.onInput(e,n,s)},focus:function(e){return t.$emit("focus",e,n,s)},invalid:(e,i)=>t.onInvalid(e,i,n,s),submit:function(e){return t.$emit("submit",e,n,s)}}},"component",n,!1)):e("k-box",{attrs:{theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[t._v(" "+t._s(t.$t("error.field.type.missing",{name:s,type:n.type}))+" ")])],1)],1)],1):t._e()]}))],2)],1)}),[],!1,null,null,null,null).exports,ee={mixins:[zt,Ht,Ut,Wt],props:{autofocus:Boolean,type:String,icon:[String,Boolean],theme:String,novalidate:{type:Boolean,default:!1},value:{type:[String,Boolean,Number,Object,Array],default:null}}};const ne=R({mixins:[ee],inheritAttrs:!1,data(){return{isInvalid:this.invalid,listeners:{...this.$listeners,invalid:(t,e)=>{this.isInvalid=t,this.$emit("invalid",t,e)}}}},computed:{inputProps(){return{...this.$props,...this.$attrs}}},watch:{invalid(){this.isInvalid=this.invalid}},methods:{blur(t){(null==t?void 0:t.relatedTarget)&&!1===this.$el.contains(t.relatedTarget)&&this.trigger(null,"blur")},focus(t){this.trigger(t,"focus")},select(t){this.trigger(t,"select")},trigger(t,e){var n,s,i;if("INPUT"===(null==(n=null==t?void 0:t.target)?void 0:n.tagName)&&"function"==typeof(null==(s=null==t?void 0:t.target)?void 0:s[e]))return void t.target[e]();if("function"==typeof(null==(i=this.$refs.input)?void 0:i[e]))return void this.$refs.input[e]();const o=this.$el.querySelector("input, select, textarea");"function"==typeof(null==o?void 0:o[e])&&o[e]()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-input",attrs:{"data-disabled":t.disabled,"data-invalid":!t.novalidate&&t.isInvalid,"data-theme":t.theme,"data-type":t.type}},[t.$slots.before||t.before?e("span",{staticClass:"k-input-before",on:{click:t.focus}},[t._t("before",(function(){return[t._v(t._s(t.before))]}))],2):t._e(),e("span",{staticClass:"k-input-element",on:{click:function(e){return e.stopPropagation(),t.focus.apply(null,arguments)}}},[t._t("default",(function(){return[e("k-"+t.type+"-input",t._g(t._b({ref:"input",tag:"component",attrs:{value:t.value}},"component",t.inputProps,!1),t.listeners))]}))],2),t.$slots.after||t.after?e("span",{staticClass:"k-input-after",on:{click:t.focus}},[t._t("after",(function(){return[t._v(t._s(t.after))]}))],2):t._e(),t.$slots.icon||t.icon?e("span",{staticClass:"k-input-icon",on:{click:t.focus}},[t._t("icon",(function(){return[e("k-icon",{attrs:{type:t.icon}})]}))],2):t._e()])}),[],!1,null,null,null,null).exports;const se=R({props:{methods:Array},data:()=>({currentForm:null,isLoading:!1,user:{email:"",password:"",remember:!1}}),computed:{canToggle(){return null!==this.codeMode&&!0===this.methods.includes("password")&&(!0===this.methods.includes("password-reset")||!0===this.methods.includes("code"))},codeMode(){return!0===this.methods.includes("password-reset")?"password-reset":!0===this.methods.includes("code")?"code":null},fields(){let t={email:{autofocus:!0,label:this.$t("email"),type:"email",required:!0,link:!1}};return"email-password"===this.form&&(t.password={label:this.$t("password"),type:"password",minLength:8,required:!0,autocomplete:"current-password",counter:!1}),t},form(){return this.currentForm?this.currentForm:"password"===this.methods[0]?"email-password":"email"},isResetForm(){return"password-reset"===this.codeMode&&"email"===this.form},toggleText(){return this.$t("login.toggleText."+this.codeMode+"."+this.formOpposite(this.form))}},methods:{formOpposite:t=>"email-password"===t?"email":"email-password",async login(){this.$emit("error",null),this.isLoading=!0;let t=Object.assign({},this.user);"email"===this.currentForm&&(t.password=null),!0===this.isResetForm&&(t.remember=!1);try{await this.$api.auth.login(t),this.$reload({globals:["$system","$translation"]})}catch(e){this.$emit("error",e)}finally{this.isLoading=!1}},toggleForm(){this.currentForm=this.formOpposite(this.form),this.$refs.fieldset.focus("email")}}},(function(){var t=this,e=t._self._c;return e("form",{staticClass:"k-login-form",on:{submit:function(e){return e.preventDefault(),t.login.apply(null,arguments)}}},[e("div",{staticClass:"k-login-fields"},[!0===t.canToggle?e("button",{staticClass:"k-login-toggler",attrs:{type:"button"},on:{click:t.toggleForm}},[t._v(" "+t._s(t.toggleText)+" ")]):t._e(),e("k-fieldset",{ref:"fieldset",attrs:{novalidate:!0,fields:t.fields,value:t.user},on:{input:function(e){t.user=e}}})],1),e("div",{staticClass:"k-login-buttons"},[!1===t.isResetForm?e("span",{staticClass:"k-login-checkbox"},[e("k-checkbox-input",{attrs:{value:t.user.remember,label:t.$t("login.remember")},on:{input:function(e){t.user.remember=e}}})],1):t._e(),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("login"+(t.isResetForm?".reset":"")))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)],1)])}),[],!1,null,null,null,null).exports;const ie=R({props:{methods:Array,pending:Object},data:()=>({code:"",isLoadingBack:!1,isLoadingLogin:!1}),computed:{mode(){return!0===this.methods.includes("password-reset")?"password-reset":"login"}},methods:{async back(){this.isLoadingBack=!0,this.$go("/logout")},async login(){this.$emit("error",null),this.isLoadingLogin=!0;try{await this.$api.auth.verifyCode(this.code),this.$panel.notification.success(this.$t("welcome")),"password-reset"===this.mode?this.$go("reset-password"):this.$reload()}catch(t){this.$emit("error",t)}finally{this.isLoadingLogin=!1}}}},(function(){var t=this,e=t._self._c;return e("form",{staticClass:"k-login-form k-login-code-form",on:{submit:function(e){return e.preventDefault(),t.login.apply(null,arguments)}}},[e("k-user-info",{attrs:{user:t.pending.email}}),e("k-text-field",{attrs:{autofocus:!0,counter:!1,help:t.$t("login.code.text."+t.pending.challenge),label:t.$t("login.code.label."+t.mode),novalidate:!0,placeholder:t.$t("login.code.placeholder."+t.pending.challenge),required:!0,value:t.code,autocomplete:"one-time-code",icon:"unlock",name:"code"},on:{input:function(e){t.code=e}}}),e("div",{staticClass:"k-login-buttons"},[e("k-button",{staticClass:"k-login-button k-login-back-button",attrs:{icon:"angle-left"},on:{click:t.back}},[t._v(" "+t._s(t.$t("back"))+" "),t.isLoadingBack?[t._v(" … ")]:t._e()],2),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("login"+("password-reset"===t.mode?".reset":"")))+" "),t.isLoadingLogin?[t._v(" … ")]:t._e()],2)],1)],1)}),[],!1,null,null,null,null).exports;const oe=R({props:{display:{type:String,default:"HH:mm"},value:String},computed:{day(){return this.formatTimes([6,7,8,9,10,11,"-",12,13,14,15,16,17])},night(){return this.formatTimes([18,19,20,21,22,23,"-",0,1,2,3,4,5])}},methods:{formatTimes(t){return t.map((t=>{if("-"===t)return t;const e=this.$library.dayjs(t+":00","H:mm");return{display:e.format(this.display),select:e.toISO("time")}}))},select(t){this.$emit("input",t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-times"},[e("div",{staticClass:"k-times-slot"},[e("k-icon",{attrs:{type:"sun"}}),e("ul",t._l(t.day,(function(n){return e("li",{key:n.select},["-"===n?e("hr"):e("k-button",{on:{click:function(e){return t.select(n.select)}}},[t._v(t._s(n.display))])],1)})),0)],1),e("div",{staticClass:"k-times-slot"},[e("k-icon",{attrs:{type:"moon"}}),e("ul",t._l(t.night,(function(n){return e("li",{key:n.select},["-"===n?e("hr"):e("k-button",{on:{click:function(e){return t.select(n.select)}}},[t._v(t._s(n.display))])],1)})),0)],1)])}),[],!1,null,null,null,null).exports;const le=R({props:{accept:{type:String,default:"*"},attributes:{type:Object},max:{type:Number},method:{type:String,default:"POST"},multiple:{type:Boolean,default:!0},url:{type:String}},methods:{open(t){this.$panel.upload.pick(this.params(t))},params(t){return{...this.$props,...t||{},on:{complete:(t,e)=>{this.$emit("success",t,e)}}}},select(t){this.$panel.upload.select(t.target.files)},drop(t,e){this.$panel.upload.open(t,this.params(e))},render(){},upload(t,e){this.$panel.upload.select(t,this.params(e)),this.$panel.upload.start()}}},null,null,!1,null,null,null,null).exports;const re=R({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-login-alert",on:{click:function(e){return t.$emit("click")}}},[e("span",[t._t("default")],2),e("k-icon",{attrs:{type:"alert"}})],1)}),[],!1,null,null,null,null).exports;const ae=R({props:{fields:Object,index:[Number,String],total:Number,value:Object},mounted(){this.$store.dispatch("content/disable"),this.$events.$on("keydown.cmd.s",this.onSubmit),this.$events.$on("keydown.esc",this.onDiscard)},destroyed(){this.$events.$off("keydown.cmd.s",this.onSubmit),this.$events.$off("keydown.esc",this.onDiscard),this.$store.dispatch("content/enable")},methods:{focus(t){this.$refs.form.focus(t)},onDiscard(){this.$emit("discard")},onInput(t){this.$emit("input",t)},onSubmit(){this.$emit("submit")}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-structure-form"},[e("div",{staticClass:"k-structure-backdrop",on:{click:t.onDiscard}}),e("section",[e("k-form",{ref:"form",staticClass:"k-structure-form-fields",attrs:{value:t.value,fields:t.fields},on:{input:t.onInput,submit:t.onSubmit}}),e("footer",{staticClass:"k-structure-form-buttons"},[e("k-button",{staticClass:"k-structure-form-cancel-button",attrs:{text:t.$t("cancel"),icon:"cancel"},on:{click:function(e){return t.$emit("close")}}}),"new"!==t.index?e("k-pagination",{attrs:{dropdown:!1,total:t.total,limit:1,page:t.index+1,details:!0},on:{paginate:function(e){return t.$emit("paginate",e)}}}):t._e(),e("k-button",{staticClass:"k-structure-form-submit-button",attrs:{text:t.$t("new"!==t.index?"confirm":"add"),icon:"check"},on:{click:t.onSubmit}})],1)],1)])}),[],!1,null,null,null,null).exports,ue=function(t){this.command("insert",((e,n)=>{let s=[];return n.split("\n").forEach(((e,n)=>{let i="ol"===t?n+1+".":"-";s.push(i+" "+e)})),s.join("\n")}))};const ce=R({layout:["headlines","bold","italic","|","link","email","file","|","code","ul","ol"],props:{buttons:{type:[Boolean,Array],default:!0},uploads:[Boolean,Object,Array]},data(){let t={},e={},n=[],s=this.commands();if(!1===this.buttons)return t;Array.isArray(this.buttons)&&(n=this.buttons),!0!==Array.isArray(this.buttons)&&(n=this.$options.layout),n.forEach(((n,i)=>{if("|"===n)t["divider-"+i]={divider:!0};else if(s[n]){let i=s[n];t[n]=i,i.shortcut&&(e[i.shortcut]=n)}}));const i=window.panel.plugins.textareaButtons??{};return!0===this.buttons&&this.$helper.object.length(i)>0&&(t["divider-custom-buttons"]={divider:!0}),Object.keys(i).forEach((n=>{const s=i[n];s.label&&s.icon&&(s.command||s.dropdown)&&(t[n]=s,s.shortcut&&(e[s.shortcut]=n))})),{layout:t,shortcuts:e}},methods:{command(t,e){"function"==typeof t?t.apply(this):this.$emit("command",t,e)},close(){for(const t in this.$refs){const e=this.$refs[t][0];"function"==typeof(null==e?void 0:e.close)&&e.close()}},fileCommandSetup(){let t={label:this.$t("toolbar.button.file"),icon:"attachment"};return!1===this.uploads?t.command="selectFile":t.dropdown={select:{label:this.$t("toolbar.button.file.select"),icon:"check",command:"selectFile"},upload:{label:this.$t("toolbar.button.file.upload"),icon:"upload",command:"uploadFile"}},t},commands(){return{headlines:{label:this.$t("toolbar.button.headings"),icon:"title",dropdown:{h1:{label:this.$t("toolbar.button.heading.1"),icon:"h1",command:"prepend",args:"#"},h2:{label:this.$t("toolbar.button.heading.2"),icon:"h2",command:"prepend",args:"##"},h3:{label:this.$t("toolbar.button.heading.3"),icon:"h3",command:"prepend",args:"###"}}},bold:{label:this.$t("toolbar.button.bold"),icon:"bold",command:"wrap",args:"**",shortcut:"b"},italic:{label:this.$t("toolbar.button.italic"),icon:"italic",command:"wrap",args:"*",shortcut:"i"},link:{label:this.$t("toolbar.button.link"),icon:"url",shortcut:"k",command:"dialog",args:"link"},email:{label:this.$t("toolbar.button.email"),icon:"email",shortcut:"e",command:"dialog",args:"email"},file:this.fileCommandSetup(),code:{label:this.$t("toolbar.button.code"),icon:"code",command:"wrap",args:"`"},ul:{label:this.$t("toolbar.button.ul"),icon:"list-bullet",command:()=>ue.apply(this,["ul"])},ol:{label:this.$t("toolbar.button.ol"),icon:"list-numbers",command:()=>ue.apply(this,["ol"])}}},shortcut(t,e){if(this.shortcuts[t]){const n=this.layout[this.shortcuts[t]];if(!n)return!1;e.preventDefault(),this.command(n.command,n.args)}}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-toolbar"},[t._l(t.layout,(function(n,s){return[n.divider?e("div",{key:s+"-divider",staticClass:"k-toolbar-divider"}):n.dropdown?e("k-dropdown",{key:s+"-dropdown"},[e("k-button",{key:s,staticClass:"k-toolbar-button",attrs:{icon:n.icon,tooltip:n.label,tabindex:"-1"},on:{click:function(e){t.$refs[s+"-dropdown"][0].toggle()}}}),e("k-dropdown-content",{ref:s+"-dropdown",refInFor:!0},t._l(n.dropdown,(function(n,s){return e("k-dropdown-item",{key:s,attrs:{icon:n.icon},on:{click:function(e){return t.command(n.command,n.args)}}},[t._v(" "+t._s(n.label)+" ")])})),1)],1):e("k-button",{key:s+"-button",staticClass:"k-toolbar-button",attrs:{icon:n.icon,tooltip:n.label,tabindex:"-1"},on:{click:function(e){return t.command(n.command,n.args)}}})]}))],2)}),[],!1,null,null,null,null).exports;const de=R({data(){return{value:{email:null,text:null},fields:{email:{label:this.$t("email"),type:"email"},text:{label:this.$t("link.text"),type:"text"}}}},computed:{kirbytext(){return this.$panel.config.kirbytext}},methods:{open(t,e){this.value.text=e,this.$refs.dialog.open()},cancel(){this.$emit("cancel")},createKirbytext(){var t;const e=this.value.email||"";return(null==(t=this.value.text)?void 0:t.length)>0?`(email: ${e} text: ${this.value.text})`:`(email: ${e})`},createMarkdown(){var t;const e=this.value.email||"";return(null==(t=this.value.text)?void 0:t.length)>0?`[${this.value.text}](mailto:${e})`:`<${e}>`},submit(){this.$emit("submit",this.kirbytext?this.createKirbytext():this.createMarkdown()),this.value={email:null,text:null},this.$refs.dialog.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",attrs:{"submit-button":t.$t("insert")},on:{close:t.cancel,submit:function(e){return t.$refs.form.submit()}}},[e("k-form",{ref:"form",attrs:{fields:t.fields,value:t.value},on:{input:function(e){t.value=e},submit:t.submit}})],1)}),[],!1,null,null,null,null).exports;const pe=R({data(){return{value:{url:null,text:null},fields:{url:{label:this.$t("link"),type:"link",placeholder:this.$t("url.placeholder"),icon:"url"},text:{label:this.$t("link.text"),type:"text"}}}},computed:{kirbytext(){return this.$panel.config.kirbytext}},methods:{open(t,e){this.value.text=e,this.$refs.dialog.open()},cancel(){this.$emit("cancel")},createKirbytext(){return this.value.text.length>0?`(link: ${this.value.url} text: ${this.value.text})`:`(link: ${this.value.url})`},createMarkdown(){return this.value.text.length>0?`[${this.value.text}](${this.value.url})`:`<${this.value.url}>`},submit(){this.$emit("submit",this.kirbytext?this.createKirbytext():this.createMarkdown()),this.value={url:null,text:null},this.$refs.dialog.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",attrs:{size:"medium","submit-button":t.$t("insert")},on:{close:t.cancel,submit:function(e){return t.$refs.form.submit()}}},[e("k-form",{ref:"form",attrs:{fields:t.fields,value:t.value},on:{input:function(e){t.value=e},submit:t.submit}})],1)}),[],!1,null,null,null,null).exports;const he=R({computed:{placeholder(){return this.field("code",{}).placeholder},languages(){return this.field("language",{options:[]}).options}},methods:{focus(){this.$refs.code.focus()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-code k-block-type-code-editor"},[e("k-input",{ref:"code",attrs:{buttons:!1,placeholder:t.placeholder,spellcheck:!1,value:t.content.code,type:"textarea"},on:{input:function(e){return t.update({code:e})}}}),t.languages.length?e("div",{staticClass:"k-block-type-code-editor-language"},[e("k-icon",{attrs:{type:"code"}}),e("k-input",{ref:"language",attrs:{empty:!1,options:t.languages,value:t.content.language,type:"select"},on:{input:function(e){return t.update({language:e})}}})],1):t._e()],1)}),[],!1,null,null,null,null).exports,me=Object.freeze(Object.defineProperty({__proto__:null,default:he},Symbol.toStringTag,{value:"Module"}));const fe=R({},(function(){var t=this;return(0,t._self._c)("k-block-title",{attrs:{content:t.content,fieldset:t.fieldset},nativeOn:{dblclick:function(e){return t.$emit("open")}}})}),[],!1,null,null,null,null).exports,ge=Object.freeze(Object.defineProperty({__proto__:null,default:fe},Symbol.toStringTag,{value:"Module"}));const ke=R({data(){return{tab:Object.keys(this.fieldset.tabs)[0]}},computed:{fields(){var t;return null==(t=this.fieldset.tabs[this.tab])?void 0:t.fields},values(){return Object.assign({},this.content)}}},(function(){var t=this,e=t._self._c;return e("div",{on:{dblclick:function(e){!t.fieldset.wysiwyg&&t.$emit("open")}}},[e("header",{staticClass:"k-block-type-fields-header"},[e("k-block-title",{attrs:{content:t.values,fieldset:t.fieldset},nativeOn:{dblclick:function(e){return t.$emit("open",t.tab)}}}),e("k-drawer-tabs",{attrs:{tab:t.tab,tabs:t.fieldset.tabs},on:{open:function(e){t.tab=e}}})],1),e("k-form",{ref:"form",staticClass:"k-block-type-fields-form",attrs:{autofocus:!0,disabled:!t.fieldset.wysiwyg,fields:t.fields,value:t.values},on:{input:function(e){return t.$emit("update",e)}}})],1)}),[],!1,null,null,null,null).exports,be=Object.freeze(Object.defineProperty({__proto__:null,default:ke},Symbol.toStringTag,{value:"Module"}));const ve=R({computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop},ratio(){return this.content.ratio}}},(function(){var t=this,e=t._self._c;return e("figure",[e("ul",{on:{dblclick:t.open}},[0===t.content.images.length?t._l(5,(function(n){return e("li",{key:n,staticClass:"k-block-type-gallery-placeholder"},[e("k-aspect-ratio",{attrs:{ratio:t.ratio}})],1)})):t._l(t.content.images,(function(n){return e("li",{key:n.id},[e("k-aspect-ratio",{attrs:{ratio:t.ratio,cover:t.crop}},[e("img",{attrs:{src:n.url,srcset:n.image.srcset,alt:n.alt}})])],1)}))],2),t.content.caption?e("figcaption",[e("k-writer",{attrs:{inline:!0,marks:t.captionMarks,value:t.content.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}})],1):t._e()])}),[],!1,null,null,null,null).exports,ye=Object.freeze(Object.defineProperty({__proto__:null,default:ve},Symbol.toStringTag,{value:"Module"}));const $e=R({computed:{isSplitable(){return this.content.text.length>0&&!1===this.$refs.input.isCursorAtStart&&!1===this.$refs.input.isCursorAtEnd},keys(){return{Enter:()=>!0===this.$refs.input.isCursorAtEnd?this.$emit("append","text"):this.split(),"Mod-Enter":this.split}},levels(){return this.field("level",{options:[]}).options},textField(){return this.field("text",{marks:!0})}},methods:{focus(){this.$refs.input.focus()},merge(t){this.update({text:t.map((t=>t.content.text)).join(" ")})},split(){var t,e;const n=null==(e=(t=this.$refs.input).getSplitContent)?void 0:e.call(t);n&&this.$emit("split",[{text:n[0]},{level:"h"+Math.min(parseInt(this.content.level.slice(1))+1,6),text:n[1]}])}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-heading-input",attrs:{"data-level":t.content.level}},[e("k-writer",{ref:"input",attrs:{inline:!0,keys:t.keys,marks:t.textField.marks,placeholder:t.textField.placeholder,value:t.content.text},on:{input:function(e){return t.update({text:e})}}}),t.levels.length>1?e("k-input",{ref:"level",staticClass:"k-block-type-heading-level",attrs:{empty:!1,options:t.levels,value:t.content.level,type:"select"},on:{input:function(e){return t.update({level:e})}}}):t._e()],1)}),[],!1,null,null,null,null).exports,we=Object.freeze(Object.defineProperty({__proto__:null,default:$e},Symbol.toStringTag,{value:"Module"}));const _e=R({computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop||!1},src(){var t;return"web"===this.content.location?this.content.src:!!(null==(t=this.content.image[0])?void 0:t.url)&&this.content.image[0].url},ratio(){return this.content.ratio||!1}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.image.placeholder")+" …","is-empty":!t.src,"empty-icon":"image"},on:{open:t.open,update:t.update}},[t.src?[t.ratio?e("k-aspect-ratio",{attrs:{ratio:t.ratio,cover:t.crop}},[e("img",{attrs:{alt:t.content.alt,src:t.src}})]):e("img",{staticClass:"k-block-type-image-auto",attrs:{alt:t.content.alt,src:t.src}})]:t._e()],2)}),[],!1,null,null,null,null).exports,xe=Object.freeze(Object.defineProperty({__proto__:null,default:_e},Symbol.toStringTag,{value:"Module"}));const Ce=R({},(function(){return this._self._c,this._m(0)}),[function(){var t=this._self._c;return t("div",[t("hr")])}],!1,null,null,null,null).exports,Se=Object.freeze(Object.defineProperty({__proto__:null,default:Ce},Symbol.toStringTag,{value:"Module"}));const Oe=R({computed:{isSplitable(){return this.content.text.length>0&&!1===this.input().isCursorAtStart&&!1===this.input().isCursorAtEnd},keys(){return{"Mod-Enter":this.split}},marks(){return this.field("text",{}).marks}},methods:{focus(){this.$refs.input.focus()},input(){return this.$refs.input.$refs.input.$refs.input},merge(t){this.update({text:t.map((t=>t.content.text)).join("").replaceAll("
      ","")})},split(){var t,e;const n=null==(e=(t=this.input()).getSplitContent)?void 0:e.call(t);n&&this.$emit("split",[{text:n[0].replace(/(
    • <\/p><\/li><\/ul>)$/,"

    ")},{text:n[1].replace(/^(
    • <\/p><\/li>)/,"

        ")}])}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-list-input",attrs:{keys:t.keys,marks:t.marks,value:t.content.text,type:"list"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,null,null,null,null).exports,Ae=Object.freeze(Object.defineProperty({__proto__:null,default:Oe},Symbol.toStringTag,{value:"Module"}));const Ie=R({computed:{placeholder(){return this.field("text",{}).placeholder}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-markdown-input",attrs:{buttons:!1,placeholder:t.placeholder,spellcheck:!1,value:t.content.text,type:"textarea"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,null,null,null,null).exports,Me=Object.freeze(Object.defineProperty({__proto__:null,default:Ie},Symbol.toStringTag,{value:"Module"}));const Te=R({computed:{citationField(){return this.field("citation",{})},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.text.focus()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-quote-editor"},[e("k-writer",{ref:"text",staticClass:"k-block-type-quote-text",attrs:{inline:t.textField.inline??!1,marks:t.textField.marks,placeholder:t.textField.placeholder,value:t.content.text},on:{input:function(e){return t.update({text:e})}}}),e("k-writer",{ref:"citation",staticClass:"k-block-type-quote-citation",attrs:{inline:t.citationField.inline??!0,marks:t.citationField.marks,placeholder:t.citationField.placeholder,value:t.content.citation},on:{input:function(e){return t.update({citation:e})}}})],1)}),[],!1,null,null,null,null).exports,je=Object.freeze(Object.defineProperty({__proto__:null,default:Te},Symbol.toStringTag,{value:"Module"}));const Ee=R({inheritAttrs:!1,computed:{columns(){return this.table.columns||this.fields},fields(){return this.table.fields||{}},rows(){return this.content.rows||[]},table(){let t=null;for(const e of Object.values(this.fieldset.tabs))e.fields.rows&&(t=e.fields.rows);return t||{}}}},(function(){var t=this;return(0,t._self._c)("k-table",{staticClass:"k-block-type-table-preview",attrs:{columns:t.columns,empty:t.$t("field.structure.empty"),rows:t.rows},nativeOn:{dblclick:function(e){return t.open.apply(null,arguments)}}})}),[],!1,null,null,null,null).exports,Le=Object.freeze(Object.defineProperty({__proto__:null,default:Ee},Symbol.toStringTag,{value:"Module"}));const De=R({computed:{component(){const t="k-"+this.textField.type+"-input";return this.$helper.isComponent(t)?t:"k-writer-input"},isSplitable(){return this.content.text.length>0&&!1===this.input().isCursorAtStart&&!1===this.input().isCursorAtEnd},keys(){const t={"Mod-Enter":this.split};return!0===this.textField.inline&&(t.Enter=this.split),t},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.input.focus()},input(){return this.$refs.input.$refs.input},merge(t){this.update({text:t.map((t=>t.content.text)).join(this.textField.inline?" ":"")})},split(){var t,e;const n=null==(e=(t=this.input()).getSplitContent)?void 0:e.call(t);n&&("writer"===this.textField.type&&(n[0]=n[0].replace(/(

        <\/p>)$/,""),n[1]=n[1].replace(/^(

        <\/p>)/,"")),this.$emit("split",n.map((t=>({text:t})))))}}},(function(){var t=this;return(0,t._self._c)(t.component,t._b({ref:"input",tag:"component",staticClass:"k-block-type-text-input",attrs:{keys:t.keys,value:t.content.text},on:{input:function(e){return t.update({text:e})}}},"component",t.textField,!1))}),[],!1,null,null,null,null).exports,Be=Object.freeze(Object.defineProperty({__proto__:null,default:De},Symbol.toStringTag,{value:"Module"}));const Pe=R({computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},video(){return this.$helper.embed.video(this.content.url,!0)}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.video.placeholder")+" …","is-empty":!t.video,"empty-icon":"video"},on:{open:t.open,update:t.update}},[e("k-aspect-ratio",{attrs:{ratio:"16/9"}},[t.video?e("iframe",{attrs:{src:t.video,referrerpolicy:"strict-origin-when-cross-origin"}}):t._e()])],1)}),[],!1,null,null,null,null).exports,Fe=Object.freeze(Object.defineProperty({__proto__:null,default:Pe},Symbol.toStringTag,{value:"Module"}));const Ne=R({inheritAttrs:!1,props:{attrs:[Array,Object],content:[Array,Object],endpoints:Object,fieldset:Object,id:String,isBatched:Boolean,isFull:Boolean,isHidden:Boolean,isLastSelected:Boolean,isMergable:Boolean,isSelected:Boolean,name:String,next:Object,prev:Object,type:String},emits:["append","chooseToAppend","chooseToConvert","chooseToPrepend","close","copy","duplicate","focus","hide","merge","open","paste","prepend","remove","selectDown","selectUp","show","sortDown","sortUp","split","submit","update","confirmToRemoveSelected"],data:()=>({skipFocus:!1}),computed:{className(){let t=["k-block-type-"+this.type];return this.fieldset.preview!==this.type&&t.push("k-block-type-"+this.fieldset.preview),!1===this.wysiwyg&&t.push("k-block-type-default"),t},customComponent(){return this.wysiwyg?this.wysiwygComponent:"k-block-type-default"},isEditable(){return!1!==this.fieldset.editable},listeners(){return{append:t=>this.$emit("append",t),chooseToAppend:t=>this.$emit("chooseToAppend",t),chooseToConvert:t=>this.$emit("chooseToConvert",t),chooseToPrepend:t=>this.$emit("chooseToPrepend",t),close:()=>this.$emit("close"),copy:()=>this.$emit("copy"),duplicate:()=>this.$emit("duplicate"),focus:()=>this.$emit("focus"),hide:()=>this.$emit("hide"),merge:()=>this.$emit("merge"),open:()=>this.open(),paste:()=>this.$emit("paste"),prepend:t=>this.$emit("prepend",t),remove:()=>this.remove(),removeSelected:()=>this.$emit("removeSelected"),show:()=>this.$emit("show"),sortDown:()=>this.$emit("sortDown"),sortUp:()=>this.$emit("sortUp"),split:t=>this.$emit("split",t),update:t=>this.$emit("update",t)}},tabs(){let t=this.fieldset.tabs;return Object.entries(t).forEach((([e,n])=>{Object.entries(n.fields).forEach((([n])=>{t[e].fields[n].section=this.name,t[e].fields[n].endpoints={field:this.endpoints.field+"/fieldsets/"+this.type+"/fields/"+n,section:this.endpoints.section,model:this.endpoints.model}}))})),t},wysiwyg(){return!1!==this.wysiwygComponent},wysiwygComponent(){const t=this.fieldset.preview;if(!1===t)return!1;let e;return t&&(e="k-block-type-"+t,this.$helper.isComponent(e))?e:(e="k-block-type-"+this.type,!!this.$helper.isComponent(e)&&e)}},methods:{close(){this.$refs.drawer.close()},focus(){!0!==this.skipFocus&&("function"==typeof this.$refs.editor.focus?this.$refs.editor.focus():this.$refs.container.focus())},goTo(t){t&&(this.skipFocus=!0,this.close(),this.$nextTick((()=>{t.$refs.container.focus(),t.open(),this.skipFocus=!1})))},isSplitable(){var t;return!!this.$refs.editor&&((this.$refs.editor.isSplitable??!0)&&"function"==typeof(null==(t=this.$refs.editor)?void 0:t.split))},onDrawerClose(){this.$emit("close"),this.focus()},onDrawerInput(t){this.$emit("update",t)},onDrawerOpen(){this.$emit("open")},onDrawerSubmit(){this.$emit("submit"),this.close()},onFocusIn(t){var e,n;(null==(n=null==(e=this.$refs.options)?void 0:e.$el)?void 0:n.contains(t.target))||this.$emit("focus",t)},open(t){var e;null==(e=this.$refs.drawer)||e.open(t)},remove(){if(this.isBatched)return this.$emit("removeSelected");this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm")},on:{submit:()=>{this.$panel.dialog.close(),this.$emit("remove",this.id)}}})},submit(){this.close()}}},(function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"k-block-container",class:"k-block-container-type-"+t.type,attrs:{"data-batched":t.isBatched,"data-disabled":t.fieldset.disabled,"data-hidden":t.isHidden,"data-id":t.id,"data-last-selected":t.isLastSelected,"data-selected":t.isSelected,"data-translate":t.fieldset.translate,tabindex:"0"},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"j",void 0,e.key,void 0)?null:e.ctrlKey?(e.preventDefault(),e.stopPropagation(),t.$emit("merge")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.altKey?(e.preventDefault(),e.stopPropagation(),t.$emit("selectDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.ctrlKey&&e.altKey?(e.preventDefault(),e.stopPropagation(),t.$emit("selectUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),e.stopPropagation(),t.$emit("sortDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),e.stopPropagation(),t.$emit("sortUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)?null:e.ctrlKey?(e.preventDefault(),e.stopPropagation(),t.remove.apply(null,arguments)):null}],focus:function(e){return e.stopPropagation(),t.$emit("focus")},focusin:function(e){return e.stopPropagation(),t.onFocusIn.apply(null,arguments)}}},[e("div",{staticClass:"k-block",class:t.className},[e(t.customComponent,t._g(t._b({ref:"editor",tag:"component"},"component",t.$props,!1),t.listeners))],1),e("k-block-options",t._g({ref:"options",attrs:{"is-batched":t.isBatched,"is-editable":t.isEditable,"is-full":t.isFull,"is-hidden":t.isHidden,"is-mergable":t.isMergable,"is-splitable":t.isSplitable()}},{...t.listeners,split:()=>t.$refs.editor.split()})),t.isEditable&&!t.isBatched?e("k-form-drawer",{ref:"drawer",staticClass:"k-block-drawer",attrs:{id:t.id,icon:t.fieldset.icon||"box",tabs:t.tabs,title:t.fieldset.name,value:t.content},on:{close:t.onDrawerClose,input:t.onDrawerInput,open:t.onDrawerOpen,submit:t.onDrawerSubmit},scopedSlots:t._u([{key:"options",fn:function(){return[t.isHidden?e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"hidden"},on:{click:function(e){return t.$emit("show")}}}):t._e(),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.prev,icon:"angle-left"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.goTo(t.prev)}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.goTo(t.next)}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.remove.apply(null,arguments)}}})]},proxy:!0}],null,!1,731710025)}):t._e()],1)}),[],!1,null,null,null,null).exports;const qe=R({inheritAttrs:!1,props:{autofocus:Boolean,empty:String,endpoints:Object,fieldsets:Object,fieldsetGroups:Object,group:String,max:{type:Number,default:null},value:{type:Array,default:()=>[]}},data(){return{isEditing:!1,isMultiSelectKey:!1,blocks:this.value,selected:[]}},computed:{draggableOptions(){return{id:this._uid,handle:".k-sort-handle",list:this.blocks,move:this.move,delay:10,data:{fieldsets:this.fieldsets,isFull:this.isFull},options:{group:this.group}}},hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.blocks.length},isFull(){return null!==this.max&&this.blocks.length>=this.max},isMergable(){if(this.selected.length<2)return!1;const t=this.selected.map((t=>this.find(t)));return!(new Set(t.map((t=>t.type))).size>1)&&"function"==typeof this.ref(t[0]).$refs.editor.merge}},watch:{value(){this.blocks=this.value}},created(){this.$events.$on("blur",this.onBlur),this.$events.$on("copy",this.onCopy),this.$events.$on("focus",this.onOutsideFocus),this.$events.$on("keydown",this.onKey),this.$events.$on("keyup",this.onKey),this.$events.$on("paste",this.onPaste)},destroyed(){this.$events.$off("blur",this.onBlur),this.$events.$off("copy",this.onCopy),this.$events.$off("focus",this.onOutsideFocus),this.$events.$off("keydown",this.onKey),this.$events.$off("keyup",this.onKey),this.$events.$off("paste",this.onPaste)},mounted(){!0===this.$props.autofocus&&setTimeout(this.focus,100)},methods:{async add(t="text",e){const n=await this.$api.get(this.endpoints.field+"/fieldsets/"+t);this.blocks.splice(e,0,n),this.save(),this.$nextTick((()=>this.focusOrOpen(n)))},choose(t){if(1===this.$helper.object.length(this.fieldsets)){const e=Object.values(this.fieldsets)[0].type;this.add(e,t)}else this.$refs.selector.open(t)},chooseToConvert(t){this.$refs.selector.open(t,{disabled:[t.type],headline:this.$t("field.blocks.changeType"),event:"convert"})},click(t){this.$emit("click",t)},copy(t){if(0===this.blocks.length)return!1;if(0===this.selected.length)return!1;let e=[];for(const n of this.blocks)this.selected.includes(n.id)&&e.push(n);if(0===e.length)return!1;this.$helper.clipboard.write(e,t),this.selected=e.map((t=>t.id)),this.$panel.notification.success(this.$t("copy.success",{count:e.length}))},copyAll(){this.selectAll(),this.copy(),this.deselectAll()},async convert(t,e){var n;const s=this.findIndex(e.id);if(-1===s)return!1;const i=t=>{let e={};for(const n of Object.values((null==t?void 0:t.tabs)??{}))e={...e,...n.fields};return e},o=this.blocks[s],l=await this.$api.get(this.endpoints.field+"/fieldsets/"+t),r=this.fieldsets[o.type],a=this.fieldsets[t];if(!a)return!1;let u=l.content;const c=i(a),d=i(r);for(const[p,h]of Object.entries(c)){const t=d[p];(null==t?void 0:t.type)===h.type&&(null==(n=null==o?void 0:o.content)?void 0:n[p])&&(u[p]=o.content[p])}this.blocks[s]={...l,id:o.id,content:u},this.save()},deselect(t){const e=this.selected.findIndex((e=>e===t.id));-1!==e&&this.selected.splice(e,1)},deselectAll(){this.selected=[]},async duplicate(t,e){const n={...this.$helper.clone(t),id:this.$helper.uuid()};this.blocks.splice(e+1,0,n),this.save()},fieldset(t){return this.fieldsets[t.type]||{icon:"box",name:t.type,tabs:{content:{fields:{}}},type:t.type}},find(t){return this.blocks.find((e=>e.id===t))},findIndex(t){return this.blocks.findIndex((e=>e.id===t))},focus(t){const e=this.ref(t);this.selected=[(null==t?void 0:t.id)??this.blocks[0]],null==e||e.focus(),null==e||e.$el.scrollIntoView({block:"nearest"})},focusOrOpen(t){this.fieldsets[t.type].wysiwyg?this.focus(t):this.open(t)},hide(t){Vue.set(t,"isHidden",!0),this.save()},isInputEvent(){const t=document.querySelector(":focus");return null==t?void 0:t.matches("input, textarea, [contenteditable], .k-writer")},isLastSelected(t){const[e]=this.selected.slice(-1);return e&&t.id===e},isOnlyInstance:()=>1===document.querySelectorAll(".k-blocks").length,isSelected(t){return this.selected.includes(t.id)},merge(){if(this.isMergable){const t=this.selected.map((t=>this.find(t)));this.ref(t[0]).$refs.editor.merge(t);for(const e of t.slice(1))this.remove(e);this.$nextTick((()=>this.focus(t[0])))}},move(t){if(t.from!==t.to){const e=t.draggedContext.element,n=t.relatedContext.component.componentData||t.relatedContext.component.$parent.componentData;if(!1===Object.keys(n.fieldsets).includes(e.type))return!1;if(!0===n.isFull)return!1}return!0},onBlur(){0===this.selected.length&&(this.isMultiSelectKey=!1)},onClickBlock(t,e){e&&this.isMultiSelectKey&&this.onKey(e),this.isMultiSelectKey&&(this.isSelected(t)?this.deselect(t):this.select(t))},onCopy(t){return!1!==this.$el.contains(t.target)&&!0!==this.isEditing&&!0!==this.$panel.dialog.isOpen&&!0!==this.isInputEvent(t)&&this.copy(t)},onFocus(t){!1===this.isMultiSelectKey&&(this.selected=[t.id])},onKey(t){if(this.isMultiSelectKey=t.metaKey||t.ctrlKey||t.altKey,"Escape"===t.code&&this.selected.length>1){const t=this.find(this.selected[0]);this.$nextTick((()=>this.focus(t)))}},onOutsideFocus(t){if("function"==typeof t.target.closest&&t.target.closest(".k-dialog"))return;const e=document.querySelector(".k-overlay:last-of-type");if(!1!==this.$el.contains(t.target)||e&&!1!==e.contains(t.target)){if(e){const e=this.$el.closest(".k-layout-column");if(!1===(null==e?void 0:e.contains(t.target)))return void(this.selected=[])}}else this.selected=[]},onPaste(t){var e;return!0===(null==(e=this.$refs.selector)?void 0:e.isOpen())?this.paste(t):!0!==this.isInputEvent(t)&&(!0!==this.isEditing&&!0!==this.$panel.dialog.isOpen&&((0!==this.selectedOrBatched.length||!1!==this.$el.contains(t.target))&&this.paste(t)))},open(t){var e;null==(e=this.$refs["block-"+t.id])||e[0].open()},async paste(t){const e=this.$helper.clipboard.read(t),n=await this.$api.post(this.endpoints.field+"/paste",{html:e});let s=this.selected[this.selected.length-1],i=this.findIndex(s);-1===i&&(i=this.blocks.length),this.blocks.splice(i+1,0,...n),this.save(),this.$panel.notification.success(this.$t("paste.success",{count:n.length}))},pasteboard(){this.$refs.pasteboard.open()},prevNext(t){var e;if(this.blocks[t])return null==(e=this.$refs["block-"+this.blocks[t].id])?void 0:e[0]},ref(t){var e,n;return null==(n=this.$refs["block-"+((null==t?void 0:t.id)??(null==(e=this.blocks[0])?void 0:e.id))])?void 0:n[0]},remove(t){const e=this.findIndex(t.id);-1!==e&&(this.deselect(t),this.$delete(this.blocks,e),this.save())},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm.all"),submitButton:this.$t("delete.all")},on:{submit:()=>{this.selected=[],this.blocks=[],this.save(),this.$panel.dialog.close()}}})},removeSelected(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm.selected")},on:{submit:()=>{for(const t of this.selected){const e=this.findIndex(t);-1!==e&&this.$delete(this.blocks,e)}this.deselectAll(),this.save(),this.$panel.dialog.close()}}})},save(){this.$emit("input",this.blocks)},select(t){!1===this.isSelected(t)&&(this.selected.push(t.id),this.selected.sort(((t,e)=>this.findIndex(t)-this.findIndex(e))))},selectDown(){const t=this.selected[this.selected.length-1],e=this.findIndex(t)+1;e=0&&this.select(this.blocks[e])},selectAll(){this.selected=Object.values(this.blocks).map((t=>t.id))},show(t){Vue.set(t,"isHidden",!1),this.save()},sort(t,e,n){if(n<0)return;let s=this.$helper.clone(this.blocks);s.splice(e,1),s.splice(n,0,t),this.blocks=s,this.save(),this.$nextTick((()=>this.focus(t)))},async split(t,e,n){const s=this.$helper.clone(t);s.content={...s.content,...n[0]};const i=await this.$api.get(this.endpoints.field+"/fieldsets/"+t.type);i.content={...i.content,...s.content,...n[1]},this.blocks.splice(e,1,s,i),this.save(),this.$nextTick((()=>this.focus(i)))},update(t,e){const n=this.findIndex(t.id);if(-1!==n)for(const s in e)Vue.set(this.blocks[n].content,s,e[s]);this.save()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-blocks",attrs:{"data-empty":0===t.blocks.length,"data-multi-select-key":t.isMultiSelectKey}},[t.hasFieldsets?[e("k-draggable",t._b({staticClass:"k-blocks-list",on:{sort:t.save},scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-empty",{staticClass:"k-blocks-empty",attrs:{icon:"box"},on:{click:function(e){return t.choose(t.blocks.length)}}},[t._v(" "+t._s(t.empty||t.$t("field.blocks.empty"))+" ")])]},proxy:!0}],null,!1,2413899928)},"k-draggable",t.draggableOptions,!1),t._l(t.blocks,(function(n,s){return e("k-block",t._b({key:n.id,ref:"block-"+n.id,refInFor:!0,attrs:{endpoints:t.endpoints,fieldset:t.fieldset(n),"is-batched":t.isSelected(n)&&t.selected.length>1,"is-last-selected":t.isLastSelected(n),"is-full":t.isFull,"is-hidden":!0===n.isHidden,"is-mergable":t.isMergable,"is-selected":t.isSelected(n),next:t.prevNext(s+1),prev:t.prevNext(s-1)},on:{append:function(e){return t.add(e,s+1)},chooseToAppend:function(e){return t.choose(s+1)},chooseToConvert:function(e){return t.chooseToConvert(n)},chooseToPrepend:function(e){return t.choose(s)},close:function(e){t.isEditing=!1},copy:function(e){return t.copy()},duplicate:function(e){return t.duplicate(n,s)},focus:function(e){return t.onFocus(n)},hide:function(e){return t.hide(n)},merge:function(e){return t.merge()},open:function(e){t.isEditing=!0},paste:function(e){return t.pasteboard()},prepend:function(e){return t.add(e,s)},remove:function(e){return t.remove(n)},removeSelected:t.removeSelected,show:function(e){return t.show(n)},selectDown:t.selectDown,selectUp:t.selectUp,sortDown:function(e){return t.sort(n,s,s+1)},sortUp:function(e){return t.sort(n,s,s-1)},split:function(e){return t.split(n,s,e)},update:function(e){return t.update(n,e)}},nativeOn:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.onClickBlock(n,e)}}},"k-block",n,!1))})),1),e("k-block-selector",{ref:"selector",attrs:{fieldsets:t.fieldsets,"fieldset-groups":t.fieldsetGroups},on:{add:t.add,convert:t.convert,paste:function(e){return t.paste(e)}}}),e("k-block-pasteboard",{ref:"pasteboard",on:{paste:function(e){return t.paste(e)}}})]:[e("k-box",{attrs:{theme:"info"}},[t._v(" No fieldsets yet ")])]],2)}),[],!1,null,null,null,null).exports;const Re=R({inheritAttrs:!1,props:{caption:String,captionMarks:[Boolean,Array],cover:{type:Boolean,default:!0},isEmpty:Boolean,emptyIcon:String,emptyText:String,ratio:String},computed:{ratioPadding(){return this.$helper.ratio(this.ratio||"16/9")}}},(function(){var t=this,e=t._self._c;return e("figure",{staticClass:"k-block-figure"},[t.isEmpty?e("k-button",{staticClass:"k-block-figure-empty",attrs:{icon:t.emptyIcon,text:t.emptyText},on:{click:function(e){return t.$emit("open")}}}):e("span",{staticClass:"k-block-figure-container",on:{dblclick:function(e){return t.$emit("open")}}},[t._t("default")],2),t.caption?e("figcaption",[e("k-writer",{attrs:{inline:!0,marks:t.captionMarks,value:t.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;const ze=R({props:{isBatched:Boolean,isEditable:Boolean,isFull:Boolean,isHidden:Boolean,isMergable:Boolean,isSplitable:Boolean},methods:{open(){this.$refs.options.open()}}},(function(){var t=this,e=t._self._c;return e("k-dropdown",{staticClass:"k-block-options"},[t.isBatched?[e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("copy"),icon:"template"},on:{click:function(e){return t.$emit("copy")}}}),t.isMergable?e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("merge"),icon:"merge"},on:{click:function(e){return t.$emit("merge")}}}):t._e(),e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("remove"),icon:"trash"},on:{click:function(e){return t.$emit("removeSelected")}}})]:[t.isEditable?e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("edit"),icon:"edit"},on:{click:function(e){return t.$emit("open")}}}):t._e(),e("k-button",{staticClass:"k-block-options-button",attrs:{disabled:t.isFull,tooltip:t.$t("insert.after"),icon:"add"},on:{click:function(e){return t.$emit("chooseToAppend")}}}),e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("delete"),icon:"trash"},on:{click:function(e){return t.$emit("remove")}}}),e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("more"),icon:"dots"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-button",{staticClass:"k-block-options-button k-sort-handle",attrs:{tooltip:t.$t("sort"),icon:"sort"},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.$emit("sortUp"))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.$emit("sortDown"))}]}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"angle-up"},on:{click:function(e){return t.$emit("chooseToPrepend")}}},[t._v(" "+t._s(t.$t("insert.before"))+" ")]),e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"angle-down"},on:{click:function(e){return t.$emit("chooseToAppend")}}},[t._v(" "+t._s(t.$t("insert.after"))+" ")]),e("hr"),t.isEditable?e("k-dropdown-item",{attrs:{icon:"edit"},on:{click:function(e){return t.$emit("open")}}},[t._v(" "+t._s(t.$t("edit"))+" ")]):t._e(),e("k-dropdown-item",{attrs:{icon:"refresh"},on:{click:function(e){return t.$emit("chooseToConvert")}}},[t._v(" "+t._s(t.$t("field.blocks.changeType"))+" ")]),t.isSplitable?e("k-dropdown-item",{attrs:{icon:"split"},on:{click:function(e){return t.$emit("split")}}},[t._v(" "+t._s(t.$t("split"))+" ")]):t._e(),e("hr"),e("k-dropdown-item",{attrs:{icon:"template"},on:{click:function(e){return t.$emit("copy")}}},[t._v(" "+t._s(t.$t("copy"))+" ")]),e("k-dropdown-item",{attrs:{icon:"download"},on:{click:function(e){return t.$emit("paste")}}},[t._v(" "+t._s(t.$t("paste.after"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:t.isHidden?"preview":"hidden"},on:{click:function(e){return t.$emit(t.isHidden?"show":"hide")}}},[t._v(" "+t._s(!0===t.isHidden?t.$t("show"):t.$t("hide"))+" ")]),e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"copy"},on:{click:function(e){return t.$emit("duplicate")}}},[t._v(" "+t._s(t.$t("duplicate"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:"trash"},on:{click:function(e){return t.$emit("remove")}}},[t._v(" "+t._s(t.$t("delete"))+" ")])],1)]],2)}),[],!1,null,null,null,null).exports;const Ye=R({inheritAttrs:!1,computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{close(){this.$refs.dialog.close()},open(){this.$refs.dialog.open()},onPaste(t){this.$emit("paste",t),this.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-block-importer",attrs:{"cancel-button":!1,"submit-button":!1,size:"large"}},[e("label",{attrs:{for:"pasteboard"},domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}}),e("textarea",{attrs:{id:"pasteboard"},on:{paste:function(e){return e.preventDefault(),t.onPaste.apply(null,arguments)}}})])}),[],!1,null,null,null,null).exports;const He=R({inheritAttrs:!1,props:{endpoint:String,fieldsets:Object,fieldsetGroups:Object},data(){return{dialogIsOpen:!1,disabled:[],headline:null,payload:null,event:"add",groups:this.createGroups()}},computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{add(t){this.$emit(this.event,t,this.payload),this.$refs.dialog.close()},close(){this.$refs.dialog.close()},createGroups(){let t={},e=0;const n=this.fieldsetGroups||{blocks:{label:this.$t("field.blocks.fieldsets.label"),sets:Object.keys(this.fieldsets)}};return Object.keys(n).forEach((s=>{let i=n[s];i.open=!1!==i.open,i.fieldsets=i.sets.filter((t=>this.fieldsets[t])).map((t=>(e++,{...this.fieldsets[t],index:e}))),0!==i.fieldsets.length&&(t[s]=i)})),t},isOpen(){return this.dialogIsOpen},navigate(t){var e,n;null==(n=null==(e=this.$refs["fieldset-"+t])?void 0:e[0])||n.focus()},onClose(){this.dialogIsOpen=!1,this.$events.$off("paste",this.close)},onOpen(){this.dialogIsOpen=!0,this.$events.$on("paste",this.close)},open(t,e={}){const n={event:"add",disabled:[],headline:null,...e};this.event=n.event,this.disabled=n.disabled,this.headline=n.headline,this.payload=t,this.$refs.dialog.open()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-block-selector",attrs:{"cancel-button":!1,"submit-button":!1,size:"medium"},on:{open:t.onOpen,close:t.onClose}},[t.headline?e("k-headline",[t._v(" "+t._s(t.headline)+" ")]):t._e(),t._l(t.groups,(function(n,s){return e("details",{key:s,attrs:{open:n.open}},[e("summary",[t._v(t._s(n.label))]),e("div",{staticClass:"k-block-types"},t._l(n.fieldsets,(function(n){return e("k-button",{key:n.name,ref:"fieldset-"+n.index,refInFor:!0,attrs:{disabled:t.disabled.includes(n.type),icon:n.icon||"box",text:n.name},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:t.navigate(n.index-1)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:t.navigate(n.index+1)}],click:function(e){return t.add(n.type)}}})})),1)])})),e("p",{staticClass:"k-clipboard-hint",domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}})],2)}),[],!1,null,null,null,null).exports;const Ue=R({inheritAttrs:!1,props:{fieldset:Object,content:Object},computed:{icon(){return this.fieldset.icon||"box"},label(){if(!this.fieldset.label||0===this.fieldset.label.length)return!1;if(this.fieldset.label===this.fieldset.name)return!1;const t=this.$helper.string.template(this.fieldset.label,this.content);return"…"!==t&&this.$helper.string.stripHTML(t)},name(){return this.fieldset.name}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-title"},[e("k-icon",{staticClass:"k-block-icon",attrs:{type:t.icon}}),e("span",{staticClass:"k-block-name"},[t._v(" "+t._s(t.name)+" ")]),t.label?e("span",{staticClass:"k-block-label"},[t._v(" "+t._s(t.label)+" ")]):t._e()],1)}),[],!1,null,null,null,null).exports;const Ve=R({inheritAttrs:!1,props:{content:[Object,Array],fieldset:Object},methods:{field(t,e=null){let n=null;return Object.values(this.fieldset.tabs).forEach((e=>{e.fields[t]&&(n=e.fields[t])})),n||e},open(){this.$emit("open")},update(t){this.$emit("update",{...this.content,...t})}}},null,null,!1,null,null,null,null).exports,Ke={install(t){t.component("k-block",Ne),t.component("k-blocks",qe),t.component("k-block-figure",Re),t.component("k-block-options",ze),t.component("k-block-pasteboard",Ye),t.component("k-block-selector",He),t.component("k-block-title",Ue),t.component("k-block-type",Ve);const e=Object.assign({"./Types/Code.vue":me,"./Types/Default.vue":ge,"./Types/Fields.vue":be,"./Types/Gallery.vue":ye,"./Types/Heading.vue":we,"./Types/Image.vue":xe,"./Types/Line.vue":Se,"./Types/List.vue":Ae,"./Types/Markdown.vue":Me,"./Types/Quote.vue":je,"./Types/Table.vue":Le,"./Types/Text.vue":Be,"./Types/Video.vue":Fe});for(const n in e){const s=n.match(/\/([a-zA-Z]*)\.vue/)[1].toLowerCase();let i=e[n].default;i.extends=Ve,t.component("k-block-type-"+s,i)}}},We=/^#([\da-f]{3}){1,2}$/i,Je=/^#([\da-f]{4}){1,2}$/i,Ge=/rgba?\(\s*(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?/i,Ze=/hsla?\(\s*(\d{1,3})(?:deg|rad|grad|turn)?(?:,|\s)+(\d{1,3})%(?:,|\s)+(\d{1,3})%(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?/i;function Qe(t){return"string"==typeof t&&(We.test(t)||Je.test(t))}function Xe(t){return H(t)&&"r"in t&&"g"in t&&"b"in t}function tn(t){return H(t)&&"h"in t&&"s"in t&&"l"in t}function en({h:t,s:e,v:n,a:s}){if(0===n)return{h:t,s:0,l:0,a:s};if(0===e&&1===n)return{h:t,s:1,l:1,a:s};const i=n*(2-e)/2;return{h:t,s:e=n*e/(1-Math.abs(2*i-1)),l:i,a:s}}function nn({h:t,s:e,l:n,a:s}){const i=e*(n<.5?n:1-n);return{h:t,s:e=0===i?0:2*i/(n+i),v:n+i,a:s}}function sn(t){if(!0===We.test(t)){3===(t=t.slice(1)).length&&(t=t.split("").reduce(((t,e)=>t+e+e),""));const e=parseInt(t,16);return{r:e>>16,g:e>>8&255,b:255&e,a:1}}if(!0===Je.test(t)){4===(t=t.slice(1)).length&&(t=t.split("").reduce(((t,e)=>t+e+e),""));const e=parseInt(t,16);return{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:Math.round((255&e)/255*100)/100}}throw new Error(`unknown hex color: ${t}`)}function on({r:t,g:e,b:n,a:s=1}){let i="#"+(1<<24|t<<16|e<<8|n).toString(16).slice(1);return s<1&&(i+=(256|Math.round(255*s)).toString(16).slice(1)),i}function ln({h:t,s:e,l:n,a:s}){const i=e*Math.min(n,1-n),o=(e,s=(e+t/30)%12)=>n-i*Math.max(Math.min(s-3,9-s,1),-1);return{r:255*o(0),g:255*o(8),b:255*o(4),a:s}}function rn({r:t,g:e,b:n,a:s}){t/=255,e/=255,n/=255;const i=Math.max(t,e,n),o=i-Math.min(t,e,n),l=1-Math.abs(i+i-o-1);let r=o&&(i==t?(e-n)/o:i==e?2+(n-t)/o:4+(t-e)/o);return r=60*(r<0?r+6:r),{h:r,s:l?o/l:0,l:(i+i-o)/2,a:s}}function an(t){return on(ln(t))}function un(t){return rn(sn(t))}function cn(t,e){if(!0===Qe(t))switch(e){case"hex":return t;case"rgb":return sn(t);case"hsl":return un(t);case"hsv":return nn(un(t))}if(!0===Xe(t))switch(e){case"hex":return on(t);case"rgb":return t;case"hsl":return rn(t);case"hsv":return function({r:t,g:e,b:n,a:s}){t/=255,e/=255,n/=255;const i=Math.max(t,e,n),o=i-Math.min(t,e,n);let l=o&&(i==t?(e-n)/o:i==e?2+(n-t)/o:4+(t-e)/o);return l=60*(l<0?l+6:l),{h:l,s:i&&o/i,v:i,a:s}}(t)}if(!0===tn(t))switch(e){case"hex":return an(t);case"rgb":return ln(t);case"hsl":return t;case"hsv":return nn(t)}if(!0===function(t){return H(t)&&"h"in t&&"s"in t&&"v"in t}(t))switch(e){case"hex":return an(en(t));case"rgb":return function({h:t,s:e,v:n,a:s}){const i=(s,i=(s+t/60)%6)=>n-n*e*Math.max(Math.min(i,4-i,1),0);return{r:255*i(5),g:255*i(3),b:255*i(1),a:s}}(t);case"hsl":return en(t);case"hsv":return t}throw new Error(`Invalid color conversion: ${JSON.stringify(t)} -> ${e}`)}function dn(t){let e;if(!t||"string"!=typeof t)return!1;if(Qe(t))return t;if(e=t.match(Ge)){const t={r:Number(e[1]),g:Number(e[3]),b:Number(e[5]),a:Number(e[7]||1)};return"%"===e[2]&&(t.r=Math.ceil(2.55*t.r)),"%"===e[4]&&(t.g=Math.ceil(2.55*t.g)),"%"===e[6]&&(t.b=Math.ceil(2.55*t.b)),"%"===e[8]&&(t.a=t.a/100),t}if(e=t.match(Ze)){const[t,n,s,i]=e.slice(1),o={h:Number(t),s:Number(n)/100,l:Number(s)/100,a:Number(i||1)};return"%"===e[5]&&(o.a=o.a/100),o}return null}const pn={convert:cn,parse:dn,parseAs:function(t,e){const n=dn(t);return n&&e?cn(n,e):n},toString:function(t,e,n=!0){var s,i;let o=t;if("string"==typeof o&&(o=dn(t)),o&&e&&(o=cn(o,e)),!0===Qe(o))return!0!==n&&(5===o.length?o=o.slice(0,4):o.length>7&&(o=o.slice(0,7))),o.toLowerCase();if(!0===Xe(o)){const t=o.r.toFixed(),e=o.g.toFixed(),i=o.b.toFixed(),l=null==(s=o.a)?void 0:s.toFixed(2);return n&&l&&l<1?`rgb(${t} ${e} ${i} / ${l})`:`rgb(${t} ${e} ${i})`}if(!0===tn(o)){const t=o.h.toFixed(),e=(100*o.s).toFixed(),s=(100*o.l).toFixed(),l=null==(i=o.a)?void 0:i.toFixed(2);return n&&l&&l<1?`hsl(${t} ${e}% ${s}% / ${l})`:`hsl(${t} ${e}% ${s}%)`}throw new Error(`Unsupported color: ${JSON.stringify(t)}`)}};class hn extends HTMLElement{constructor(){super(),this.color={h:0,s:1,v:1,a:1}}connectedCallback(){this.innerHTML="",this.classList.add("k-color"),this.coords=document.createElement("k-coords"),this.coords.addEventListener("input",this.onCoords.bind(this)),this.appendChild(this.coords),this.hue=document.createElement("input"),this.hue.type="range",this.hue.min=0,this.hue.max=360,this.hue.value=this.color.h,this.hue.setAttribute("data-variant","hue"),this.hue.addEventListener("input",this.onHue.bind(this)),this.appendChild(this.hue),this.hasAlpha&&(this.alpha=document.createElement("input"),this.alpha.type="range",this.alpha.min=0,this.alpha.max=1,this.alpha.step=.01,this.alpha.value=this.color.a,this.alpha.setAttribute("data-variant","alpha"),this.alpha.addEventListener("input",this.onAlpha.bind(this)),this.appendChild(this.alpha)),this.coords.value={x:0,y:0}}between(t,e,n){return Math.min(Math.max(t,e),n)}get hex(){return pn.toString(this.color,"hex")}get hsl(){return pn.toString(this.color,"hsl")}get hasAlpha(){return"true"===this.getAttribute("alpha","true")}onAlpha(t){this.onInput(t,{a:Number(t.target.value)})}onCoords(t){const e=Math.round(t.target.value.x),n=Math.round(t.target.value.y);this.onInput(t,{s:e/100,v:1-n/100})}onHue(t){this.onInput(t,{h:Number(t.target.value)})}onInput(t,e){t.stopPropagation(),this.value=e,this.dispatchEvent(new CustomEvent("input",{detail:this.color}))}get rgb(){return pn.toString(this.color,"rgb")}get value(){return this.color}set value(t){if("string"==typeof t){const e=pn.parseAs(t,"hsv");if(!e)return;t=e}t={...this.color,...t},this.color={h:this.between(t.h,0,360),s:this.between(t.s,0,1),v:this.between(t.v,0,1),a:this.hasAlpha?this.between(t.a,0,1):1};const e=pn.convert(this.color,"hsl");this.style.setProperty("--h",e.h),this.style.setProperty("--s",(100*e.s).toFixed()+"%"),this.style.setProperty("--l",(100*e.l).toFixed()+"%"),this.coords.value={x:100*this.color.s,y:100*(1-this.color.v)},this.hue.value=this.color.h,this.hasAlpha&&(this.style.setProperty("--a",e.a),this.alpha.value=this.color.a)}}class mn extends HTMLElement{static get observedAttributes(){return["x","y"]}constructor(){super(),this.x=0,this.y=0}attributeChangedCallback(){this.value={x:this.getAttribute("x")??0,y:this.getAttribute("y")??0}}connectedCallback(){this.classList.add("k-coords"),this.tabIndex=0,this.marker=document.createElement("button"),this.marker.type="button",this.marker.classList.add("k-coords-thumb"),this.addEventListener("mousedown",(t=>this.onDrag(t))),this.addEventListener("click",(t=>this.onMove(t))),this.addEventListener("keydown",(t=>this.onKeys(t))),this.appendChild(this.marker),void 0!==this.value.x&&void 0!==this.value.y&&this.setMarker()}getCoords(t,e){return{x:Math.min(Math.max(t.clientX-e.left,0),e.width),y:Math.min(Math.max(t.clientY-e.top,0),e.height)}}get disabled(){return this.hasAttribute("aria-disabled")&&!1!==this.getAttribute("aria-disabled")}onDrag(t){if(0!==t.button)return;const e=t=>this.onMove(t),n=()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",e),window.addEventListener("mouseup",n)}onMove(t){const e=this.getBoundingClientRect(),n=this.getCoords(t,e),s=n.x/e.width*100,i=n.y/e.height*100;this.onInput(t,{x:s,y:i})}onKeys(t){const e=t.shiftKey?10:1,n={ArrowUp:{y:this.y-e},ArrowDown:{y:this.y+e},ArrowLeft:{x:this.x-e},ArrowRight:{x:this.x+e}};n[t.key]&&this.onInput(t,n[t.key])}onInput(t,e){if(t.preventDefault(),t.stopPropagation(),this.disabled)return!1;this.value={...this.value,...e},this.dispatchEvent(new CustomEvent("input",{detail:this.value}))}parseValue(t){if("object"==typeof t)return t;const e={"top left":{x:0,y:0},"top center":{x:50,y:0},"top right":{x:100,y:0},"center left":{x:0,y:50},center:{x:50,y:50},"center center":{x:50,y:50},"center right":{x:100,y:50},"bottom left":{x:0,y:100},"bottom center":{x:50,y:100},"bottom right":{x:100,y:100}};if(e[t])return e[t];const n=t.split(",").map((t=>t.trim()));return{x:n[0],y:n[1]??0}}get value(){return{x:this.x,y:this.y}}set value(t){"object"!=typeof t&&(t=this.parseValue(t)),this.x=Math.min(Math.max(parseFloat(t.x??0),0),100),this.y=Math.min(Math.max(parseFloat(t.y??0),0),100),this.setMarker()}setMarker(){this.marker&&(this.marker.style.left=this.x+"%",this.marker.style.top=this.y+"%")}}const fn=R({props:{autofocus:String,form:String,id:String,max:Number,min:Number,name:String,required:Boolean,step:Number,value:Number,variant:String}},(function(){var t=this;return(0,t._self._c)("input",t._b({attrs:{"data-variant":t.variant,type:"range"}},"input",t.$props,!1))}),[],!1,null,null,null,null).exports,gn={install(t){customElements.define("k-color",hn),customElements.define("k-coords",mn),t.component("k-range",fn)}};const kn=R({mixins:[Qt],inheritAttrs:!1,props:{autofocus:Boolean,empty:String,fieldsets:Object,fieldsetGroups:Object,group:String,max:{type:Number,default:null},value:{type:Array,default:()=>[]}},data:()=>({opened:[]}),computed:{hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.value.length},isFull(){return null!==this.max&&this.value.length>=this.max}},methods:{focus(){this.$refs.blocks.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-blocks-field",scopedSlots:t._u([{key:"options",fn:function(){return[t.hasFieldsets?e("k-dropdown",[e("k-button",{attrs:{icon:"dots"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"add"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}},[t._v(" "+t._s(t.$t("add"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{disabled:t.isEmpty,icon:"template"},on:{click:function(e){return t.$refs.blocks.copyAll()}}},[t._v(" "+t._s(t.$t("copy.all"))+" ")]),e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"download"},on:{click:function(e){return t.$refs.blocks.pasteboard()}}},[t._v(" "+t._s(t.$t("paste"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{disabled:t.isEmpty,icon:"trash"},on:{click:function(e){return t.$refs.blocks.removeAll()}}},[t._v(" "+t._s(t.$t("delete.all"))+" ")])],1)],1):t._e()]},proxy:!0}])},"k-field",t.$props,!1),[e("k-blocks",t._g({ref:"blocks",attrs:{autofocus:t.autofocus,compact:!1,empty:t.empty,endpoints:t.endpoints,fieldsets:t.fieldsets,"fieldset-groups":t.fieldsetGroups,group:t.group,max:t.max,value:t.value},on:{close:function(e){t.opened=e},open:function(e){t.opened=e}}},t.$listeners)),t.isEmpty||t.isFull?t._e():e("k-button",{staticClass:"k-field-add-item-button",attrs:{icon:"add",tooltip:t.$t("add")},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}})],1)}),[],!1,null,null,null,null).exports,bn={mixins:[Yt,Ut,Kt,Zt],props:{columns:Number,max:Number,min:Number,options:Array,value:{type:[Array,Object],default:()=>[]}}};const vn=R({mixins:[bn],inheritAttrs:!1,data(){return{selected:this.toArray(this.value)}},watch:{value(t){this.selected=this.toArray(t)},selected(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},onInput(t,e){if(!0===e)this.selected.push(t);else{const e=this.selected.indexOf(t);-1!==e&&this.selected.splice(e,1)}this.$emit("input",this.selected)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()},toArray:t=>!0===Array.isArray(t)?t:"string"==typeof t?String(t).split(","):"object"==typeof t?Object.values(t):void 0},validations(){return{selected:{required:!this.required||t.required,min:!this.min||t.minLength(this.min),max:!this.max||t.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-checkboxes-input",style:"--columns:"+t.columns},[t.options.length?t._l(t.options,(function(n,s){return e("li",{key:s},[e("k-checkbox-input",{attrs:{id:t.id+"-"+s,label:n.text,value:-1!==t.selected.indexOf(n.value)},on:{input:function(e){return t.onInput(n.value,e)}}})],1)})):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.$t("options.none")))])],2)}),[],!1,null,null,null,null).exports,yn={props:{counter:{type:Boolean,default:!0}},computed:{counterOptions(){const t=this.counterValue??this.value;if(null===t||this.disabled||!1===this.counter)return!1;let e=0;return t&&(e=Array.isArray(t)?t.length:String(t).length),{count:e,min:this.min??this.minlength,max:this.max??this.maxlength}}}};const $n=R({mixins:[Qt,ee,bn,yn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-checkboxes-field",attrs:{counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"checkboxes"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,wn={mixins:[Yt,Ut,Kt,Gt,Zt],props:{alpha:{type:Boolean,default:!0},format:{type:String,default:"hex",validator:t=>["hex","rgb","hsl"].includes(t)},placeholder:String,value:String}};const _n=R({mixins:[wn],inheritAttrs:!1,watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.onBlur(),this.$props.autofocus&&this.focus()},methods:{convert(t){try{return this.$library.colors.toString(t,this.format,this.alpha)}catch(e){return t}},focus(){this.$refs.input.focus()},onBlur(){const t=this.convert(this.value);this.onInput(t)},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onPaste(t){t instanceof ClipboardEvent&&(t=this.$helper.clipboard.read(t,!0));const e=this.convert(t);this.onInput(e)},onSave(){this.onBlur(),this.$emit("submit")},select(){this.$refs.input.select()}},validations(){return{value:{color:t=>!t||null!==this.$library.colors.parse(t),required:!this.required||t.required}}}},(function(){var t=this;return(0,t._self._c)("input",t._b({ref:"input",staticClass:"k-text-input k-color-input",attrs:{autocomplete:"off",spellcheck:"false",type:"text"},on:{blur:t.onBlur,input:function(e){return t.onInput(e.target.value)},paste:t.onPaste,keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?(e.stopPropagation(),e.preventDefault(),t.onSave.apply(null,arguments)):null}}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,name:t.name,placeholder:t.placeholder,required:t.required,value:t.value},!1))}),[],!1,null,null,null,null).exports;const xn=R({mixins:[Qt,ee,wn],inheritAttrs:!1,props:{icon:{type:String,default:"pipette"},mode:{type:String,default:"picker",validator:t=>["picker","input","options"].includes(t)},options:{type:Array,default:()=>[]}},data:()=>({isInvalid:!1}),computed:{convertedOptions(){return this.options.map((t=>({...t,value:this.convert(t.value)})))},currentOption(){return this.convertedOptions.find((t=>t.value===this.value))}},methods:{convert(t){return this.$library.colors.toString(t,this.format,this.alpha)},onInput(t){this.setPicker(t),this.$emit("input",t)},onPicker(t){const e=this.convert(t);this.$emit("input",e)},onOption(t){const e=this.convert(t.value);e!==this.value||this.required?this.$emit("input",e):this.$emit("input","")},setPicker(t=this.value){this.$refs.color&&(this.$refs.color.value=this.$library.colors.parseAs(t,"hsv"))}}},(function(){var t,e=this,n=e._self._c;return n("k-field",e._b({staticClass:"k-color-field",attrs:{input:e._uid}},"k-field",e.$props,!1),["options"===e.mode?n("div",{staticClass:"k-color-field-options",staticStyle:{"--preview-width":"var(--field-input-height)"}},e._l(e.convertedOptions,(function(t){var s;return n("button",{key:t.value,staticClass:"k-color-preview",style:"color: "+t.value,attrs:{"aria-current":t.value===(null==(s=e.currentOption)?void 0:s.value),title:t.text??t.value,type:"button"},on:{click:function(n){return e.onOption(t)}}})})),0):n("k-input",e._b({ref:"input",attrs:{id:e._uid,theme:"field",type:"color"},on:{input:e.onInput,invalid:function(t){e.isInvalid=t??!1},submit:function(t){return e.$emit("submit")}},scopedSlots:e._u([{key:"before",fn:function(){return["picker"===e.mode?[n("k-dropdown",[n("button",{staticClass:"k-color-field-preview k-color-preview",style:e.isInvalid?null:"color: "+e.value,attrs:{type:"button"},on:{click:function(t){return e.$refs.picker.toggle()}}}),n("k-dropdown-content",{ref:"picker",staticClass:"k-color-field-picker",on:{open:function(t){return e.$nextTick(e.setPicker)}}},[n("k-color",{ref:"color",attrs:{alpha:e.alpha},on:{input:function(t){return e.onPicker(t.target.value)}}}),n("div",{staticClass:"k-color-field-options"},e._l(e.convertedOptions,(function(t){return n("button",{key:t.value,staticClass:"k-color-preview",style:"color: "+t.value,attrs:{title:t.text??t.value,type:"button"},on:{click:function(n){return e.$refs.input.$refs.input.onPaste(t.value)}}})})),0)],1)],1)]:n("div",{staticClass:"k-color-field-preview k-color-preview",style:e.isInvalid?null:"color: "+e.value})]},proxy:!0},(null==(t=e.currentOption)?void 0:t.text)?{key:"after",fn:function(){return[e._v(" "+e._s(e.currentOption.text)+" ")]},proxy:!0}:null,"picker"===e.mode?{key:"icon",fn:function(){return[n("k-button",{staticClass:"k-input-icon-button",attrs:{icon:e.icon},on:{click:function(t){return t.stopPropagation(),e.$refs.picker.toggle()}}})]},proxy:!0}:null],null,!0)},"k-input",e.$props,!1))],1)}),[],!1,null,null,null,null).exports,Cn={mixins:[Yt,Ut,Kt,Zt],props:{display:{type:String,default:"DD.MM.YYYY"},max:String,min:String,step:{type:Object,default:()=>({size:1,unit:"day"})},type:{type:String,default:"date"},value:String}};const Sn=R({mixins:[Cn],inheritAttrs:!1,data:()=>({dt:null,formatted:null}),computed:{inputType:()=>"date",pattern(){return this.$library.dayjs.pattern(this.display)},rounding(){return{...this.$options.props.step.default(),...this.step}}},watch:{value:{handler(t,e){if(t!==e){const e=this.toDatetime(t);this.commit(e)}},immediate:!0}},created(){this.$events.$on("keydown.cmd.s",this.onBlur)},destroyed(){this.$events.$off("keydown.cmd.s",this.onBlur)},methods:{alter(t){let e=this.parse()||this.round(this.$library.dayjs()),n=this.rounding.unit,s=this.rounding.size;const i=this.selection();null!==i&&("meridiem"===i.unit?(t="pm"===e.format("a")?"subtract":"add",n="hour",s=12):(n=i.unit,n!==this.rounding.unit&&(s=1))),e=e[t](s,n).round(this.rounding.unit,this.rounding.size),this.commit(e),this.emit(e),this.$nextTick((()=>this.select(i)))},commit(t){this.dt=t,this.formatted=this.pattern.format(t),this.$emit("invalid",this.$v.$invalid,this.$v)},emit(t){this.$emit("input",this.toISO(t))},focus(){this.$refs.input.focus()},onArrowDown(){this.alter("subtract")},onArrowUp(){this.alter("add")},onBlur(){const t=this.parse();this.commit(t),this.emit(t)},onEnter(){this.onBlur(),this.$nextTick((()=>this.$emit("submit")))},onInput(t){const e=this.parse(),n=this.pattern.format(e);if(!t||n==t)return this.commit(e),this.emit(e)},onTab(t){""!=this.$refs.input.value&&(this.onBlur(),this.$nextTick((()=>{const e=this.selection();if(this.$refs.input&&e.start===this.$refs.input.selectionStart&&e.end===this.$refs.input.selectionEnd-1)if(t.shiftKey){if(0===e.index)return;this.selectPrev(e.index)}else{if(e.index===this.pattern.parts.length-1)return;this.selectNext(e.index)}else{if(this.$refs.input&&this.$refs.input.selectionStart==e.end+1&&e.index==this.pattern.parts.length-1)return;if(this.$refs.input&&this.$refs.input.selectionEnd-1>e.end){const t=this.pattern.at(this.$refs.input.selectionEnd,this.$refs.input.selectionEnd);this.select(this.pattern.parts[t.index])}else this.select(this.pattern.parts[e.index])}t.preventDefault()})))},parse(){let t=this.$refs.input.value;return t=this.$library.dayjs.interpret(t,this.inputType),this.round(t)},round(t){return(null==t?void 0:t.round(this.rounding.unit,this.rounding.size))||null},select(t){var e;t||(t=this.selection()),null==(e=this.$refs.input)||e.setSelectionRange(t.start,t.end+1)},selectFirst(){this.select(this.pattern.parts[0])},selectLast(){this.select(this.pattern.parts[this.pattern.parts.length-1])},selectNext(t){this.select(this.pattern.parts[t+1])},selectPrev(t){this.select(this.pattern.parts[t-1])},selection(){return this.pattern.at(this.$refs.input.selectionStart,this.$refs.input.selectionEnd)},toDatetime(t){return this.round(this.$library.dayjs.iso(t,this.inputType))},toISO(t){return(null==t?void 0:t.toISO(this.inputType))||null}},validations(){return{value:{min:!this.dt||!this.min||(()=>this.dt.validate(this.min,"min",this.rounding.unit)),max:!this.dt||!this.max||(()=>this.dt.validate(this.max,"max",this.rounding.unit)),required:!this.required||(()=>!!this.dt)}}}},(function(){var t=this;return(0,t._self._c)("input",{directives:[{name:"direction",rawName:"v-direction"}],ref:"input",class:`k-text-input k-${t.type}-input`,attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled,placeholder:t.display,required:t.required,autocomplete:"off",spellcheck:"false",type:"text"},domProps:{value:t.formatted},on:{blur:t.onBlur,focus:function(e){return t.$emit("focus")},input:function(e){return t.onInput(e.target.value)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.stopPropagation(),e.preventDefault(),t.onArrowDown.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.stopPropagation(),e.preventDefault(),t.onArrowUp.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:t.onTab.apply(null,arguments)}]}})}),[],!1,null,null,null,null).exports;const On=R({mixins:[Qt,ee,Cn],inheritAttrs:!1,props:{calendar:{type:Boolean,default:!0},icon:{type:String,default:"calendar"},time:{type:[Boolean,Object],default:()=>({})},times:{type:Boolean,default:!0}},data(){return{isInvalid:!1,iso:this.toIso(this.value)}},computed:{isEmpty(){return this.time?null===this.iso.date&&this.iso.time:null===this.iso.date}},watch:{value(t,e){t!==e&&(this.iso=this.toIso(t))}},methods:{focus(){this.$refs.dateInput.focus()},now(){const t=this.$library.dayjs();return{date:t.toISO("date"),time:this.time?t.toISO("time"):"00:00:00"}},onInput(){if(this.isEmpty)return this.$emit("input","");const t=this.$library.dayjs.iso(this.iso.date+" "+this.iso.time);(t||null!==this.iso.date&&null!==this.iso.time)&&this.$emit("input",(null==t?void 0:t.toISO())||"")},onCalendarInput(t){var e;null==(e=this.$refs.calendar)||e.close(),this.onDateInput(t)},onDateInput(t){t&&!this.iso.time&&(this.iso.time=this.now().time),this.iso.date=t,this.onInput()},onDateInvalid(t){this.isInvalid=t},onTimeInput(t){t&&!this.iso.date&&(this.iso.date=this.now().date),this.iso.time=t,this.onInput()},onTimesInput(t){var e;null==(e=this.$refs.times)||e.close(),this.onTimeInput(t+":00")},toIso(t){const e=this.$library.dayjs.iso(t);return{date:(null==e?void 0:e.toISO("date"))||null,time:(null==e?void 0:e.toISO("time"))||null}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-date-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("div",{ref:"body",staticClass:"k-date-field-body",attrs:{"data-invalid":!t.novalidate&&t.isInvalid,"data-theme":"field"}},[e("k-input",t._b({ref:"dateInput",attrs:{id:t._uid,autofocus:t.autofocus,disabled:t.disabled,display:t.display,max:t.max,min:t.min,required:t.required,value:t.value,theme:"field",type:"date"},on:{invalid:t.onDateInvalid,input:t.onDateInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.calendar?{key:"icon",fn:function(){return[e("k-dropdown",[e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,tooltip:t.$t("date.select")},on:{click:function(e){return t.$refs.calendar.toggle()}}}),e("k-dropdown-content",{ref:"calendar",attrs:{align:"right"}},[e("k-calendar",{attrs:{value:t.value,min:t.min,max:t.max},on:{input:t.onCalendarInput}})],1)],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1)),t.time?e("k-input",{ref:"timeInput",attrs:{disabled:t.disabled,display:t.time.display,required:t.required,step:t.time.step,value:t.iso.time,icon:t.time.icon,theme:"field",type:"time"},on:{input:t.onTimeInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-dropdown",[e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.time.icon||"clock",tooltip:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{align:"right"}},[e("k-times",{attrs:{display:t.time.display,value:t.value},on:{input:t.onTimesInput}})],1)],1)]},proxy:!0}:null],null,!0)}):t._e()],1)])}),[],!1,null,null,null,null).exports,An={mixins:[Yt,Ut,Kt,Gt,Zt],props:{autocomplete:{type:[Boolean,String],default:"off"},maxlength:Number,minlength:Number,pattern:String,placeholder:String,preselect:Boolean,spellcheck:{type:[Boolean,String],default:"off"},type:{type:String,default:"text"},value:String}};const In=R({mixins:[An],inheritAttrs:!1,data(){return{listeners:{...this.$listeners,input:t=>this.onInput(t.target.value)}}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.$refs.input.select()}},validations(){return{value:{required:!this.required||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.maxLength(this.maxlength),email:"email"!==this.type||t.email,url:"url"!==this.type||t.url,pattern:!this.pattern||(t=>!this.required&&!t||!this.$refs.input.validity.patternMismatch)}}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-text-input"},"input",{autocomplete:t.autocomplete,autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,type:t.type,value:t.value},!1),t.listeners))}),[],!1,null,null,null,null).exports,Mn={mixins:[An],props:{autocomplete:{type:String,default:"email"},placeholder:{type:String,default:()=>window.panel.$t("email.placeholder")},type:{type:String,default:"email"}}};const Tn=R({extends:In,mixins:[Mn]},null,null,!1,null,null,null,null).exports;const jn=R({mixins:[Qt,ee,Mn],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"email"}},computed:{mailto(){var t;return(null==(t=this.value)?void 0:t.length)>0?"mailto:"+this.value:null}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-email-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"email"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.mailto,tooltip:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,En={mixins:[Qt],inheritAttrs:!1,props:{empty:String,info:String,link:Boolean,layout:{type:String,default:"list"},max:Number,multiple:Boolean,parent:String,search:Boolean,size:String,text:String,value:{type:Array,default:()=>[]}},data(){return{selected:this.value}},computed:{btnIcon(){return!this.multiple&&this.selected.length>0?"refresh":"add"},btnLabel(){return!this.multiple&&this.selected.length>0?this.$t("change"):this.$t("add")},collection(){return{empty:this.emptyProps,items:this.selected,layout:this.layout,link:this.link,size:this.size,sortable:!this.disabled&&this.selected.length>1}},isInvalid(){return!(!this.required||0!==this.selected.length)||(!!(this.min&&this.selected.lengththis.max))},items(){return this.models.map(this.item)},more(){return!this.max||this.max>this.selected.length}},watch:{value(t){this.selected=t}},methods:{focus(){},item:t=>t,onInput(){this.$emit("input",this.selected)},open(){if(this.disabled)return!1;this.$refs.selector.open({endpoint:this.endpoints.field,max:this.max,multiple:this.multiple,search:this.search,selected:this.selected.map((t=>t.id))})},remove(t){this.selected.splice(t,1),this.onInput()},removeById(t){this.selected=this.selected.filter((e=>e.id!==t)),this.onInput()},select(t){0!==t.length?(this.selected=this.selected.filter((e=>t.filter((t=>t.id===e.id)).length>0)),t.forEach((t=>{0===this.selected.filter((e=>t.id===e.id)).length&&this.selected.push(t)})),this.onInput()):this.selected=[]}}};const Ln=R({mixins:[En],props:{uploads:[Boolean,Object,Array]},computed:{canUpload(){return!this.disabled&&this.more&&this.uploads},emptyProps(){return{icon:"image",text:this.empty||this.$t("field.files.empty")}},options(){return this.uploads?{icon:this.btnIcon,text:this.btnLabel,options:[{icon:"check",text:this.$t("select"),click:"open"},{icon:"upload",text:this.$t("upload"),click:"upload"}]}:{options:[{icon:"check",text:this.$t("select"),click:()=>this.open()}]}},uploadOptions(){return{accept:this.uploads.accept,max:this.max,multiple:this.multiple,url:this.$panel.urls.api+"/"+this.endpoints.field+"/upload",on:{done:this.onUpload}}}},created(){this.$events.$on("file.delete",this.removeById)},destroyed(){this.$events.$off("file.delete",this.removeById)},methods:{drop(t){return!1!==this.uploads&&this.$panel.upload.open(t,this.uploadOptions)},isSelected(t){return this.selected.find((e=>e.id===t.id))},onAction(t){if(this.canUpload)switch(t){case"open":return this.open();case"upload":return this.$panel.upload.pick(this.uploadOptions)}},onUpload(t){!1===this.multiple&&(this.selected=[]);for(const e of t)this.isSelected(e)||this.selected.push(e);this.onInput(),this.$events.$emit("model.update")},prompt(){return!this.disabled&&(this.canUpload?this.$refs.options.toggle():void this.open())}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-files-field",scopedSlots:t._u([t.more&&!t.disabled?{key:"options",fn:function(){return[e("k-button-group",{staticClass:"k-field-options"},[e("k-options-dropdown",t._b({ref:"options",on:{action:t.onAction}},"k-options-dropdown",t.options,!1))],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-dropzone",{attrs:{disabled:!t.canUpload},on:{drop:t.drop}},[e("k-collection",t._b({on:{empty:t.prompt,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function({index:n}){return[t.disabled?t._e():e("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(n)}}})]}}])},"k-collection",t.collection,!1))],1),e("k-files-dialog",{ref:"selector",on:{submit:t.select}})],1)}),[],!1,null,null,null,null).exports;const Dn=R({},(function(){return(0,this._self._c)("div",{staticClass:"k-field k-gap-field"})}),[],!1,null,null,null,null).exports;const Bn=R({mixins:[Vt,Jt],props:{numbered:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-headline-field"},[e("k-headline",{attrs:{"data-numbered":t.numbered,size:"large"}},[t._v(" "+t._s(t.label)+" ")]),t.help?e("footer",{staticClass:"k-field-footer"},[e("k-text",{staticClass:"k-field-help",attrs:{html:t.help,theme:"help"}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;const Pn=R({mixins:[Vt,Jt],props:{text:String,theme:{type:String,default:"info"}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-field k-info-field"},[e("k-headline",[t._v(t._s(t.label))]),e("k-box",{attrs:{theme:t.theme}},[e("k-text",{attrs:{html:t.text}})],1),t.help?e("footer",{staticClass:"k-field-footer"},[e("k-text",{staticClass:"k-field-help",attrs:{html:t.help,theme:"help"}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;const Fn=R({mixins:[Qt],inheritAttrs:!1,props:{empty:String,fieldsetGroups:Object,fieldsets:Object,layouts:{type:Array,default:()=>[["1/1"]]},settings:Object,value:{type:Array,default:()=>[]}},computed:{isEmpty(){return 0===this.value.length}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-layout-field",scopedSlots:t._u([{key:"options",fn:function(){return[e("k-dropdown",[e("k-button",{attrs:{icon:"dots"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{icon:"add"},on:{click:function(e){return t.$refs.layouts.select(0)}}},[t._v(" "+t._s(t.$t("add"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{disabled:t.isEmpty,icon:"template"},on:{click:function(e){return t.$refs.layouts.copy()}}},[t._v(" "+t._s(t.$t("copy.all"))+" ")]),e("k-dropdown-item",{attrs:{icon:"download"},on:{click:function(e){return t.$refs.layouts.pasteboard()}}},[t._v(" "+t._s(t.$t("paste"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{disabled:t.isEmpty,icon:"trash"},on:{click:function(e){return t.$refs.layouts.removeAll()}}},[t._v(" "+t._s(t.$t("delete.all"))+" ")])],1)],1)]},proxy:!0}])},"k-field",t.$props,!1),[e("k-layouts",t._b({ref:"layouts",on:{input:function(e){return t.$emit("input",e)}}},"k-layouts",t.$props,!1))],1)}),[],!1,null,null,null,null).exports;const Nn=R({},(function(){return(0,this._self._c)("hr",{staticClass:"k-line-field"})}),[],!1,null,null,null,null).exports;const qn=R({mixins:[Qt,ee],inheritAttrs:!1,props:{options:Array,value:{default:"",type:String}},data:()=>({model:null,linkType:null,linkValue:null,expanded:!1,isInvalid:!1}),computed:{currentType(){return this.activeTypes[this.linkType]??this.activeTypes.url},availableTypes(){return{url:{detect:t=>/^(http|https):\/\//.test(t),icon:"url",label:this.$t("url"),link:t=>t,placeholder:this.$t("url.placeholder"),input:"url",value:t=>t},page:{detect:t=>!0===this.isPageUUID(t),icon:"page",label:this.$t("page"),link:t=>t,placeholder:this.$t("select")+" …",input:"text",value:t=>t},file:{detect:t=>!0===this.isFileUUID(t),icon:"file",label:this.$t("file"),link:t=>t,placeholder:this.$t("select")+" …",value:t=>t},email:{detect:t=>t.startsWith("mailto:"),icon:"email",label:this.$t("email"),link:t=>t.replace(/^mailto:/,""),placeholder:this.$t("email.placeholder"),input:"email",value:t=>"mailto:"+t},tel:{detect:t=>t.startsWith("tel:"),icon:"phone",label:this.$t("tel"),link:t=>t.replace(/^tel:/,""),pattern:"[+]{0,1}[0-9]+",placeholder:this.$t("tel.placeholder"),input:"tel",value:t=>"tel:"+t},anchor:{detect:t=>t.startsWith("#"),icon:"anchor",label:"Anchor",link:t=>t,pattern:"^#.+",placeholder:"#element",input:"text",value:t=>t},custom:{detect:()=>!0,icon:"title",label:this.$t("custom"),link:t=>t,input:"text",value:t=>t}}},activeTypes(){if(!this.options)return this.availableTypes;const t={};for(const e of this.options)t[e]=this.availableTypes[e];return t}},watch:{value:{handler(t,e){if(t===e)return;const n=this.detect(t);this.linkType=this.linkType??n.type,this.linkValue=n.link,t!==e&&this.preview()},immediate:!0}},created(){this.$events.on("click",this.onOutsideClick)},destroyed(){this.$events.off("click",this.onOutsideClick)},methods:{clear(){this.$emit("input",""),this.expanded=!1},detect(t){if(0===(t=t??"").length)return{type:"url",link:""};for(const e in this.availableTypes)if(!0===this.availableTypes[e].detect(t))return{type:e,link:this.availableTypes[e].link(t)}},focus(){var t;null==(t=this.$refs.input)||t.focus()},getFileUUID:t=>t.replace("/@/file/","file://"),getPageUUID:t=>t.replace("/@/page/","page://"),isFileUUID:t=>!0===t.startsWith("file://")||!0===t.startsWith("/@/file/"),isPageUUID:t=>!0===t.startsWith("page://")||!0===t.startsWith("/@/page/"),onInput(t){const e=t.trim();if(!e.length)return this.$emit("input","");this.$emit("input",this.currentType.value(e))},onInvalid(t){this.isInvalid=t},onOutsideClick(t){!1===this.$el.contains(t.target)&&(this.expanded=!1)},async preview(){"page"===this.linkType&&this.linkValue?this.model=await this.previewForPage(this.linkValue):"file"===this.linkType&&this.linkValue?this.model=await this.previewForFile(this.linkValue):this.model=null},async previewForFile(t){try{const e=await this.$api.files.get(null,t,{select:"filename, panelImage"});return{label:e.filename,image:e.panelImage}}catch(e){return null}},async previewForPage(t){try{return{label:(await this.$api.pages.get(t,{select:"title"})).title}}catch(e){return null}},switchType(t){t!==this.linkType&&(this.isInvalid=!1,this.linkType=t,this.linkValue="","page"===this.linkType||"file"===this.linkType?this.expanded=!0:this.expanded=!1,this.$emit("input",""),this.$nextTick((()=>{this.focus()})))},toggle(){this.expanded=!this.expanded}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-link-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._b({attrs:{invalid:t.isInvalid,icon:!1,theme:"field"}},"k-input",t.$props,!1),[e("div",{staticClass:"k-link-input-header"},[e("k-dropdown",[e("k-button",{staticClass:"k-link-input-toggle",attrs:{disabled:t.disabled,icon:t.currentType.icon},on:{click:function(e){return t.$refs.types.toggle()}}},[t._v(" "+t._s(t.currentType.label)+" ")]),e("k-dropdown-content",{ref:"types"},t._l(t.activeTypes,(function(n,s){return e("k-dropdown-item",{key:s,attrs:{icon:n.icon},on:{click:function(e){return t.switchType(s)}}},[t._v(" "+t._s(n.label)+" ")])})),1)],1),"page"===t.linkType||"file"===t.linkType?e("div",{staticClass:"k-link-input-model",on:{click:t.toggle}},[t.model?e("k-tag",{staticClass:"k-link-input-model-preview",attrs:{removable:!0},on:{remove:t.clear}},[t.model.image?e("k-item-image",{staticClass:"k-link-input-model-preview-image",attrs:{image:{...t.model.image,cover:!0,back:"gray-200"}}}):t._e(),t._v(" "+t._s(t.model.label)+" ")],1):e("k-button",{staticClass:"k-link-input-model-placeholder"},[t._v(" "+t._s(t.currentType.placeholder)+" ")]),e("k-button",{staticClass:"k-link-input-model-toggle",attrs:{icon:"bars"}})],1):e("k-"+t.currentType.input+"-input",{ref:"input",tag:"component",attrs:{id:t._uid,pattern:t.currentType.pattern??null,placeholder:t.currentType.placeholder,value:t.linkValue},on:{invalid:t.onInvalid,input:t.onInput}})],1),"page"===t.linkType?e("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"k-link-input-body",attrs:{"data-type":"page"}},[e("div",{staticClass:"k-page-browser"},[e("k-page-tree",{attrs:{current:t.getPageUUID(t.value),root:!1},on:{select:function(e){return t.onInput(e.id)}}})],1)]):"file"===t.linkType?e("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"k-link-input-body",attrs:{"data-type":"file"}},[e("k-file-browser",{attrs:{selected:t.getFileUUID(t.value)},on:{select:function(e){return t.onInput(e.id)}}})],1):t._e()])],1)}),[],!1,null,null,null,null).exports;class Rn{constructor(t={}){this.options={...this.defaults,...t}}init(){return null}bindEditor(t=null){this.editor=t}get name(){return null}get type(){return"extension"}get defaults(){return{}}plugins(){return[]}inputRules(){return[]}pasteRules(){return[]}keys(){return{}}}class zn extends Rn{constructor(t={}){super(t)}get type(){return"node"}get schema(){return{}}commands(){return{}}}class Yn extends zn{get defaults(){return{inline:!1}}get name(){return"doc"}get schema(){return{content:this.options.inline?"inline*":"block+"}}}class Hn extends Yn{get schema(){return{content:this.options.nodes.join("|")}}}const Un={props:{autofocus:Boolean,keys:Object,nodes:{type:Array,default:()=>["bulletList","orderedList"]},marks:{type:[Array,Boolean],default:!0},value:String}};const Vn=R({mixins:[Un],inheritAttrs:!1,data(){return{list:this.value,html:this.value}},computed:{extensions(){return[new Hn({inline:!0,nodes:this.nodes})]}},watch:{value(t){t!==this.html&&(this.list=t,this.html=t)}},methods:{focus(){this.$refs.input.focus()},onInput(t){let e=(new DOMParser).parseFromString(t,"text/html").querySelector("ul, ol");e&&0!==e.textContent.trim().length?(this.list=t,this.html=t.replace(/(

        |<\/p>)/gi,""),this.$emit("input",this.html)):this.$emit("input",this.list="")}}},(function(){var t=this;return(0,t._self._c)("k-writer",t._b({ref:"input",staticClass:"k-list-input",attrs:{extensions:t.extensions,value:t.list},on:{input:t.onInput}},"k-writer",t.$props,!1))}),[],!1,null,null,null,null).exports;const Kn=R({mixins:[Qt,ee,Un],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-list-field",attrs:{input:t._uid,counter:!1}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{id:t._uid,type:"list",theme:"field"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,Wn={mixins:[Ut,Kt,Zt],props:{max:Number,min:Number,layout:String,options:Array,search:[Object,Boolean],separator:{type:String,default:","},sort:Boolean,value:{type:Array,required:!0,default:()=>[]}}};const Jn=R({mixins:[Wn],inheritAttrs:!1,data(){return{state:this.value,q:null,limit:!0,scrollTop:0}},computed:{draggable(){return this.state.length>1&&!this.sort},dragOptions(){return{disabled:!this.draggable,draggable:".k-tag",delay:1}},emptyLabel(){return this.q?this.$t("search.results.none"):this.$t("options.none")},filtered(){var t;return(null==(t=this.q)?void 0:t.length)>=(this.search.min||0)?this.options.filter((t=>this.isFiltered(t))).map((t=>({...t,text:this.toHighlightedString(t.text)}))):this.options},more(){return!this.max||this.state.lengththis.options.find((e=>e.value===t))));if(!1===this.sort)return t;const e=t=>this.options.findIndex((e=>e.value===t.value));return t.sort(((t,n)=>e(t)-e(n)))},visible(){return this.limit?this.filtered.slice(0,this.search.display||this.filtered.length):this.filtered}},watch:{value(t){this.state=t,this.onInvalid()}},mounted(){this.onInvalid(),this.$events.$on("click",this.close),this.$events.$on("keydown.cmd.s",this.close)},destroyed(){this.$events.$off("click",this.close),this.$events.$off("keydown.cmd.s",this.close)},methods:{add(t){!0===this.more&&(this.state.push(t.value),this.onInput())},blur(){this.close()},close(){var t;!0===(null==(t=this.$refs.dropdown)?void 0:t.isOpen)&&(this.$refs.dropdown.close(),this.limit=!0)},focus(){var t;null==(t=this.$refs.dropdown)||t.open()},index(t){return this.state.findIndex((e=>e===t.value))},isFiltered(t){return String(t.text).match(this.regex)||String(t.value).match(this.regex)},isSelected(t){return-1!==this.index(t)},navigate(t){var e,n,s;"prev"===t&&(t="previous"),null==(s=null==(n=null==(e=document.activeElement)?void 0:e[t+"Sibling"])?void 0:n.focus)||s.call(n)},onClose(){var t;!1===(null==(t=this.$refs.dropdown)?void 0:t.isOpen)&&(document.activeElement===this.$parent.$el&&(this.q=null),this.$parent.$el.focus())},onEscape(){this.q?this.q=null:this.close()},onInput(){this.$emit("input",this.state)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onOpen(){this.$nextTick((()=>{var t,e,n;null==(e=null==(t=this.$refs.search)?void 0:t.focus)||e.call(t),(null==(n=this.$refs.dropdown)?void 0:n.$el)&&(this.$refs.dropdown.$el.querySelector(".k-multiselect-options").scrollTop=this.scrollTop)}))},remove(t){const e=this.index(t);this.state.splice(e,1),this.onInput()},select(t){this.scrollTop=this.$refs.dropdown.$el.querySelector(".k-multiselect-options").scrollTop,this.isSelected(t)?this.remove(t):this.add(t)},toHighlightedString(t){return(t=this.$helper.string.stripHTML(t)).replace(this.regex,"$1")}},validations(){return{state:{required:!this.required||t.required,minLength:!this.min||t.minLength(this.min),maxLength:!this.max||t.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("k-draggable",{staticClass:"k-multiselect-input",attrs:{list:t.state,options:t.dragOptions,"data-layout":t.layout,element:"k-dropdown"},on:{end:t.onInput},nativeOn:{click:function(e){return t.$refs.dropdown.toggle.apply(null,arguments)}},scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-dropdown-content",{ref:"dropdown",on:{open:t.onOpen,close:t.onClose},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:(e.stopPropagation(),t.close.apply(null,arguments))}}},[t.search?e("k-dropdown-item",{staticClass:"k-multiselect-search",attrs:{icon:"search"}},[e("input",{ref:"search",attrs:{placeholder:t.search.min?t.$t("search.min",{min:t.search.min}):t.$t("search")+" …"},domProps:{value:t.q},on:{input:function(e){t.q=e.target.value},keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:(e.stopPropagation(),t.onEscape.apply(null,arguments))}}})]):t._e(),e("div",{staticClass:"k-multiselect-options scroll-y-auto"},[t._l(t.visible,(function(n){return e("k-dropdown-item",{key:n.value,class:{"k-multiselect-option":!0,selected:t.isSelected(n),disabled:!t.more},attrs:{icon:t.isSelected(n)?"check":"circle-outline"},on:{click:function(e){return e.preventDefault(),t.select(n)}},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),e.stopPropagation(),t.select(n))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:(e.preventDefault(),e.stopPropagation(),t.select(n))}]}},[e("span",{domProps:{innerHTML:t._s(n.text)}})])})),0===t.filtered.length?e("k-dropdown-item",{staticClass:"k-multiselect-option",attrs:{disabled:!0}},[t._v(" "+t._s(t.emptyLabel)+" ")]):t._e()],2),t.visible.lengththis.onInput(t.target.value),blur:this.onBlur}}},watch:{value(t){this.number=t},number:{immediate:!0,handler(){this.onInvalid()}}},mounted(){this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{decimals(){const t=Number(this.step||0);return Math.floor(t)===t?0:-1!==t.toString().indexOf("e")?parseInt(t.toFixed(16).split(".")[1].split("").reverse().join("")).toString().length:t.toString().split(".")[1].length||0},format(t){if(isNaN(t)||""===t)return"";const e=this.decimals();return t=e?parseFloat(t).toFixed(e):Number.isInteger(this.step)?parseInt(t):parseFloat(t)},clean(){this.number=this.format(this.number)},emit(t){t=parseFloat(t),isNaN(t)&&(t=""),t!==this.value&&this.$emit("input",t)},focus(){this.$refs.input.focus()},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.number=t,this.emit(t)},onBlur(){this.clean(),this.emit(this.number)},select(){this.$refs.input.select()}},validations(){return{value:{required:!this.required||t.required,min:!this.min||t.minValue(this.min),max:!this.max||t.maxValue(this.max)}}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({ref:"input",staticClass:"k-number-input",attrs:{step:t.stepNumber,type:"number"},domProps:{value:t.number},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.ctrlKey?t.clean.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?t.clean.apply(null,arguments):null}]}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,max:t.max,min:t.min,name:t.name,placeholder:t.placeholder,required:t.required},!1),t.listeners))}),[],!1,null,null,null,null).exports;const Xn=R({mixins:[Qt,ee,Zn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-number-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"number"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const ts=R({mixins:[Qt,ee],props:{empty:String,fields:Object,value:[String,Object]},data(){return{object:this.valueToObject(this.value)}},computed:{drawer(){return{icon:"box",tab:"object",tabs:{object:{fields:this.$helper.field.subfields(this,this.fields)}},title:this.label,value:this.object}},isEmpty(){return 0===this.$helper.object.length(this.object)},isInvalid(){return!0===this.required&&this.isEmpty}},watch:{value(t){this.object=this.valueToObject(t)}},methods:{onAdd(){this.object=this.$helper.field.form(this.fields),this.$emit("input",this.object),this.open()},onCellInput(t,e){Vue.set(this.object,t,e),this.$emit("input",this.object)},onDrawerInput(t){this.object=t,this.$emit("input",this.object)},onRemove(){this.object={},this.$emit("input",this.object)},open(t){if(this.disabled)return!1;this.$refs.drawer.open(null,t)},valueToObject:t=>"object"!=typeof t?null:t}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-object-field",scopedSlots:t._u([t.disabled?null:{key:"options",fn:function(){return[t.isEmpty?e("k-button",{attrs:{icon:"add"},on:{click:t.onAdd}}):e("k-button",{attrs:{icon:"remove"},on:{click:t.onRemove}})]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[t.isEmpty?e("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"box"},on:{click:t.onAdd}},[t._v(" "+t._s(t.empty||t.$t("field.object.empty"))+" ")]):e("table",{staticClass:"k-table k-object-field-table",attrs:{"data-invalid":t.isInvalid}},[e("tbody",[t._l(t.fields,(function(n){return[n.saveable&&t.$helper.field.isVisible(n,t.value)?e("tr",{key:n.name,on:{click:function(e){return t.open(n.name)}}},[e("th",{attrs:{"data-mobile":"true"}},[e("button",{attrs:{type:"button"}},[t._v(t._s(n.label))])]),e("k-table-cell",{attrs:{column:n,field:n,mobile:!0,value:t.object[n.name]},on:{input:function(e){return t.onCellInput(n.name,e)}}})],1):t._e()]}))],2)]),e("k-form-drawer",t._b({ref:"drawer",on:{input:t.onDrawerInput}},"k-form-drawer",t.drawer,!1))],1)}),[],!1,null,null,null,null).exports;const es=R({mixins:[En],computed:{emptyProps(){return{icon:"page",text:this.empty||this.$t("field.pages.empty")}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-pages-field",scopedSlots:t._u([{key:"options",fn:function(){return[e("k-button-group",{staticClass:"k-field-options"},[t.more&&!t.disabled?e("k-button",{staticClass:"k-field-options-button",attrs:{icon:t.btnIcon,text:t.btnLabel},on:{click:t.open}}):t._e()],1)]},proxy:!0}])},"k-field",t.$props,!1),[e("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function({index:n}){return[t.disabled?t._e():e("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(n)}}})]}}])},"k-collection",t.collection,!1)),e("k-pages-dialog",{ref:"selector",on:{submit:t.select}})],1)}),[],!1,null,null,null,null).exports,ns={mixins:[An],props:{autocomplete:{type:String,default:"new-password"},type:{type:String,default:"password"}}};const ss=R({extends:In,mixins:[ns]},null,null,!1,null,null,null,null).exports;const is=R({mixins:[Qt,ee,ns,yn],inheritAttrs:!1,props:{minlength:{type:Number,default:8},icon:{type:String,default:"key"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-password-field",attrs:{input:t._uid,counter:t.counterOptions},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"password"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,os={mixins:[Yt,Ut,Kt,Zt],props:{columns:Number,options:Array,value:[String,Number,Boolean]}};const ls=R({mixins:[os],inheritAttrs:!1,watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-radio-input",style:"--columns:"+t.columns},[t.options.length?t._l(t.options,(function(n,s){return e("li",{key:s},[e("input",{staticClass:"k-radio-input-native",attrs:{id:t.id+"-"+s,name:t.id,type:"radio"},domProps:{value:n.value,checked:t.value===n.value},on:{change:function(e){return t.onInput(n.value)}}}),n.info?e("label",{attrs:{for:t.id+"-"+s}},[e("span",{staticClass:"k-radio-input-text",domProps:{innerHTML:t._s(n.text)}}),e("span",{staticClass:"k-radio-input-info",domProps:{innerHTML:t._s(n.info)}})]):e("label",{attrs:{for:t.id+"-"+s},domProps:{innerHTML:t._s(n.text)}}),n.icon?e("k-icon",{attrs:{type:n.icon}}):t._e()],1)})):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.$t("options.none")))])],2)}),[],!1,null,null,null,null).exports;const rs=R({mixins:[Qt,ee,os],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-radio-field"},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"radio"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,as={mixins:[Yt,Ut,Kt,Gt,Zt],props:{default:[Number,String],max:{type:Number,default:100},min:{type:Number,default:0},step:{type:Number,default:1},tooltip:{type:[Boolean,Object],default:()=>({before:null,after:null})},value:[Number,String]}};const us=R({mixins:[as],inheritAttrs:!1,data(){return{listeners:{...this.$listeners,input:t=>this.onInput(t.target.value)}}},computed:{baseline(){return this.min<0?0:this.min},label(){return this.required||this.value||0===this.value?this.format(this.position):"–"},position(){return this.value||0===this.value?this.value:this.default||this.baseline}},watch:{position(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},format(t){const e=document.lang?document.lang.replace("_","-"):"en",n=this.step.toString().split("."),s=n.length>1?n[1].length:0;return new Intl.NumberFormat(e,{minimumFractionDigits:s}).format(t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.$emit("input",t)}},validations(){return{position:{required:!this.required||t.required,min:!this.min||t.minValue(this.min),max:!this.max||t.maxValue(this.max)}}}},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-range-input"},[e("input",t._g(t._b({ref:"input",staticClass:"k-range-input-native",style:`--min: ${t.min}; --max: ${t.max}; --value: ${t.position}`,attrs:{type:"range"},domProps:{value:t.position}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,max:t.max,min:t.min,name:t.name,required:t.required,step:t.step},!1),t.listeners)),t.tooltip?e("span",{staticClass:"k-range-input-tooltip"},[t.tooltip.before?e("span",{staticClass:"k-range-input-tooltip-before"},[t._v(t._s(t.tooltip.before))]):t._e(),e("span",{staticClass:"k-range-input-tooltip-text"},[t._v(t._s(t.label))]),t.tooltip.after?e("span",{staticClass:"k-range-input-tooltip-after"},[t._v(t._s(t.tooltip.after))]):t._e()]):t._e()])}),[],!1,null,null,null,null).exports;const cs=R({mixins:[ee,Qt,as],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-range-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"range"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,ds={mixins:[Yt,Ut,Kt,Gt,Zt],props:{ariaLabel:String,default:String,empty:{type:[Boolean,String],default:!0},placeholder:String,options:Array,value:{type:[String,Number,Boolean],default:""}}};const ps=R({mixins:[ds],inheritAttrs:!1,data(){return{selected:this.value,listeners:{...this.$listeners,click:t=>this.onClick(t),change:t=>this.onInput(t.target.value),input:()=>{}}}},computed:{emptyOption(){return this.placeholder||"—"},hasEmptyOption(){return!1!==this.empty&&!(this.required&&this.default)},label(){const t=this.text(this.selected);return""===this.selected||null===this.selected||null===t?this.emptyOption:t}},watch:{value(t){this.selected=t,this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onClick(t){t.stopPropagation(),this.$emit("click",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.selected=t,this.$emit("input",this.selected)},select(){this.focus()},text(t){let e=null;return this.options.forEach((n=>{n.value==t&&(e=n.text)})),e}},validations(){return{selected:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-select-input",attrs:{"data-disabled":t.disabled,"data-empty":""===t.selected}},[e("select",t._g({ref:"input",staticClass:"k-select-input-native",attrs:{id:t.id,autofocus:t.autofocus,"aria-label":t.ariaLabel,disabled:t.disabled,name:t.name,required:t.required},domProps:{value:t.selected}},t.listeners),[t.hasEmptyOption?e("option",{attrs:{disabled:t.required,value:""}},[t._v(" "+t._s(t.emptyOption)+" ")]):t._e(),t._l(t.options,(function(n){return e("option",{key:n.value,attrs:{disabled:n.disabled},domProps:{value:n.value}},[t._v(" "+t._s(n.text)+" ")])}))],2),t._v(" "+t._s(t.label)+" ")])}),[],!1,null,null,null,null).exports;const hs=R({mixins:[Qt,ee,ds],inheritAttrs:!1,props:{icon:{type:String,default:"angle-down"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-select-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"select"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,ms={mixins:[An],props:{allow:{type:String,default:""},formData:{type:Object,default:()=>({})},sync:{type:String}}};const fs=R({extends:In,mixins:[ms],data(){return{slug:this.sluggify(this.value),slugs:this.$language?this.$language.rules:this.$panel.system.slugs,syncValue:null}},watch:{formData:{handler(t){return!this.disabled&&(!(!this.sync||void 0===t[this.sync])&&(t[this.sync]!=this.syncValue&&(this.syncValue=t[this.sync],void this.onInput(this.sluggify(this.syncValue)))))},deep:!0,immediate:!0},value(t){(t=this.sluggify(t))!==this.slug&&(this.slug=t,this.$emit("input",this.slug))}},methods:{sluggify(t){return this.$helper.slug(t,[this.slugs,this.$panel.system.ascii],this.allow)},onInput(t){this.slug=this.sluggify(t),this.$emit("input",this.slug)}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-text-input",attrs:{autocomplete:"off",spellcheck:"false",type:"text"},domProps:{value:t.slug}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required},!1),t.listeners))}),[],!1,null,null,null,null).exports;const gs=R({mixins:[Qt,ee,ms],inheritAttrs:!1,props:{icon:{type:String,default:"url"},path:{type:String},wizard:{type:[Boolean,Object],default:!1}},data(){return{slug:this.value}},computed:{preview(){return void 0!==this.help?this.help:void 0!==this.path?this.path+this.value:null}},watch:{value(){this.slug=this.value}},methods:{focus(){this.$refs.input.focus()},onWizard(){var t;this.formData[null==(t=this.wizard)?void 0:t.field]&&(this.slug=this.formData[this.wizard.field])}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-slug-field",attrs:{input:t._uid,help:t.preview},scopedSlots:t._u([t.wizard&&t.wizard.text?{key:"options",fn:function(){return[e("k-button",{attrs:{text:t.wizard.text,icon:"wand"},on:{click:t.onWizard}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,value:t.slug,theme:"field",type:"slug"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const ks=R({mixins:[Qt],inheritAttrs:!1,props:{columns:Object,duplicate:{type:Boolean,default:!0},empty:String,fields:Object,limit:Number,max:Number,min:Number,prepend:{type:Boolean,default:!1},sortable:{type:Boolean,default:!0},sortBy:String,value:{type:Array,default:()=>[]}},data(){return{autofocus:null,items:this.toItems(this.value),currentIndex:null,currentModel:null,page:1}},computed:{dragOptions(){return{disabled:!this.isSortable,fallbackClass:"k-sortable-row-fallback"}},form(){return this.$helper.field.subfields(this,this.fields)},index(){return this.limit?(this.page-1)*this.limit+1:1},more(){return!0!==this.disabled&&!(this.max&&this.items.length>=this.max)},isInvalid(){return!0!==this.disabled&&(!!(this.min&&this.items.lengththis.max))},isSortable(){return!this.sortBy&&(!this.limit&&(!0!==this.disabled&&(!(this.items.length<=1)&&!1!==this.sortable)))},pagination(){let t=0;return this.limit&&(t=(this.page-1)*this.limit),{page:this.page,offset:t,limit:this.limit,total:this.items.length,align:"center",details:!0}},options(){if(this.disabled)return[];let t=[],e=this.duplicate&&this.more&&null===this.currentIndex;return t.push({icon:"edit",text:this.$t("edit"),click:"edit"}),e&&t.push({icon:"copy",text:this.$t("duplicate"),click:"duplicate"}),t.push({icon:"remove",text:e?this.$t("remove"):null,click:"remove"}),t},paginatedItems(){return this.limit?this.items.slice(this.pagination.offset,this.pagination.offset+this.limit):this.items}},watch:{value(t){t!=this.items&&(this.items=this.toItems(t))}},methods:{add(t){!0===this.prepend?this.items.unshift(t):this.items.push(t)},focus(){var t,e;null==(e=null==(t=this.$refs.add)?void 0:t.focus)||e.call(t)},jump(t,e){this.open(t+this.pagination.offset,e)},onAdd(){return!0!==this.disabled&&(null!==this.currentIndex?(this.onFormDiscard(),!1):(this.currentIndex="new",this.currentModel=this.$helper.field.form(this.fields),void this.onFormOpen()))},onFormClose(){this.currentIndex=null,this.currentModel=null},onFormDiscard(){if("new"===this.currentIndex){if(0===Object.values(this.currentModel).filter((t=>!1===this.$helper.object.isEmpty(t))).length)return void this.onFormClose()}this.onFormSubmit()},onFormOpen(t=this.autofocus){this.$nextTick((()=>{var e;null==(e=this.$refs.form)||e.focus(t)}))},async onFormPaginate(t){try{await this.save(),this.open(t)}catch(e){}},async onFormSubmit(){try{await this.save(),this.onFormClose()}catch(t){}},onInput(t=this.items){this.$emit("input",t)},onOption(t,e,n){switch(t){case"remove":this.onFormClose(),this.remove(n+this.pagination.offset);break;case"duplicate":this.add(this.items[n+this.pagination.offset]),this.onInput();break;case"edit":this.open(n)}},open(t,e){this.currentIndex=t,this.currentModel=this.$helper.clone(this.items[t]),this.onFormOpen(e)},paginate({page:t}){this.page=t},remove(t){this.disabled||null===t||this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.structure.delete.confirm")},on:{submit:()=>{this.items.splice(t,1),this.onInput(),this.$panel.dialog.close(),0===this.paginatedItems.length&&this.page>1&&this.page--,this.items=this.sort(this.items)}}})},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.structure.delete.confirm.all")},on:{submit:()=>{this.page=1,this.items=[],this.onInput(),this.$panel.dialog.close()}}})},sort(t){return this.sortBy?t.sortBy(this.sortBy):t},async save(){if(null!==this.currentIndex&&void 0!==this.currentIndex)try{return await this.validate(this.currentModel),"new"===this.currentIndex?this.add(this.currentModel):this.items[this.currentIndex]=this.currentModel,this.items=this.sort(this.items),this.onInput(),!0}catch(t){throw this.$panel.notification.error({message:this.$t("error.form.incomplete"),details:t}),t}},toItems(t){return!1===Array.isArray(t)?[]:this.sort(t)},async validate(t){const e=await this.$api.post(this.endpoints.field+"/validate",t);if(e.length>0)throw e;return!0},onFormInput(t){this.currentModel=t,this.$emit("formInput",t)}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-structure-field",nativeOn:{click:function(t){t.stopPropagation()}},scopedSlots:t._u([{key:"options",fn:function(){return[e("k-dropdown",[e("k-button",{attrs:{disabled:null!==t.currentIndex,icon:"dots"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{disabled:!t.more,icon:"add"},on:{click:t.onAdd}},[t._v(" "+t._s(t.$t("add"))+" ")]),e("k-dropdown-item",{attrs:{disabled:0===t.items.length||t.disabled,icon:"trash"},on:{click:t.removeAll}},[t._v(" "+t._s(t.$t("delete.all"))+" ")])],1)],1)]},proxy:!0}])},"k-field",t.$props,!1),[null!==t.currentIndex?e("k-structure-form",{ref:"form",attrs:{fields:t.form,index:t.currentIndex,total:t.items.length,value:t.currentModel},on:{close:t.onFormClose,discard:t.onFormDiscard,input:t.onFormInput,paginate:function(e){return t.onFormPaginate(e.offset)},submit:t.onFormSubmit}}):0===t.items.length?e("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"list-bullet"},on:{click:t.onAdd}},[t._v(" "+t._s(t.empty||t.$t("field.structure.empty"))+" ")]):[e("k-table",{attrs:{columns:t.columns,disabled:t.disabled,fields:t.fields,empty:t.$t("field.structure.empty"),index:t.index,options:t.options,pagination:!!t.limit&&t.pagination,rows:t.paginatedItems,sortable:t.isSortable,"data-invalid":t.isInvalid},on:{cell:function(e){return t.jump(e.rowIndex,e.columnIndex)},input:t.onInput,option:t.onOption,paginate:t.paginate}}),t.more?e("k-button",{staticClass:"k-field-add-item-button",attrs:{icon:"add",tooltip:t.$t("add")},on:{click:t.onAdd}}):t._e()]],2)}),[],!1,null,null,null,null).exports,bs={mixins:[Yt,Ut,Kt,Gt,Zt],props:{accept:{type:String,default:"all"},icon:{type:[String,Boolean],default:"tag"},layout:String,max:Number,min:Number,options:{type:Array,default:()=>[]},separator:{type:String,default:","},value:{type:Array,default:()=>[]}}};const vs=R({mixins:[bs],inheritAttrs:!1,data(){return{tags:this.toValues(this.value),selected:null,newTag:null}},computed:{dragOptions(){return{delay:1,disabled:!this.draggable,draggable:".k-tag"}},draggable(){return this.tags.length>1},skip(){return this.tags.map((t=>t.value))}},watch:{value(t){this.tags=this.toValues(t),this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{addString(t,e=!0){if(!t)return;if(0===(t=t.trim()).length)return;if(!0===t.includes(this.separator)){for(const e of t.split(this.separator))this.addString(e);return}const n=this.toValue(t);n&&this.addTag(n,e)},addTag(t,e=!0){this.addTagToIndex(t),this.$refs.autocomplete.close(),e&&this.$refs.input.focus()},addTagToIndex(t){if("options"===this.accept){if(!this.options.find((e=>e.value===t.value)))return}-1===this.index(t)&&(!this.max||this.tags.length=this.tags.length)return;break;case"first":e=0;break;case"last":e=this.tags.length-1;break;default:e=t}let s=this.tags[e];if(s){let t=this.$refs[s.value];if(null==t?void 0:t[0])return{ref:t[0],tag:s,index:e}}return!1},index(t){return this.tags.findIndex((e=>e.value===t.value))},navigate(t){var e=this.get(t);e?(e.ref.focus(),this.selectTag(e.tag)):"next"===t&&(this.$refs.input.focus(),this.selectTag(null))},onBack(t){0===t.target.selectionStart&&t.target.selectionStart===t.target.selectionEnd&&0!==this.tags.length&&(this.$refs.autocomplete.close(),this.navigate("last"),t.preventDefault())},onBlur(t){var e;let n=t.relatedTarget||t.explicitOriginalTarget;(null==(e=this.$refs.autocomplete.$el)?void 0:e.contains(n))||this.addString(this.$refs.input.value,!1)},onEnter(t){if(!this.newTag||0===this.newTag.length)return!0;t.preventDefault(),this.addString(this.newTag)},onInput(){const t=this.tags.map((t=>t.value));this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onSubmit(t){t.preventDefault(),t.stopImmediatePropagation(),this.onBlur(t),this.$emit("submit",t)},onTab(t){var e;(null==(e=this.newTag)?void 0:e.length)>0&&(t.preventDefault(),this.addString(this.newTag))},onType(t){this.newTag=t,this.$refs.autocomplete.search(t)},remove(t){const e=this.get("prev"),n=this.get("next");this.tags.splice(this.index(t),1),this.onInput(),e?(this.selectTag(e.tag),e.ref.focus()):n?this.selectTag(n.tag):(this.selectTag(null),this.$refs.input.focus())},select(){this.focus()},selectTag(t){this.selected=t},toValue(t){const e=this.options.find((e=>e.value===t));return"options"===this.accept?e:e||("string"==typeof t&&(t={value:t}),{value:t.value,text:this.$helper.string.escapeHTML(t.text??t.value)})},toValues(t){return"object"==typeof t&&(t=Object.values(t)),!1===Array.isArray(t)?[]:t.map(this.toValue).filter((t=>t))}},validations(){return{tags:{required:!this.required||t.required,minLength:!this.min||t.minLength(this.min),maxLength:!this.max||t.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("k-draggable",{directives:[{name:"direction",rawName:"v-direction"}],staticClass:"k-tags-input",attrs:{list:t.tags,options:t.dragOptions,"data-layout":t.layout},on:{end:t.onInput},scopedSlots:t._u([{key:"footer",fn:function(){return[e("span",{staticClass:"k-tags-input-element"},[e("k-autocomplete",{ref:"autocomplete",attrs:{html:!0,options:t.options,skip:t.skip},on:{select:t.addTag,leave:function(e){return t.$refs.input.focus()}}},[e("input",{ref:"input",attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled||t.max&&t.tags.length>=t.max,name:t.name,autocomplete:"off",type:"text"},domProps:{value:t.newTag},on:{input:function(e){return t.onType(e.target.value)},blur:t.onBlur,keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?t.onSubmit.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.onBack.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.onEnter.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.onTab.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.onBack.apply(null,arguments)}]}})])],1)]},proxy:!0}])},t._l(t.tags,(function(n){return e("k-tag",{key:n.value,ref:n.value,refInFor:!0,attrs:{removable:!t.disabled,name:"tag"},on:{remove:function(e){return t.remove(n)}},nativeOn:{click:function(t){t.stopPropagation()},blur:function(e){return t.selectTag(null)},focus:function(e){return t.selectTag(n)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:t.navigate("prev")},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:t.navigate("next")}],dblclick:function(e){return t.edit(n)}}},[e("span",{domProps:{innerHTML:t._s(n.text)}})])})),1)}),[],!1,null,null,null,null).exports;const ys=R({mixins:[Qt,ee,bs,yn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-tags-field",attrs:{input:t._uid,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"tags"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,$s={mixins:[An],props:{autocomplete:{default:"tel"},placeholder:{default:()=>window.panel.$t("tel.placeholder")},type:{default:"tel"}}};const ws=R({extends:In,mixins:[$s]},null,null,!1,null,null,null,null).exports;const _s=R({mixins:[Qt,ee,$s],inheritAttrs:!1,props:{icon:{type:String,default:"phone"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-tel-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"tel"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const xs=R({mixins:[Qt,ee,An,yn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()},select(){this.$refs.input.select()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-text-field",attrs:{input:t._uid,counter:t.counterOptions},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,Cs={mixins:[Yt,Ut,Kt,Gt,Zt],props:{buttons:{type:[Boolean,Array],default:!0},endpoints:Object,font:String,maxlength:Number,minlength:Number,placeholder:String,preselect:Boolean,size:String,spellcheck:{type:[Boolean,String],default:"off"},theme:String,uploads:[Boolean,Object,Array],value:String}};const Ss=R({mixins:[Cs],inheritAttrs:!1,data:()=>({over:!1}),computed:{uploadOptions(){return{url:this.$panel.urls.api+"/"+this.endpoints.field+"/upload",multiple:!1,on:{done:this.insertUpload}}}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{cancel(){this.$refs.input.focus()},dialog(t){if(!this.$refs[t+"Dialog"])throw"Invalid toolbar dialog";this.$refs[t+"Dialog"].open(this.$refs.input,this.selection())},focus(){this.$refs.input.focus()},insert(t){const e=this.$refs.input,n=e.value;setTimeout((()=>{if(e.focus(),document.execCommand("insertText",!1,t),e.value===n){const n=e.value.slice(0,e.selectionStart)+t+e.value.slice(e.selectionEnd);e.value=n,this.$emit("input",n)}}))},insertFile(t){(null==t?void 0:t.length)>0&&this.insert(t.map((t=>t.dragText)).join("\n\n"))},insertUpload(t){this.insertFile(t),this.$events.$emit("model.update")},onCommand(t,e){"function"==typeof this[t]?"function"==typeof e?this[t](e(this.$refs.input,this.selection())):this[t](e):window.console.warn(t+" is not a valid command")},onDrop(t){if(this.uploads&&this.$helper.isUploadEvent(t))return this.$panel.upload.open(t.dataTransfer.files,this.uploadOptions);"text"===this.$panel.drag.type&&(this.focus(),this.insert(this.$panel.drag.data))},onFocus(t){this.$emit("focus",t)},onInput(t){this.$emit("input",t.target.value)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onOut(){this.$refs.input.blur(),this.over=!1},onOver(t){if(this.uploads&&this.$helper.isUploadEvent(t))return t.dataTransfer.dropEffect="copy",this.focus(),void(this.over=!0);"text"===this.$panel.drag.type&&(t.dataTransfer.dropEffect="copy",this.focus(),this.over=!0)},onShortcut(t){!1!==this.buttons&&"Meta"!==t.key&&"Control"!==t.key&&this.$refs.toolbar&&this.$refs.toolbar.shortcut(t.key,t)},onSubmit(t){return this.$emit("submit",t)},prepend(t){this.insert(t+" "+this.selection())},select(){this.$refs.select()},selectFile(){this.$refs.fileDialog.open({endpoint:this.endpoints.field+"/files",multiple:!1})},selection(){const t=this.$refs.input,e=t.selectionStart,n=t.selectionEnd;return t.value.substring(e,n)},uploadFile(){this.$panel.upload.pick(this.uploadOptions)},wrap(t){this.insert(t+this.selection()+t)}},validations(){return{value:{required:!this.required||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.maxLength(this.maxlength)}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-textarea-input",attrs:{"data-over":t.over,"data-size":t.size,"data-theme":t.theme}},[e("div",{staticClass:"k-textarea-input-wrapper"},[t.buttons&&!t.disabled?e("k-toolbar",{ref:"toolbar",attrs:{buttons:t.buttons,disabled:t.disabled,uploads:t.uploads},on:{command:t.onCommand},nativeOn:{mousedown:function(t){t.preventDefault()}}}):t._e(),e("k-autosize",[e("textarea",t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-textarea-input-native",attrs:{"data-font":t.font},on:{click:function(e){var n;null==(n=t.$refs.toolbar)||n.close()},focus:t.onFocus,input:t.onInput,keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.metaKey?t.onSubmit.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.ctrlKey?t.onSubmit.apply(null,arguments):null},function(e){return e.metaKey?t.onShortcut.apply(null,arguments):null},function(e){return e.ctrlKey?t.onShortcut.apply(null,arguments):null}],dragover:t.onOver,dragleave:t.onOut,drop:t.onDrop}},"textarea",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,value:t.value},!1))])],1),e("k-toolbar-email-dialog",{ref:"emailDialog",on:{cancel:t.cancel,submit:function(e){return t.insert(e)}}}),e("k-toolbar-link-dialog",{ref:"linkDialog",on:{cancel:t.cancel,submit:function(e){return t.insert(e)}}}),e("k-files-dialog",{ref:"fileDialog",on:{cancel:t.cancel,submit:function(e){return t.insertFile(e)}}})],1)}),[],!1,null,null,null,null).exports;const Os=R({mixins:[Qt,ee,Cs,yn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-textarea-field",attrs:{input:t._uid,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,type:"textarea",theme:"field"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,As={props:{display:{type:String,default:"HH:mm"},max:String,min:String,step:{type:Object,default:()=>({size:5,unit:"minute"})},type:{type:String,default:"time"},value:String}};const Is=R({mixins:[Sn,As],computed:{inputType:()=>"time"}},null,null,!1,null,null,null,null).exports;const Ms=R({mixins:[Qt,ee,As],inheritAttrs:!1,props:{icon:{type:String,default:"clock"},times:{type:Boolean,default:!0}},methods:{focus(){this.$refs.input.focus()},select(t){var e;this.$emit("input",t),null==(e=this.$refs.times)||e.close()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-time-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"time"},on:{input:function(e){return t.$emit("input",e||"")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-dropdown",[e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon||"clock",tooltip:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{align:"right"}},[e("k-times",{attrs:{display:t.display,value:t.value},on:{input:t.select}})],1)],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,Ts={props:{autofocus:Boolean,disabled:Boolean,id:[Number,String],text:{type:[Array,String]},required:Boolean,value:Boolean}};const js=R({mixins:[Ts],inheritAttrs:!1,computed:{label(){const t=this.text||[this.$t("off"),this.$t("on")];return Array.isArray(t)?this.value?t[1]:t[0]:t}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onEnter(t){"Enter"===t.key&&this.$refs.input.click()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.$refs.input.focus()}},validations(){return{value:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-toggle-input",attrs:{"data-disabled":t.disabled}},[e("input",{ref:"input",staticClass:"k-toggle-input-native",attrs:{id:t.id,disabled:t.disabled,type:"checkbox"},domProps:{checked:t.value},on:{change:function(e){return t.onInput(e.target.checked)}}}),e("span",{staticClass:"k-toggle-input-label",domProps:{innerHTML:t._s(t.label)}})])}),[],!1,null,null,null,null).exports;const Es=R({mixins:[Qt,ee,Ts],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-toggle-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"toggle"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,Ls={mixins:[Yt,Ut,Kt,Zt],props:{columns:Number,grow:Boolean,labels:Boolean,options:Array,reset:Boolean,value:[String,Number,Boolean]}};const Ds=R({mixins:[Ls],inheritAttrs:!1,watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){(this.$el.querySelector("input[checked]")||this.$el.querySelector("input")).focus()},onClick(t){t===this.value&&this.reset&&!this.required&&this.$emit("input","")},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-toggles-input",style:"--options:"+(t.columns||t.options.length),attrs:{"data-invalid":t.$v.$invalid,"data-labels":t.labels}},t._l(t.options,(function(n,s){return e("li",{key:s},[e("input",{staticClass:"input-hidden",attrs:{id:t.id+"-"+s,"aria-label":n.text,name:t.id,type:"radio"},domProps:{value:n.value,checked:t.value===n.value},on:{click:function(e){return t.onClick(n.value)},change:function(e){return t.onInput(n.value)}}}),e("label",{attrs:{for:t.id+"-"+s,title:n.text}},[n.icon?e("k-icon",{attrs:{type:n.icon}}):t._e(),t.labels||!n.icon?e("span",{staticClass:"k-toggles-text",domProps:{innerHTML:t._s(n.text)}}):t._e()],1)])})),0)}),[],!1,null,null,null,null).exports;const Bs=R({mixins:[Qt,ee,Ls],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-toggles-field"},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",class:{grow:t.grow},attrs:{id:t._uid,theme:"field",type:"toggles"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,Ps={mixins:[An],props:{autocomplete:{type:String,default:"url"},type:{type:String,default:"url"}}};const Fs=R({extends:In,mixins:[Ps]},null,null,!1,null,null,null,null).exports;const Ns=R({mixins:[Qt,ee,Ps],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"url"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-url-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"url"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.value,tooltip:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const qs=R({mixins:[En],computed:{emptyProps(){return{icon:"users",text:this.empty||this.$t("field.users.empty")}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-users-field",scopedSlots:t._u([{key:"options",fn:function(){return[e("k-button-group",{staticClass:"k-field-options"},[t.more&&!t.disabled?e("k-button",{staticClass:"k-field-options-button",attrs:{icon:t.btnIcon,text:t.btnLabel},on:{click:t.open}}):t._e()],1)]},proxy:!0}])},"k-field",t.$props,!1),[e("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function({index:n}){return[t.disabled?t._e():e("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(n)}}})]}}])},"k-collection",t.collection,!1)),e("k-users-dialog",{ref:"selector",on:{submit:t.select}})],1)}),[],!1,null,null,null,null).exports;const Rs=t=>({$from:e})=>((t,e)=>{for(let n=t.depth;n>0;n--){const s=t.node(n);if(e(s))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:s}}})(e,t),zs=t=>e=>{if((t=>t instanceof o)(e)){const{node:n,$from:s}=e;if(((t,e)=>Array.isArray(t)&&t.indexOf(e.type)>-1||e.type===t)(t,n))return{node:n,pos:s.pos,depth:s.depth}}},Ys=(t,e,n={})=>{const s=zs(e)(t.selection)||Rs((t=>t.type===e))(t.selection);return 0!==U(n)&&s?s.node.hasMarkup(e,{...s.node.attrs,...n}):!!s};function Hs(t=null,e=null){if(!t||!e)return!1;const n=t.parent.childAfter(t.parentOffset);if(!n.node)return!1;const s=n.node.marks.find((t=>t.type===e));if(!s)return!1;let i=t.index(),o=t.start()+n.offset,l=i+1,r=o+n.node.nodeSize;for(;i>0&&s.isInSet(t.parent.child(i-1).marks);)i-=1,o-=t.parent.child(i).nodeSize;for(;l{i=[...i,...t.marks]}));const o=i.find((t=>t.type.name===e.name));return o?o.attrs:{}},getNodeAttrs:function(t,e){const{from:n,to:s}=t.selection;let i=[];t.doc.nodesBetween(n,s,(t=>{i=[...i,t]}));const o=i.reverse().find((t=>t.type.name===e.name));return o?o.attrs:{}},markInputRule:function(t,n,s){return new e(t,((t,e,i,o)=>{const l=s instanceof Function?s(e):s,{tr:r}=t,a=e.length-1;let u=o,c=i;if(e[a]){const s=i+e[0].indexOf(e[a-1]),l=s+e[a-1].length-1,d=s+e[a-1].lastIndexOf(e[a]),p=d+e[a].length,h=function(t,e,n){let s=[];return n.doc.nodesBetween(t,e,((t,e)=>{s=[...s,...t.marks.map((n=>({start:e,end:e+t.nodeSize,mark:n})))]})),s}(i,o,t).filter((t=>{const{excluded:e}=t.mark.type;return e.find((t=>t.name===n.name))})).filter((t=>t.end>s));if(h.length)return!1;ps&&r.delete(s,d),c=s,u=c+e[a].length}return r.addMark(c,u,n.create(l)),r.removeStoredMark(n),r}))},markIsActive:function(t,e){const{from:n,$from:s,to:i,empty:o}=t.selection;return o?!!e.isInSet(t.storedMarks||s.marks()):!!t.doc.rangeHasMark(n,i,e)},markPasteRule:function(t,e,o){const l=(n,s)=>{const r=[];return n.forEach((n=>{var i;if(n.isText){const{text:l,marks:a}=n;let u,c=0;const d=!!a.filter((t=>"link"===t.type.name))[0];for(;!d&&null!==(u=t.exec(l));)if((null==(i=null==s?void 0:s.type)?void 0:i.allowsMarkType(e))&&u[1]){const t=u.index,s=t+u[0].length,i=t+u[0].indexOf(u[1]),l=i+u[1].length,a=o instanceof Function?o(u):o;t>0&&r.push(n.cut(c,t)),r.push(n.cut(i,l).mark(e.create(a).addToSet(n.marks))),c=s}cnew s(l(t.content),t.openStart,t.openEnd)}})},minMax:function(t=0,e=0,n=0){return Math.min(Math.max(parseInt(t,10),e),n)},nodeIsActive:Ys,nodeInputRule:function(t,n,s){return new e(t,((t,e,i,o)=>{const l=s instanceof Function?s(e):s,{tr:r}=t;return e[0]&&r.replaceWith(i-1,o,n.create(l)),r}))},pasteRule:function(t,e,o){const l=n=>{const s=[];return n.forEach((n=>{if(n.isText){const{text:i}=n;let l,r=0;do{if(l=t.exec(i),l){const t=l.index,i=t+l[0].length,a=o instanceof Function?o(l[0]):o;t>0&&s.push(n.cut(r,t)),s.push(n.cut(t,i).mark(e.create(a).addToSet(n.marks))),r=i}}while(l);rnew s(l(t.content),t.openStart,t.openEnd)}})},removeMark:function(t){return(e,n)=>{const{tr:s,selection:i}=e;let{from:o,to:l}=i;const{$from:r,empty:a}=i;if(a){const e=Hs(r,t);o=e.from,l=e.to}return s.removeMark(o,l,t),n(s)}},toggleBlockType:function(t,e,n={}){return(s,i,o)=>Ys(s,t,n)?l(e)(s,i,o):l(t,n)(s,i,o)},toggleList:function(t,e){return(n,s,i)=>{const{schema:o,selection:l}=n,{$from:u,$to:c}=l,d=u.blockRange(c);if(!d)return!1;const p=Rs((t=>Us(t,o)))(l);if(d.depth>=1&&p&&d.depth-p.depth<=1){if(p.node.type===t)return r(e)(n,s,i);if(Us(p.node,o)&&t.validContent(p.node.content)){const{tr:e}=n;return e.setNodeMarkup(p.pos,t),s&&s(e),!1}}return a(t)(n,s,i)}},updateMark:function(t,e){return(n,s)=>{const{tr:i,selection:o,doc:l}=n,{ranges:r,empty:a}=o;if(a){const{from:n,to:s}=Hs(o.$from,t);l.rangeHasMark(n,s,t)&&i.removeMark(n,s,t),i.addMark(n,s,t.create(e))}else r.forEach((n=>{const{$to:s,$from:o}=n;l.rangeHasMark(o.pos,s.pos,t)&&i.removeMark(o.pos,s.pos,t),i.addMark(o.pos,s.pos,t.create(e))}));return s(i)}}};class Ks{emit(t,...e){this._callbacks=this._callbacks||{};const n=this._callbacks[t];return n&&n.forEach((t=>t.apply(this,e))),this}off(t,e){if(arguments.length){const n=this._callbacks?this._callbacks[t]:null;n&&(e?this._callbacks[t]=n.filter((t=>t!==e)):delete this._callbacks[t])}else this._callbacks={};return this}on(t,e){return this._callbacks=this._callbacks||{},this._callbacks[t]=this._callbacks[t]||[],this._callbacks[t].push(e),this}}class Ws{constructor(t=[],e){t.forEach((t=>{t.bindEditor(e),t.init()})),this.extensions=t}commands({schema:t,view:e}){return this.extensions.filter((t=>t.commands)).reduce(((n,s)=>{const{name:i,type:o}=s,l={},r=s.commands({schema:t,utils:Vs,...["node","mark"].includes(o)?{type:t[`${o}s`][i]}:{}}),a=(t,n)=>{l[t]=t=>{if("function"!=typeof n||!e.editable)return!1;e.focus();const s=n(t);return"function"==typeof s?s(e.state,e.dispatch,e):s}};return"object"==typeof r?Object.entries(r).forEach((([t,e])=>{a(t,e)})):a(i,r),{...n,...l}}),{})}buttons(t="mark"){const e={};return this.extensions.filter((e=>e.type===t)).filter((t=>t.button)).forEach((t=>{Array.isArray(t.button)?t.button.forEach((t=>{e[t.id||t.name]=t})):e[t.name]=t.button})),e}getAllowedExtensions(t){return t instanceof Array||!t?t instanceof Array?this.extensions.filter((e=>!t.includes(e.name))):this.extensions:[]}getFromExtensions(t,e,n=this.extensions){return n.filter((t=>["extension"].includes(t.type))).filter((e=>e[t])).map((n=>n[t]({...e,utils:Vs})))}getFromNodesAndMarks(t,e,n=this.extensions){return n.filter((t=>["node","mark"].includes(t.type))).filter((e=>e[t])).map((n=>n[t]({...e,type:e.schema[`${n.type}s`][n.name],utils:Vs})))}inputRules({schema:t,excludedExtensions:e}){const n=this.getAllowedExtensions(e);return[...this.getFromExtensions("inputRules",{schema:t},n),...this.getFromNodesAndMarks("inputRules",{schema:t},n)].reduce(((t,e)=>[...t,...e]),[])}keymaps({schema:t}){return[...this.getFromExtensions("keys",{schema:t}),...this.getFromNodesAndMarks("keys",{schema:t})].map((t=>k(t)))}get marks(){return this.extensions.filter((t=>"mark"===t.type)).reduce(((t,{name:e,schema:n})=>({...t,[e]:n})),{})}get nodes(){return this.extensions.filter((t=>"node"===t.type)).reduce(((t,{name:e,schema:n})=>({...t,[e]:n})),{})}get options(){const{view:t}=this;return this.extensions.reduce(((e,n)=>({...e,[n.name]:new Proxy(n.options,{set(e,n,s){const i=e[n]!==s;return Object.assign(e,{[n]:s}),i&&t.updateState(t.state),!0}})})),{})}pasteRules({schema:t,excludedExtensions:e}){const n=this.getAllowedExtensions(e);return[...this.getFromExtensions("pasteRules",{schema:t},n),...this.getFromNodesAndMarks("pasteRules",{schema:t},n)].reduce(((t,e)=>[...t,...e]),[])}plugins({schema:t}){return[...this.getFromExtensions("plugins",{schema:t}),...this.getFromNodesAndMarks("plugins",{schema:t})].reduce(((t,e)=>[...t,...e]),[]).map((t=>t instanceof n?t:new n(t)))}}class Js extends zn{get button(){return{id:this.name,icon:"paragraph",label:window.panel.$t("toolbar.button.paragraph"),name:this.name,separator:!0}}commands({utils:t,type:e}){return{paragraph:()=>t.setBlockType(e)}}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}get name(){return"paragraph"}}let Gs=class extends zn{get name(){return"text"}get schema(){return{group:"inline"}}};class Zs extends Ks{constructor(t={}){super(),this.defaults={autofocus:!1,content:"",disableInputRules:!1,disablePasteRules:!1,editable:!0,element:null,extensions:[],emptyDocument:{type:"doc",content:[]},events:{},inline:!1,parseOptions:{},topNode:"doc",useBuiltInExtensions:!0},this.init(t)}blur(){this.view.dom.blur()}get builtInExtensions(){return this.options.useBuiltInExtensions?[new Yn({inline:this.options.inline}),new Gs,new Js]:[]}buttons(t){return this.extensions.buttons(t)}clearContent(t=!1){this.setContent(this.options.emptyDocument,t)}command(t,...e){var n,s;null==(s=(n=this.commands)[t])||s.call(n,...e)}createCommands(){return this.extensions.commands({schema:this.schema,view:this.view})}createDocument(t,e=this.options.parseOptions){if(null===t)return this.schema.nodeFromJSON(this.options.emptyDocument);if("object"==typeof t)try{return this.schema.nodeFromJSON(t)}catch(n){return window.console.warn("Invalid content.","Passed value:",t,"Error:",n),this.schema.nodeFromJSON(this.options.emptyDocument)}if("string"==typeof t){const n=`

        ${t}
        `,s=(new window.DOMParser).parseFromString(n,"text/html").body.firstElementChild;return b.fromSchema(this.schema).parse(s,e)}return!1}createEvents(){const t=this.options.events||{};return Object.entries(t).forEach((([t,e])=>{this.on(t,e)})),t}createExtensions(){return new Ws([...this.builtInExtensions,...this.options.extensions],this)}createFocusEvents(){const t=(t,e,n=!0)=>{this.focused=n,this.emit(n?"focus":"blur",{event:e,state:t.state,view:t});const s=this.state.tr.setMeta("focused",n);this.view.dispatch(s)};return new n({props:{attributes:{tabindex:0},handleDOMEvents:{focus:(e,n)=>{t(e,n,!0)},blur:(e,n)=>{t(e,n,!1)}}}})}createInputRules(){return this.extensions.inputRules({schema:this.schema,excludedExtensions:this.options.disableInputRules})}createKeymaps(){return this.extensions.keymaps({schema:this.schema})}createMarks(){return this.extensions.marks}createNodes(){return this.extensions.nodes}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createPlugins(){return this.extensions.plugins({schema:this.schema})}createSchema(){return new v({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return y.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,$({rules:this.inputRules}),...this.pasteRules,...this.keymaps,k({Backspace:C}),k(S),this.createFocusEvents()]})}createView(){return new w(this.element,{dispatchTransaction:this.dispatchTransaction.bind(this),editable:()=>this.options.editable,handlePaste:(t,e)=>{if("function"==typeof this.events.paste){const t=e.clipboardData.getData("text/html"),n=e.clipboardData.getData("text/plain");if(!0===this.events.paste(e,t,n))return!0}},handleDrop:(...t)=>{this.emit("drop",...t)},state:this.createState()})}destroy(){this.view&&this.view.destroy()}dispatchTransaction(t){const e=this.state,n=this.state.apply(t);this.view.updateState(n),this.setActiveNodesAndMarks();const s={editor:this,getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:t};this.emit("transaction",s),!t.docChanged&&t.getMeta("preventUpdate")||this.emit("update",s);const{from:i,to:o}=this.state.selection,l=!e||!e.selection.eq(n.selection);this.emit(n.selection.empty?"deselect":"select",{...s,from:i,hasChanged:l,to:o})}focus(t=null){if(this.view.focused&&null===t||!1===t)return;const{from:e,to:n}=this.selectionAtPosition(t);this.setSelection(e,n),setTimeout((()=>this.view.focus()),10)}getHTML(t=this.state.doc.content){const e=document.createElement("div"),n=_.fromSchema(this.schema).serializeFragment(t);return e.appendChild(n),this.options.inline&&e.querySelector("p")?e.querySelector("p").innerHTML:e.innerHTML}getHTMLStartToSelection(){const t=this.state.doc.slice(0,this.selection.head).content;return this.getHTML(t)}getHTMLSelectionToEnd(){const t=this.state.doc.slice(this.selection.head).content;return this.getHTML(t)}getHTMLStartToSelectionToEnd(){return[this.getHTMLStartToSelection(),this.getHTMLSelectionToEnd()]}getJSON(){return this.state.doc.toJSON()}getMarkAttrs(t=null){return this.activeMarkAttrs[t]}getSchemaJSON(){return JSON.parse(JSON.stringify({nodes:this.nodes,marks:this.marks}))}init(t={}){this.options={...this.defaults,...t},this.element=this.options.element,this.focused=!1,this.events=this.createEvents(),this.extensions=this.createExtensions(),this.nodes=this.createNodes(),this.marks=this.createMarks(),this.schema=this.createSchema(),this.keymaps=this.createKeymaps(),this.inputRules=this.createInputRules(),this.pasteRules=this.createPasteRules(),this.plugins=this.createPlugins(),this.view=this.createView(),this.commands=this.createCommands(),this.setActiveNodesAndMarks(),!1!==this.options.autofocus&&this.focus(this.options.autofocus),this.emit("init",{view:this.view,state:this.state}),this.extensions.view=this.view,this.setContent(this.options.content,!0)}isEditable(){return this.options.editable}isEmpty(){if(this.state)return 0===this.state.doc.textContent.length}get isActive(){return Object.entries({...this.activeMarks,...this.activeNodes}).reduce(((t,[e,n])=>({...t,[e]:(t={})=>n(t)})),{})}removeMark(t){if(this.schema.marks[t])return Vs.removeMark(this.schema.marks[t])(this.state,this.view.dispatch)}get selection(){return this.state.selection}get selectionAtEnd(){return x.atEnd(this.state.doc)}get selectionIsAtEnd(){return this.selection.head===this.selectionAtEnd.head}get selectionAtStart(){return x.atStart(this.state.doc)}get selectionIsAtStart(){return this.selection.head===this.selectionAtStart.head}selectionAtPosition(t=null){return null===t?this.selection:"start"===t||!0===t?this.selectionAtStart:"end"===t?this.selectionAtEnd:{from:t,to:t}}setActiveNodesAndMarks(){this.activeMarks=Object.values(this.schema.marks).filter((t=>Vs.markIsActive(this.state,t))).map((t=>t.name)),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce(((t,[e,n])=>({...t,[e]:Vs.getMarkAttrs(this.state,n)})),{}),this.activeNodes=Object.values(this.schema.nodes).filter((t=>Vs.nodeIsActive(this.state,t))).map((t=>t.name)),this.activeNodeAttrs=Object.entries(this.schema.nodes).reduce(((t,[e,n])=>({...t,[e]:Vs.getNodeAttrs(this.state,n)})),{})}setContent(t={},e=!1,n){const{doc:s,tr:i}=this.state,o=this.createDocument(t,n),l=i.replaceWith(0,s.content.size,o).setMeta("preventUpdate",!e);this.view.dispatch(l)}setSelection(t=0,e=0){const{doc:n,tr:s}=this.state,i=Vs.minMax(t,0,n.content.size),o=Vs.minMax(e,0,n.content.size),l=x.create(n,i,o),r=s.setSelection(l);this.view.dispatch(r)}get state(){return this.view?this.view.state:null}toggleMark(t){if(this.schema.marks[t])return Vs.toggleMark(this.schema.marks[t])(this.state,this.view.dispatch)}updateMark(t,e){if(this.schema.marks[t])return Vs.updateMark(this.schema.marks[t],e)(this.state,this.view.dispatch)}}class Qs extends Rn{constructor(t={}){super(t)}command(){return()=>{}}remove(){this.editor.removeMark(this.name)}get schema(){return{}}get type(){return"mark"}toggle(){return this.editor.toggleMark(this.name)}update(t){this.editor.updateMark(this.name,t)}}class Xs extends Qs{get button(){return{icon:"bold",label:window.panel.$t("toolbar.button.bold")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,t)]}keys(){return{"Mod-b":()=>this.toggle()}}get name(){return"bold"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g,t)]}get schema(){return{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM:()=>["strong",0]}}}class ti extends Qs{get button(){return{icon:"clear",label:window.panel.$t("toolbar.button.clear")}}commands(){return()=>this.clear()}clear(){const{state:t}=this.editor,{from:e,to:n}=t.tr.selection;for(const s of this.editor.activeMarks){const i=t.schema.marks[s],o=this.editor.state.tr.removeMark(e,n,i);this.editor.view.dispatch(o)}}get name(){return"clear"}}let ei=class extends Qs{get button(){return{icon:"code",label:window.panel.$t("toolbar.button.code")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:`)([^`]+)(?:`)$/,t)]}keys(){return{"Mod-`":()=>this.toggle()}}get name(){return"code"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/(?:`)([^`]+)(?:`)/g,t)]}get schema(){return{excludes:"_",parseDOM:[{tag:"code"}],toDOM:()=>["code",0]}}};class ni extends Qs{get button(){return{icon:"email",label:window.panel.$t("toolbar.button.email")}}commands(){return{email:t=>{if(t.altKey||t.metaKey)return this.remove();this.editor.emit("email")},insertEmail:(t={})=>{if(t.href)return this.update(t)},removeEmail:()=>this.remove(),toggleEmail:(t={})=>{var e;(null==(e=t.href)?void 0:e.length)>0?this.editor.command("insertEmail",t):this.editor.command("removeEmail")}}}get defaults(){return{target:null}}get name(){return"email"}pasteRules({type:t,utils:e}){return[e.pasteRule(/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/gi,t,(t=>({href:t})))]}plugins(){return[{props:{handleClick:(t,e,n)=>{const s=this.editor.getMarkAttrs("email");s.href&&!0===n.altKey&&n.target instanceof HTMLAnchorElement&&(n.stopPropagation(),window.open(s.href))}}}]}get schema(){return{attrs:{href:{default:null},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href^='mailto:']",getAttrs:t=>({href:t.getAttribute("href").replace("mailto:",""),title:t.getAttribute("title")})}],toDOM:t=>["a",{...t.attrs,href:"mailto:"+t.attrs.href},0]}}}class si extends Qs{get button(){return{icon:"italic",label:window.panel.$t("toolbar.button.italic")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,t),e.markInputRule(/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,t)]}keys(){return{"Mod-i":()=>this.toggle()}}get name(){return"italic"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/_([^_]+)_/g,t),e.markPasteRule(/\*([^*]+)\*/g,t)]}get schema(){return{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}}}let ii=class extends Qs{get button(){return{icon:"url",label:window.panel.$t("toolbar.button.link")}}commands(){return{link:t=>{if(t.altKey||t.metaKey)return this.remove();this.editor.emit("link",this.editor)},insertLink:(t={})=>{if(t.href)return this.update(t)},removeLink:()=>this.remove(),toggleLink:(t={})=>{var e;(null==(e=t.href)?void 0:e.length)>0?this.editor.command("insertLink",t):this.editor.command("removeLink")}}}get defaults(){return{target:null}}get name(){return"link"}pasteRules({type:t,utils:e}){return[e.pasteRule(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b([-a-zA-Z0-9@:%_+.~#?&//=,]*)/gi,t,(t=>({href:t})))]}plugins(){return[{props:{handleClick:(t,e,n)=>{const s=this.editor.getMarkAttrs("link");s.href&&!0===n.altKey&&n.target instanceof HTMLAnchorElement&&(n.stopPropagation(),window.open(s.href,s.target))}}}]}get schema(){return{attrs:{href:{default:null},target:{default:null},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]:not([href^='mailto:'])",getAttrs:t=>({href:t.getAttribute("href"),target:t.getAttribute("target"),title:t.getAttribute("title")})}],toDOM:t=>["a",{...t.attrs},0]}}};class oi extends Qs{get button(){return{icon:"strikethrough",label:window.panel.$t("toolbar.button.strike")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/~([^~]+)~$/,t)]}keys(){return{"Mod-d":()=>this.toggle()}}get name(){return"strike"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/~([^~]+)~/g,t)]}get schema(){return{parseDOM:[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",getAttrs:t=>"line-through"===t}],toDOM:()=>["s",0]}}}let li=class extends Qs{get button(){return{icon:"superscript",label:window.panel.$t("toolbar.button.sup")}}commands(){return()=>this.toggle()}get name(){return"sup"}get schema(){return{parseDOM:[{tag:"sup"}],toDOM:()=>["sup",0]}}};class ri extends Qs{get button(){return{icon:"subscript",label:window.panel.$t("toolbar.button.sub")}}commands(){return()=>this.toggle()}get name(){return"sub"}get schema(){return{parseDOM:[{tag:"sub"}],toDOM:()=>["sub",0]}}}class ai extends Qs{get button(){return{icon:"underline",label:window.panel.$t("toolbar.button.underline")}}commands(){return()=>this.toggle()}keys(){return{"Mod-u":()=>this.toggle()}}get name(){return"underline"}get schema(){return{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:t=>"underline"===t}],toDOM:()=>["u",0]}}}class ui extends zn{get button(){return{id:this.name,icon:"list-bullet",label:window.panel.$t("toolbar.button.ul"),name:this.name,when:["listItem","bulletList","orderedList"]}}commands({type:t,schema:e,utils:n}){return()=>n.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^\s*([-+*])\s$/,t)]}keys({type:t,schema:e,utils:n}){return{"Shift-Ctrl-8":n.toggleList(t,e.nodes.listItem)}}get name(){return"bulletList"}get schema(){return{content:"listItem+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]}}}class ci extends zn{commands({utils:t,type:e}){return()=>this.createHardBreak(t,e)}createHardBreak(t,e){return t.chainCommands(t.exitCode,((t,n)=>(n(t.tr.replaceSelectionWith(e.create()).scrollIntoView()),!0)))}get defaults(){return{enter:!1,text:!1}}keys({utils:t,type:e}){const n=this.createHardBreak(t,e);let s={"Mod-Enter":n,"Shift-Enter":n};return this.options.enter&&(s.Enter=n),s}get name(){return"hardBreak"}get schema(){return{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]}}}class di extends zn{get button(){const t=this.options.levels.map((t=>({id:`h${t}`,command:`h${t}`,icon:`h${t}`,label:window.panel.$t("toolbar.button.heading."+t),attrs:{level:t},name:this.name,when:["heading","paragraph"]})));return t[t.length-1].separator=!0,t}commands({type:t,schema:e,utils:n}){let s={toggleHeading:s=>n.toggleBlockType(t,e.nodes.paragraph,s)};return this.options.levels.forEach((i=>{s[`h${i}`]=()=>n.toggleBlockType(t,e.nodes.paragraph,{level:i})})),s}get defaults(){return{levels:[1,2,3,4,5,6]}}inputRules({type:t,utils:e}){return this.options.levels.map((n=>e.textblockTypeInputRule(new RegExp(`^(#{1,${n}})\\s$`),t,(()=>({level:n})))))}keys({type:t,utils:e}){return this.options.levels.reduce(((n,s)=>({...n,[`Shift-Ctrl-${s}`]:e.setBlockType(t,{level:s})})),{})}get name(){return"heading"}get schema(){return{attrs:{level:{default:1}},content:"inline*",group:"block",defining:!0,draggable:!1,parseDOM:this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}}))),toDOM:t=>[`h${t.attrs.level}`,0]}}}class pi extends zn{commands({type:t}){return()=>(e,n)=>n(e.tr.replaceSelectionWith(t.create()))}inputRules({type:t,utils:e}){return[e.nodeInputRule(/^(?:---|___\s|\*\*\*\s)$/,t)]}get name(){return"horizontalRule"}get schema(){return{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]}}}class hi extends zn{keys({type:t,utils:e}){return{Enter:e.splitListItem(t),"Shift-Tab":e.liftListItem(t),Tab:e.sinkListItem(t)}}get name(){return"listItem"}get schema(){return{content:"paragraph block*",defining:!0,draggable:!1,parseDOM:[{tag:"li"}],toDOM:()=>["li",0]}}}class mi extends zn{get button(){return{id:this.name,icon:"list-numbers",label:window.panel.$t("toolbar.button.ol"),name:this.name,when:["listItem","bulletList","orderedList"]}}commands({type:t,schema:e,utils:n}){return()=>n.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^(\d+)\.\s$/,t,(t=>({order:+t[1]})),((t,e)=>e.childCount+e.attrs.order===+t[1]))]}keys({type:t,schema:e,utils:n}){return{"Shift-Ctrl-9":n.toggleList(t,e.nodes.listItem)}}get name(){return"orderedList"}get schema(){return{attrs:{order:{default:1}},content:"listItem+",group:"block",parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1===t.attrs.order?["ol",0]:["ol",{start:t.attrs.order},0]}}}class fi extends Rn{commands(){return{undo:()=>O,redo:()=>A,undoDepth:()=>I,redoDepth:()=>M}}get defaults(){return{depth:"",newGroupDelay:""}}keys(){return{"Mod-z":O,"Mod-y":A,"Shift-Mod-z":A,"Mod-я":O,"Shift-Mod-я":A}}get name(){return"history"}plugins(){return[T({depth:this.options.depth,newGroupDelay:this.options.newGroupDelay})]}}class gi extends Rn{commands(){return{insertHtml:t=>(e,n)=>{let s=document.createElement("div");s.innerHTML=t.trim();const i=b.fromSchema(e.schema).parse(s);n(e.tr.replaceSelectionWith(i).scrollIntoView())}}}}class ki extends Rn{keys(){const t={};for(const e in this.options)t[e]=()=>(this.options[e](),!0);return t}}let bi=class extends Rn{constructor(t={}){super(t)}close(){this.visible=!1}init(){this.editor.on("blur",(()=>this.close())),this.editor.on("deselect",(()=>this.close())),this.editor.on("select",(({hasChanged:t})=>{!1!==t&&this.open()}))}open(){this.visible=!0,this.options.inline&&this.options.writer.$nextTick((()=>this.reposition()))}set position(t){this.options.inline&&(this.toolbar.style.bottom=t.bottom+"px",this.toolbar.style.left=t.left+"px")}reposition(){const{from:t,to:e}=this.editor.selection,n=this.editor.view.coordsAtPos(t),s=this.editor.view.coordsAtPos(e,!0),i=this.editor.element.getBoundingClientRect();let o=(n.left+s.left)/2-i.left,l=Math.round(i.bottom-n.top);const r=i.clientWidth,a=this.toolbar.clientWidth;o-a/2<0&&(o=o+(a/2-o)-20),o+a/2>r&&(o=o-(o+a/2-r)+20),this.position={bottom:l,left:o}}get toolbar(){return this.editor.element.querySelector(".k-writer-toolbar")}get type(){return"toolbar"}get visible(){var t;return"flex"===(null==(t=this.toolbar)?void 0:t.style.display)}set visible(t){this.options.inline&&this.toolbar&&(this.toolbar.style.display=t?"flex":"none")}};const vi={props:{autofocus:Boolean,breaks:Boolean,code:Boolean,disabled:Boolean,emptyDocument:{type:Object,default:()=>({type:"doc",content:[]})},extensions:Array,headings:[Array,Boolean],inline:Boolean,keys:Object,marks:{type:[Array,Boolean],default:!0},nodes:{type:[Array,Boolean],default:()=>["heading","bulletList","orderedList"]},paste:{type:Function,default:()=>()=>!1},placeholder:String,spellcheck:Boolean,toolbar:{type:Object,default:()=>({inline:!0})},value:{type:String,default:""}}};const yi=R({mixins:[vi],data(){return{editor:null,json:{},html:this.value,isEmpty:!0}},computed:{isCursorAtEnd(){return this.editor.selectionIsAtEnd},isCursorAtStart(){return this.editor.selectionIsAtStart},isParagraphNodeHidden(){return!0===Array.isArray(this.nodes)&&3!==this.nodes.length&&!1===this.nodes.includes("paragraph")}},watch:{value(t,e){t!==e&&t!==this.html&&(this.html=t,this.editor.setContent(this.html))}},mounted(){this.editor=new Zs({autofocus:this.autofocus,content:this.value,editable:!this.disabled,element:this.$el,emptyDocument:this.emptyDocument,parseOptions:{preserveWhitespace:!0},events:{link:t=>{this.$refs.linkDialog.open(t.getMarkAttrs("link"))},email:()=>{this.$refs.emailDialog.open(this.editor.getMarkAttrs("email"))},paste:this.paste,update:t=>{if(!this.editor)return;const e=JSON.stringify(this.editor.getJSON());e!==JSON.stringify(this.json)&&(this.json=e,this.isEmpty=t.editor.isEmpty(),this.html=t.editor.getHTML(),this.isEmpty&&(0===t.editor.activeNodes.length||t.editor.activeNodes.includes("paragraph"))&&(this.html=""),this.$emit("input",this.html))}},extensions:[...this.createMarks(),...this.createNodes(),new ki(this.keys),new fi,new gi,new bi({writer:this,inline:this.toolbar.inline}),...this.extensions||[]],inline:this.inline}),this.isEmpty=this.editor.isEmpty(),this.json=this.editor.getJSON()},beforeDestroy(){this.editor.destroy()},methods:{command(t,...e){this.editor.command(t,...e)},createMarks(){return this.filterExtensions({bold:new Xs,italic:new si,underline:new ai,strike:new oi,sup:new li,sub:new ri,code:new ei,link:new ii,email:new ni,clear:new ti,...this.createMarksFromPanelPlugins()},this.marks)},createMarksFromPanelPlugins(){const t=window.panel.plugins.writerMarks??{};for(const e in t)Object.setPrototypeOf(t[e],new Qs);return t},createNodes(){const t=new ci({text:!0,enter:this.inline});return!0===this.inline?[t]:this.filterExtensions({bulletList:new ui,orderedList:new mi,heading:new di({levels:this.headings}),horizontalRule:new pi,listItem:new hi,...this.createNodesFromPanelPlugins()},this.nodes,((e,n)=>((e.includes("bulletList")||e.includes("orderedList"))&&n.push(new hi),n.push(t),n)))},createNodesFromPanelPlugins(){const t=window.panel.plugins.writerNodes??{};for(const e in t)Object.setPrototypeOf(t[e],new zn);return t},getHTML(){return this.editor.getHTML()},filterExtensions(t,e,n){!1===e?e=[]:!0!==e&&!1!==Array.isArray(e)||(e=Object.keys(t));let s=[];for(const i of e)t[i]&&s.push(t[i]);return"function"==typeof n&&(s=n(e,s)),s},focus(){this.editor.focus()},getSplitContent(){return this.editor.getHTMLStartToSelectionToEnd()},onCommand(t,...e){this.editor.command(t,...e)}}},(function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"direction",rawName:"v-direction"}],ref:"editor",staticClass:"k-writer",attrs:{"data-empty":t.isEmpty,"data-placeholder":t.placeholder,spellcheck:t.spellcheck}},[t.editor?[e("k-writer-toolbar",t._b({ref:"toolbar",attrs:{editor:t.editor,"active-marks":t.editor.activeMarks,"active-nodes":t.editor.activeNodes,"active-node-attrs":t.editor.activeNodeAttrs,"is-paragraph-node-hidden":t.isParagraphNodeHidden},on:{command:t.onCommand}},"k-writer-toolbar",t.toolbar,!1)),e("k-writer-link-dialog",{ref:"linkDialog",on:{close:function(e){return t.editor.focus()},submit:function(e){return t.editor.command("toggleLink",e)}}}),e("k-writer-email-dialog",{ref:"emailDialog",on:{close:function(e){return t.editor.focus()},submit:function(e){return t.editor.command("toggleEmail",e)}}})]:t._e()],2)}),[],!1,null,null,null,null).exports,$i={mixins:[Yt,Ut,Kt,Gt,Zt,vi],props:{maxlength:Number,minlength:Number},computed:{counterValue(){const t=this.$helper.string.stripHTML(this.value);return this.$helper.string.unescapeHTML(t)}}};const wi=R({mixins:[$i,vi],inheritAttrs:!1,watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)}},validations(){return{counterValue:{required:!this.required||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.maxLength(this.maxlength)}}}},(function(){var t=this;return(0,t._self._c)("k-writer",t._b({ref:"input",staticClass:"k-writer-input",on:{input:function(e){return t.$emit("input",e)}}},"k-writer",t.$props,!1))}),[],!1,null,null,null,null).exports;const _i=R({mixins:[Qt,ee,$i,yn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-writer-field",attrs:{input:t._uid,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{after:t.after,before:t.before,icon:t.icon,theme:"field"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,xi={install(t){t.component("k-blocks-field",kn),t.component("k-checkboxes-field",$n),t.component("k-color-field",xn),t.component("k-date-field",On),t.component("k-email-field",jn),t.component("k-files-field",Ln),t.component("k-gap-field",Dn),t.component("k-headline-field",Bn),t.component("k-info-field",Pn),t.component("k-layout-field",Fn),t.component("k-line-field",Nn),t.component("k-link-field",qn),t.component("k-list-field",Kn),t.component("k-multiselect-field",Gn),t.component("k-number-field",Xn),t.component("k-object-field",ts),t.component("k-pages-field",es),t.component("k-password-field",is),t.component("k-radio-field",rs),t.component("k-range-field",cs),t.component("k-select-field",hs),t.component("k-slug-field",gs),t.component("k-structure-field",ks),t.component("k-tags-field",ys),t.component("k-text-field",xs),t.component("k-textarea-field",Os),t.component("k-tel-field",_s),t.component("k-time-field",Ms),t.component("k-toggle-field",Es),t.component("k-toggles-field",Bs),t.component("k-url-field",Ns),t.component("k-users-field",qs),t.component("k-writer-field",_i)}};const Ci=R({mixins:[Yt,Ut,Kt,Jt,Zt],inheritAttrs:!1,props:{value:Boolean},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onChange(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-checkbox-input",on:{click:function(t){t.stopPropagation()}}},[e("input",{ref:"input",staticClass:"k-checkbox-input-native input-hidden",attrs:{id:t.id,disabled:t.disabled,type:"checkbox"},domProps:{checked:t.value},on:{change:function(e){return t.onChange(e.target.checked)}}}),e("span",{staticClass:"k-checkbox-input-icon",attrs:{"aria-hidden":"true"}},[e("svg",{attrs:{width:"12",height:"10",viewBox:"0 0 12 10",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{d:"M1 5l3.3 3L11 1","stroke-width":"2",fill:"none","fill-rule":"evenodd"}})])]),e("span",{staticClass:"k-checkbox-input-label",domProps:{innerHTML:t._s(t.label)}})])}),[],!1,null,null,null,null).exports,Si={install(t){t.component("k-checkbox-input",Ci),t.component("k-checkboxes-input",vn),t.component("k-color-input",_n),t.component("k-date-input",Sn),t.component("k-email-input",Tn),t.component("k-list-input",Vn),t.component("k-multiselect-input",Jn),t.component("k-number-input",Qn),t.component("k-password-input",ss),t.component("k-radio-input",ls),t.component("k-range-input",us),t.component("k-select-input",ps),t.component("k-slug-input",fs),t.component("k-tags-input",vs),t.component("k-tel-input",ws),t.component("k-text-input",In),t.component("k-textarea-input",Ss),t.component("k-time-input",Is),t.component("k-toggle-input",js),t.component("k-toggles-input",Ds),t.component("k-url-input",Fs),t.component("k-writer-input",wi)}};const Oi=R({props:{attrs:[Array,Object],columns:Array,disabled:Boolean,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean,layouts:Array,settings:Object},computed:{tabs(){let t=this.settings.tabs;return Object.entries(t).forEach((([e,n])=>{Object.entries(n.fields).forEach((([n])=>{t[e].fields[n].endpoints={field:this.endpoints.field+"/fields/"+n,section:this.endpoints.section,model:this.endpoints.model}}))})),t}},methods:{remove(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.layout.delete.confirm")},on:{submit:()=>{this.$emit("remove"),this.$panel.dialog.close()}}})}}},(function(){var t=this,e=t._self._c;return e("section",{staticClass:"k-layout",attrs:{"data-selected":t.isSelected,tabindex:"0"},on:{click:function(e){return t.$emit("select")}}},[e("k-grid",{staticClass:"k-layout-columns"},t._l(t.columns,(function(n,s){return e("k-layout-column",t._b({key:n.id,attrs:{endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets},on:{input:function(e){return t.$emit("updateColumn",{column:n,columnIndex:s,blocks:e})}}},"k-layout-column",n,!1))})),1),t.disabled?t._e():e("nav",{staticClass:"k-layout-toolbar"},[t.settings?e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{tooltip:t.$t("settings"),icon:"settings"},on:{click:function(e){return t.$refs.drawer.open()}}}):t._e(),e("k-dropdown",[e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{icon:"angle-down"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{icon:"angle-up"},on:{click:function(e){return t.$emit("prepend")}}},[t._v(" "+t._s(t.$t("insert.before"))+" ")]),e("k-dropdown-item",{attrs:{icon:"angle-down"},on:{click:function(e){return t.$emit("append")}}},[t._v(" "+t._s(t.$t("insert.after"))+" ")]),e("hr"),t.settings?e("k-dropdown-item",{attrs:{icon:"settings"},on:{click:function(e){return t.$refs.drawer.open()}}},[t._v(" "+t._s(t.$t("settings"))+" ")]):t._e(),e("k-dropdown-item",{attrs:{icon:"copy"},on:{click:function(e){return t.$emit("duplicate")}}},[t._v(" "+t._s(t.$t("duplicate"))+" ")]),e("k-dropdown-item",{attrs:{disabled:1===t.layouts.length,icon:"dashboard"},on:{click:function(e){return t.$emit("change")}}},[t._v(" "+t._s(t.$t("field.layout.change"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:"template"},on:{click:function(e){return t.$emit("copy")}}},[t._v(" "+t._s(t.$t("copy"))+" ")]),e("k-dropdown-item",{attrs:{icon:"download"},on:{click:function(e){return t.$emit("paste")}}},[t._v(" "+t._s(t.$t("paste.after"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:"trash"},on:{click:t.remove}},[t._v(" "+t._s(t.$t("field.layout.delete"))+" ")])],1)],1),e("k-sort-handle")],1),t.settings?e("k-form-drawer",{ref:"drawer",staticClass:"k-layout-drawer",attrs:{tabs:t.tabs,title:t.$t("settings"),value:t.attrs,icon:"settings"},on:{input:function(e){return t.$emit("updateAttrs",e)}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const Ai=R({props:{blocks:Array,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean,width:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column k-layout-column",attrs:{id:t.id,"data-width":t.width,tabindex:"0"},on:{dblclick:function(e){return t.$refs.blocks.choose(t.blocks.length)}}},[e("k-blocks",{ref:"blocks",attrs:{endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets,value:t.blocks,group:"layout"},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{dblclick:function(t){t.stopPropagation()}}})],1)}),[],!1,null,null,null,null).exports;const Ii=R({props:{disabled:Boolean,empty:String,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,layouts:Array,max:Number,settings:Object,value:Array},data(){return{current:null,nextIndex:null,rows:this.value,selected:null}},computed:{draggableOptions(){return{id:this._uid,handle:!0,list:this.rows}}},watch:{value(){this.rows=this.value}},methods:{copy(t,e){if(0===this.rows.length)return!1;const n=void 0!==e?this.rows[e]:this.rows;this.$helper.clipboard.write(JSON.stringify(n),t),this.$panel.notification.success(this.$t("copy.success",{count:n.length??1}))},change(t,e){const n=e.columns.map((t=>t.width)),s=this.layouts.findIndex((t=>t.toString()===n.toString()));this.$refs.selector.open({rowIndex:t,layoutIndex:s,layout:e})},duplicate(t,e){let n={...this.$helper.clone(e),id:this.$helper.uuid()};n=this.updateIds(n),this.rows.splice(t+1,0,n),this.save()},async onAdd(t){let e=await this.$api.post(this.endpoints.field+"/layout",{columns:t});this.rows.splice(this.nextIndex,0,e),this.layouts.length>1&&this.$refs.selector.close(),this.save()},async onChange(t,e,n){if(e===n.layoutIndex)return this.$refs.selector.close();const s=n.layout,i=await this.$api.post(this.endpoints.field+"/layout",{columns:t}),o=s.columns.filter((t=>{var e;return(null==(e=null==t?void 0:t.blocks)?void 0:e.length)>0})),l=[];if(0===o.length)l.push(i);else{const t=Math.ceil(o.length/i.columns.length)*i.columns.length;for(let e=0;e{var s;return t.blocks=(null==(s=o[n+e])?void 0:s.blocks)??[],t})),t.columns.filter((t=>{var e;return null==(e=null==t?void 0:t.blocks)?void 0:e.length})).length&&l.push(t)}}this.rows.splice(n.rowIndex,1,...l),this.save(),this.$refs.selector.close()},async onPaste(t){const e=this.$helper.clipboard.read(t),n=this.current??this.rows.length;let s=await this.$api.post(this.endpoints.field+"/layout/paste",{json:e});s.length&&(this.rows.splice(n,0,...s),this.save()),this.$panel.notification.success(this.$t("paste.success",{count:s.length}))},async onSelect(t,e,n){return n?this.onChange(t,e,n):this.onAdd(t)},pasteboard(t){this.current=t,this.$refs.pasteboard.open()},remove(t){const e=this.rows.findIndex((e=>e.id===t.id));-1!==e&&this.$delete(this.rows,e),this.save()},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.layout.delete.confirm.all")},on:{submit:()=>{this.rows=[],this.save(),this.$panel.dialog.close()}}})},save(){this.$emit("input",this.rows)},select(t){if(this.nextIndex=t,1===this.layouts.length)return this.onAdd(this.layouts[0]);this.$refs.selector.open()},updateAttrs(t,e){this.rows[t].attrs=e,this.save()},updateColumn(t){this.rows[t.index].columns[t.columnIndex].blocks=t.blocks,this.save()},updateIds(t){return!1===Array.isArray(t)&&(t=[t]),t.map((t=>(t.id=this.$helper.uuid(),t.columns=t.columns.map((t=>(t.id=this.$helper.uuid(),t.blocks=t.blocks.map((t=>(t.id=this.$helper.uuid(),t))),t))),t)))}}},(function(){var t=this,e=t._self._c;return e("div",[t.rows.length?[e("k-draggable",t._b({staticClass:"k-layouts",on:{sort:t.save}},"k-draggable",t.draggableOptions,!1),t._l(t.rows,(function(n,s){return e("k-layout",t._b({key:n.id,attrs:{disabled:t.disabled,endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets,"is-selected":t.selected===n.id,layouts:t.layouts,settings:t.settings},on:{append:function(e){return t.select(s+1)},change:function(e){return t.change(s,n)},copy:function(e){return t.copy(e,s)},duplicate:function(e){return t.duplicate(s,n)},paste:function(e){return t.pasteboard(s+1)},prepend:function(e){return t.select(s)},remove:function(e){return t.remove(n)},select:function(e){t.selected=n.id},updateAttrs:function(e){return t.updateAttrs(s,e)},updateColumn:function(e){return t.updateColumn({layout:n,index:s,...e})}}},"k-layout",n,!1))})),1),t.disabled?t._e():e("k-button",{staticClass:"k-field-add-item-button",attrs:{icon:"add",tooltip:t.$t("add")},on:{click:function(e){return t.select(t.rows.length)}}})]:[e("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"},on:{click:function(e){return t.select(0)}}},[t._v(" "+t._s(t.empty||t.$t("field.layout.empty"))+" ")])],e("k-layout-selector",{ref:"selector",attrs:{layouts:t.layouts},on:{select:t.onSelect}}),e("k-block-pasteboard",{ref:"pasteboard",on:{paste:t.onPaste}})],2)}),[],!1,null,null,null,null).exports;const Mi=R({inheritAttrs:!1,props:{layouts:Array},data:()=>({payload:null}),methods:{close(){this.$refs.dialog.close()},isCurrent(t){var e;return t===(null==(e=this.payload)?void 0:e.layoutIndex)},onSelect(t,e){this.$emit("select",t,e,this.payload)},open(t){this.payload=t,this.$refs.dialog.open()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-layout-selector",attrs:{"cancel-button":!1,"submit-button":!1,size:"medium"}},[e("k-headline",[t._v(t._s(t.$t("field.layout.select")))]),e("ul",t._l(t.layouts,(function(n,s){return e("li",{key:s,staticClass:"k-layout-selector-option",attrs:{"aria-current":t.isCurrent(s)}},[e("k-grid",{nativeOn:{click:function(e){return t.onSelect(n,s)}}},t._l(n,(function(t,n){return e("k-column",{key:n,attrs:{width:t}})})),1)],1)})),0)],1)}),[],!1,null,null,null,null).exports,Ti={install(t){t.component("k-layout",Oi),t.component("k-layout-column",Ai),t.component("k-layouts",Ii),t.component("k-layout-selector",Mi)}},ji={inheritAttrs:!1,props:{column:{type:Object,default:()=>({})},field:Object,value:{}}};const Ei=R({mixins:[ji],inheritAttrs:!1,props:{value:[Array,String]},computed:{bubbles(){var t,e;let n=this.value;const s=(null==(t=this.column)?void 0:t.options)||(null==(e=this.field)?void 0:e.options)||[];return"string"==typeof n&&(n=n.split(",")),n.map((t=>{"string"==typeof t&&(t={value:t,text:t});for(const e of s)e.value===t.value&&(t.text=e.text);return{back:"light",color:"black",...t}}))}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-bubbles-field-preview",class:t.$options.class},[e("k-bubbles",{attrs:{bubbles:t.bubbles}})],1)}),[],!1,null,null,null,null).exports;const Li=R({extends:Ei,inheritAttrs:!1,class:"k-array-field-preview",computed:{bubbles(){return[{text:1===this.value.length?`1 ${this.$t("entry")}`:`${this.value.length} ${this.$t("entries")}`}]}}},null,null,!1,null,null,null,null).exports;const Di=R({mixins:[ji],inheritAttrs:!1,props:{field:Object,value:String},computed:{text(){const t=this.field.options.find((t=>this.$library.colors.toString(t.value,this.field.format,this.field.alpha)===this.value));return t?t.text:null}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-color-field-preview"},[e("k-bubble",{attrs:{text:t.text},scopedSlots:t._u([{key:"image",fn:function(){return[e("span",{staticClass:"k-item-figure k-color-preview",style:"color: "+t.value})]},proxy:!0}])})],1)}),[],!1,null,null,null,null).exports;const Bi=R({mixins:[ji],inheritAttrs:!1,computed:{text(){return this.value}}},(function(){var t=this;return(0,t._self._c)("p",{staticClass:"k-text-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),t._t("default",(function(){return[t._v(t._s(t.text))]})),t._v(" "+t._s(t.column.after)+" ")],2)}),[],!1,null,null,null,null).exports;const Pi=R({extends:Bi,inheritAttrs:!1,props:{value:String},class:"k-date-field-preview",computed:{text(){var t,e,n,s,i,o;if("string"!=typeof this.value)return"";const l=this.$library.dayjs(this.value);if(!l)return"";let r=(null==(t=this.column)?void 0:t.display)||(null==(e=this.field)?void 0:e.display)||"YYYY-MM-DD",a=(null==(s=null==(n=this.column)?void 0:n.time)?void 0:s.display)||(null==(o=null==(i=this.field)?void 0:i.time)?void 0:o.display);return a&&(r+=" "+a),l.format(r)}}},null,null,!1,null,null,null,null).exports;const Fi=R({mixins:[ji],props:{value:[String,Object]},computed:{link(){return"object"==typeof this.value?this.value.href:this.value},text(){return"object"==typeof this.value?this.value.text:this.link}}},(function(){var t=this,e=t._self._c;return e("p",{staticClass:"k-url-field-preview",class:t.$options.class,attrs:{"data-link":t.link}},[t._v(" "+t._s(t.column.before)+" "),e("k-link",{attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[t._v(" "+t._s(t.text)+" ")]),t._v(" "+t._s(t.column.after)+" ")],1)}),[],!1,null,null,null,null).exports;const Ni=R({extends:Fi,class:"k-email-field-preview"},null,null,!1,null,null,null,null).exports;const qi=R({extends:Ei,inheritAttrs:!1,class:"k-files-field-preview",computed:{bubbles(){return this.value.map((t=>({text:t.filename,link:t.link,image:t.image})))}}},null,null,!1,null,null,null,null).exports;const Ri=R({mixins:[ji],inheritAttrs:!1,props:{value:Object}},(function(){var t=this;return(0,t._self._c)("k-status-icon",t._b({staticClass:"k-flag-field-preview"},"k-status-icon",t.value,!1))}),[],!1,null,null,null,null).exports;const zi=R({mixins:[ji],inheritAttrs:!1,props:{value:String},computed:{html(){return this.value}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-html-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),e("div",{domProps:{innerHTML:t._s(t.html)}}),t._v(" "+t._s(t.column.after)+" ")])}),[],!1,null,null,null,null).exports;const Yi=R({mixins:[ji],inheritAttrs:!1,props:{value:[Object]}},(function(){return(0,this._self._c)("k-item-image",{staticClass:"k-image-field-preview",attrs:{image:this.value,layout:"list"}})}),[],!1,null,null,null,null).exports;const Hi=R({extends:Ei,inheritAttrs:!1,class:"k-object-field-preview",props:{value:[Array,Object]},computed:{bubbles:()=>[{text:"{ ... }"}]}},null,null,!1,null,null,null,null).exports;const Ui=R({extends:Ei,inheritAttrs:!1,class:"k-pages-field-preview"},null,null,!1,null,null,null,null).exports;const Vi=R({extends:Bi,inheritAttrs:!1,props:{value:String},class:"k-time-field-preview",computed:{text(){const t=this.$library.dayjs.iso(this.value,"time");return(null==t?void 0:t.format(this.field.display))||""}}},null,null,!1,null,null,null,null).exports;const Ki=R({props:{field:Object,value:Boolean,column:Object},computed:{text(){return!1!==this.column.text?this.field.text:null}}},(function(){var t=this;return(0,t._self._c)("k-input",{staticClass:"k-toggle-field-preview",attrs:{text:t.text,value:t.value,type:"toggle"},on:{input:function(e){return t.$emit("input",e)}}})}),[],!1,null,null,null,null).exports;const Wi=R({extends:Ei,inheritAttrs:!1,class:"k-users-field-preview",computed:{bubble(){return this.value.map((t=>({text:t.username,link:t.link,image:t.image})))}}},null,null,!1,null,null,null,null).exports,Ji={install(t){t.component("k-array-field-preview",Li),t.component("k-bubbles-field-preview",Ei),t.component("k-color-field-preview",Di),t.component("k-date-field-preview",Pi),t.component("k-email-field-preview",Ni),t.component("k-files-field-preview",qi),t.component("k-flag-field-preview",Ri),t.component("k-html-field-preview",zi),t.component("k-image-field-preview",Yi),t.component("k-object-field-preview",Hi),t.component("k-pages-field-preview",Ui),t.component("k-text-field-preview",Bi),t.component("k-toggle-field-preview",Ki),t.component("k-time-field-preview",Vi),t.component("k-url-field-preview",Fi),t.component("k-users-field-preview",Wi),t.component("k-list-field-preview",zi),t.component("k-writer-field-preview",zi),t.component("k-checkboxes-field-preview",Ei),t.component("k-multiselect-field-preview",Ei),t.component("k-radio-field-preview",Ei),t.component("k-select-field-preview",Ei),t.component("k-tags-field-preview",Ei),t.component("k-toggles-field-preview",Ei)}};const Gi=R({data:()=>({link:{href:"",title:null,target:!1}}),computed:{fields(){return{href:{label:this.$t("link"),type:"link",icon:"url"},title:{label:this.$t("title"),type:"text",icon:"title"},target:{label:this.$t("open.newWindow"),type:"toggle",text:[this.$t("no"),this.$t("yes")]}}}},methods:{open(t){this.link={href:"",title:null,target:!1,...t},this.link.target=Boolean(this.link.target),this.$refs.dialog.open()},submit(){const t=this.link.href.replace("file://","/@/file/").replace("page://","/@/page/");this.$emit("submit",{...this.link,href:t,target:this.link.target?"_blank":null}),this.$refs.dialog.close()}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",{ref:"dialog",attrs:{fields:t.fields,"submit-button":t.$t("confirm"),value:t.link,size:"medium"},on:{close:function(e){return t.$emit("close")},input:function(e){t.link=e},submit:t.submit}})}),[],!1,null,null,null,null).exports;const Zi=R({data:()=>({email:{email:null,title:null}}),computed:{fields(){return{href:{label:this.$t("email"),type:"email",icon:"email"},title:{label:this.$t("title"),type:"text",icon:"title"}}}},methods:{open(t){this.email={title:null,...t},this.$refs.dialog.open()},submit(){this.$emit("submit",this.email),this.$refs.dialog.close()}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",{ref:"dialog",attrs:{fields:t.fields,"submit-button":t.$t("confirm"),value:t.email,size:"medium"},on:{input:function(e){t.email=e},close:function(e){return t.$emit("close")},submit:t.submit}})}),[],!1,null,null,null,null).exports;const Qi=R({props:{activeMarks:Array,activeNodes:Array,activeNodeAttrs:{type:[Array,Object],default:()=>[]},editor:{type:Object,required:!0},inline:{type:Boolean,default:!0},isParagraphNodeHidden:Boolean,marks:{type:[Array,Boolean],default:!0},nodes:{type:[Array,Boolean],default:!0}},computed:{activeNodeButton(){return Object.values(this.nodeButtons).find((t=>this.isButtonActive(t)))||!1},hasVisibleMarkButtons(){return this.$helper.object.length(this.markButtons)>0},hasVisibleNodeButtons(){return this.$helper.object.length(this.nodeButtons)>1},markButtons(){if(!1===this.marks)return{};const t=this.editor.buttons("mark");if(!0===this.marks)return t;const e={};for(const[n,s]of this.marks.entries())"|"===s?e["divider"+n]="|":t[s]&&(e[s]=t[s]);return e},nodeButtons(){if(!1===this.nodes)return{};const t=this.editor.buttons("node");if(!0===this.isParagraphNodeHidden&&t.paragraph&&delete t.paragraph,!0===this.nodes)return t;const e={};for(const n of this.nodes.entries())t[n]&&(e[n]=t[n]);return e}},methods:{command(t,...e){this.$emit("command",t,...e)},isButtonActive(t){if("paragraph"===t.name)return 1===this.activeNodes.length&&this.activeNodes.includes(t.name);let e=!0;if(t.attrs){const n=Object.values(this.activeNodeAttrs).find((e=>JSON.stringify(e)===JSON.stringify(t.attrs)));e=Boolean(n||!1)}return!0===e&&this.activeNodes.includes(t.name)}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-toolbar k-writer-toolbar",style:t.inline?"display: none":null,attrs:{"data-inline":t.inline}},[t.hasVisibleNodeButtons?e("k-dropdown",{nativeOn:{mousedown:function(t){t.preventDefault()}}},[e("k-button",{staticClass:"k-toolbar-button k-writer-toolbar-nodes",attrs:{current:!!t.activeNodeButton,icon:t.activeNodeButton.icon||"title"},on:{click:function(e){return t.$refs.nodes.toggle()}}}),e("k-dropdown-content",{ref:"nodes"},[t._l(t.nodeButtons,(function(n,s){var i,o,l;return[e("k-dropdown-item",{key:s,attrs:{current:(null==(i=t.activeNodeButton)?void 0:i.id)===n.id,disabled:!1===(null==(l=null==(o=t.activeNodeButton)?void 0:o.when)?void 0:l.includes(n.name)),icon:n.icon},on:{click:function(e){return t.command(n.command||s)}}},[t._v(" "+t._s(n.label)+" ")]),!0===n.separator?e("hr",{key:s+"-divider"}):t._e()]}))],2)],1):t._e(),t.hasVisibleNodeButtons&&t.hasVisibleMarkButtons?e("div",{staticClass:"k-toolbar-divider"}):t._e(),t._l(t.markButtons,(function(n,s){return["|"===n?e("div",{key:s,staticClass:"k-toolbar-divider"}):e("k-button",{key:s,staticClass:"k-toolbar-button",attrs:{current:t.activeMarks.includes(s),icon:n.icon,tooltip:n.label},nativeOn:{mousedown:function(e){return e.preventDefault(),t.command(n.command||s,e)}}})]}))],2)}),[],!1,null,null,null,null).exports,Xi={install(t){t.component("k-writer-email-dialog",Zi),t.component("k-writer-link-dialog",Gi),t.component("k-writer-toolbar",Qi),t.component("k-writer",yi)}},to={install(t){customElements.define("k-autosize",Dt),t.component("k-calendar",Pt),t.component("k-counter",Ft),t.component("k-autocomplete",Bt),t.component("k-form",Nt),t.component("k-form-buttons",qt),t.component("k-form-indicator",Rt),t.component("k-field",Xt),t.component("k-fieldset",te),t.component("k-input",ne),t.component("k-login",se),t.component("k-login-code",ie),t.component("k-times",oe),t.component("k-upload",le),t.component("k-login-alert",re),t.component("k-structure-form",ae),t.component("k-toolbar",ce),t.component("k-toolbar-email-dialog",de),t.component("k-toolbar-link-dialog",pe),t.use(Ke),t.use(gn),t.use(Si),t.use(xi),t.use(Ti),t.use(Ji),t.use(Xi)}};const eo=R({props:{cover:Boolean,ratio:String},computed:{ratioPadding(){return this.$helper.ratio(this.ratio)}}},(function(){var t=this;return(0,t._self._c)("span",{staticClass:"k-aspect-ratio",style:{"padding-bottom":t.ratioPadding},attrs:{"data-cover":t.cover}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const no=R({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-bar"},[t.$slots.left?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"left"}},[t._t("left")],2):t._e(),t.$slots.center?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"center"}},[t._t("center")],2):t._e(),t.$slots.right?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"right"}},[t._t("right")],2):t._e()])}),[],!1,null,null,null,null).exports;const so=R({props:{theme:{type:String,default:"none"},text:String,html:{type:Boolean,default:!1}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-box",attrs:{"data-theme":t.theme}},[t._t("default",(function(){return[t.html?e("k-text",{attrs:{html:t.text}}):e("k-text",[t._v(" "+t._s(t.text)+" ")])]}))],2)}),[],!1,null,null,null,null).exports;const io=R({inheritAttrs:!1,props:{back:String,color:String,element:{type:String,default:"li"},image:Object,link:String,text:String}},(function(){var t=this,e=t._self._c;return e(t.link?"k-link":"p",{tag:"component",staticClass:"k-bubble",style:{color:t.$helper.color(t.color),background:t.$helper.color(t.back)},attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[t._t("image",(function(){return[t.image?e("k-item-image",{attrs:{image:t.image,layout:"list"}}):e("span")]})),t.text?e("span",{staticClass:"k-bubble-text"},[t._v(t._s(t.text))]):t._e()],2)}),[],!1,null,null,null,null).exports;const oo=R({inheritAttrs:!1,props:{bubbles:Array},computed:{items(){let t=this.bubbles;return"string"==typeof t&&(t=t.split(",")),t.map((t=>"string"==typeof t?{text:t}:t))}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-bubbles"},t._l(t.items,(function(n,s){return e("li",{key:s},[e("k-bubble",t._b({},"k-bubble",n,!1))],1)})),0)}),[],!1,null,null,null,null).exports;const lo=R({props:{columns:{type:[Object,Array],default:()=>({})},empty:Object,help:String,items:{type:[Array,Object],default:()=>[]},layout:{type:String,default:"list"},link:{type:Boolean,default:!0},size:String,sortable:Boolean,pagination:{type:[Boolean,Object],default:!1}},computed:{hasPagination(){return!1!==this.pagination&&(!0!==this.paginationOptions.hide&&!(this.pagination.total<=this.pagination.limit))},hasFooter(){return!(!this.hasPagination&&!this.help)},paginationOptions(){return{limit:10,details:!0,keys:!1,total:0,hide:!1,..."object"!=typeof this.pagination?{}:this.pagination}}},watch:{$props(){this.$forceUpdate()}},methods:{onEmpty(t){t.stopPropagation(),this.$emit("empty")},onOption(...t){this.$emit("action",...t),this.$emit("option",...t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-collection"},[t.items.length?e("k-items",{attrs:{columns:t.columns,items:t.items,layout:t.layout,link:t.link,size:t.size,sortable:t.sortable},on:{change:function(e){return t.$emit("change",e)},item:function(e){return t.$emit("item",e)},option:t.onOption,sort:function(e){return t.$emit("sort",e)}},scopedSlots:t._u([{key:"options",fn:function({item:e,itemIndex:n}){return[t._t("options",null,null,{item:e,index:n})]}}],null,!0)}):e("k-empty",t._g(t._b({attrs:{layout:t.layout}},"k-empty",t.empty,!1),t.$listeners.empty?{click:t.onEmpty}:{})),t.hasFooter?e("footer",{staticClass:"k-collection-footer"},[t.help?e("k-text",{staticClass:"k-collection-help",attrs:{theme:"help",html:t.help}}):t._e(),e("div",{staticClass:"k-collection-pagination"},[t.hasPagination?e("k-pagination",t._b({on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.paginationOptions,!1)):t._e()],1)],1):t._e()],1)}),[],!1,null,null,null,null).exports;const ro=R({props:{width:String,sticky:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column",attrs:{"data-width":t.width,"data-sticky":t.sticky}},[e("div",[t._t("default")],2)])}),[],!1,null,null,null,null).exports;const ao=R({props:{disabled:{type:Boolean,default:!1}},data:()=>({files:[],dragging:!1,over:!1}),methods:{cancel(){this.reset()},reset(){this.dragging=!1,this.over=!1},onDrop(t){return!0===this.disabled||!1===this.$helper.isUploadEvent(t)?this.reset():(this.$events.$emit("dropzone.drop"),this.files=t.dataTransfer.files,this.$emit("drop",this.files),void this.reset())},onEnter(t){!1===this.disabled&&this.$helper.isUploadEvent(t)&&(this.dragging=!0)},onLeave(){this.reset()},onOver(t){!1===this.disabled&&this.$helper.isUploadEvent(t)&&(t.dataTransfer.dropEffect="copy",this.over=!0)}}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-dropzone",attrs:{"data-dragging":t.dragging,"data-over":t.over},on:{dragenter:t.onEnter,dragleave:t.onLeave,dragover:t.onOver,drop:t.onDrop}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const uo=R({props:{text:String,icon:String,layout:{type:String,default:"list"}},computed:{element(){return void 0!==this.$listeners.click?"button":"div"}}},(function(){var t=this,e=t._self._c;return e(t.element,t._g({tag:"component",staticClass:"k-empty",attrs:{"data-layout":t.layout,type:"button"===t.element&&"button"}},t.$listeners),[t.icon?e("k-icon",{attrs:{type:t.icon}}):t._e(),e("p",[t._t("default",(function(){return[t._v(t._s(t.text))]}))],2)],1)}),[],!1,null,null,null,null).exports;const co=R({props:{details:Array,focusable:Boolean,image:Object,isLocked:Boolean,url:String},computed:{focus(){const t=this.$store.getters["content/values"]().focus;if(!t)return;const[e,n]=t.replaceAll("%","").split(" ");return{x:parseFloat(e),y:parseFloat(n)}},canFocus(){return this.focusable&&this.image.src&&!1===this.isLocked},hasFocus(){var t,e;return void 0!==(null==(t=this.focus)?void 0:t.x)&&void 0!==(null==(e=this.focus)?void 0:e.y)},options(){const t=[{icon:"open",text:this.$t("open"),link:this.url,target:"_blank"}];return this.canFocus&&(this.hasFocus?t.push({icon:"cancel",text:this.$t("file.focus.reset"),disabled:!this.hasFocus,click:this.setFocus}):t.push({icon:"preview",text:this.$t("file.focus.placeholder"),click:()=>this.setFocus("50% 50%")})),t},storeId(){return this.$store.getters["content/id"](null,!0)}},methods:{setFocus(t){!0===this.$helper.object.isObject(t)&&(t=`${t.x.toFixed(1)}% ${t.y.toFixed(1)}%`),this.$store.dispatch("content/update",["focus",t])}}},(function(){var t,e,n=this,s=n._self._c;return s("div",{staticClass:"k-file-preview",attrs:{"data-has-focus":n.hasFocus}},[s("k-view",{staticClass:"k-file-preview-layout"},[s("div",{staticClass:"k-file-preview-thumb"},[n.image.src?[s("k-coords",{attrs:{"aria-disabled":!n.canFocus,x:null==(t=n.focus)?void 0:t.x,y:null==(e=n.focus)?void 0:e.y},on:{input:function(t){return n.setFocus(t.detail)}}},[s("img",n._b({on:{dragstart:function(t){t.preventDefault()}}},"img",n.image,!1))]),s("k-dropdown",[s("k-button",{staticStyle:{color:"var(--color-gray-500)"},attrs:{icon:"dots",size:"xs"},on:{click:function(t){return n.$refs.dropdown.toggle()}}}),s("k-dropdown-content",{ref:"dropdown",attrs:{options:n.options,theme:"light"}})],1)]:s("k-icon",{staticClass:"k-item-icon",attrs:{color:n.$helper.color(n.image.color),type:n.image.icon}})],2),s("div",{staticClass:"k-file-preview-details"},[s("dl",[n._l(n.details,(function(t){return s("div",{key:t.title},[s("dt",[n._v(n._s(t.title))]),s("dd",[t.link?s("k-link",{attrs:{to:t.link,tabindex:"-1",target:"_blank"}},[n._v(" /"+n._s(t.text)+" ")]):[n._v(" "+n._s(t.text)+" ")]],2)])})),n.image.src?s("div",{staticClass:"k-file-preview-focus-info"},[s("dt",[n._v(n._s(n.$t("file.focus.title")))]),s("dd",[n.canFocus?s("k-button",{attrs:{icon:n.hasFocus?"cancel-small":"preview",title:n.hasFocus?n.$t("file.focus.reset"):void 0,size:"xs",variant:"filled"},on:{click:function(t){return n.setFocus(n.hasFocus?void 0:"50% 50%")}}},[n.hasFocus?[n._v(" "+n._s(n.focus.x)+"% "+n._s(n.focus.y)+"% ")]:n.canFocus?[n._v(" "+n._s(n.$t("file.focus.placeholder"))+" ")]:n._e()],2):n.hasFocus?[n._v(" "+n._s(n.focus.x)+"% "+n._s(n.focus.y)+"% ")]:[n._v("–")]],2)]):n._e()],2)])])],1)}),[],!1,null,null,null,null).exports;const po=R({props:{gutter:String}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-grid",attrs:{"data-gutter":t.gutter}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const ho=R({props:{editable:Boolean,tab:String,tabs:{type:Array,default:()=>[]}},computed:{tabsWithBadges(){const t=Object.keys(this.$store.getters["content/changes"]());return this.tabs.map((e=>{let n=[];return Object.values(e.columns).forEach((t=>{Object.values(t.sections).forEach((t=>{"fields"===t.type&&Object.keys(t.fields).forEach((t=>{n.push(t)}))}))})),e.badge=n.filter((e=>t.includes(e.toLowerCase()))).length,e}))}}},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-header",attrs:{"data-editable":t.editable,"data-tabs":t.tabsWithBadges.length>1}},[e("k-headline",{attrs:{tag:"h1",size:"huge"},on:{click:function(e){t.editable&&t.$emit("edit")}}},[t._t("default"),e("k-icon",{attrs:{type:"edit"}})],2),t.$slots.left||t.$slots.right?e("k-bar",{staticClass:"k-header-buttons",scopedSlots:t._u([{key:"left",fn:function(){return[t._t("left")]},proxy:!0},{key:"right",fn:function(){return[t._t("right")]},proxy:!0}],null,!0)}):t._e(),e("k-tabs",{attrs:{tab:t.tab,tabs:t.tabsWithBadges,theme:"notice"}})],1)}),[],!1,null,null,null,null).exports;const mo=R({inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-panel",{staticClass:"k-panel-inside",attrs:{tabindex:"0"}},[e("header",{staticClass:"k-panel-header"},[e("k-topbar",{attrs:{breadcrumb:t.$panel.view.breadcrumb,license:t.$panel.license,menu:t.$panel.menu,view:t.$panel.view}})],1),e("main",{staticClass:"k-panel-view scroll-y"},[t._t("default")],2),t._t("footer")],2)}),[],!1,null,null,null,null).exports;const fo=R({inheritAttrs:!1,props:{data:Object,flag:Object,image:[Object,Boolean],info:String,layout:{type:String,default:"list"},link:{type:[Boolean,String,Function]},options:{type:[Array,Function,String]},sortable:Boolean,target:String,text:String,width:String},computed:{hasFigure(){return!1!==this.image&&this.$helper.object.length(this.image)>0},title(){return this.text||"-"}},methods:{onOption(t){this.$emit("action",t),this.$emit("option",t)}}},(function(){var t=this,e=t._self._c;return e("article",t._b({staticClass:"k-item",class:!!t.layout&&"k-"+t.layout+"-item",attrs:{"data-has-figure":t.hasFigure,"data-has-flag":Boolean(t.flag),"data-has-info":Boolean(t.info),"data-has-options":Boolean(t.options),tabindex:"-1"},on:{click:function(e){return t.$emit("click",e)},dragstart:function(e){return t.$emit("drag",e)}}},"article",t.data,!1),[t._t("image",(function(){return[t.hasFigure?e("k-item-image",{attrs:{image:t.image,layout:t.layout,width:t.width}}):t._e()]})),t.sortable?e("k-sort-handle",{staticClass:"k-item-sort-handle"}):t._e(),e("header",{staticClass:"k-item-content"},[t._t("default",(function(){return[e("h3",{staticClass:"k-item-title"},[!1!==t.link?e("k-link",{staticClass:"k-item-title-link",attrs:{target:t.target,to:t.link}},[e("span",{domProps:{innerHTML:t._s(t.title)}})]):e("span",{domProps:{innerHTML:t._s(t.title)}})],1),t.info?e("p",{staticClass:"k-item-info",domProps:{innerHTML:t._s(t.info)}}):t._e()]}))],2),t.flag||t.options||t.$slots.options?e("footer",{staticClass:"k-item-footer"},[e("nav",{staticClass:"k-item-buttons",on:{click:function(t){t.stopPropagation()}}},[t.flag?e("k-status-icon",t._b({},"k-status-icon",t.flag,!1)):t._e(),t._t("options",(function(){return[t.options?e("k-options-dropdown",{staticClass:"k-item-options-dropdown",attrs:{options:t.options},on:{option:t.onOption}}):t._e()]}))],2)]):t._e()],2)}),[],!1,null,null,null,null).exports;const go=R({inheritAttrs:!1,props:{image:[Object,Boolean],layout:{type:String,default:"list"},width:String},computed:{back(){return this.image.back||"black"},ratio(){return"cards"===this.layout&&this.image.ratio||"1/1"},size(){switch(this.layout){case"cards":return"large";case"cardlets":return"medium";default:return"regular"}},sizes(){switch(this.width){case"1/2":case"2/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 44em, 27em";case"1/3":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 29.333em, 27em";case"1/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 22em, 27em";case"2/3":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 27em, 27em";case"3/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 66em, 27em";default:return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 88em, 27em"}}}},(function(){var t=this,e=t._self._c;return t.image?e("div",{staticClass:"k-item-figure",style:{background:t.$helper.color(t.back)}},[t.image.src?e("k-image",{staticClass:"k-item-image",attrs:{cover:t.image.cover,ratio:t.ratio,sizes:t.sizes,src:t.image.src,srcset:t.image.srcset}}):e("k-aspect-ratio",{attrs:{ratio:t.ratio}},[e("k-icon",{staticClass:"k-item-icon",attrs:{color:t.$helper.color(t.image.color),type:t.image.icon}})],1)],1):t._e()}),[],!1,null,null,null,null).exports;const ko=R({inheritAttrs:!1,props:{columns:{type:[Object,Array],default:()=>[]},items:{type:Array,default:()=>[]},layout:{type:String,default:"list"},link:{type:Boolean,default:!0},image:{type:[Object,Boolean],default:()=>({})},sortable:Boolean,empty:{type:[String,Object]},size:{type:String,default:"default"}},computed:{dragOptions(){return{sort:this.sortable,disabled:!1===this.sortable,draggable:".k-draggable-item"}},table(){return{columns:this.columns,rows:this.items,sortable:this.sortable}}},methods:{onDragStart(t,e){this.$panel.drag.start("text",e)},onOption(t,e,n){this.$emit("option",t,e,n)},imageOptions(t){let e=this.image,n=t.image;return!1!==e&&!1!==n&&("object"!=typeof e&&(e={}),"object"!=typeof n&&(n={}),{...n,...e})}}},(function(){var t=this,e=t._self._c;return"table"===t.layout?e("k-table",t._b({on:{change:function(e){return t.$emit("change",e)},sort:function(e){return t.$emit("sort",e)},option:t.onOption}},"k-table",t.table,!1)):e("k-draggable",{staticClass:"k-items",class:"k-"+t.layout+"-items",attrs:{handle:!0,options:t.dragOptions,"data-layout":t.layout,"data-size":t.size,list:t.items},on:{change:function(e){return t.$emit("change",e)},end:function(e){return t.$emit("sort",t.items,e)}}},[t._l(t.items,(function(n,s){return[t._t("default",(function(){return[e("k-item",t._b({key:n.id||s,class:{"k-draggable-item":t.sortable&&n.sortable},attrs:{image:t.imageOptions(n),layout:t.layout,link:!!t.link&&n.link,sortable:t.sortable&&n.sortable,width:n.column},on:{click:function(e){return t.$emit("item",n,s)},drag:function(e){return t.onDragStart(e,n.dragText)},option:function(e){return t.onOption(e,n,s)}},nativeOn:{mouseover:function(e){return t.$emit("hover",e,n,s)}},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options",null,null,{item:n,itemIndex:s})]},proxy:!0}],null,!0)},"k-item",n,!1))]}),null,{item:n,itemIndex:s})]}))],2)}),[],!1,null,null,null,null).exports;const bo=R({mixins:[{props:{autofocus:{default:!0,type:Boolean},centered:{default:!1,type:Boolean},dimmed:{default:!0,type:Boolean},loading:{default:!1,type:Boolean},type:{default:"overlay",type:String},visible:{default:!1,type:Boolean}}}],inheritAttrs:!0,data:()=>({isOpen:!1,scrollTop:0}),watch:{visible:{handler(t){!0===t?this.open():this.close()},immediate:!0}},mounted(){this.visible&&this.open()},methods:{cancel(){this.$emit("cancel"),this.close()},click(t){t.target===this.$refs.overlay&&this.cancel()},close(){!1!==this.isOpen&&(this.isOpen=!1,this.$emit("close"),this.restoreScrollPosition(),this.$events.$off("keydown.esc",this.cancel))},focus(){this.$helper.focus(this.$refs.overlay)},hide(){this.close()},open(){!0!==this.isOpen&&(this.storeScrollPosition(),this.isOpen=!0,this.$emit("open"),this.$events.$on("keydown.esc",this.cancel),setTimeout((()=>{!0===this.autofocus&&this.focus(),this.$emit("ready")})))},restoreScrollPosition(){const t=document.querySelector(".k-panel-view");(null==t?void 0:t.scrollTop)&&(t.scrollTop=this.scrollTop)},show(){this.open()},storeScrollPosition(){const t=document.querySelector(".k-panel-view");(null==t?void 0:t.scrollTop)?this.scrollTop=t.scrollTop:this.scrollTop=0}}},(function(){var t=this,e=t._self._c;return t.isOpen?e("portal",{attrs:{to:t.type}},[e("div",{ref:"overlay",staticClass:"k-overlay",class:"k-"+t.type+"-overlay",attrs:{"data-centered":t.loading||t.centered,"data-dimmed":t.dimmed,"data-loading":t.loading,dir:t.$panel.direction},on:{click:t.click}},[t.loading?e("k-loader",{staticClass:"k-overlay-loader"}):t._t("default",null,{close:t.close,isOpen:t.isOpen})],2)]):t._e()}),[],!1,null,null,null,null).exports;const vo=R({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-panel",attrs:{"data-dragging":t.$panel.drag.isDragging,"data-loading":t.$panel.isLoading,"data-language":t.$panel.language.code,"data-language-default":t.$panel.language.isDefault,"data-role":t.$panel.user.role,"data-translation":t.$panel.translation.code,"data-user":t.$panel.user.id,dir:t.$panel.direction}},[t._t("default"),t.$panel.dialog.isOpen&&!t.$panel.dialog.legacy?e("k-fiber-dialog"):t._e(),t.$panel.drawer.isOpen&&!t.$panel.drawer.legacy?e("k-fiber-drawer"):t._e(),t.$panel.notification.isFatal&&t.$panel.notification.isOpen?e("k-fatal",{attrs:{html:t.$panel.notification.message}}):t._e(),!1===t.$panel.system.isLocal?e("k-offline-warning"):t._e(),e("k-icons"),e("portal-target",{staticClass:"k-drawer-portal k-portal",attrs:{name:"drawer",multiple:""}}),e("portal-target",{staticClass:"k-dialog-portal k-portal",attrs:{name:"dialog",multiple:""}}),e("portal-target",{staticClass:"k-overlay-portal k-portal",attrs:{name:"overlay",multiple:""}})],2)}),[],!1,null,null,null,null).exports;const yo=R({props:{reports:Array,size:{type:String,default:"large"}},methods:{component(t){return null!==this.target(t)?"k-link":"div"},target(t){return t.link?t.link:t.click?t.click:t.dialog?()=>this.$dialog(t.dialog):null}}},(function(){var t=this,e=t._self._c;return e("dl",{staticClass:"k-stats",attrs:{"data-size":t.size}},t._l(t.reports,(function(n,s){return e(t.component(n),{key:s,tag:"component",staticClass:"k-stat",attrs:{"data-theme":n.theme,to:t.target(n)}},[e("dt",{staticClass:"k-stat-label"},[t._v(t._s(n.label))]),e("dd",{staticClass:"k-stat-value"},[t._v(t._s(n.value))]),e("dd",{staticClass:"k-stat-info"},[t._v(t._s(n.info))])])})),1)}),[],!1,null,null,null,null).exports;const $o=R({inheritAttrs:!1,props:{columns:Object,disabled:Boolean,fields:{type:Object,default:()=>({})},empty:String,index:{type:[Number,Boolean],default:1},rows:Array,options:[Array,Function],pagination:[Object,Boolean],sortable:Boolean},data(){return{values:this.rows}},computed:{colspan(){let t=this.columnsCount;return this.hasIndexColumn&&t++,this.hasOptions&&t++,t},columnsCount(){return this.$helper.object.length(this.columns)},dragOptions(){return{disabled:!this.sortable,fallbackClass:"k-table-row-fallback",ghostClass:"k-table-row-ghost"}},hasIndexColumn(){return this.sortable||!1!==this.index},hasOptions(){var t;return(null==(t=this.options)?void 0:t.length)>0||Object.values(this.values).filter((t=>t.options)).length>0}},watch:{rows(){this.values=this.rows}},methods:{isColumnEmpty(t){return 0===this.rows.filter((e=>!1===this.$helper.object.isEmpty(e[t]))).length},label(t,e){return t.label||this.$helper.string.ucfirst(e)},onChange(t){this.$emit("change",t)},onCell(t){this.$emit("cell",t)},onCellUpdate({columnIndex:t,rowIndex:e,value:n}){this.values[e][t]=n,this.$emit("input",this.values)},onHeader(t){this.$emit("header",t)},onOption(t,e,n){this.$emit("option",t,e,n)},onSort(){this.$emit("input",this.values),this.$emit("sort",this.values)},width(t){return"string"!=typeof t?"auto":!1===t.includes("/")?t:this.$helper.ratio(t,"auto",!1)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-table"},[e("table",{attrs:{"data-disabled":t.disabled,"data-indexed":t.hasIndexColumn}},[e("thead",[e("tr",[t.hasIndexColumn?e("th",{staticClass:"k-table-index-column",attrs:{"data-mobile":""}},[t._v(" # ")]):t._e(),t._l(t.columns,(function(n,s){return e("th",{key:s+"-header",staticClass:"k-table-column",style:"width:"+t.width(n.width),attrs:{"data-align":n.align,"data-mobile":n.mobile},on:{click:function(e){return t.onHeader({column:n,columnIndex:s})}}},[t._t("header",(function(){return[t._v(" "+t._s(t.label(n,s))+" ")]}),null,{column:n,columnIndex:s,label:t.label(n,s)})],2)})),t.hasOptions?e("th",{staticClass:"k-table-options-column",attrs:{"data-mobile":""}}):t._e()],2)]),e("k-draggable",{attrs:{list:t.values,options:t.dragOptions,handle:!0,element:"tbody"},on:{change:t.onChange,end:t.onSort}},[0===t.rows.length?e("tr",[e("td",{staticClass:"k-table-empty",attrs:{colspan:t.columnsCount}},[t._v(" "+t._s(t.empty)+" ")])]):t._l(t.values,(function(n,s){return e("tr",{key:s},[t.hasIndexColumn?e("td",{staticClass:"k-table-index-column",attrs:{"data-sortable":t.sortable&&!1!==n.sortable,"data-mobile":""}},[t._t("index",(function(){return[e("div",{staticClass:"k-table-index",domProps:{textContent:t._s(t.index+s)}})]}),null,{row:n,rowIndex:s}),t.sortable&&!1!==n.sortable?e("k-sort-handle",{staticClass:"k-table-sort-handle"}):t._e()],2):t._e(),t._l(t.columns,(function(i,o){return e("k-table-cell",{key:s+"-"+o,staticClass:"k-table-column",style:"width:"+t.width(i.width),attrs:{column:i,field:t.fields[o],row:n,mobile:i.mobile,value:n[o]},on:{input:function(e){return t.onCellUpdate({columnIndex:o,rowIndex:s,value:e})}},nativeOn:{click:function(e){return t.onCell({row:n,rowIndex:s,column:i,columnIndex:o})}}})})),t.hasOptions?e("td",{staticClass:"k-table-options-column",attrs:{"data-mobile":""}},[t._t("options",(function(){return[e("k-options-dropdown",{attrs:{options:n.options||t.options,text:(n.options||t.options).length>1},on:{option:function(e){return t.onOption(e,n,s)}}})]}),null,{row:n,rowIndex:s,options:t.options})],2):t._e()],2)}))],2)],1),t.pagination?e("k-pagination",t._b({staticClass:"k-table-pagination",on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.pagination,!1)):t._e()],1)}),[],!1,null,null,null,null).exports;const wo=R({inheritAttrs:!1,props:{column:Object,field:Object,mobile:{type:Boolean,default:!1},row:Object,value:{default:""}},computed:{component(){return this.$helper.isComponent(`k-${this.type}-field-preview`)?`k-${this.type}-field-preview`:this.$helper.isComponent(`k-table-${this.type}-cell`)?`k-table-${this.type}-cell`:Array.isArray(this.value)?"k-array-field-preview":"object"==typeof this.value?"k-object-field-preview":"k-text-field-preview"},type(){var t;return this.column.type||(null==(t=this.field)?void 0:t.type)}}},(function(){var t=this,e=t._self._c;return e("td",{attrs:{"data-align":t.column.align,"data-mobile":t.mobile}},[!1===t.$helper.object.isEmpty(t.value)?[e(t.component,{tag:"component",attrs:{column:t.column,field:t.field,row:t.row,value:t.value},on:{input:function(e){return t.$emit("input",e)}}})]:t._e()],2)}),[],!1,null,null,null,null).exports;const _o=R({props:{value:[String,Object]}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-table-update-status-cell"},["string"==typeof t.value?e("span",{staticClass:"k-table-update-status-cell-version"},[t._v(" "+t._s(t.value)+" ")]):e("k-dropdown",{attrs:{"data-theme":t.value.theme}},[e("k-button",{staticClass:"k-table-update-status-cell-button",attrs:{icon:t.value.icon,href:t.value.url},on:{click:function(e){return t.$refs.dropdown.toggle()}}},[t._v(" "+t._s(t.value.currentVersion)+" ")]),e("k-dropdown-content",{ref:"dropdown",attrs:{align:"right"}},[e("dl",{staticClass:"k-plugin-info"},[e("div",[e("dt",[t._v(t._s(t.$t("plugin")))]),e("dd",[t._v(t._s(t.value.pluginName))])]),e("div",[e("dt",[t._v(t._s(t.$t("version.current")))]),e("dd",[t._v(t._s(t.value.currentVersion))])]),e("div",[e("dt",[t._v(t._s(t.$t("version.latest")))]),e("dd",[t._v(t._s(t.value.latestVersion))])]),e("div",[e("dt",[t._v(t._s(t.$t("system.updateStatus")))]),e("dd",{attrs:{"data-theme":t.value.theme}},[t._v(t._s(t.value.label))])])]),t.value.url?e("k-dropdown-item",{attrs:{icon:"open",link:t.value.url}},[t._v(" "+t._s(t.$t("versionInformation"))+" ")]):t._e()],1)],1)],1)}),[],!1,null,null,null,null).exports;const xo=R({props:{tab:String,tabs:Array,theme:String},data(){return{size:null,visibleTabs:this.tabs,invisibleTabs:[]}},computed:{current(){return(this.tabs.find((t=>t.name===this.tab))||this.tabs[0]||{}).name}},watch:{tabs:{handler(t){this.visibleTabs=t,this.invisibleTabs=[],this.resize(!0)},immediate:!0}},created(){window.addEventListener("resize",this.resize)},destroyed(){window.removeEventListener("resize",this.resize)},methods:{resize(t){if(this.tabs&&!(this.tabs.length<=1)){if(this.tabs.length<=3)return this.visibleTabs=this.tabs,void(this.invisibleTabs=[]);if(window.innerWidth>=700){if("large"===this.size&&!t)return;this.visibleTabs=this.tabs,this.invisibleTabs=[],this.size="large"}else{if("small"===this.size&&!t)return;this.visibleTabs=this.tabs.slice(0,2),this.invisibleTabs=this.tabs.slice(2),this.size="small"}}}}},(function(){var t=this,e=t._self._c;return t.tabs&&t.tabs.length>1?e("div",{staticClass:"k-tabs",attrs:{"data-theme":t.theme}},[e("nav",[t._l(t.visibleTabs,(function(n){return e("k-button",{key:n.name,staticClass:"k-tab-button",attrs:{link:n.link,current:t.current===n.name,icon:n.icon,tooltip:n.label}},[t._v(" "+t._s(n.label||n.text||n.name)+" "),n.badge?e("span",{staticClass:"k-tabs-badge"},[t._v(" "+t._s(n.badge)+" ")]):t._e()])})),t.invisibleTabs.length?e("k-button",{staticClass:"k-tab-button k-tabs-dropdown-button",attrs:{text:t.$t("more"),icon:"dots"},on:{click:function(e){return e.stopPropagation(),t.$refs.more.toggle()}}}):t._e()],2),t.invisibleTabs.length?e("k-dropdown-content",{ref:"more",staticClass:"k-tabs-dropdown",attrs:{align:"right"}},t._l(t.invisibleTabs,(function(n){return e("k-dropdown-item",{key:"more-"+n.name,attrs:{link:n.link,current:t.tab===n.name,icon:n.icon,tooltip:n.label}},[t._v(" "+t._s(n.label||n.text||n.name)+" ")])})),1):t._e()],1):t._e()}),[],!1,null,null,null,null).exports;const Co=R({props:{align:String}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-view",attrs:{"data-align":t.align}},[t._t("default")],2)}),[],!1,null,null,null,null).exports,So={install(t){t.component("k-aspect-ratio",eo),t.component("k-bar",no),t.component("k-box",so),t.component("k-bubble",io),t.component("k-bubbles",oo),t.component("k-collection",lo),t.component("k-column",ro),t.component("k-dropzone",ao),t.component("k-empty",uo),t.component("k-file-preview",co),t.component("k-grid",po),t.component("k-header",ho),t.component("k-inside",mo),t.component("k-item",fo),t.component("k-item-image",go),t.component("k-items",ko),t.component("k-overlay",bo),t.component("k-panel",vo),t.component("k-stats",yo),t.component("k-table",$o),t.component("k-table-cell",wo),t.component("k-table-update-status-cell",_o),t.component("k-tabs",xo),t.component("k-view",Co)}};const Oo=R({components:{draggable:()=>N((()=>import("./vuedraggable.js")),[])},props:{data:Object,element:String,handle:[String,Boolean],list:[Array,Object],move:Function,options:Object},emits:["change","end","sort","start"],computed:{dragOptions(){let t=!1;return t=!0===this.handle?".k-sort-handle":this.handle,{fallbackClass:"k-sortable-fallback",fallbackOnBody:!0,forceFallback:!0,ghostClass:"k-sortable-ghost",handle:t,scroll:document.querySelector(".k-panel-view"),...this.options}}},methods:{onStart(t){this.$panel.drag.start("data",{}),this.$emit("start",t)},onEnd(t){this.$panel.drag.stop(),this.$emit("end",t)}}},(function(){var t=this;return(0,t._self._c)("draggable",t._b({staticClass:"k-draggable",attrs:{"component-data":t.data,tag:t.element,list:t.list,move:t.move},on:{change:function(e){return t.$emit("change",e)},end:t.onEnd,sort:function(e){return t.$emit("sort",e)},start:t.onStart},scopedSlots:t._u([{key:"footer",fn:function(){return[t._t("footer")]},proxy:!0}],null,!0)},"draggable",t.dragOptions,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Ao=R({data:()=>({error:null}),errorCaptured(t){return this.$panel.debug&&window.console.warn(t),this.error=t,!1},render(){return this.error?this.$slots.error?this.$slots.error[0]:this.$scopedSlots.error?this.$scopedSlots.error({error:this.error}):Vue.h("k-box",{attrs:{theme:"negative"}},this.error.message||this.error):this.$slots.default[0]}},null,null,!1,null,null,null,null).exports;const Io=R({props:{html:String},mounted(){try{let t=this.$refs.iframe.contentWindow.document;t.open(),t.write(this.html),t.close()}catch(t){console.error(t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-fatal"},[e("div",{staticClass:"k-fatal-box"},[e("k-bar",{scopedSlots:t._u([{key:"left",fn:function(){return[e("k-headline",[t._v(" The JSON response could not be parsed ")])]},proxy:!0},{key:"right",fn:function(){return[e("k-button",{attrs:{icon:"cancel",text:"Close"},on:{click:function(e){return t.$panel.notification.close()}}})]},proxy:!0}])}),e("iframe",{ref:"iframe",staticClass:"k-fatal-iframe"})],1)])}),[],!1,null,null,null,null).exports;const Mo=R({props:{alt:String,color:String,back:String,size:String,type:String},computed:{isEmoji(){return this.$helper.string.hasEmoji(this.type)}}},(function(){var t=this,e=t._self._c;return e("span",{class:"k-icon k-icon-"+t.type,style:{background:t.$helper.color(t.back)},attrs:{"aria-label":t.alt,role:t.alt?"img":null,"aria-hidden":!t.alt,"data-back":t.back,"data-size":t.size}},[t.isEmoji?e("span",{staticClass:"k-icon-emoji"},[t._v(t._s(t.type))]):e("svg",{style:{color:t.$helper.color(t.color)},attrs:{viewBox:"0 0 16 16"}},[e("use",{attrs:{"xlink:href":"#icon-"+t.type}})])])}),[],!1,null,null,null,null).exports;const To=R({icons:window.panel.plugins.icons},(function(){var t=this,e=t._self._c;return e("svg",{staticClass:"k-icons",attrs:{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",overflow:"hidden"}},[e("defs",t._l(t.$options.icons,(function(n,s){return e("symbol",{key:s,attrs:{id:"icon-"+s,viewBox:"0 0 16 16"},domProps:{innerHTML:t._s(n)}})})),0)])}),[],!1,null,null,null,null).exports;const jo=R({props:{alt:String,back:String,cover:Boolean,ratio:String,sizes:String,src:String,srcset:String},data:()=>({loaded:{type:Boolean,default:!1},error:{type:Boolean,default:!1}}),computed:{ratioPadding(){return this.$helper.ratio(this.ratio||"1/1")}},created(){let t=new Image;t.onload=()=>{this.loaded=!0,this.$emit("load")},t.onerror=()=>{this.error=!0,this.$emit("error")},t.src=this.src}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-image",attrs:{"data-ratio":t.ratio,"data-back":t.back,"data-cover":t.cover}},[e("span",{style:{"padding-bottom":t.ratioPadding}},[t.loaded?e("img",{key:t.src,attrs:{alt:t.alt||"",src:t.src,srcset:t.srcset,sizes:t.sizes},on:{dragstart:function(t){t.preventDefault()}}}):t._e(),t.loaded||t.error?t._e():e("k-loader",{attrs:{position:"center",theme:"light"}}),!t.loaded&&t.error?e("k-icon",{staticClass:"k-image-error",attrs:{type:"cancel"}}):t._e()],1)])}),[],!1,null,null,null,null).exports;const Eo=R({},(function(){var t=this._self._c;return t("span",{staticClass:"k-loader"},[t("k-icon",{staticClass:"k-loader-icon",attrs:{type:"loader"}})],1)}),[],!1,null,null,null,null).exports;const Lo=R({},(function(){var t=this,e=t._self._c;return t.$panel.notification.isOpen?e("div",{staticClass:"k-notification",attrs:{"data-theme":t.$panel.notification.type}},[e("p",[t._v(t._s(t.$panel.notification.message))]),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return t.$panel.notification.close()}}})],1):t._e()}),[],!1,null,null,null,null).exports;const Do=R({data:()=>({offline:!1}),created(){this.$events.$on("offline",this.isOffline),this.$events.$on("online",this.isOnline)},destroyed(){this.$events.$off("offline",this.isOffline),this.$events.$off("online",this.isOnline)},methods:{isOnline(){this.offline=!1},isOffline(){this.offline=!0}}},(function(){var t=this,e=t._self._c;return t.offline?e("div",{staticClass:"k-offline-warning"},[e("p",[e("k-icon",{attrs:{type:"bolt"}}),t._v(" "+t._s(t.$t("error.offline")))],1)]):t._e()}),[],!1,null,null,null,null).exports,Bo=(t,e=!1)=>{if(t>=0&&t<=100)return!0;if(e)throw new Error("value has to be between 0 and 100");return!1};const Po=R({props:{value:{type:Number,default:0,validator:Bo}},data(){return{state:this.value}},watch:{value(t){this.state=t}},methods:{set(t){Bo(t,!0),this.state=t}}},(function(){var t=this;return(0,t._self._c)("progress",{staticClass:"k-progress",attrs:{max:"100"},domProps:{value:t.state}},[t._v(t._s(t.state)+"%")])}),[],!1,null,null,null,null).exports;const Fo=R({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-registration"},[e("p",[t._v(t._s(t.$t("license.unregistered")))]),e("k-button",{staticClass:"k-topbar-button",attrs:{responsive:!0,tooltip:t.$t("license.unregistered"),icon:"key"},on:{click:function(e){return t.$dialog("registration")}}},[t._v(" "+t._s(t.$t("license.register"))+" ")]),e("k-button",{staticClass:"k-topbar-button",attrs:{responsive:!0,link:"https://getkirby.com/buy",target:"_blank",icon:"cart"}},[t._v(" "+t._s(t.$t("license.buy"))+" ")])],1)}),[],!1,null,null,null,null).exports;const No=R({props:{icon:{type:String,default:"sort"}}},(function(){return(0,this._self._c)("k-icon",{staticClass:"k-sort-handle",attrs:{type:this.icon,"aria-hidden":"true"}})}),[],!1,null,null,null,null).exports;const qo=R({props:{click:{type:Function,default:()=>{}},disabled:Boolean,responsive:Boolean,status:String,text:String,tooltip:String},computed:{icon(){return"draft"===this.status?"circle-outline":"unlisted"===this.status?"circle-half":"circle"},theme(){return"draft"===this.status?"negative":"unlisted"===this.status?"info":"positive"},title(){let t=this.tooltip||this.text;return this.disabled&&(t+=` (${this.$t("disabled")})`),t}},methods:{onClick(){this.click(),this.$emit("click")}}},(function(){var t=this;return(0,t._self._c)("k-button",{class:"k-status-icon k-status-icon-"+t.status,attrs:{disabled:t.disabled,icon:t.icon,responsive:t.responsive,text:t.text,theme:t.theme,tooltip:t.title},on:{click:t.onClick}})}),[],!1,null,null,null,null).exports;const Ro=R({props:{user:[Object,String]}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-user-info"},[t.user.avatar?e("k-image",{attrs:{cover:!0,src:t.user.avatar.url,ratio:"1/1"}}):e("k-icon",{attrs:{type:"user"}}),t._v(" "+t._s(t.user.name||t.user.email||t.user)+" ")],1)}),[],!1,null,null,null,null).exports,zo={install(t){t.component("k-draggable",Oo),t.component("k-error-boundary",Ao),t.component("k-fatal",Io),t.component("k-icon",Mo),t.component("k-icons",To),t.component("k-image",jo),t.component("k-loader",Eo),t.component("k-notification",Lo),t.component("k-offline-warning",Do),t.component("k-progress",Po),t.component("k-registration",Fo),t.component("k-status-icon",qo),t.component("k-sort-handle",No),t.component("k-user-info",Ro)}};const Yo=R({props:{crumbs:{type:Array,default:()=>[]},label:{type:String,default:"Breadcrumb"},view:Object},computed:{dropdown(){return this.segments.map((t=>({...t,text:t.label,icon:"angle-right"})))},segments(){return[{link:this.view.link,label:this.view.breadcrumbLabel,icon:this.view.icon,loading:this.$panel.isLoading},...this.crumbs]}},methods:{isLast(t){return this.crumbs.length-1===t}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-breadcrumb",attrs:{"aria-label":t.label}},[e("k-dropdown",{staticClass:"k-breadcrumb-dropdown"},[e("k-button",{attrs:{icon:"road-sign"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.dropdown,theme:"light"}})],1),e("ol",t._l(t.segments,(function(n,s){return e("li",{key:s},[e("k-link",{staticClass:"k-breadcrumb-link",attrs:{title:n.text||n.label,to:n.link,"aria-current":!!t.isLast(s)&&"page"}},[n.loading?e("k-loader",{staticClass:"k-breadcrumb-icon"}):n.icon?e("k-icon",{staticClass:"k-breadcrumb-icon",attrs:{type:n.icon}}):t._e(),e("span",{staticClass:"k-breadcrumb-link-text"},[t._v(" "+t._s(n.text||n.label)+" ")])],1)],1)})),0)],1)}),[],!1,null,null,null,null).exports;const Ho=R({props:{items:{type:Array},name:{default:"items",type:String},selected:{type:String},type:{default:"radio",type:String}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-browser"},[e("div",{staticClass:"k-browser-items"},t._l(t.items,(function(n){return e("label",{key:n.value,staticClass:"k-browser-item"},[e("input",{attrs:{name:t.name,type:t.type},domProps:{checked:t.selected===n.value},on:{change:function(e){return t.$emit("select",n)}}}),n.image?e("k-item-image",{staticClass:"k-browser-item-image",attrs:{image:{...n.image,cover:!0,back:"black"}}}):t._e(),e("span",{staticClass:"k-browser-item-info"},[t._v(" "+t._s(n.label)+" ")])],1)})),0)])}),[],!1,null,null,null,null).exports;const Uo=R({inheritAttrs:!1,props:{autofocus:Boolean,click:Function,current:[String,Boolean],disabled:Boolean,icon:String,id:[String,Number],link:String,responsive:Boolean,rel:String,role:String,target:String,tabindex:String,text:[String,Number],theme:String,tooltip:String,type:{type:String,default:"button"}},emits:["click"],computed:{component(){return!0===this.disabled?"k-button-disabled":this.link?"k-button-link":"k-button-native"}},methods:{focus(){this.$refs.button.focus&&this.$refs.button.focus()},tab(){this.$refs.button.tab&&this.$refs.button.tab()},untab(){this.$refs.button.untab&&this.$refs.button.untab()}}},(function(){var t=this;return(0,t._self._c)(t.component,t._b({ref:"button",tag:"component",nativeOn:{click:function(e){return t.$emit("click",e)}}},"component",t.$props,!1),[t.text?[t._v(" "+t._s(t.text)+" ")]:t._t("default")],2)}),[],!1,null,null,null,null).exports;const Vo=R({inheritAttrs:!1,props:{icon:String,id:[String,Number],responsive:Boolean,theme:String,tooltip:String}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-button",attrs:{id:t.id,"data-disabled":!0,"data-responsive":t.responsive,"data-theme":t.theme,title:t.tooltip}},[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports;const Ko=R({props:{buttons:Array}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-button-group"},[t.$slots.default?t._t("default"):t._l(t.buttons,(function(n,s){return e("k-button",t._b({key:s},"k-button",n,!1))}))],2)}),[],!1,null,null,null,null).exports;const Wo=R({inheritAttrs:!1,props:{autofocus:Boolean,current:[String,Boolean],icon:String,id:[String,Number],link:String,rel:String,responsive:Boolean,role:String,target:String,tabindex:String,theme:String,tooltip:String},methods:{focus(){this.$el.focus()}}},(function(){var t=this,e=t._self._c;return e("k-link",{staticClass:"k-button",attrs:{id:t.id,"aria-current":t.current,autofocus:t.autofocus,"data-theme":t.theme,"data-responsive":t.responsive,rel:t.rel,role:t.role,tabindex:t.tabindex,target:t.target,title:t.tooltip,to:t.link}},[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports,Jo={mounted(){this.$el.addEventListener("keyup",this.onTab,!0),this.$el.addEventListener("blur",this.onUntab,!0)},destroyed(){this.$el.removeEventListener("keyup",this.onTab,!0),this.$el.removeEventListener("blur",this.onUntab,!0)},methods:{focus(){this.$el.focus&&this.$el.focus()},onTab(t){9===t.keyCode&&this.$el.setAttribute("data-tabbed",!0)},onUntab(){this.$el.removeAttribute("data-tabbed")},tab(){this.$el.focus(),this.$el.setAttribute("data-tabbed",!0)},untab(){this.$el.removeAttribute("data-tabbed")}}};const Go=R({mixins:[Jo],inheritAttrs:!1,props:{autofocus:Boolean,click:{type:Function,default:()=>{}},current:[String,Boolean],icon:String,id:[String,Number],responsive:Boolean,role:String,tabindex:String,theme:String,tooltip:String,type:{type:String,default:"button"}}},(function(){var t=this,e=t._self._c;return e("button",{staticClass:"k-button",attrs:{id:t.id,"aria-current":t.current,autofocus:t.autofocus,"data-theme":t.theme,"data-responsive":t.responsive,role:t.role,tabindex:t.tabindex,title:t.tooltip,type:t.type},on:{click:t.click}},[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports;const Zo=R({},(function(){return(0,this._self._c)("span",{staticClass:"k-dropdown",on:{click:function(t){t.stopPropagation()}}},[this._t("default")],2)}),[],!1,null,null,null,null).exports;let Qo=null;const Xo=R({props:{align:{type:String,default:"left"},options:[Array,Function,String],theme:{type:String,default:"dark"}},emits:["action","close","leave","open"],data:()=>({current:-1,dropup:!1,isOpen:!1,items:[]}),methods:{async fetchOptions(t){if(!this.options)return t(this.items);"string"==typeof this.options?this.$dropdown(this.options)(t):"function"==typeof this.options?this.options(t):Array.isArray(this.options)&&t(this.options)},onOptionClick(t){"function"==typeof t.click?t.click.call(this):t.click&&this.$emit("action",t.click)},open(){this.reset(),Qo&&Qo!==this&&Qo.close(),this.fetchOptions((t=>{this.$events.$on("keydown",this.navigate),this.$events.$on("click",this.close),this.items=t,this.isOpen=!0,Qo=this,this.onOpen(),this.$emit("open")}))},reset(){this.current=-1,this.$events.$off("keydown",this.navigate),this.$events.$off("click",this.close)},close(){this.reset(),this.isOpen=Qo=!1,this.$emit("close")},toggle(){this.isOpen?this.close():this.open()},focus(t=0){var e;(null==(e=this.$children[t])?void 0:e.focus)&&(this.current=t,this.$children[t].focus())},onOpen(){this.dropup=!1,this.$nextTick((()=>{if(this.$el){let t=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,e=50,n=this.$el.getBoundingClientRect().top||0,s=this.$el.clientHeight;n+s>t-e&&s+2*ethis.$children.length-1){const t=this.$children.filter((t=>!1===t.disabled));this.current=this.$children.indexOf(t[t.length-1]);break}if(!1===(null==(n=this.$children[this.current])?void 0:n.disabled)){this.focus(this.current);break}}break;case"Tab":for(;;){if(this.current++,this.current>this.$children.length-1){this.close(),this.$emit("leave",t.code);break}if(!1===(null==(s=this.$children[this.current])?void 0:s.disabled))break}}}}},(function(){var t=this,e=t._self._c;return t.isOpen?e("div",{staticClass:"k-dropdown-content",attrs:{"data-align":t.align,"data-dropup":t.dropup,"data-theme":t.theme}},[t._t("default",(function(){return[t._l(t.items,(function(n,s){return["-"===n?e("hr",{key:t._uid+"-item-"+s}):e("k-dropdown-item",t._b({key:t._uid+"-item-"+s,ref:t._uid+"-item-"+s,refInFor:!0,on:{click:function(e){return t.onOptionClick(n)}}},"k-dropdown-item",n,!1),[t._v(" "+t._s(n.text)+" ")])]}))]}))],2):t._e()}),[],!1,null,null,null,null).exports;const tl=R({inheritAttrs:!1,props:{disabled:Boolean,icon:String,image:[String,Object],link:String,target:String,theme:String,upload:String,current:[String,Boolean]},emit:["click"],methods:{focus(){this.$refs.button.focus()},onClick(t){this.$parent.close(),this.$emit("click",t)},tab(){this.$refs.button.tab()}}},(function(){var t=this;return(0,t._self._c)("k-button",t._b({ref:"button",staticClass:"k-dropdown-item",on:{click:t.onClick}},"k-button",t.$props,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const el=R({props:{selected:{type:String}},data:()=>({files:[],page:null,view:"tree"}),methods:{selectFile(t){this.$emit("select",t)},async selectPage(t){this.page=t;const e="site://"===t.id?"/site/files":"/pages/"+this.$api.pages.id(t.id)+"/files",{data:n}=await this.$api.get(e,{select:"filename,panelImage,uuid"});this.files=n.map((t=>({label:t.filename,image:t.panelImage,id:t.uuid,value:t.uuid}))),this.view="files"},togglePage(){this.$nextTick((()=>{this.$refs.tree.scrollIntoView({behaviour:"smooth",block:"nearest",inline:"nearest"})}))}}},(function(){var t,e,n=this,s=n._self._c;return s("div",{staticClass:"k-file-browser",attrs:{"data-view":n.view}},[s("div",{staticClass:"k-file-browser-layout"},[s("aside",{ref:"tree",staticClass:"k-file-browser-tree"},[s("k-page-tree",{attrs:{current:null==(t=n.page)?void 0:t.id},on:{select:n.selectPage,toggleBranch:n.togglePage}})],1),s("div",{ref:"items",staticClass:"k-file-browser-items"},[s("k-button",{staticClass:"k-file-browser-back-button",attrs:{icon:"angle-left",text:null==(e=n.page)?void 0:e.label},on:{click:function(t){n.view="tree"}}}),n.files.length?s("k-browser",{attrs:{items:n.files,selected:n.selected},on:{select:n.selectFile}}):n._e()],1)])])}),[],!1,null,null,null,null).exports;const nl=R({mixins:[Jo],props:{disabled:Boolean,rel:String,tabindex:[String,Number],target:String,title:String,to:[String,Function]},emits:["click"],computed:{href(){return"function"==typeof this.to?"":"/"!==this.to[0]||this.target?!0===this.to.includes("@")&&!1===this.to.includes("/")&&!1===this.to.startsWith("mailto:")?"mailto:"+this.to:this.to:this.$url(this.to)},relAttr(){return"_blank"===this.target?"noreferrer noopener":this.rel}},methods:{isRoutable(t){if(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)return!1;if(t.defaultPrevented)return!1;if(void 0!==t.button&&0!==t.button)return!1;if(this.target)return!1;if("string"==typeof this.href){if(this.href.includes("://")||this.href.startsWith("//"))return!1;if(this.href.includes("mailto:"))return!1}return!0},onClick(t){if(!0===this.disabled)return t.preventDefault(),!1;"function"==typeof this.to&&(t.preventDefault(),this.to()),this.isRoutable(t)&&(t.preventDefault(),this.$go(this.to)),this.$emit("click",t)}}},(function(){var t=this,e=t._self._c;return t.to&&!t.disabled?e("a",{ref:"link",staticClass:"k-link",attrs:{href:t.href,rel:t.relAttr,tabindex:t.tabindex,target:t.target,title:t.title},on:{click:t.onClick}},[t._t("default")],2):e("span",{staticClass:"k-link",attrs:{title:t.title,"data-disabled":""}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const sl=R({computed:{defaultLanguage(){return this.$panel.languages.find((t=>!0===t.default))},language(){return this.$panel.language},languages(){return this.$panel.languages.filter((t=>!1===t.default))}},methods:{change(t){this.$reload({query:{language:t.code}})}}},(function(){var t=this,e=t._self._c;return t.languages.length?e("k-dropdown",{staticClass:"k-languages-dropdown"},[e("k-button",{attrs:{text:t.language.name,responsive:!0,icon:"globe"},on:{click:function(e){return t.$refs.languages.toggle()}}}),t.languages?e("k-dropdown-content",{ref:"languages"},[e("k-dropdown-item",{on:{click:function(e){return t.change(t.defaultLanguage)}}},[t._v(" "+t._s(t.defaultLanguage.name)+" ")]),e("hr"),t._l(t.languages,(function(n){return e("k-dropdown-item",{key:n.code,on:{click:function(e){return t.change(n)}}},[t._v(" "+t._s(n.name)+" ")])}))],2):t._e()],1):t._e()}),[],!1,null,null,null,null).exports;const il=R({props:{align:{type:String,default:"right"},icon:{type:String,default:"dots"},options:{type:[Array,Function,String],default:()=>[]},text:{type:[Boolean,String],default:!0},theme:{type:String,default:"dark"}},computed:{hasSingleOption(){return Array.isArray(this.options)&&1===this.options.length}},methods:{onAction(t,e,n){"function"==typeof t?t.call(this):(this.$emit("action",t,e,n),this.$emit("option",t,e,n))},toggle(){this.$refs.options.toggle()}}},(function(){var t=this,e=t._self._c;return t.hasSingleOption?e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{icon:t.options[0].icon||t.icon,tooltip:t.options[0].tooltip||t.options[0].text},on:{click:function(e){return t.onAction(t.options[0].option||t.options[0].click,t.options[0],0)}}},[!0===t.text?[t._v(" "+t._s(t.options[0].text)+" ")]:!1!==t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2):t.options.length?e("k-dropdown",{staticClass:"k-options-dropdown"},[e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{icon:t.icon,tooltip:t.$t("options")},on:{click:function(e){return t.$refs.options.toggle()}}},[t.text&&!0!==t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2),e("k-dropdown-content",{ref:"options",staticClass:"k-options-dropdown-content",attrs:{align:t.align,options:t.options},on:{action:t.onAction}})],1):t._e()}),[],!1,null,null,null,null).exports;const ol=R({name:"k-tree",inheritAttrs:!1,props:{element:{type:String,default:"k-tree"},current:{type:String},items:{type:[Array,Object]},level:{default:0,type:Number}},data(){return{state:this.items}},methods:{select(t){this.$emit("select",t)},toggle(t){this.$emit("toggle",t)}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-tree",class:t.$options.name,style:{"--tree-level":t.level}},t._l(t.state,(function(n,s){return e("li",{key:s,attrs:{"aria-expanded":n.open,"aria-current":n.id===t.current}},[e("p",{staticClass:"k-tree-branch"},[e("button",{staticClass:"k-tree-toggle",attrs:{disabled:!n.hasChildren,type:"button"},on:{click:function(e){return t.toggle(n)}}},[e("k-icon",{attrs:{type:n.open?"angle-down":"angle-right"}})],1),e("button",{staticClass:"k-tree-folder",attrs:{type:"button"},on:{click:function(e){return t.select(n)},dblclick:function(e){return t.toggle(n)}}},[e("k-icon",{attrs:{type:n.icon??"folder"}}),e("span",[t._v(t._s(n.label))])],1)]),n.hasChildren&&n.open?[e(t.$options.name,t._b({tag:"component",attrs:{items:n.children,level:t.level+1},on:{select:t.select,toggle:t.toggle}},"component",t.$props,!1))]:t._e()],2)})),0)}),[],!1,null,null,null,null).exports;const ll=R({name:"k-page-tree",extends:ol,inheritAttrs:!1,props:{root:{default:!0,type:Boolean},current:{default:"/site",type:String},identifier:{default:"uuid",type:String,validator:t=>["id","uuid"].includes(t)},items:{type:String}},data:()=>({state:[]}),async created(){this.items?this.state=await this.load(this.items):!1===this.root?this.state=await this.load("/site"):this.state=[{icon:"home",id:"site://",label:this.$t("view.site"),hasChildren:!0,children:"/site",open:!0}]},methods:{async load(t){const{data:e}=await this.$api.get(t+"/children",{select:"hasChildren,id,panelImage,title,uuid",status:"all"}),n={};return e.forEach((t=>{const e=t[this.identifier];n[e]={id:e,icon:t.panelImage.icon,label:t.title,hasChildren:t.hasChildren,children:"/pages/"+this.$api.pages.id(t.id),open:!1}})),n},toggle(t){t.open=!t.open,this.$emit("toggleBranch",t)}}},null,null,!1,null,null,null,null).exports;const rl=R({props:{align:{type:String,default:"left"},details:Boolean,dropdown:Boolean,keys:Boolean,limit:{type:Number,default:10},page:{type:Number,default:1},pageLabel:String,total:{type:Number,default:0},prevLabel:String,nextLabel:String,validate:{type:Function,default:()=>Promise.resolve()}},data(){return{current:this.page}},computed:{detailsText(){return 1===this.limit?this.start+" / ":this.start+"-"+this.end+" / "},end(){return Math.min(this.start-1+this.limit,this.total)},hasPages(){return this.total>this.limit},isVisible(){return this.pages>1},nextBtn(){return{disabled:this.end>=this.total,tooltip:this.nextLabel??this.$t("next"),icon:"angle-right",click:this.next}},offset(){return this.start-1},pages(){return Math.ceil(this.total/this.limit)},prevBtn(){return{disabled:this.start<=1,tooltip:this.prevLabel??this.$t("prev"),icon:"angle-left",click:this.prev}},start(){return(this.current-1)*this.limit+1}},watch:{page(t){this.current=parseInt(t)}},created(){!0===this.keys&&window.addEventListener("keydown",this.onKey,!1)},destroyed(){window.removeEventListener("keydown",this.onKey,!1)},methods:{async goTo(t){var e;try{await this.validate(t),null==(e=this.$refs.dropdown)||e.close();const n=((t=Math.max(1,Math.min(t,this.pages)))-1)*this.limit+1;this.$emit("paginate",{page:t,start:n,end:Math.min(n-1+this.limit,this.total),limit:this.limit,offset:n-1,total:this.total})}catch(n){}},prev(){this.goTo(this.current-1)},next(){this.goTo(this.current+1)},onKey(t){switch(t.code){case"ArrowLeft":return this.prev();case"ArrowRight":return this.next()}}}},(function(){var t=this,e=t._self._c;return t.isVisible?e("nav",{staticClass:"k-pagination",attrs:{"data-align":t.align}},[e("k-button",t._b({},"k-button",t.prevBtn,!1)),t.details?e("k-dropdown",[e("k-button",{staticClass:"k-pagination-details",attrs:{disabled:!t.hasPages},on:{click:function(e){var n;null==(n=t.$refs.dropdown)||n.toggle()}}},[t.total>1?[t._v(" "+t._s(t.detailsText)+" ")]:t._e(),t._v(" "+t._s(t.total)+" ")],2),t.dropdown?e("k-dropdown-content",{ref:"dropdown",staticClass:"k-pagination-selector",on:{open:function(e){t.$nextTick((()=>t.$refs.page.focus()))}}},[e("div",{staticClass:"k-pagination-settings"},[e("label",{attrs:{for:"k-pagination-page"}},[e("span",[t._v(t._s(t.pageLabel??t.$t("pagination.page"))+":")]),e("select",{ref:"page",attrs:{id:"k-pagination-page"}},t._l(t.pages,(function(n){return e("option",{key:n,domProps:{selected:t.page===n,value:n}},[t._v(" "+t._s(n)+" ")])})),0)]),e("k-button",{attrs:{icon:"check"},on:{click:function(e){return t.goTo(t.$refs.page.value)}}})],1)]):t._e()],1):t._e(),e("k-button",t._b({},"k-button",t.nextBtn,!1))],1):t._e()}),[],!1,null,null,null,null).exports;const al=R({props:{prev:{type:[Boolean,Object],default:!1},next:{type:[Boolean,Object],default:!1}},computed:{buttons(){return[{...this.button(this.prev),icon:"angle-left"},{...this.button(this.next),icon:"angle-right"}]}},methods:{button:t=>t||{disabled:!0,link:"#"}}},(function(){return(0,this._self._c)("k-button-group",{staticClass:"k-prev-next",attrs:{buttons:this.buttons}})}),[],!1,null,null,null,null).exports;const ul=R({props:{removable:Boolean},methods:{remove(){this.removable&&this.$emit("remove")},focus(){this.$refs.button.focus()}}},(function(){var t=this,e=t._self._c;return e("span",{ref:"button",staticClass:"k-tag",attrs:{tabindex:"0"},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:(e.preventDefault(),t.remove.apply(null,arguments))}}},[e("span",{staticClass:"k-tag-text"},[t._t("default")],2),t.removable?e("k-icon",{staticClass:"k-tag-toggle",attrs:{type:"cancel-small"},nativeOn:{click:function(e){return t.remove.apply(null,arguments)}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const cl=R({props:{breadcrumb:Array,license:Boolean,menu:Array,title:String,view:Object},computed:{notification(){return"view"===this.$panel.notification.context?this.$panel.notification:null}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-topbar"},[e("k-view",[e("div",{staticClass:"k-topbar-wrapper"},[e("k-dropdown",{staticClass:"k-topbar-menu"},[e("k-button",{staticClass:"k-topbar-button k-topbar-menu-button",attrs:{tooltip:t.$t("menu"),icon:"bars"},on:{click:function(e){return t.$refs.menu.toggle()}}},[e("k-icon",{attrs:{type:"angle-down"}})],1),e("k-dropdown-content",{ref:"menu",staticClass:"k-topbar-menu",attrs:{options:t.menu,theme:"light"}})],1),e("k-breadcrumb",{staticClass:"k-topbar-breadcrumb",attrs:{crumbs:t.breadcrumb,view:t.view}}),e("div",{staticClass:"k-topbar-signals"},[t.notification&&"error"!==t.notification.type?e("k-button",{staticClass:"k-topbar-notification k-topbar-button",attrs:{icon:t.notification.icon,text:t.notification.message,theme:t.notification.theme},on:{click:function(e){return t.notification.close()}}}):t.license?t._e():e("k-registration"),e("k-form-indicator"),e("k-button",{staticClass:"k-topbar-button",attrs:{tooltip:t.$t("search"),icon:"search"},on:{click:function(e){return t.$panel.search()}}})],1)],1)])],1)}),[],!1,null,null,null,null).exports,dl={install(t){t.component("k-breadcrumb",Yo),t.component("k-browser",Ho),t.component("k-button",Uo),t.component("k-button-disabled",Vo),t.component("k-button-group",Ko),t.component("k-button-link",Wo),t.component("k-button-native",Go),t.component("k-dropdown",Zo),t.component("k-dropdown-content",Xo),t.component("k-dropdown-item",tl),t.component("k-file-browser",el),t.component("k-languages-dropdown",sl),t.component("k-link",nl),t.component("k-options-dropdown",il),t.component("k-page-tree",ll),t.component("k-pagination",rl),t.component("k-prev-next",al),t.component("k-tag",ul),t.component("k-topbar",cl),t.component("k-tree",ol)}};const pl=R({props:{empty:String,blueprint:String,lock:[Boolean,Object],parent:String,tab:Object},computed:{content(){return this.$store.getters["content/values"]()}},methods:{exists(t){return this.$helper.isComponent(`k-${t}-section`)}}},(function(){var t=this,e=t._self._c;return 0===t.tab.columns.length?e("k-box",{attrs:{html:!0,text:t.empty,theme:"info"}}):e("k-grid",{staticClass:"k-sections",attrs:{gutter:"large"}},t._l(t.tab.columns,(function(n,s){return e("k-column",{key:t.parent+"-column-"+s,attrs:{width:n.width,sticky:n.sticky}},[t._l(n.sections,(function(i,o){return[t.$helper.field.isVisible(i,t.content)?[t.exists(i.type)?e("k-"+i.type+"-section",t._b({key:t.parent+"-column-"+s+"-section-"+o+"-"+t.blueprint,tag:"component",class:"k-section k-section-name-"+i.name,attrs:{column:n.width,lock:t.lock,name:i.name,parent:t.parent,timestamp:t.$panel.view.timestamp},on:{submit:function(e){return t.$emit("submit",e)}}},"component",i,!1)):[e("k-box",{key:t.parent+"-column-"+s+"-section-"+o,attrs:{text:t.$t("error.section.type.invalid",{type:i.type}),theme:"negative"}})]]:t._e()]}))],2)})),1)}),[],!1,null,null,null,null).exports,hl={props:{blueprint:String,lock:[Boolean,Object],help:String,name:String,parent:String,timestamp:Number},methods:{load(){return this.$api.get(this.parent+"/sections/"+this.name)}}};const ml=R({mixins:[hl],inheritAttrs:!1,data:()=>({fields:{},isLoading:!0,issue:null}),computed:{values(){return this.$store.getters["content/values"]()}},watch:{timestamp(){this.fetch()}},created(){this.onInput=at(this.onInput,50),this.fetch()},methods:{async fetch(){try{const t=await this.load();this.fields=t.fields;for(const e in this.fields)this.fields[e].section=this.name,this.fields[e].endpoints={field:this.parent+"/fields/"+e,section:this.parent+"/sections/"+this.name,model:this.parent}}catch(t){this.issue=t}finally{this.isLoading=!1}},onInput(t,e,n){this.$store.dispatch("content/update",[n,t[n]])},onSubmit(t){this.$store.dispatch("content/update",[null,t]),this.$events.$emit("keydown.cmd.s",t)}}},(function(){var t=this,e=t._self._c;return t.isLoading?t._e():e("section",{staticClass:"k-fields-section"},[t.issue?[e("k-headline",{staticClass:"k-fields-issue-headline"},[t._v(" Error ")]),e("k-box",{attrs:{text:t.issue.message,html:!1,theme:"negative"}})]:t._e(),e("k-form",{attrs:{fields:t.fields,validate:!0,value:t.values,disabled:t.lock&&"lock"===t.lock.state},on:{input:t.onInput,submit:t.onSubmit}})],2)}),[],!1,null,null,null,null).exports;const fl=R({inheritAttrs:!1,props:{blueprint:String,column:String,parent:String,name:String,timestamp:Number},data:()=>({data:[],error:null,isLoading:!1,isProcessing:!1,options:{columns:{},empty:null,headline:null,help:null,layout:"list",link:null,max:null,min:null,size:null,sortable:null},pagination:{page:null},searchterm:null,searching:!1}),computed:{addIcon:()=>"add",buttons(){let t=[];return this.canSearch&&t.push({icon:"filter",text:this.$t("search"),click:this.onSearchToggle,responsive:!0}),this.canAdd&&t.push({icon:this.addIcon,text:this.$t("add"),click:this.onAdd}),t},canAdd:()=>!0,canDrop:()=>!1,canSearch(){return this.options.search},collection(){return{columns:this.options.columns,empty:this.emptyPropsWithSearch,layout:this.options.layout,help:this.options.help,items:this.items,pagination:this.pagination,sortable:!this.isProcessing&&this.options.sortable,size:this.options.size}},emptyProps(){return{icon:"page",text:this.$t("pages.empty")}},emptyPropsWithSearch(){return{...this.emptyProps,text:this.searching?this.$t("search.results.none"):this.options.empty||this.emptyProps.text}},items(){return this.data},isInvalid(){var t;return!((null==(t=this.searchterm)?void 0:t.length)>0)&&(!!(this.options.min&&this.data.lengththis.options.max))},paginationId(){return"kirby$pagination$"+this.parent+"/"+this.name},type:()=>"models"},watch:{searchterm:at((function(){this.pagination.page=0,this.reload()}),200),timestamp(){this.reload()}},created(){this.load()},methods:{async load(t){this.isProcessing=!0,t||(this.isLoading=!0);const e=this.pagination.page??localStorage.getItem(this.paginationId)??1;try{const t=await this.$api.get(this.parent+"/sections/"+this.name,{page:e,searchterm:this.searchterm});this.options=t.options,this.pagination=t.pagination,this.data=t.data}catch(n){this.error=n.message}finally{this.isProcessing=!1,this.isLoading=!1}},onAction(){},onAdd(){},onChange(){},onDrop(){},onSort(){},onPaginate(t){localStorage.setItem(this.paginationId,t.page),this.pagination=t,this.reload()},onSearchToggle(){this.searching=!this.searching,this.searchterm=null},async reload(){await this.load(!0)},update(){this.reload(),this.$events.$emit("model.update")}}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("section",{class:`k-models-section k-${t.type}-section`,attrs:{"data-processing":t.isProcessing}},[e("header",{staticClass:"k-section-header"},[e("k-headline",{attrs:{link:t.options.link}},[t._v(" "+t._s(t.options.headline||" ")+" "),t.options.min?e("abbr",{attrs:{title:t.$t("section.required")}},[t._v("*")]):t._e()]),e("k-button-group",{attrs:{buttons:t.buttons}})],1),t.error?e("k-box",{attrs:{theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[e("strong",[t._v(" "+t._s(t.$t("error.section.notLoaded",{name:t.name}))+": ")]),t._v(" "+t._s(t.error)+" ")])],1):[e("k-dropzone",{attrs:{disabled:!t.canDrop},on:{drop:t.onDrop}},[t.searching&&t.options.search?e("k-input",{staticClass:"k-models-section-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",value:t.searchterm,type:"text"},on:{input:function(e){t.searchterm=e},keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.onSearchToggle.apply(null,arguments)}}}):t._e(),e("k-collection",t._g(t._b({attrs:{"data-invalid":t.isInvalid},on:{action:t.onAction,change:t.onChange,sort:t.onSort,paginate:t.onPaginate}},"k-collection",t.collection,!1),t.canAdd?{empty:t.onAdd}:{}))],1)]],2):t._e()}),[],!1,null,null,null,null).exports;const gl=R({extends:fl,computed:{addIcon:()=>"upload",canAdd(){return this.$panel.permissions.files.create&&!1!==this.options.upload},canDrop(){return!1!==this.canAdd},emptyProps(){return{icon:"image",text:this.$t("files.empty")}},items(){return this.data.map((t=>(t.sortable=this.options.sortable,t.column=this.column,t.options=this.$dropdown(t.link,{query:{view:"list",update:this.options.sortable,delete:this.data.length>this.options.min}}),t.data={"data-id":t.id,"data-template":t.template},t)))},type:()=>"files",uploadOptions(){return{...this.options.upload,url:this.$panel.urls.api+"/"+this.options.upload.api,on:{complete:()=>{this.$panel.notification.success({context:"view"})}}}}},created(){this.$events.$on("model.update",this.reload),this.$events.$on("file.sort",this.reload)},destroyed(){this.$events.$off("model.update",this.reload),this.$events.$off("file.sort",this.reload)},methods:{onAction(t,e){"replace"===t&&this.replace(e)},onAdd(){this.canAdd&&this.$panel.upload.pick(this.uploadOptions)},onDrop(t){this.canAdd&&this.$panel.upload.open(t,this.uploadOptions)},async onSort(t){if(!1===this.options.sortable)return!1;this.isProcessing=!0;try{await this.$api.patch(this.options.apiUrl+"/files/sort",{files:t.map((t=>t.id)),index:this.pagination.offset}),this.$panel.notification.success(),this.$events.$emit("file.sort")}catch(e){this.$panel.error(e),this.reload()}finally{this.isProcessing=!1}},replace(t){this.$panel.upload.replace(t,this.uploadOptions)}}},null,null,!1,null,null,null,null).exports;const kl=R({mixins:[hl],data:()=>({label:null,text:null,theme:null}),async created(){const t=await this.load();this.label=t.label,this.text=t.text,this.theme=t.theme||"info"}},(function(){var t=this,e=t._self._c;return e("section",{staticClass:"k-info-section"},[e("k-headline",{staticClass:"k-info-section-label"},[t._v(" "+t._s(t.label)+" ")]),e("k-box",{attrs:{theme:t.theme}},[e("k-text",{attrs:{html:t.text}})],1)],1)}),[],!1,null,null,null,null).exports;const bl=R({extends:fl,computed:{canAdd(){return this.options.add&&this.$panel.permissions.pages.create},items(){return this.data.map((t=>{const e=!1!==t.permissions.changeStatus;return t.flag={status:t.status,tooltip:this.$t("page.status")+": "+this.$t("page.status."+t.status),disabled:!e,click:()=>this.$dialog(t.link+"/changeStatus")},t.sortable=t.permissions.sort&&this.options.sortable,t.deletable=this.data.length>this.options.min,t.column=this.column,t.options=this.$dropdown(t.link,{query:{view:"list",delete:t.deletable,sort:t.sortable}}),t.data={"data-id":t.id,"data-status":t.status,"data-template":t.template},t}))}},created(){this.$events.$on("page.changeStatus",this.reload),this.$events.$on("page.sort",this.reload)},destroyed(){this.$events.$off("page.changeStatus",this.reload),this.$events.$off("page.sort",this.reload)},methods:{onAdd(){this.canAdd&&this.$dialog("pages/create",{query:{parent:this.options.link||this.parent,view:this.parent,section:this.name}})},async onChange(t){let e=null;if(t.added&&(e="added"),t.moved&&(e="moved"),e){this.isProcessing=!0;const s=t[e].element,i=t[e].newIndex+1+this.pagination.offset;try{await this.$api.pages.changeStatus(s.id,"listed",i),this.$panel.notification.success(),this.$events.$emit("page.sort",s)}catch(n){this.$panel.error({message:n.message,details:n.details}),await this.reload()}finally{this.isProcessing=!1}}}}},null,null,!1,null,null,null,null).exports;const vl=R({mixins:[hl],data:()=>({isLoading:!0,headline:null,reports:null,size:null}),async created(){const t=await this.load();this.isLoading=!1,this.headline=t.headline,this.reports=t.reports,this.size=t.size},methods:{}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("section",{staticClass:"k-stats-section"},[e("header",{staticClass:"k-section-header"},[e("k-headline",[t._v(" "+t._s(t.headline)+" ")])],1),t.reports.length>0?e("k-stats",{attrs:{reports:t.reports,size:t.size}}):e("k-empty",{attrs:{icon:"chart"}},[t._v(" "+t._s(t.empty||t.$t("stats.empty")))])],1):t._e()}),[],!1,null,null,null,null).exports,yl={install(t){t.component("k-sections",pl),t.component("k-fields-section",ml),t.component("k-files-section",gl),t.component("k-info-section",kl),t.component("k-pages-section",bl),t.component("k-stats-section",vl)}};const $l=R({},(function(){var t=this._self._c;return t("pre",{staticClass:"k-code"},[t("code",[this._t("default")],2)])}),[],!1,null,null,null,null).exports;const wl=R({props:{link:String,size:{type:String},tag:{type:String,default:"h2"},theme:{type:String}},emits:["click"]},(function(){var t=this,e=t._self._c;return e(t.tag,{tag:"component",staticClass:"k-headline",attrs:{"data-theme":t.theme,"data-size":t.size},on:{click:function(e){return t.$emit("click",e)}}},[t.link?e("k-link",{attrs:{to:t.link}},[t._t("default")],2):t._t("default")],2)}),[],!1,null,null,null,null).exports;const _l=R({props:{align:String,html:String,size:String,theme:String},computed:{attrs(){return{class:"k-text","data-align":this.align,"data-size":this.size,"data-theme":this.theme}}}},(function(){var t=this,e=t._self._c;return t.html?e("div",t._b({domProps:{innerHTML:t._s(t.html)}},"div",t.attrs,!1)):e("div",t._b({},"div",t.attrs,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports,xl={install(t){t.component("k-code",$l),t.component("k-headline",wl),t.component("k-text",_l)}};const Cl=R({props:{blueprint:String,next:Object,prev:Object,permissions:{type:Object,default:()=>({})},lock:{type:[Boolean,Object]},model:{type:Object,default:()=>({})},tab:{type:Object,default:()=>({columns:[]})},tabs:{type:Array,default:()=>[]}},computed:{id(){return this.model.link},isLocked(){var t;return"lock"===(null==(t=this.lock)?void 0:t.state)},protectedFields:()=>[]},watch:{"$panel.view.timestamp":{handler(){this.$store.dispatch("content/create",{id:this.id,api:this.id,content:this.model.content,ignore:this.protectedFields})},immediate:!0}},created(){this.$events.$on("model.reload",this.$reload),this.$events.$on("keydown.left",this.toPrev),this.$events.$on("keydown.right",this.toNext)},destroyed(){this.$events.$off("model.reload",this.$reload),this.$events.$off("keydown.left",this.toPrev),this.$events.$off("keydown.right",this.toNext)},methods:{toPrev(t){this.prev&&"body"===t.target.localName&&this.$go(this.prev.link)},toNext(t){this.next&&"body"===t.target.localName&&this.$go(this.next.link)}}},null,null,!1,null,null,null,null).exports;const Sl=R({extends:Cl,computed:{avatarOptions(){return[{icon:"upload",text:this.$t("change"),click:()=>this.$panel.upload.pick(this.uploadOptions)},{icon:"trash",text:this.$t("delete"),click:this.deleteAvatar}]},buttons(){return[{icon:"email",text:`${this.$t("email")}: ${this.model.email}`,disabled:!this.permissions.changeEmail||this.isLocked,click:()=>this.$dialog(this.id+"/changeEmail")},{icon:"bolt",text:`${this.$t("role")}: ${this.model.role}`,disabled:!this.permissions.changeRole||this.isLocked,click:()=>this.$dialog(this.id+"/changeRole")},{icon:"globe",text:`${this.$t("language")}: ${this.model.language}`,disabled:!this.permissions.changeLanguage||this.isLocked,click:()=>this.$dialog(this.id+"/changeLanguage")}]},uploadOptions(){return{url:this.$panel.urls.api+"/"+this.id+"/avatar",accept:"image/*",immediate:!0,multiple:!1}}},methods:{async deleteAvatar(){await this.$api.users.deleteAvatar(this.model.id),this.avatar=null,this.$panel.notification.success(),this.$reload()},onAvatar(){this.model.avatar?this.$refs.picture.toggle():this.$panel.upload.pick(this.uploadOptions)}}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("div",{staticClass:"k-user-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[e("div",{staticClass:"k-user-profile"},[e("k-view",[e("k-dropdown",[e("k-button",{staticClass:"k-user-view-image",attrs:{tooltip:t.$t("avatar"),disabled:t.isLocked},on:{click:t.onAvatar}},[t.model.avatar?e("k-image",{attrs:{cover:!0,src:t.model.avatar,ratio:"1/1"}}):e("k-icon",{attrs:{back:"gray-900",color:"gray-200",type:"user"}})],1),t.model.avatar?e("k-dropdown-content",{ref:"picture",attrs:{options:t.avatarOptions}}):t._e()],1),e("k-button-group",{attrs:{buttons:t.buttons}})],1)],1),e("k-view",[e("k-header",{attrs:{editable:t.permissions.changeName&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[e("k-dropdown",{staticClass:"k-user-view-options"},[e("k-button",{attrs:{disabled:t.isLocked,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)}})],1),e("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[t.model.account?t._e():e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[t.model.name&&0!==t.model.name.length?[t._v(" "+t._s(t.model.name)+" ")]:e("span",{staticClass:"k-user-name-placeholder"},[t._v(" "+t._s(t.$t("name"))+" … ")])],2),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("user.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}})],1)],1)])}),[],!1,null,null,null,null).exports;const Ol=R({extends:Sl,prevnext:!1},null,null,!1,null,null,null,null).exports;const Al=R({props:{error:String,layout:String}},(function(){var t=this,e=t._self._c;return e(`k-${t.layout}`,{tag:"component"},[e("k-view",{staticClass:"k-error-view"},[e("div",{staticClass:"k-error-view-content"},[e("k-text",[e("p",[e("k-icon",{staticClass:"k-error-view-icon",attrs:{type:"alert"}})],1),t._t("default",(function(){return[e("p",[t._v(" "+t._s(t.error)+" ")])]}))],2)],1)])],1)}),[],!1,null,null,null,null).exports;const Il=R({extends:Cl,props:{preview:Object},methods:{action(t){if("replace"===t)return this.$panel.upload.replace({...this.preview,...this.model})}}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("div",{staticClass:"k-file-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[e("k-file-preview",t._b({attrs:{"is-locked":t.isLocked}},"k-file-preview",t.preview,!1)),e("k-view",{staticClass:"k-file-content"},[e("k-header",{attrs:{editable:t.permissions.changeName&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[e("k-button",{attrs:{link:t.preview.url,icon:"open",target:"_blank"}},[t._v(" "+t._s(t.$t("open"))+" ")]),e("k-dropdown",{staticClass:"k-file-view-options"},[e("k-button",{attrs:{disabled:t.isLocked,responsive:!0,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)},on:{action:t.action}})],1),e("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[t._v(" "+t._s(t.model.filename)+" ")]),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("file.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}})],1)],1)])}),[],!1,null,null,null,null).exports;const Ml=R({props:{isInstallable:Boolean,isInstalled:Boolean,isOk:Boolean,requirements:Object,translations:Array},data(){return{user:{name:"",email:"",language:this.$panel.translation.code,password:"",role:"admin"}}},computed:{fields(){return{email:{label:this.$t("email"),type:"email",link:!1,autofocus:!0,required:!0},password:{label:this.$t("password"),type:"password",placeholder:this.$t("password")+" …",required:!0},language:{label:this.$t("language"),type:"select",options:this.translations,icon:"globe",empty:!1,required:!0}}},isReady(){return this.isOk&&this.isInstallable},isComplete(){return this.isOk&&this.isInstalled}},methods:{async install(){try{await this.$api.system.install(this.user),await this.$reload({globals:["$system","$translation"]}),this.$panel.notification.success(this.$t("welcome")+"!")}catch(t){this.$panel.error(t)}}}},(function(){var t=this,e=t._self._c;return e("k-panel",[e("k-view",{staticClass:"k-installation-view",attrs:{align:"center"}},[t.isComplete?e("k-text",[e("k-headline",[t._v(t._s(t.$t("installation.completed")))]),e("k-link",{attrs:{to:"/login"}},[t._v(" "+t._s(t.$t("login"))+" ")])],1):t.isReady?e("form",{on:{submit:function(e){return e.preventDefault(),t.install.apply(null,arguments)}}},[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("installation"))+" ")]),e("k-fieldset",{attrs:{fields:t.fields,novalidate:!0,value:t.user},on:{input:function(e){t.user=e}}}),e("k-button",{attrs:{text:t.$t("install"),type:"submit",icon:"check"}})],1):e("div",[e("k-headline",[t._v(" "+t._s(t.$t("installation.issues.headline"))+" ")]),e("ul",{staticClass:"k-installation-issues"},[!1===t.isInstallable?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.disabled"))}})],1):t._e(),!1===t.requirements.php?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.php"))}})],1):t._e(),!1===t.requirements.server?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.server"))}})],1):t._e(),!1===t.requirements.mbstring?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.mbstring"))}})],1):t._e(),!1===t.requirements.curl?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.curl"))}})],1):t._e(),!1===t.requirements.accounts?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.accounts"))}})],1):t._e(),!1===t.requirements.content?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.content"))}})],1):t._e(),!1===t.requirements.media?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.media"))}})],1):t._e(),!1===t.requirements.sessions?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.sessions"))}})],1):t._e()]),e("k-button",{attrs:{text:t.$t("retry"),icon:"refresh"},on:{click:t.$reload}})],1)],1)],1)}),[],!1,null,null,null,null).exports;const Tl=R({props:{code:String,deletable:Boolean,direction:String,id:String,info:Array,next:Object,name:String,prev:Object,translations:Array,url:String},methods:{createTranslation(){this.$panel.dialog.open(`dialogs/languages/${this.id}/translations/create`)},option(t,e){this.$panel.dialog.open(`dialogs/languages/${this.id}/translations/${e.key}/${t}`)},remove(){this.$panel.dialog.open(`dialogs/languages/${this.id}/delete`)},update(t){this.$panel.dialog.open(`dialogs/languages/${this.id}/update`,{on:{ready:()=>{this.$panel.dialog.focus(t)}}})},updateTranslation({row:t}){this.$dialog(`languages/${this.id}/translations/${t.key}/update`)}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-language-view"},[e("k-header",{attrs:{editable:!0},on:{edit:function(e){return t.update()}},scopedSlots:t._u([{key:"right",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[t._v(" "+t._s(t.name)+" "),e("k-button-group",{attrs:{slot:"left"},slot:"left"},[e("k-button",{attrs:{link:t.url,icon:"open",text:"Open"}}),e("k-button",{attrs:{text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.update()}}}),e("k-button",{attrs:{disabled:!t.deletable,text:t.$t("delete"),icon:"trash"},on:{click:function(e){return t.remove()}}})],1)],1),e("section",[e("k-bar",[e("k-headline",{staticStyle:{"margin-bottom":"var(--spacing-3)"},attrs:{slot:"left"},slot:"left"},[t._v("Language settings")])],1),e("k-stats",{attrs:{reports:t.info,size:"small"}})],1),e("section",[e("k-bar",[e("k-headline",{attrs:{slot:"left"},slot:"left"},[t._v("Language variables")]),e("k-button-group",{attrs:{slot:"right"},slot:"right"},[e("k-button",{attrs:{icon:"add",text:t.$t("add")},on:{click:function(e){return t.createTranslation()}}})],1)],1),t.translations.length?[e("k-table",{attrs:{columns:{key:{label:"Key",mobile:!0,width:"1/4"},value:{label:"Value",mobile:!0}},rows:t.translations},on:{cell:t.updateTranslation,option:t.option}})]:[e("k-empty",{on:{click:t.createTranslation}},[t._v("No translations yet")])]],2)],1)],1)}),[],!1,null,null,null,null).exports;const jl=R({props:{languages:{type:Array,default:()=>[]}},computed:{languagesCollection(){return this.languages.map((t=>({...t,image:{back:"black",color:"gray",icon:"globe"},link:()=>{this.$go(`languages/${t.id}`)},options:[{icon:"edit",text:this.$t("edit"),click(){this.$go(`languages/${t.id}`)}},{icon:"cog",text:this.$t("settings"),click(){this.$dialog(`languages/${t.id}/update`)}},{icon:"trash",text:this.$t("delete"),disabled:!1===t.deletable,click(){this.$dialog(`languages/${t.id}/delete`)}}]})))},primaryLanguage(){return this.languagesCollection.filter((t=>t.default))},secondaryLanguages(){return this.languagesCollection.filter((t=>!1===t.default))}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-languages-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.languages"))+" "),e("k-button-group",{attrs:{slot:"left"},slot:"left"},[e("k-button",{attrs:{text:t.$t("language.create"),icon:"add"},on:{click:function(e){return t.$dialog("languages/create")}}})],1)],1),e("section",{staticClass:"k-languages"},[t.languages.length>0?[e("section",{staticClass:"k-languages-view-section"},[e("header",{staticClass:"k-languages-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("languages.default")))])],1),e("k-collection",{attrs:{items:t.primaryLanguage}})],1),e("section",{staticClass:"k-languages-view-section"},[e("header",{staticClass:"k-languages-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("languages.secondary")))])],1),t.secondaryLanguages.length?e("k-collection",{attrs:{items:t.secondaryLanguages}}):e("k-empty",{attrs:{icon:"globe"},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.secondary.empty"))+" ")])],1)]:0===t.languages.length?[e("k-empty",{attrs:{icon:"globe"},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.empty"))+" ")])]:t._e()],2)],1)],1)}),[],!1,null,null,null,null).exports;const El=R({components:{"k-login-plugin":window.panel.plugins.login||se},props:{methods:Array,pending:Object},data:()=>({issue:""}),computed:{form(){return this.pending.email?"code":"login"},viewClass(){return"code"===this.form?"k-login-code-view":"k-login-view"}},created(){this.$store.dispatch("content/clear")},methods:{async onError(t){null!==t?(!0===t.details.challengeDestroyed&&await this.$reload({globals:["$system"]}),this.issue=t.message):this.issue=null}}},(function(){var t=this,e=t._self._c;return e("k-panel",[e("k-view",{class:t.viewClass,attrs:{align:"center"}},[e("div",[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("login"))+" ")]),t.issue?e("k-login-alert",{on:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),"code"===t.form?e("k-login-code",t._b({on:{error:t.onError}},"k-login-code",t.$props,!1)):e("k-login-plugin",{attrs:{methods:t.methods},on:{error:t.onError}})],1)])],1)}),[],!1,null,null,null,null).exports;const Ll=R({extends:Cl,props:{status:Object},computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("k-view",{staticClass:"k-page-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[e("k-header",{attrs:{editable:t.permissions.changeTitle&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeTitle")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[t.permissions.preview&&t.model.previewUrl?e("k-button",{staticClass:"k-page-view-preview",attrs:{link:t.model.previewUrl,responsive:!0,text:t.$t("open"),icon:"open",target:"_blank"}}):t._e(),t.status?e("k-status-icon",{attrs:{status:t.model.status,disabled:!t.permissions.changeStatus||t.isLocked,responsive:!0,text:t.status.label},on:{click:function(e){return t.$dialog(t.id+"/changeStatus")}}}):t._e(),e("k-dropdown",{staticClass:"k-page-view-options"},[e("k-button",{attrs:{disabled:!0===t.isLocked,responsive:!0,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)}})],1),e("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[t.model.id?e("k-prev-next",{attrs:{prev:t.prev,next:t.next}}):t._e()]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("page.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}})],1)],1)}),[],!1,null,null,null,null).exports;const Dl=R({props:{id:String},computed:{view(){return"k-"+this.id+"-plugin-view"}}},(function(){var t=this._self._c;return t("k-inside",[t(this.view,{tag:"component"})],1)}),[],!1,null,null,null,null).exports;const Bl=R({data:()=>({isLoading:!1,issue:"",values:{password:null,passwordConfirmation:null}}),computed:{fields(){return{password:{autofocus:!0,label:this.$t("user.changePassword.new"),icon:"key",type:"password"},passwordConfirmation:{label:this.$t("user.changePassword.new.confirm"),icon:"key",type:"password"}}}},mounted(){this.$panel.title=this.$t("view.resetPassword")},methods:{async submit(){if(!this.values.password||this.values.password.length<8)return this.issue=this.$t("error.user.password.invalid"),!1;if(this.values.password!==this.values.passwordConfirmation)return this.issue=this.$t("error.user.password.notSame"),!1;this.isLoading=!0;try{await this.$api.users.changePassword(this.$panel.user.id,this.values.password),this.$panel.notification.success(),this.$go("/")}catch(t){this.issue=t.message}finally{this.isLoading=!1}}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-password-reset-view",attrs:{align:"center"}},[e("k-form",{attrs:{fields:t.fields,"submit-button":t.$t("change"),value:t.values},on:{input:function(e){t.values=e},submit:t.submit},scopedSlots:t._u([{key:"header",fn:function(){return[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("view.resetPassword"))+" ")]),t.issue?e("k-login-alert",{on:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),e("k-user-info",{attrs:{user:t.$panel.user}})]},proxy:!0},{key:"footer",fn:function(){return[e("div",{staticClass:"k-login-buttons"},[e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("change"))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)],1)]},proxy:!0}])})],1)],1)}),[],!1,null,null,null,null).exports;const Pl=R({props:{type:{default:"pages",type:String}},data(){return{items:[],query:this.getQuery(),pagination:{}}},watch:{query:{handler(t){this.search(t)},immediate:!0},type(){this.search(this.query)}},updated(){this.query=this.getQuery(),this.focus()},methods:{focus(){var t;null==(t=this.$refs.input)||t.focus()},getQuery:()=>new URLSearchParams(window.location.search).get("query"),onPaginate(t){this.search(this.query,t.page)},async search(t,e){this.$panel.isLoading=!0,e||(e=new URLSearchParams(window.location.search).get("page")??1);const n=this.$panel.url(window.location,{type:this.type,query:this.query,page:e>1?e:null});window.history.pushState("","",n.toString());try{if(null===t||t.length<2)throw Error("Empty query");const n=await this.$search(this.type,t,{page:e,limit:15});this.items=n.results,this.pagination=n.pagination}catch(s){this.items=[],this.pagination={}}finally{this.$panel.isLoading=!1}}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-search-view"},[e("k-header",[t._v("Search")]),e("div",{staticClass:"k-search-view-layout"},[e("k-input",{ref:"input",staticClass:"k-search-view-input",attrs:{"aria-label":t.$t("search"),autofocus:!0,placeholder:t.$t("search")+" …",value:t.query,icon:"search",type:"text"},on:{input:function(e){t.query=e}}}),e("aside",{staticClass:"k-search-view-types"},[e("nav",t._l(t.$panel.searches,(function(n,s){return e("k-button",{key:s,staticClass:"k-search-view-type",attrs:{current:t.type===s,icon:n.icon,link:"/search/?type="+s+"&query="+t.query}},[t._v(" "+t._s(n.label)+" ")])})),1)]),e("div",{staticClass:"k-search-view-results"},[t.query?e("k-collection",{attrs:{items:t.items,empty:{icon:"search",text:t.$t("search.results.none")},pagination:t.pagination},on:{paginate:t.onPaginate}}):t._e()],1)],1)],1)],1)}),[],!1,null,null,null,null).exports;const Fl=R({extends:Cl,computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("k-view",{staticClass:"k-site-view",attrs:{"data-locked":t.isLocked,"data-id":"/","data-template":"site"}},[e("k-header",{attrs:{editable:t.permissions.changeTitle&&!t.isLocked,tabs:t.tabs,tab:t.tab.name},on:{edit:function(e){return t.$dialog("site/changeTitle")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-site-view-preview",attrs:{link:t.model.previewUrl,responsive:!0,text:t.$t("open"),icon:"open",target:"_blank"}}),e("k-languages-dropdown")],1)]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("site.blueprint"),lock:t.lock,tab:t.tab,parent:"site"},on:{submit:function(e){return t.$emit("submit",e)}}})],1)],1)}),[],!1,null,null,null,null).exports;const Nl=R({props:{environment:Array,exceptions:Array,plugins:Array,security:Array,urls:Object},data:()=>({accessible:[]}),computed:{securityIssues(){const t=this.accessible.map((t=>({id:t,text:this.$t("system.issues."+t),link:"https://getkirby.com/security/"+t,icon:"folder"})));return this.security.concat(t).map((t=>({image:{back:"var(--color-red-200)",icon:t.icon||"alert",color:"var(--color-red)"},...t})))}},async created(){this.exceptions.length>0&&(console.info("The following errors occurred during the update check of Kirby and/or plugins:"),this.exceptions.map((t=>console.warn(t))),console.info("End of errors from the update check.")),console.info("Running system health checks for the Panel system view; failed requests in the following console output are expected behavior.");const t=(Promise.allSettled||Promise.all).bind(Promise),e=Object.entries(this.urls).map(this.check);await t(e),console.info(`System health checks ended. ${this.accessible.length} issues with accessible files/folders found (see the security list in the system view).`)},methods:{async check([t,e]){if(!e)return!1;!0===await this.isAccessible(e)&&this.accessible.push(t)},isAccessible:async t=>(await fetch(t,{cache:"no-store"})).status<400,retry(){this.$go(window.location.href)}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-system-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.system"))+" ")]),e("section",{staticClass:"k-system-view-section"},[e("header",{staticClass:"k-system-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("environment")))])],1),e("k-stats",{staticClass:"k-system-info",attrs:{reports:t.environment,size:"medium"}})],1),t.securityIssues.length?e("section",{staticClass:"k-system-view-section"},[e("header",{staticClass:"k-system-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("security")))]),e("k-button",{attrs:{tooltip:t.$t("retry"),icon:"refresh"},on:{click:t.retry}})],1),e("k-items",{attrs:{items:t.securityIssues}})],1):t._e(),t.plugins.length?e("section",{staticClass:"k-system-view-section"},[e("header",{staticClass:"k-system-view-section-header"},[e("k-headline",{attrs:{link:"https://getkirby.com/plugins"}},[t._v(" "+t._s(t.$t("plugins"))+" ")])],1),e("k-table",{attrs:{index:!1,columns:{name:{label:t.$t("name"),type:"url",mobile:!0},author:{label:t.$t("author")},license:{label:t.$t("license")},version:{label:t.$t("version"),type:"update-status",mobile:!0,width:"10rem"}},rows:t.plugins}})],1):t._e()],1)],1)}),[],!1,null,null,null,null).exports;const ql=R({props:{role:Object,roles:Array,search:String,title:String,users:Object},computed:{items(){return this.users.data.map((t=>(t.options=this.$dropdown(t.link),t)))}},methods:{paginate(t){this.$reload({query:{page:t.page}})}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-users-view"},[e("k-header",{scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",{attrs:{buttons:[{disabled:!1===t.$panel.permissions.users.create,text:t.$t("user.create"),icon:"add",click:()=>t.$dialog("users/create")}]}})]},proxy:!0},t.roles.length>1?{key:"right",fn:function(){return[e("k-button-group",[e("k-dropdown",[e("k-button",{attrs:{responsive:!0,text:`${t.$t("role")}: ${t.role?t.role.title:t.$t("role.all")}`,icon:"funnel"},on:{click:function(e){return t.$refs.roles.toggle()}}}),e("k-dropdown-content",{ref:"roles",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{icon:"bolt",link:"/users"}},[t._v(" "+t._s(t.$t("role.all"))+" ")]),e("hr"),t._l(t.roles,(function(n){return e("k-dropdown-item",{key:n.id,attrs:{link:"/users/?role="+n.id,icon:"bolt"}},[t._v(" "+t._s(n.title)+" ")])}))],2)],1)],1)]},proxy:!0}:null],null,!0)},[t._v(" "+t._s(t.$t("view.users"))+" ")]),t.users.data.length>0?[e("k-collection",{attrs:{items:t.items,pagination:t.users.pagination},on:{paginate:t.paginate}})]:0===t.users.pagination.total?[e("k-empty",{attrs:{icon:"users"}},[t._v(" "+t._s(t.$t("role.empty"))+" ")])]:t._e()],2)],1)}),[],!1,null,null,null,null).exports,Rl={install(t){t.component("k-account-view",Ol),t.component("k-error-view",Al),t.component("k-file-view",Il),t.component("k-installation-view",Ml),t.component("k-language-view",Tl),t.component("k-languages-view",jl),t.component("k-login-view",El),t.component("k-page-view",Ll),t.component("k-plugin-view",Dl),t.component("k-reset-password-view",Bl),t.component("k-search-view",Pl),t.component("k-site-view",Fl),t.component("k-system-view",Nl),t.component("k-users-view",ql),t.component("k-user-view",Sl)}},zl={install(t){t.use(wt),t.use(Lt),t.use(to),t.use(So),t.use(zo),t.use(dl),t.use(yl),t.use(xl),t.use(Rl),t.use(j)}},Yl={install(t){window.onunhandledrejection=t=>{t.preventDefault(),window.panel.error(t.reason)},t.config.errorHandler=window.panel.error.bind(window.panel)}},Hl=t=>{var e=(t=t||{}).desc?-1:1,n=-e,s=/^0/,i=/\s+/g,o=/^\s+|\s+$/g,l=/[^\x00-\x80]/,r=/^0x[0-9a-f]+$/i,a=/(0x[\da-fA-F]+|(^[\+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|\d+)/g,u=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=t.insensitive?function(t){return function(t){if(t.toLocaleLowerCase)return t.toLocaleLowerCase();return t.toLowerCase()}(""+t).replace(o,"")}:function(t){return(""+t).replace(o,"")};function d(t){return t.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0")}function p(t,e){return(!t.match(s)||1===e)&&parseFloat(t)||t.replace(i," ").replace(o,"")||0}return function(t,s){var i=c(t),o=c(s);if(!i&&!o)return 0;if(!i&&o)return n;if(i&&!o)return e;var a=d(i),h=d(o),m=parseInt(i.match(r),16)||1!==a.length&&Date.parse(i),f=parseInt(o.match(r),16)||m&&o.match(u)&&Date.parse(o)||null;if(f){if(mf)return e}for(var g=a.length,k=h.length,b=0,v=Math.max(g,k);b0)return e;if(w<0)return n;if(b===v-1)return 0}else{if(y<$)return n;if(y>$)return e}}return 0}};Array.fromObject=function(t){return Array.isArray(t)?t:Object.values(t??{})},Array.prototype.sortBy=function(t){const e=t.split(" "),n=e[0],s=e[1]||"asc";return this.sort(((t,e)=>{const i=String(t[n]).toLowerCase(),o=String(e[n]).toLowerCase();return Hl("desc"===s?o:i)}))},Array.wrap=function(t){return Array.isArray(t)?t:[t]};const Ul={read:function(t,e=!1){if(!t)return null;if("string"==typeof t)return t;if(t instanceof ClipboardEvent){if(t.preventDefault(),!0===e)return t.clipboardData.getData("text/plain");const n=t.clipboardData.getData("text/html")||t.clipboardData.getData("text/plain")||null;if(n)return n.replace(/\u00a0/g," ")}return null},write:function(t,e){if("string"!=typeof t&&(t=JSON.stringify(t,null,2)),e&&e instanceof ClipboardEvent)return e.preventDefault(),e.clipboardData.setData("text/plain",t),!0;const n=document.createElement("textarea");if(n.value=t,document.body.append(n),navigator.userAgent.match(/ipad|ipod|iphone/i)){n.contentEditable=!0,n.readOnly=!0;const t=document.createRange();t.selectNodeContents(n);const e=window.getSelection();e.removeAllRanges(),e.addRange(t),n.setSelectionRange(0,999999)}else n.select();return document.execCommand("copy"),n.remove(),!0}};function Vl(t){if("string"==typeof t){if("pattern"===(t=t.toLowerCase()))return"var(--color-gray-800) var(--bg-pattern)";if(!1===t.startsWith("#")&&!1===t.startsWith("var(")){const e="--color-"+t;if(window.getComputedStyle(document.documentElement).getPropertyValue(e))return`var(${e})`}return t}}function Kl(t,e=!1){if(!t.match("youtu"))return!1;let n=null;try{n=new URL(t)}catch(d){return!1}const s=n.pathname.split("/").filter((t=>""!==t)),i=s[0],o=s[1],l="https://"+(!0===e?"www.youtube-nocookie.com":n.host)+"/embed",r=t=>!!t&&null!==t.match(/^[a-zA-Z0-9_-]+$/);let a=n.searchParams,u=null;switch(s.join("/")){case"embed/videoseries":case"playlist":r(a.get("list"))&&(u=l+"/videoseries");break;case"watch":r(a.get("v"))&&(u=l+"/"+a.get("v"),a.has("t")&&a.set("start",a.get("t")),a.delete("v"),a.delete("t"));break;default:n.host.includes("youtu.be")&&r(i)?(u=!0===e?"https://www.youtube-nocookie.com/embed/"+i:"https://www.youtube.com/embed/"+i,a.has("t")&&a.set("start",a.get("t")),a.delete("t")):["embed","shorts"].includes(i)&&r(o)&&(u=l+"/"+o)}if(!u)return!1;const c=a.toString();return c.length&&(u+="?"+c),u}function Wl(t,e=!1){let n=null;try{n=new URL(t)}catch(a){return!1}const s=n.pathname.split("/").filter((t=>""!==t));let i=n.searchParams,o=null;switch(!0===e&&i.append("dnt",1),n.host){case"vimeo.com":case"www.vimeo.com":o=s[0];break;case"player.vimeo.com":o=s[1]}if(!o||!o.match(/^[0-9]*$/))return!1;let l="https://player.vimeo.com/video/"+o;const r=i.toString();return r.length&&(l+="?"+r),l}const Jl={youtube:Kl,vimeo:Wl,video:function(t,e=!1){return t.includes("youtu")?Kl(t,e):!!t.includes("vimeo")&&Wl(t,e)}};const Gl={form:function(t){const e={};for(const n in t)e[n]=Y(t[n].default);return e},isVisible:function(t,e){if("hidden"===t.type||!0===t.hidden)return!1;if(!t.when)return!0;for(const n in t.when){const s=e[n.toLowerCase()],i=t.when[n];if((void 0!==s||""!==i&&i!==[])&&s!==i)return!1}return!0},subfields:function(t,e){let n={};return Object.keys(e).forEach((s=>{let i=e[s];i.section=t.name,i.endpoints={field:t.endpoints.field+"+"+s,section:t.endpoints.section,model:t.endpoints.model},n[s]=i})),n}},Zl=t=>t.split(".").slice(-1).join(""),Ql=t=>t.split(".").slice(0,-1).join("."),Xl=t=>Intl.NumberFormat("en",{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow"}).format(t),tr={extension:Zl,name:Ql,niceSize:Xl};function er(t,e){if("string"==typeof t&&(t=document.querySelector(t)),!t)return!1;const n=["[autofocus]","[data-autofocus]","input","textarea","select","[contenteditable=true]","[type=submit]","button"];e&&n.unshift(`[name="${e}"]`);const s=function(t,e){for(const n of e){const e=t.querySelector(n);if(!0===nr(e))return e}return null}(t,n);return s?(s.focus(),s):!0===nr(t)&&(t.focus(),t)}function nr(t){return!!t&&(!t.matches("[disabled], [aria-disabled], input[type=hidden]")&&"function"==typeof t.focus)}const sr=t=>"function"==typeof window.Vue.options.components[t],ir=t=>!!t.dataTransfer&&(!!t.dataTransfer.types&&(!0===t.dataTransfer.types.includes("Files")&&!1===t.dataTransfer.types.includes("text/plain")));const or={metaKey:function(){return window.navigator.userAgent.indexOf("Mac")>-1?"cmd":"ctrl"}},lr=(t="3/2",e="100%",n=!0)=>{const s=String(t).split("/");if(2!==s.length)return e;const i=Number(s[0]),o=Number(s[1]);let l=100;return 0!==i&&0!==o&&(l=n?l/i*o:l/o*i,l=parseFloat(String(l)).toFixed(2)),l+"%"};RegExp.escape=function(t){return t.replace(new RegExp("[-/\\\\^$*+?.()[\\]{}]","gu"),"\\$&")};const rr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function ar(t){return String(t).replace(/[&<>"'`=/]/g,(t=>rr[t]))}function ur(t){return!t||0===String(t).length}function cr(t){const e=String(t);return e.charAt(0).toLowerCase()+e.slice(1)}function dr(t="",e=""){const n=new RegExp(`^(${e})+`,"g");return t.replace(n,"")}function pr(t="",e=""){const n=new RegExp(`(${e})+$`,"g");return t.replace(n,"")}function hr(t,e={}){const n=(t,e={})=>{const s=e[ar(t.shift())]??"…";return"…"===s||0===t.length?s:n(t,s)},s="[{]{1,2}[\\s]?",i="[\\s]?[}]{1,2}";return(t=t.replace(new RegExp(`${s}(.*?)${i}`,"gi"),((t,s)=>n(s.split("."),e)))).replace(new RegExp(`${s}.*${i}`,"gi"),"…")}function mr(t){const e=String(t);return e.charAt(0).toUpperCase()+e.slice(1)}function fr(){let t,e,n="";for(t=0;t<32;t++)e=16*Math.random()|0,8!=t&&12!=t&&16!=t&&20!=t||(n+="-"),n+=(12==t?4:16==t?3&e|8:e).toString(16);return n}const gr={camelToKebab:function(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()},escapeHTML:ar,hasEmoji:function(t){if("string"!=typeof t)return!1;const e=t.match(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c\ude32-\ude3a]|[\ud83c\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/i);return null!==e&&null!==e.length},isEmpty:ur,lcfirst:cr,ltrim:dr,pad:function(t,e=2){t=String(t);let n="";for(;n.length]+)>)/gi,"")},template:hr,ucfirst:mr,ucwords:function(t){return String(t).split(/ /g).map((t=>mr(t))).join(" ")},unescapeHTML:function(t){for(const e in rr)t=String(t).replaceAll(rr[e],e);return t},uuid:fr},kr=(t,e)=>{const n={url:"/",field:"file",method:"POST",filename:t.name,attributes:{},complete:function(){},error:function(){},success:function(){},progress:function(){}},s=Object.assign(n,e),i=new FormData;i.append(s.field,t,s.filename),s.attributes&&Object.keys(s.attributes).forEach((t=>{i.append(t,s.attributes[t])}));const o=new XMLHttpRequest,l=e=>{if(!e.lengthComputable||!s.progress)return;let n=Math.max(0,Math.min(100,e.loaded/e.total*100));s.progress(o,t,Math.ceil(n))};o.upload.addEventListener("loadstart",l),o.upload.addEventListener("progress",l),o.addEventListener("load",(e=>{let n=null;try{n=JSON.parse(e.target.response)}catch(i){n={status:"error",message:"The file could not be uploaded"}}"error"===n.status?s.error(o,t,n):(s.success(o,t,n),s.progress(o,t,100))})),o.addEventListener("error",(e=>{const n=JSON.parse(e.target.response);s.error(o,t,n),s.progress(o,t,100)})),o.open(s.method,s.url,!0),s.headers&&Object.keys(s.headers).forEach((t=>{const e=s.headers[t];o.setRequestHeader(t,e)})),o.send(i)};function br(){var t;return new URL((null==(t=document.querySelector("base"))?void 0:t.href)||window.location.origin)}function vr(t={},e={}){e instanceof URL&&(e=e.search);const n=new URLSearchParams(e);return Object.entries(t).forEach((([t,e])=>{null!==e&&n.set(t,e)})),n}function yr(t="",e={},n){return(t=Cr(t,n)).search=vr(e,t.search),t}function $r(t){return null!==String(t).match(/^https?:\/\//)}function wr(t){return Cr(t).origin===window.location.origin}function _r(t){if(t instanceof URL||t instanceof Location)return!0;if("string"!=typeof t)return!1;try{return new URL(t,window.location),!0}catch(e){return!1}}function xr(t,e){return!0===$r(t)?t:(e=e||br(),(e=String(e).replaceAll(/\/$/g,""))+"/"+(t=String(t).replaceAll(/^\//g,"")))}function Cr(t,e){return t instanceof URL?t:new URL(xr(t,e))}const Sr={base:br,buildUrl:yr,buildQuery:vr,isAbsolute:$r,isSameOrigin:wr,isUrl:_r,makeAbsolute:xr,toObject:Cr},Or={install(t){t.prototype.$helper={clipboard:Ul,clone:K.clone,color:Vl,embed:Jl,focus:er,isComponent:sr,isUploadEvent:ir,debounce:at,field:Gl,file:tr,keyboard:or,object:K,pad:gr.pad,ratio:lr,slug:gr.slug,sort:Hl,string:gr,upload:kr,url:Sr,uuid:gr.uuid},t.prototype.$esc=gr.escapeHTML}},Ar={install(t){t.directive("direction",{inserted(t,e,n){!0!==n.context.disabled?t.dir=window.panel.translation.direction:t.dir=null}})}},Ir=async(t,e={})=>("string"==typeof t&&(t=`/dialogs/${t}`),window.panel.dialog.open(t,e)),Mr=(t,e={})=>("string"==typeof t&&(t=`/dropdowns/${t}`),async n=>{await window.panel.dropdown.open(t,e);const s=window.panel.dropdown.options();if(0===s.length)throw Error("The dropdown is empty");n(s)}),Tr={install(t){window.panel.deprecated=window.panel.notification.deprecated.bind(window.panel.notification),window.panel.redirect=window.panel.redirect.bind(window.panel),window.panel.reload=window.panel.reload.bind(window.panel),window.panel.request=window.panel.request.bind(window.panel),window.panel.search=window.panel.search.bind(window.panel);const e=["api","config","direction","events","language","languages","license","menu","multilang","permissions","search","searches","system","t","translation","url","urls","user","view","vue"];for(const n of e){const e=`$${n}`;t.prototype[e]=window.panel[e]=window.panel[n]}t.prototype.$dialog=Ir,t.prototype.$dropdown=Mr}};E.extend(L),E.extend(((t,e,n)=>{n.interpret=(t,e="date")=>{const s={date:{"YYYY-MM-DD":!0,"YYYY-MM-D":!0,"YYYY-MM-":!0,"YYYY-MM":!0,"YYYY-M-DD":!0,"YYYY-M-D":!0,"YYYY-M-":!0,"YYYY-M":!0,"YYYY-":!0,YYYYMMDD:!0,"MMM DD YYYY":!1,"MMM D YYYY":!1,"MMM DD YY":!1,"MMM D YY":!1,"MMM YYYY":!0,"MMM DD":!1,"MMM D":!1,"MM YYYY":!0,"M YYYY":!0,"DD MMMM YYYY":!1,"DD MMMM YY":!1,"DD MMMM":!1,"D MMMM YYYY":!1,"D MMMM YY":!1,"D MMMM":!1,"DD MMM YYYY":!1,"D MMM YYYY":!1,"DD MMM YY":!1,"D MMM YY":!1,"DD MMM":!1,"D MMM":!1,"DD MM YYYY":!1,"DD M YYYY":!1,"D MM YYYY":!1,"D M YYYY":!1,"DD MM YY":!1,"D MM YY":!1,"DD M YY":!1,"D M YY":!1,YYYY:!0,MMMM:!0,MMM:!0,"DD MM":!1,"DD M":!1,"D MM":!1,"D M":!1,DD:!1,D:!1},time:{"HH:mm:ss a":!1,"HH:mm:ss":!1,"HH:mm a":!1,"HH:mm":!1,"HH a":!1,HH:!1}};if("string"==typeof t&&""!==t)for(const i in s[e]){const o=n(t,i,s[e][i]);if(!0===o.isValid())return o}return null}})),E.extend(((t,e,n)=>{const s=t=>"date"===t?"YYYY-MM-DD":"time"===t?"HH:mm:ss":"YYYY-MM-DD HH:mm:ss";e.prototype.toISO=function(t="datetime"){return this.format(s(t))},n.iso=function(t,e="datetime"){const i=n(t,s(e));return i&&i.isValid()?i:null}})),E.extend(((t,e)=>{e.prototype.merge=function(t,e="date"){let n=this.clone();if(!t||!t.isValid())return this;if("string"==typeof e){const t={date:["year","month","date"],time:["hour","minute","second"]};if(!1===Object.hasOwn(t,e))throw new Error("Invalid merge unit alias");e=t[e]}for(const s of e)n=n.set(s,t.get(s));return n}})),E.extend(((t,e,n)=>{n.pattern=t=>new class{constructor(t,e){this.dayjs=t,this.pattern=e;const n={year:["YY","YYYY"],month:["M","MM","MMM","MMMM"],day:["D","DD"],hour:["h","hh","H","HH"],minute:["m","mm"],second:["s","ss"],meridiem:["a"]};this.parts=this.pattern.split(/\W/).map(((t,e)=>{const s=this.pattern.indexOf(t);return{index:e,unit:Object.keys(n)[Object.values(n).findIndex((e=>e.includes(t)))],start:s,end:s+(t.length-1)}}))}at(t,e=t){const n=this.parts.filter((n=>n.start<=t&&n.end>=e-1));return n[0]?n[0]:this.parts.filter((e=>e.start<=t)).pop()}format(t){return t&&t.isValid()?t.format(this.pattern):null}}(n,t)})),E.extend(((t,e)=>{e.prototype.round=function(t="date",e=1){const n=["second","minute","hour","date","month","year"];if("day"===t&&(t="date"),!1===n.includes(t))throw new Error("Invalid rounding unit");if(["date","month","year"].includes(t)&&1!==e||"hour"===t&&24%e!=0||["second","minute"].includes(t)&&60%e!=0)throw"Invalid rounding size for "+t;let s=this.clone();const i=n.indexOf(t),o=n.slice(0,i),l=o.pop();if(o.forEach((t=>s=s.startOf(t))),l){const e={month:12,date:s.daysInMonth(),hour:24,minute:60,second:60}[l];Math.round(s.get(l)/e)*e===e&&(s=s.add(1,"date"===t?"day":t)),s=s.startOf(t)}return s=s.set(t,Math.round(s.get(t)/e)*e),s}})),E.extend(((t,e,n)=>{e.prototype.validate=function(t,e,s="day"){if(!this.isValid())return!1;if(!t)return!0;t=n.iso(t);const i={min:"isAfter",max:"isBefore"}[e];return this.isSame(t,s)||this[i](t,s)}}));const jr={install(t){t.prototype.$library={colors:pn,dayjs:E}}},Er=t=>({async changeName(e,n,s){return t.patch(this.url(e,n,"name"),{name:s})},async delete(e,n){return t.delete(this.url(e,n))},async get(e,n,s){let i=await t.get(this.url(e,n),s);return!0===Array.isArray(i.content)&&(i.content={}),i},id:t=>!0===t.startsWith("/@/file/")?t.replace("/@/file/","@"):!0===t.startsWith("file://")?t.replace("file://","@"):t,link(t,e,n){return"/"+this.url(t,e,n)},async update(e,n,s){return t.patch(this.url(e,n),s)},url(t,e,n){let s="files/"+this.id(e);return t&&(s=t+"/"+s),n&&(s+="/"+n),s}}),Lr=t=>({async blueprint(e){return t.get("pages/"+this.id(e)+"/blueprint")},async blueprints(e,n){return t.get("pages/"+this.id(e)+"/blueprints",{section:n})},async changeSlug(e,n){return t.patch("pages/"+this.id(e)+"/slug",{slug:n})},async changeStatus(e,n,s){return t.patch("pages/"+this.id(e)+"/status",{status:n,position:s})},async changeTemplate(e,n){return t.patch("pages/"+this.id(e)+"/template",{template:n})},async changeTitle(e,n){return t.patch("pages/"+this.id(e)+"/title",{title:n})},async children(e,n){return t.post("pages/"+this.id(e)+"/children/search",n)},async create(e,n){return null===e||"/"===e?t.post("site/children",n):t.post("pages/"+this.id(e)+"/children",n)},async delete(e,n){return t.delete("pages/"+this.id(e),n)},async duplicate(e,n,s){return t.post("pages/"+this.id(e)+"/duplicate",{slug:n,children:s.children||!1,files:s.files||!1})},async get(e,n){let s=await t.get("pages/"+this.id(e),n);return!0===Array.isArray(s.content)&&(s.content={}),s},id:t=>!0===t.startsWith("/@/page/")?t.replace("/@/page/","@"):!0===t.startsWith("page://")?t.replace("page://","@"):t.replace(/\//g,"+"),async files(e,n){return t.post("pages/"+this.id(e)+"/files/search",n)},link(t){return"/"+this.url(t)},async preview(t){return(await this.get(this.id(t),{select:"previewUrl"})).previewUrl},async search(e,n){return e?t.post("pages/"+this.id(e)+"/children/search?select=id,title,hasChildren",n):t.post("site/children/search?select=id,title,hasChildren",n)},async update(e,n){return t.patch("pages/"+this.id(e),n)},url(t,e){let n=null===t?"pages":"pages/"+String(t).replace(/\//g,"+");return e&&(n+="/"+e),n}});class Dr extends Error{constructor(t,{request:e,response:n,cause:s}){super(n.json.message||t,{cause:s}),this.request=e,this.response=n}state(){return this.response.json}}class Br extends Dr{}class Pr extends Dr{state(){return{message:this.message,text:this.response.text}}}const Fr=t=>(window.location.href=xr(t),!1),Nr=async(t,e={})=>{var n;(e={cache:"no-store",credentials:"same-origin",mode:"same-origin",...e}).body=((n=e.body)instanceof HTMLFormElement&&(n=new FormData(n)),n instanceof FormData&&(n=Object.fromEntries(n)),"object"==typeof n?JSON.stringify(n):n),e.headers=((t={},e={})=>{return{"content-type":"application/json","x-csrf":e.csrf??!1,"x-fiber":!0,"x-fiber-globals":(n=e.globals,!!n&&(!1===Array.isArray(n)?String(n):n.join(","))),"x-fiber-referrer":e.referrer??!1,...V(t)};var n})(e.headers,e),e.url=yr(t,e.query);const s=new Request(e.url,e);return!1===wr(s.url)?Fr(s.url):await qr(s,await fetch(s))},qr=async(t,e)=>{var n;if(!1===e.headers.get("Content-Type").includes("application/json"))return Fr(e.url);try{e.text=await e.text(),e.json=JSON.parse(e.text)}catch(s){throw new Pr("Invalid JSON response",{cause:s,request:t,response:e})}if(401===e.status)throw new Br("Unauthenticated",{request:t,response:e});if("error"===(null==(n=e.json)?void 0:n.status))throw e.json;if(!1===e.ok)throw new Dr(`The request to ${e.url} failed`,{request:t,response:e});return{request:t,response:e}},Rr=t=>({blueprint:async e=>t.get("users/"+e+"/blueprint"),blueprints:async(e,n)=>t.get("users/"+e+"/blueprints",{section:n}),changeEmail:async(e,n)=>t.patch("users/"+e+"/email",{email:n}),changeLanguage:async(e,n)=>t.patch("users/"+e+"/language",{language:n}),changeName:async(e,n)=>t.patch("users/"+e+"/name",{name:n}),changePassword:async(e,n)=>t.patch("users/"+e+"/password",{password:n}),changeRole:async(e,n)=>t.patch("users/"+e+"/role",{role:n}),create:async e=>t.post("users",e),delete:async e=>t.delete("users/"+e),deleteAvatar:async e=>t.delete("users/"+e+"/avatar"),link(t,e){return"/"+this.url(t,e)},async list(e){return t.post(this.url(null,"search"),e)},get:async(e,n)=>t.get("users/"+e,n),async roles(e){return(await t.get(this.url(e,"roles"))).data.map((t=>({info:t.description||`(${window.panel.$t("role.description.placeholder")})`,text:t.title,value:t.name})))},search:async e=>t.post("users/search",e),update:async(e,n)=>t.patch("users/"+e,n),url(t,e){let n=t?"users/"+t:"users";return e&&(n+="/"+e),n}}),zr=t=>{const e={csrf:t.system.csrf,endpoint:pr(t.urls.api,"/"),methodOverwrite:!0,ping:null,requests:[],running:0},n=()=>{clearInterval(e.ping),e.ping=setInterval(e.auth.ping,3e5)};return e.request=async(s,i={},o=!1)=>{const l=s+"/"+JSON.stringify(i);e.requests.push(l),!1===o&&(t.isLoading=!0),e.language=t.language.code;try{return await(t=>async(e,n={})=>{n={cache:"no-store",credentials:"same-origin",mode:"same-origin",headers:{"content-type":"application/json","x-csrf":t.csrf,"x-language":t.language,...V(n.headers??{})},...n},t.methodOverwrite&&"GET"!==n.method&&"POST"!==n.method&&(n.headers["x-http-method-override"]=n.method,n.method="POST"),n.url=pr(t.endpoint,"/")+"/"+dr(e,"/");const s=new Request(n.url,n),{response:i}=await qr(s,await fetch(s));let o=i.json;return o.data&&"model"===o.type&&(o=o.data),o})(e)(s,i)}finally{n(),e.requests=e.requests.filter((t=>t!==l)),0===e.requests.length&&(t.isLoading=!1)}},e.auth=(t=>({async login(e){const n={long:e.remember||!1,email:e.email,password:e.password};return t.post("auth/login",n)},logout:async()=>t.post("auth/logout"),ping:async()=>t.post("auth/ping"),user:async e=>t.get("auth",e),verifyCode:async e=>t.post("auth/code",{code:e})}))(e),e.delete=(t=>async(e,n,s,i=!1)=>t.post(e,n,s,"DELETE",i))(e),e.files=Er(e),e.get=(t=>async(e,n,s,i=!1)=>(n&&(e+="?"+Object.keys(n).filter((t=>void 0!==n[t]&&null!==n[t])).map((t=>t+"="+n[t])).join("&")),t.request(e,Object.assign(s||{},{method:"GET"}),i)))(e),e.languages=(t=>({create:async e=>t.post("languages",e),delete:async e=>t.delete("languages/"+e),get:async e=>t.get("languages/"+e),list:async()=>t.get("languages"),update:async(e,n)=>t.patch("languages/"+e,n)}))(e),e.pages=Lr(e),e.patch=(t=>async(e,n,s,i=!1)=>t.post(e,n,s,"PATCH",i))(e),e.post=(t=>async(e,n,s,i="POST",o=!1)=>t.request(e,Object.assign(s||{},{method:i,body:JSON.stringify(n)}),o))(e),e.roles=(t=>({list:async e=>t.get("roles",e),get:async e=>t.get("roles/"+e)}))(e),e.system=(t=>({get:async(e={view:"panel"})=>t.get("system",e),install:async e=>(await t.post("system/install",e)).user,register:async e=>t.post("system/register",e)}))(e),e.site=(t=>({blueprint:async()=>t.get("site/blueprint"),blueprints:async()=>t.get("site/blueprints"),changeTitle:async e=>t.patch("site/title",{title:e}),children:async e=>t.post("site/children/search",e),get:async(e={view:"panel"})=>t.get("site",e),update:async e=>t.post("site",e)}))(e),e.translations=(t=>({list:async()=>t.get("translations"),get:async e=>t.get("translations/"+e)}))(e),e.users=Rr(e),n(),e},Yr=()=>({addEventListener(t,e){"function"==typeof e&&(this.on[t]=e)},addEventListeners(t){if(!1!==H(t))for(const e in t)this.addEventListener(e,t[e])},emit(t,...e){return this.hasEventListener(t)?this.on[t](...e):()=>{}},hasEventListener(t){return"function"==typeof this.on[t]},on:{}}),Hr=(t,e={})=>({...e,key:()=>t,defaults:()=>e,reset(){return this.set(this.defaults())},set(t){this.validateState(t);for(const e in this.defaults())this[e]=t[e]??this.defaults()[e];return this.state()},state(){const t={};for(const e in this.defaults())t[e]=this[e]??this.defaults()[e];return t},validateState(t){if(!1===H(t))throw new Error(`Invalid ${this.key()} state`);return!0}}),Ur=(t,e,n)=>{const s=Hr(e,n);return{...s,...Yr(),hasSubmitter(){return!0===this.hasEventListener("submit")||"string"==typeof this.path},async load(e,n={}){return!0!==n.silent&&(this.isLoading=!0),await t.open(e,n),this.isLoading=!1,this.addEventListeners(n.on),this.state()},async open(t,e={}){return"function"==typeof e&&(e={on:{submit:e}}),!0===_r(t)?this.load(t,e):(this.set(t),this.addEventListeners(e.on),this.emit("open",t,e),this.state())},async post(e,n={}){var s;if(!this.path)throw new Error(`The ${this.key()} cannot be posted`);this.isLoading=!0,e=e??(null==(s=this.props)?void 0:s.value)??{};try{return await t.post(this.path,e,n)}catch(i){t.error(i)}finally{this.isLoading=!1}return!1},async refresh(e={}){e.url=e.url??this.url();const n=(await t.get(e.url,e))["$"+this.key()];if(n&&n.component===this.component)return this.props=n.props,this.state()},async reload(t={}){if(!this.path)return!1;this.open(this.url(),t)},set(t){return s.set.call(this,t),this.on={},this.addEventListeners(t.on??{}),this.state()},url(){return t.url(this.path,this.query)}}},Vr=(t,e,n)=>{const s=Ur(t,e,n);return{...s,async cancel(){this.isOpen&&this.emit("cancel"),this.close()},async close(){var t;null==(t=this.ref)||t.hide(),this.isOpen&&this.emit("close"),this.reset()},focus(t){er(`.k-${this.key()}-portal`,t)},input(t){!1!==this.isOpen&&(this.props.value=t,this.emit("input",t))},async open(t,e={}){return t instanceof window.Vue?this.openComponent(t):this.openState(t,e)},async openComponent(t){const e=await this.openState({component:t.$options._componentTag,legacy:!0,props:{...t.$attrs,...t.$props},on:t.$listeners,ref:t});return t.show(),e},async openState(e,n){return!1===this.isOpen&&t.notification.close(),await s.open.call(this,e,n),this.isOpen=!0,this.state()},async submit(t,e={}){if(!1===this.hasSubmitter())return console.warn(`There's no ${this.key()} submitter`),this.close();let n;return n=this.hasEventListener("submit")?await this.emit("submit",t??this.value,e):await this.post(t??this.value,e),!1===H(n)?n:this.success(n["$"+this.key()]??{})},success(e){return"string"==typeof e&&t.notification.success(e),this.close(),this.successNotification(e),this.successEvents(e),this.successDispatch(e),e.route||e.redirect?this.successRedirect(e):t.view.reload(e.reload),e},successDispatch(e){if(!1!==H(e.dispatch))for(const n in e.dispatch){const s=e.dispatch[n];t.app.$store.dispatch(n,!0===Array.isArray(s)?[...s]:s)}},successEvents(e){if(e.event){const n=Array.wrap(e.event);for(const s of n)"string"==typeof s&&t.events.emit(s,e)}!1!==e.emit&&t.events.emit("success",e)},successNotification(e){e.message&&t.notification.success(e.message)},successRedirect(e){const n=e.route??e.redirect;return!!n&&("string"==typeof n?t.open(n):t.open(n.url,n.options))},get value(){var t;return null==(t=this.props)?void 0:t.value}}},Kr=()=>({...Hr("drag",{type:null,data:{}}),get isDragging(){return null!==this.type},start(t,e){this.type=t,this.data=e},stop(){this.type=null,this.data={}}}),Wr=t=>{const e=Vr(t,"drawer",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,isOpen:!1,legacy:!1,ref:null,parent:null,tabId:null});return t.events.on("drawer.save",(e=>{e.preventDefault(),t.drawer.submit()})),{...e,get breadcrumb(){const t=[];let e=this;for(;null!==e;)t.push(e.props),e=e.parent;return t.reverse()},goTo(t){let e=this;for(;null!==e;){if(e.props.id===t)return this.openState(e);e=e.parent}},get icon(){return this.props.icon??"box"},async open(t,n={}){const s=!0===this.isOpen?this.state():null;return await e.open.call(this,t,n),this.path!==(null==s?void 0:s.path)&&(this.parent=s),this.openTab(),this.state()},openTab(t){if(!(t=t||Object.keys(this.tabs)[0]))return!1;this.tabId=t,this.emit("openTab",t)},get tab(){return this.tabs[this.tabId]??null},get tabs(){var t;return(null==(t=this.props)?void 0:t.tabs)??{}},get title(){return this.props.title}}},Jr=t=>{const e=Ur(t,"dropdown",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null});return{...e,close(){this.emit("close"),this.reset()},options(){return!1===Array.isArray(this.props.options)?[]:this.props.options.map((e=>e.dialog?(e.click=()=>{const n="string"==typeof e.dialog?e.dialog:e.dialog.url,s="object"==typeof e.dialog?e.dialog:{};return t.app.$dialog(n,s)},e):e))},set(t){return t.options&&(t.props={options:t.options}),e.set.call(this,t)}}},Gr=t=>{const e=D();e.on("keydown.cmd.s",(n=>{e.emit(t.context+".save",n)})),e.on("keydown.cmd.shift.f",(()=>t.search())),e.on("keydown.cmd./",(()=>t.search()));const n={document:{blur:!0,click:!1,copy:!0,focus:!0,paste:!0},window:{dragenter:!1,dragexit:!1,dragleave:!1,dragover:!1,drop:!1,keydown:!1,keyup:!1,offline:!1,online:!1,popstate:!1}};return{blur(t){this.emit("blur",t)},click(t){this.emit("click",t)},copy(t){this.emit("copy",t)},dragenter(t){this.entered=t.target,this.prevent(t),this.emit("dragenter",t)},dragexit(t){this.prevent(t),this.entered=null,this.emit("dragexit",t)},dragleave(t){this.prevent(t),this.entered===t.target&&(this.entered=null,this.emit("dragleave",t))},dragover(t){this.prevent(t),this.emit("dragover",t)},drop(t){this.prevent(t),this.entered=null,this.emit("drop",t)},emit:e.emit,entered:null,focus(t){this.emit("focus",t)},keychain(t,e){let n=[t];(e.metaKey||e.ctrlKey)&&n.push("cmd"),!0===e.altKey&&n.push("alt"),!0===e.shiftKey&&n.push("shift");let s=e.key?cr(e.key):null;const i={escape:"esc",arrowUp:"up",arrowDown:"down",arrowLeft:"left",arrowRight:"right"};return i[s]&&(s=i[s]),s&&!1===["alt","control","shift","meta"].includes(s)&&n.push(s),n.join(".")},keydown(t){this.emit(this.keychain("keydown",t),t),this.emit("keydown",t)},keyup(t){this.emit(this.keychain("keyup",t),t),this.emit("keyup",t)},off:e.off,offline(t){this.emit("offline",t)},on:e.on,online(t){this.emit("online",t)},paste(t){this.emit("paste",t)},popstate(t){this.emit("popstate",t)},prevent(t){t.stopPropagation(),t.preventDefault()},subscribe(){for(const t in n.document)document.addEventListener(t,this[t].bind(this),n.document[t]);for(const t in n.window)window.addEventListener(t,this[t].bind(this),n.window[t])},unsubscribe(){for(const t in n.document)document.removeEventListener(t,this[t]);for(const t in n.window)window.removeEventListener(t,this[t])},$on:e.on,$emit:e.emit,$off:e.off}},Zr={interval:null,start(t,e){this.stop(),t&&(this.interval=setInterval(e,t))},stop(){clearInterval(this.interval),this.interval=null}},Qr=(t={})=>({...Hr("notification",{context:null,details:null,isOpen:!1,message:null,timeout:null,type:null}),close(){return this.timer.stop(),this.reset(),this.state()},deprecated(t){console.warn("Deprecated: "+t)},error(e){if(e instanceof Br&&t.user.id)return t.redirect("logout");if(e instanceof Pr)return this.fatal(e);if(e instanceof Dr){const t=Object.values(e.response.json).find((t=>"string"==typeof(null==t?void 0:t.error)));t&&(e.message=t.error)}return"string"==typeof e&&(e={message:e,type:"error"}),e={message:e.message??"Something went wrong",details:e.details??{}},"view"===t.context&&t.dialog.open({component:"k-error-dialog",props:e,type:"error"}),this.open({message:e.message,type:"error"})},get icon(){return"success"===this.type?"check":"alert"},get isFatal(){return"fatal"===this.type},fatal(t){return"string"==typeof t?this.open({message:t,type:"fatal"}):t instanceof Pr?this.open({message:t.response.text,type:"fatal"}):this.open({message:t.message??"Something went wrong",type:"fatal"})},open(e){return this.timer.stop(),"string"==typeof e?this.success(e):(this.set({context:t.context,...e}),this.isOpen=!0,this.timer.start(this.timeout,(()=>this.close())),this.state())},success(t){return t||(t={}),"string"==typeof t&&(t={message:t}),this.open({timeout:4e3,type:"success",...t})},get theme(){return"error"===this.type?"negative":"positive"},timer:Zr}),Xr=()=>({...Hr("language",{code:null,default:!1,direction:"ltr",name:null,rules:[]}),get isDefault(){return this.default}}),ta=(t,e,n)=>{if(!n.template&&!n.render&&!n.extends)throw new Error(`Neither template nor render method provided. Nor extending a component when loading plugin component "${e}". The component has not been registered.`);return(n=ea(t,e,n)).template&&(n.render=null),n=na(n),!0===sr(e)&&window.console.warn(`Plugin is replacing "${e}"`),t.component(e,n),n},ea=(t,e,n)=>"string"!=typeof(null==n?void 0:n.extends)?n:!1===sr(n.extends)?(window.console.warn(`Problem with plugin trying to register component "${e}": cannot extend non-existent component "${n.extends}"`),n.extends=null,n):(n.extends=t.options.components[n.extends].extend({options:n,components:{...t.options.components,...n.components??{}}}),n),na=t=>{if(!1===Array.isArray(t.mixins))return t;const e={section:hl};return t.mixins=t.mixins.map((t=>"string"==typeof t?e[t]:t)),t},sa=(t,e={})=>((e={components:{},created:[],icons:{},login:null,textareaButtons:{},use:[],thirdParty:{},writerMarks:{},writerNodes:{},...e}).use=((t,e)=>{if(!1===Array.isArray(e))return[];for(const n of e)t.use(n);return e})(t,e.use),e.components=((t,e)=>{if(!1===H(e))return;const n={};for(const[i,o]of Object.entries(e))try{n[i]=ta(t,i,o)}catch(s){window.console.warn(s.message)}return n})(t,e.components),e),ia=()=>{const t=Hr("translation",{code:null,data:{},direction:"ltr",name:null});return{...t,set(e){return t.set.call(this,e),document.documentElement.lang=this.code,document.body.dir=this.direction,this.state()},translate(t,e,n=null){if("string"!=typeof t)return;const s=this.data[t]??n;return"string"!=typeof s?s:hr(s,e)}}},oa=t=>{const e=Hr("upload",{accept:"*",attributes:{},files:[],max:null,multiple:!0,replacing:null,url:null});return{...e,...Yr(),input:null,cancel(){this.emit("cancel"),this.completed.length>0&&(this.emit("complete",this.completed),t.view.reload()),this.reset()},get completed(){return this.files.filter((t=>t.completed)).map((t=>t.model))},done(){t.dialog.close(),this.completed.length>0&&(this.emit("done",this.completed),t.notification.success({context:"view"}),t.view.reload()),this.reset()},file(t){const e=URL.createObjectURL(t);return{completed:!1,error:null,extension:Zl(t.name),filename:t.name,id:fr(),model:null,name:Ql(t.name),niceSize:Xl(t.size),progress:0,size:t.size,src:t,type:t.type,url:e}},open(e,n){e instanceof FileList?(this.set(n),this.select(e)):this.set(e);const s={component:"k-upload-dialog",on:{cancel:()=>this.cancel(),submit:()=>this.start()}};this.replacing&&(s.component="k-upload-replace-dialog",s.props={original:this.replacing}),t.dialog.open(s)},pick(t){this.set(t),this.input=document.createElement("input"),this.input.type="file",this.input.classList.add("sr-only"),this.input.value=null,this.input.accept=this.accept,this.input.multiple=this.multiple,this.input.click(),this.input.addEventListener("change",(e=>{!0===t.immediate?(this.set(t),this.select(e.target.files),this.start()):this.open(e.target.files,t),this.input.remove()}))},remove(t){this.files=this.files.filter((e=>e.id!==t))},replace(e,n){this.pick({...n,url:t.urls.api+"/"+e.link,accept:"."+e.extension+","+e.mime,multiple:!1,replacing:e})},reset(){e.reset.call(this),this.files.splice(0)},select(t,e){if(this.set(e),t instanceof Event&&(t=t.target.files),t instanceof FileList==!1)throw new Error("Please provide a FileList");t=(t=[...t]).map((t=>this.file(t))),this.files=[...this.files,...t],this.files=this.files.filter(((t,e)=>this.files.findLastIndex((e=>e.src.name===t.src.name&&e.src.type===t.src.type&&e.src.size===t.src.size&&e.src.lastModified===t.src.lastModified))===e)),null!==this.max&&(this.files=this.files.slice(-1*this.max)),this.emit("select",this.files)},set(t){if(t)return e.set.call(this,t),this.on={},this.addEventListeners(t.on||{}),1===this.max&&(this.multiple=!1),!1===this.multiple&&(this.max=1),this.state()},start(){var e;if(!this.url)throw new Error("The upload URL is missing");if(0!==this.files.length){if(this.files.length===this.completed.length)return this.done();for(const n of this.files){if(!0===n.completed)continue;n.error=null,n.progress=0;this.files.filter((t=>t.name===n.name&&t.extension===n.extension)).length>1?n.error=t.t("error.file.name.unique"):(kr(n.src,{attributes:this.attributes,headers:{"x-csrf":t.system.csrf},filename:n.name+"."+n.extension,url:this.url,error:(e,s,i)=>{t.error(i,!1),n.error=i.message,n.progress=0},progress:(t,e,s)=>{n.progress=s},success:(t,e,s)=>{n.completed=!0,n.model=s.data,this.files.length===this.completed.length&&this.done()}}),void 0!==(null==(e=this.attributes)?void 0:e.sort)&&this.attributes.sort++)}}}}},la=t=>{const e=Ur(t,"view",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,breadcrumb:[],breadcrumbLabel:null,icon:null,id:null,link:null,search:"pages",title:null});return{...e,set(n){e.set.call(this,n),t.title=this.title;const s=this.url().toString();window.location.toString()!==s&&window.history.pushState(null,null,s)},async submit(){throw new Error("Not yet implemented")}}},ra={config:{},languages:[],license:!1,menu:[],multilang:!1,permissions:{},searches:{},urls:{}},aa=["dialog","drawer"],ua=["dropdown","language","notification","system","translation","user"],ca={create(t={}){var e;return this.isLoading=!1,this.drag=Kr(),this.events=Gr(this),this.upload=oa(this),this.language=Xr(),this.notification=Qr(this),this.system=Hr("system",{ascii:{},csrf:null,isLocal:null,locales:{},slugs:[],title:null}),this.translation=ia(),this.user=Hr("user",{email:null,id:null,language:null,role:null,username:null}),this.dropdown=Jr(this),this.view=la(this),this.drawer=Wr(this),this.dialog=((e=this).events.on("dialog.save",(t=>{var n;null==(n=null==t?void 0:t.preventDefault)||n.call(t),e.dialog.submit()})),Vr(e,"dialog",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,isOpen:!1,legacy:!1,ref:null})),this.redirect=Fr,this.reload=this.view.reload.bind(this.view),this.t=this.translation.translate.bind(this.translation),this.plugins=sa(window.Vue,t),this.set(window.fiber),this.api=zr(this),Vue.reactive(this)},get context(){return this.dialog.isOpen?"dialog":this.drawer.isOpen?"drawer":"view"},get debug(){return!0===this.config.debug},get direction(){return this.translation.direction},error(t,e=!0){if(!0===this.debug&&console.error(t),!0===e)return this.notification.error(t)},async get(t,e={}){const{response:n}=await this.request(t,{method:"GET",...e});return n.json},async open(t,e={}){try{if(!1===_r(t))this.set(t);else{this.isLoading=!0;const n=await this.get(t,e);this.set(n),this.isLoading=!1}return this.state()}catch(n){return this.error(n)}},async post(t,e={},n={}){const{response:s}=await this.request(t,{method:"POST",body:e,...n});return s.json},async request(t,e={}){return Nr(t,{referrer:this.view.path,csrf:this.system.csrf,...e})},async search(t,e,n){if(!t&&!e)return this.dialog.open({component:"k-search-dialog"});const{$search:s}=await this.get(`/search/${t}`,{query:{query:e,...n}});return s},set(t={}){t=Object.fromEntries(Object.entries(t).map((([t,e])=>[t.replace("$",""),e])));for(const e in ra){const n=t[e]??this[e]??ra[e];typeof n==typeof ra[e]&&(this[e]=n)}for(const e of ua)!0===H(t[e])&&this[e].set(t[e]);for(const e of aa)!0===H(t[e])?this[e].open(t[e]):void 0!==t[e]&&this[e].close(t[e]);!0===H(t.dropdown)?this.dropdown.open(t.dropdown):void 0!==t.dropdown&&this.dropdown.close(),!0===H(t.view)&&this.view.open(t.view)},state(){const t={};for(const e in ra)t[e]=this[e]??ra[e];for(const e of ua)t[e]=this[e].state();for(const e of aa)t[e]=this[e].state();return t.dropdown=this.dropdown.state(),t.view=this.view.state(),t},get title(){return document.title},set title(t){!1===ur(this.system.title)&&(t+=" | "+this.system.title),document.title=t},url:(t="",e={},n)=>yr(t,e,n)},da=(t,e)=>{localStorage.setItem("kirby$content$"+t,JSON.stringify(e))},pa={namespaced:!0,state:{current:null,models:{},status:{enabled:!0}},getters:{exists:t=>e=>Object.hasOwn(t.models,e),hasChanges:(t,e)=>t=>U(e.model(t).changes)>0,isCurrent:t=>e=>t.current===e,id:t=>e=>(e=e||t.current)+"?language="+window.panel.language.code,model:(t,e)=>n=>(n=n||t.current,!0===e.exists(n)?t.models[n]:{api:null,originals:{},values:{},changes:{}}),originals:(t,e)=>t=>Y(e.model(t).originals),values:(t,e)=>t=>({...e.originals(t),...e.changes(t)}),changes:(t,e)=>t=>Y(e.model(t).changes)},mutations:{CLEAR(t){Object.keys(t.models).forEach((e=>{t.models[e].changes={}})),Object.keys(localStorage).forEach((t=>{t.startsWith("kirby$content$")&&localStorage.removeItem(t)}))},CREATE(t,[e,n]){if(!n)return!1;let s=t.models[e]?t.models[e].changes:n.changes;Vue.set(t.models,e,{api:n.api,originals:n.originals,changes:s||{}})},CURRENT(t,e){t.current=e},MOVE(t,[e,n]){const s=Y(t.models[e]);Vue.del(t.models,e),Vue.set(t.models,n,s);const i=localStorage.getItem("kirby$content$"+e);localStorage.removeItem("kirby$content$"+e),localStorage.setItem("kirby$content$"+n,i)},REMOVE(t,e){Vue.del(t.models,e),localStorage.removeItem("kirby$content$"+e)},REVERT(t,e){t.models[e]&&(Vue.set(t.models[e],"changes",{}),localStorage.removeItem("kirby$content$"+e))},STATUS(t,e){Vue.set(t.status,"enabled",e)},UPDATE(t,[e,n,s]){if(!t.models[e])return!1;void 0===s&&(s=null),s=Y(s);const i=JSON.stringify(s);JSON.stringify(t.models[e].originals[n]??null)==i?Vue.del(t.models[e].changes,n):Vue.set(t.models[e].changes,n,s),da(e,{api:t.models[e].api,originals:t.models[e].originals,changes:t.models[e].changes})}},actions:{init(t){Object.keys(localStorage).filter((t=>t.startsWith("kirby$content$"))).map((t=>t.split("kirby$content$")[1])).forEach((e=>{const n=localStorage.getItem("kirby$content$"+e);t.commit("CREATE",[e,JSON.parse(n)])})),Object.keys(localStorage).filter((t=>t.startsWith("kirby$form$"))).map((t=>t.split("kirby$form$")[1])).forEach((e=>{const n=localStorage.getItem("kirby$form$"+e);let s=null;try{s=JSON.parse(n)}catch(o){}if(!s||!s.api)return localStorage.removeItem("kirby$form$"+e),!1;const i={api:s.api,originals:s.originals,changes:s.values};t.commit("CREATE",[e,i]),da(e,i),localStorage.removeItem("kirby$form$"+e)}))},clear(t){t.commit("CLEAR")},create(t,e){const n=Y(e.content);Array.isArray(e.ignore)&&e.ignore.forEach((t=>delete n[t])),e.id=t.getters.id(e.id);const s={api:e.api,originals:n,changes:{}};t.commit("CREATE",[e.id,s]),t.dispatch("current",e.id)},current(t,e){t.commit("CURRENT",e)},disable(t){t.commit("STATUS",!1)},enable(t){t.commit("STATUS",!0)},move(t,[e,n]){e=t.getters.id(e),n=t.getters.id(n),t.commit("MOVE",[e,n])},remove(t,e){t.commit("REMOVE",e),t.getters.isCurrent(e)&&t.commit("CURRENT",null)},revert(t,e){e=e||t.state.current,t.commit("REVERT",e)},async save(t,e){if(e=e||t.state.current,t.getters.isCurrent(e)&&!1===t.state.status.enabled)return!1;t.dispatch("disable");const n=t.getters.model(e),s={...n.originals,...n.changes};try{await window.panel.api.patch(n.api,s),t.commit("CREATE",[e,{...n,originals:s}]),t.dispatch("revert",e)}finally{t.dispatch("enable")}},update(t,[e,n,s]){if(s=s||t.state.current,null===e)for(const i in n)t.commit("UPDATE",[s,i,n[i]]);else t.commit("UPDATE",[s,e,n])}}},ha={namespaced:!0,actions:{close(t,e){window.panel.drawer.close(e)},goto(t,e){window.panel.drawer.goto(e)},open(t,e){window.panel.drawer.goto(e)}}},ma={namespaced:!0,actions:{close(){window.panel.notification.close()},deprecated(t,e){window.panel.notification.deprecated(e)},error(t,e){window.panel.notification.error(e)},open(t,e){window.panel.notification.open(e)},success(t,e){window.panel.notification.success(e)}}};Vue.use(B);const fa=new B.Store({strict:!1,actions:{dialog(t,e){window.panel.dialog.open(e)},drag(t,e){window.panel.drag.start(...e)},fatal(t,e){window.panel.notification.fatal(e)},isLoading(t,e){window.panel.isLoading=e},navigate(){window.panel.dialog.close(),window.panel.drawer.close()}},modules:{content:pa,drawers:ha,notification:ma}});Vue.config.productionTip=!1,Vue.config.devtools=!0,Vue.use(Or),Vue.use(jr),Vue.use(P),Vue.use(zl),window.panel=Vue.prototype.$panel=ca.create(window.panel.plugins),Vue.prototype.$go=window.panel.view.open.bind(window.panel.view),Vue.prototype.$reload=window.panel.reload.bind(window.panel),window.panel.app=new Vue({store:fa,render:()=>Vue.h(q)}),Vue.use(Ar),Vue.use(Yl),Vue.use(Tr),!1===CSS.supports("selector(:has(*))")&&N((()=>import("./css-has-polyfill.js")),[]).then((({default:t})=>{t(document)})),!1===CSS.supports("container")&&N((()=>import("./container-query-polyfill.modern.js")),[]),window.panel.app.$mount("#app"); diff --git a/panel/dist/js/vendor.js b/panel/dist/js/vendor.js index 5d9826a81f..a59517cb7b 100644 --- a/panel/dist/js/vendor.js +++ b/panel/dist/js/vendor.js @@ -1,4 +1,4 @@ -"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e={},n={},r={},i={},o={};function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function l(t){for(var e=1;e=+n}))};var M={};Object.defineProperty(M,"__esModule",{value:!0}),M.default=void 0;var O=(0,r.regex)("email",/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i);M.default=O;var C={};Object.defineProperty(C,"__esModule",{value:!0}),C.default=void 0;var D=r,N=(0,D.withParams)({type:"ipAddress"},(function(t){if(!(0,D.req)(t))return!0;if("string"!=typeof t)return!1;var e=t.split(".");return 4===e.length&&e.every(T)}));C.default=N;var T=function(t){if(t.length>3||0===t.length)return!1;if("0"===t[0]&&"0"!==t)return!1;if(!t.match(/^\d+$/))return!1;var e=0|+t;return e>=0&&e<=255},A={};Object.defineProperty(A,"__esModule",{value:!0}),A.default=void 0;var $=r;A.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:":";return(0,$.withParams)({type:"macAddress"},(function(e){if(!(0,$.req)(e))return!0;if("string"!=typeof e)return!1;var n="string"==typeof t&&""!==t?e.split(t):12===e.length||16===e.length?e.match(/.{2}/g):null;return null!==n&&(6===n.length||8===n.length)&&n.every(E)}))};var E=function(t){return t.toLowerCase().match(/^[0-9a-f]{2}$/)},P={};Object.defineProperty(P,"__esModule",{value:!0}),P.default=void 0;var I=r;P.default=function(t){return(0,I.withParams)({type:"maxLength",max:t},(function(e){return!(0,I.req)(e)||(0,I.len)(e)<=t}))};var R={};Object.defineProperty(R,"__esModule",{value:!0}),R.default=void 0;var _=r;R.default=function(t){return(0,_.withParams)({type:"minLength",min:t},(function(e){return!(0,_.req)(e)||(0,_.len)(e)>=t}))};var z={};Object.defineProperty(z,"__esModule",{value:!0}),z.default=void 0;var j=r,B=(0,j.withParams)({type:"required"},(function(t){return(0,j.req)("string"==typeof t?t.trim():t)}));z.default=B;var V={};Object.defineProperty(V,"__esModule",{value:!0}),V.default=void 0;var F=r;V.default=function(t){return(0,F.withParams)({type:"requiredIf",prop:t},(function(e,n){return!(0,F.ref)(t,this,n)||(0,F.req)(e)}))};var L={};Object.defineProperty(L,"__esModule",{value:!0}),L.default=void 0;var q=r;L.default=function(t){return(0,q.withParams)({type:"requiredUnless",prop:t},(function(e,n){return!!(0,q.ref)(t,this,n)||(0,q.req)(e)}))};var W={};Object.defineProperty(W,"__esModule",{value:!0}),W.default=void 0;var J=r;W.default=function(t){return(0,J.withParams)({type:"sameAs",eq:t},(function(e,n){return e===(0,J.ref)(t,this,n)}))};var K={};Object.defineProperty(K,"__esModule",{value:!0}),K.default=void 0;var H=(0,r.regex)("url",/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i);K.default=H;var Y={};Object.defineProperty(Y,"__esModule",{value:!0}),Y.default=void 0;var U=r;Y.default=function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&e.reduce((function(e,n){return e||n.apply(t,r)}),!1)}))};var G={};Object.defineProperty(G,"__esModule",{value:!0}),G.default=void 0;var Z=r;G.default=function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&e.reduce((function(e,n){return e&&n.apply(t,r)}),!0)}))};var X={};Object.defineProperty(X,"__esModule",{value:!0}),X.default=void 0;var Q=r;X.default=function(t){return(0,Q.withParams)({type:"not"},(function(e,n){return!(0,Q.req)(e)||!t.call(this,e,n)}))};var tt={};Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var et=r;tt.default=function(t){return(0,et.withParams)({type:"minValue",min:t},(function(e){return!(0,et.req)(e)||(!/\s/.test(e)||e instanceof Date)&&+e>=+t}))};var nt={};Object.defineProperty(nt,"__esModule",{value:!0}),nt.default=void 0;var rt=r;nt.default=function(t){return(0,rt.withParams)({type:"maxValue",max:t},(function(e){return!(0,rt.req)(e)||(!/\s/.test(e)||e instanceof Date)&&+e<=+t}))};var it={};Object.defineProperty(it,"__esModule",{value:!0}),it.default=void 0;var ot=(0,r.regex)("integer",/(^[0-9]*$)|(^-[0-9]+$)/);it.default=ot;var st={};Object.defineProperty(st,"__esModule",{value:!0}),st.default=void 0;var lt=(0,r.regex)("decimal",/^[-]?\d*(\.\d+)?$/);function at(t){this.content=t}function ct(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){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let t=0;i.text[t]==o.text[t];t++)n++;return n}if(i.content.size||o.content.size){let t=ct(i.content,o.content,n+1);if(null!=t)return t}n+=i.nodeSize}else n+=i.nodeSize}}function ht(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),a=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let t=0,e=Math.min(s.text.length,l.text.length);for(;t>1}},at.from=function(t){if(t instanceof at)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new at(e)};class ut{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let n=0;nt&&!1!==n(l,r+s,i||null,o)&&l.content.size){let i=s+1;l.nodesBetween(Math.max(0,t-i),Math.min(l.content.size,e-i),n,r+i)}s=a}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let i="",o=!0;return this.nodesBetween(t,e,((s,l)=>{s.isText?(i+=s.text.slice(Math.max(t,l)-l,e-l),o=!n):s.isLeaf?(r?i+="function"==typeof r?r(s):r:s.type.spec.leafText&&(i+=s.type.spec.leafText(s)),o=!n):!o&&s.isBlock&&(i+=n,o=!0)}),0),i}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),i=1);it)for(let i=0,o=0;ot&&((oe)&&(s=s.isText?s.cut(Math.max(0,t-o),Math.min(s.text.length,e-o)):s.cut(Math.max(0,t-o-1),Math.min(s.content.size,e-o-1))),n.push(s),r+=s.nodeSize),o=l}return new ut(n,r)}cutByIndex(t,e){return t==e?ut.empty:0==t&&e==this.content.length?this:new ut(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),i=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new ut(r,i)}addToStart(t){return new ut([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new ut(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;ethis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=t)return i==t||e>0?ft(n+1,i):ft(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((t=>t.toJSON())):null}static fromJSON(t,e){if(!e)return ut.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new ut(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return ut.empty;let e,n=0;for(let r=0;rthis.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;et.type.rank-e.type.rank)),e}}mt.none=[];class gt extends Error{}class yt{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=wt(this.content,t+this.openStart,e);return n&&new yt(n,this.openStart,this.openEnd)}removeBetween(t,e){return new yt(vt(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return yt.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new yt(ut.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let i=t.firstChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)r++;return new yt(t,n,r)}}function vt(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(vt(o.content,e-i-1,n-i-1)))}function wt(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=wt(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function bt(t,e,n){if(n.openStart>t.depth)throw new gt("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new gt("Inconsistent open depths");return xt(t,e,n,0)}function xt(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0;i--)r=e.node(i).copy(ut.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return Ct(o,Dt(t,i,s,e,r))}{let r=t.parent,i=r.content;return Ct(r,i.cut(0,t.parentOffset).append(n.content).append(i.cut(e.parentOffset)))}}return Ct(o,Nt(t,e,r))}function St(t,e){if(!e.type.compatibleContent(t.type))throw new gt("Cannot join "+e.type.name+" onto "+t.type.name)}function kt(t,e,n){let r=t.node(n);return St(r,e.node(n)),r}function Mt(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Ot(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&&(Mt(t.nodeAfter,r),o++));for(let l=o;li&&kt(t,e,i+1),s=r.depth>i&&kt(n,r,i+1),l=[];return Ot(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(St(o,s),Mt(Ct(o,Dt(t,e,n,r,i+1)),l)):(o&&Mt(Ct(o,Nt(t,e,i+1)),l),Ot(e,n,i,l),s&&Mt(Ct(s,Nt(n,r,i+1)),l)),Ot(r,null,i,l),new ut(l)}function Nt(t,e,n){let r=[];if(Ot(null,t,n,r),t.depth>n){Mt(Ct(kt(t,e,n+1),Nt(t,e,n+1)),r)}return Ot(e,null,n,r),new ut(r)}yt.empty=new yt(ut.empty,0,0);class Tt{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let i=0;i0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new Pt(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,i=e;for(let o=t;;){let{index:t,offset:e}=o.content.findIndex(i),s=i-e;if(n.push(o,t,r+e),!s)break;if(o=o.child(t),o.isText)break;i=s-1,r+=e+1}return new Tt(e,n,i)}static resolveCached(t,e){for(let r=0;rt&&this.nodesBetween(t,e,(t=>(n.isInSet(t.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),zt(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=ut.empty,r=0,i=n.childCount){let o=this.contentMatchAt(t).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let l=r;lt.type.name))}`);this.content.forEach((t=>t.check()))}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((t=>t.toJSON()))),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=ut.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}}Rt.prototype.text=void 0;class _t extends Rt{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):zt(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new _t(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new _t(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function zt(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class jt{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new Bt(t,e);if(null==n.next)return jt.empty;let r=Vt(n);n.next&&n.err("Unexpected trailing text");let i=function(t){let e=Object.create(null);return n(Kt(t,0));function n(r){let i=[];r.forEach((e=>{t[e].forEach((({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)}))}))}));let o=e[r.join(",")]=new jt(r.indexOf(t.length-1)>-1);for(let t=0;tt.to=e))}function o(t,e){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(o(n,e))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(e,s),i(o(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return i(o(t.expr,e),s),i(o(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(e)].concat(o(t.expr,e));if("range"==t.type){let s=e;for(let e=0;et.createAndFill())));for(let t=0;t=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function e(n){t.push(n);for(let r=0;r{let r=n+(e.validEnd?"*":" ")+" ";for(let i=0;i"+t.indexOf(e.next[i].next);return r})).join("\n")}}jt.empty=new jt(!0);class Bt{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function Vt(t){let e=[];do{e.push(Ft(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function Ft(t){let e=[];do{e.push(Lt(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function Lt(t){let e=function(t){if(t.eat("(")){let e=Vt(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let t=n[o];t.groups.indexOf(e)>-1&&i.push(t)}0==i.length&&t.err("No node type or group '"+e+"' found");return i}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(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("{"))break;e=Wt(t,e)}return e}function qt(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Wt(t,e){let n=qt(t),r=n;return t.eat(",")&&(r="}"!=t.next?qt(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Jt(t,e){return e-t}function Kt(t,e){let n=[];return function e(r){let i=t[r];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(r);for(let t=0;t-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;er[e]=new t(e,n,i)));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 t in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class Zt{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Xt{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=Ut(r.attrs),this.excluded=null;let i=Ht(this.attrs);this.instance=i?new mt(this,i):null}create(t=null){return!t&&this.instance?this.instance:new mt(this,Yt(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach(((t,i)=>n[t]=new Xt(t,r++,e,i))),n}removeFromSet(t){for(var e=0;e-1}}class Qt{constructor(t){this.cached=Object.create(null);let e=this.spec={};for(let r in t)e[r]=t[r];e.nodes=at.from(t.nodes),e.marks=at.from(t.marks||{}),this.nodes=Gt.compile(this.spec.nodes,this),this.marks=Xt.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let t=this.nodes[r],e=t.spec.content||"",i=t.spec.marks;t.contentMatch=n[e]||(n[e]=jt.parse(e,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.markSet="_"==i?null:i?te(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let r in this.marks){let t=this.marks[r],e=t.spec.excludes;t.excluded=null==e?[t]:""==e?[]:te(this,e.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof Gt))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new _t(n,n.defaultAttrs,t,mt.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return Rt.fromJSON(this,t)}markFromJSON(t){return mt.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function te(t,e){let n=[];for(let r=0;r-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class ee{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)})),this.normalizeLists=!this.tags.some((e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}parse(t,e={}){let n=new le(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new le(this,e,!0);return n.addAll(t,e.from,e.to),yt.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;rt.length&&(61!=o.charCodeAt(t.length)||o.slice(t.length+1)!=e))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r{n(t=ce(t)),t.mark||t.ignore||t.clearMark||(t.mark=r)}))}for(let r in t.nodes){let e=t.nodes[r].spec.parseDOM;e&&e.forEach((t=>{n(t=ce(t)),t.node||t.ignore||t.mark||(t.node=r)}))}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new ee(t,ee.schemaRules(t)))}}const ne={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},re={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ie={ol:!0,ul:!0};function oe(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class se{constructor(t,e,n,r,i,o,s){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=mt.none,this.stashMarks=[],this.match=o||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(ut.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=ut.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(ut.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;e{o.clearMark(t)&&(n=t.addToSet(n))})):e=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(e),!1!==o.consuming)break;i=o}return[e,n]}addElementByRule(t,e,n){let r,i,o;if(e.node)i=this.parser.schema.nodes[e.node],i.isLeaf?this.insertNode(i.create(e.attrs))||this.leafFallback(t):r=this.enter(i,e.attrs||null,e.preserveWhitespace);else{o=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(o)}let s=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((t=>this.insertNode(t)));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(t,e,n){let r=e||0;for(let i=e?t.childNodes[e]:t.firstChild,o=null==n?null:t.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(i);this.findAtPoint(t,r)}findPlace(t){let e,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(t);if(o&&(!e||e.length>o.length)&&(e=o,n=i,!o.length))break;if(i.solid)break}if(!e)return!1;this.sync(n);for(let r=0;rthis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(t,s)=>{for(;t>=0;t--){let l=e[t];if(""==l){if(t==e.length-1||0==t)continue;for(;s>=i;s--)if(o(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!t||t.name!=l&&-1==t.groups.indexOf(l))return!1;s--}}return!0};return o(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(t){let e=function(t,e){for(let n=0;n=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);let e=r.popFromStashMark(t);e&&r.type&&r.type.allowsMarkType(e.type)&&(r.activeMarks=e.addToSet(r.activeMarks))}if(r==e)break}}}function ae(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function ce(t){let e={};for(let n in t)e[n]=t[n];return e}function he(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=t=>{o.push(t);for(let n=0;n{if(i.length||t.marks.length){let n=0,o=0;for(;n=0;r--){let i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&ue.renderSpec(fe(n),r(t,e))}static renderSpec(t,e,n=null){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let r,i=e[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?t.createElementNS(n,i):t.createElement(i),l=e[1],a=1;if(l&&"object"==typeof l&&null==l.nodeType&&!Array.isArray(l)){a=2;for(let t in l)if(null!=l[t]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),l[t]):s.setAttribute(t,l[t])}}for(let c=a;ca)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:o}=ue.renderSpec(t,i,n);if(s.appendChild(e),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new ue(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=de(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return de(t.marks)}}function de(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function fe(t){return t.document||window.document}const pe=Math.pow(2,16);function me(t){return 65535&t}class ge{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class ye{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&ye.empty)return ye.empty}recover(t){let e=0,n=me(t);if(!this.inverted)for(let r=0;rt)break;let a=this.ranges[s+i],c=this.ranges[s+o],h=l+a;if(t<=h){let i=l+r+((a?t==l?-1:t==h?1:e:e)<0?0:c);if(n)return i;let o=t==(e<0?l:h)?null:s/3+(t-l)*pe,u=t==l?2:t==h?1:4;return(e<0?t!=l:t!=h)&&(u|=8),new ge(i,u,o)}r+=c-a}return n?t+r:new ge(t+r,0,null)}touches(t,e){let n=0,r=me(e),i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;st)break;let l=this.ranges[s+i];if(t<=e+l&&s==3*r)return!0;n+=this.ranges[s+o]-l}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new ve;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;ni&&et.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),r),e.openStart,e.openEnd);return xe.fromReplace(t,this.from,this.to,i)}invert(){return new Me(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new ke(e.pos,n.pos,this.mark)}merge(t){return t instanceof ke&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new ke(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ke(e.from,e.to,t.markFromJSON(e.mark))}}be.jsonID("addMark",ke);class Me extends be{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new yt(Se(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return xe.fromReplace(t,this.from,this.to,n)}invert(){return new ke(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new Me(e.pos,n.pos,this.mark)}merge(t){return t instanceof Me&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Me(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Me(e.from,e.to,t.markFromJSON(e.mark))}}be.jsonID("removeMark",Me);class Oe extends be{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return xe.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return xe.fromReplace(t,this.pos,this.pos+1,new yt(ut.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;nn.pos?null:new Ne(e.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ne(e.from,e.to,e.gapFrom,e.gapTo,yt.fromJSON(t,e.slice),e.insert,!!e.structure)}}function Te(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 t=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,i--}}return!1}function Ae(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function $e(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),i=t.$from.index(n),o=t.$to.indexAfter(n);if(no;c--,h--){let t=i.node(c),e=i.index(c);if(t.type.spec.isolating)return!1;let n=t.content.cutByIndex(e,t.childCount),o=r&&r[h]||t;if(o!=t&&(n=n.replaceChild(0,o.type.create(o.attrs))),!t.canReplace(e+1,t.childCount)||!o.type.validContent(n))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function Re(t,e){let n=t.resolve(e),r=n.index();return i=n.nodeBefore,o=n.nodeAfter,!(!i||!o||i.isLeaf||!i.canAppend(o))&&n.parent.canReplace(r,r+1);var i,o}function _e(t,e,n=e,r=yt.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return ze(i,o,r)?new De(e,n,r):new je(i,o,r).fit()}function ze(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}be.jsonID("replaceAround",Ne);class je{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=ut.empty;for(let r=0;r<=t.depth;r++){let e=t.node(r);this.frontier.push({type:e.type,match:e.contentMatchAt(t.indexAfter(r))})}for(let r=t.depth;r>0;r--)this.placed=ut.from(t.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(t<0?this.$to:n.doc.resolve(t));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let l=new yt(i,o,s);return t>-1?new Ne(n.pos,t,this.$to.pos,this.$to.end(),l,e):l.size||n.pos!=this.$to.pos?new De(n.pos,r.pos,l):null}findFittable(){for(let t=1;t<=2;t++)for(let e=this.unplaced.openStart;e>=0;e--){let n,r=null;e?(r=Fe(this.unplaced.content,e-1).firstChild,n=r.content):n=this.unplaced.content;let i=n.firstChild;for(let o=this.depth;o>=0;o--){let n,{type:s,match:l}=this.frontier[o],a=null;if(1==t&&(i?l.matchType(i.type)||(a=l.fillBefore(ut.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:e,frontierDepth:o,parent:r,inject:a};if(2==t&&i&&(n=l.findWrapping(i.type)))return{sliceDepth:e,frontierDepth:o,parent:r,wrap:n};if(r&&l.matchType(r.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Fe(t,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new yt(t,e+1,Math.max(n,r.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Fe(t,e);if(r.childCount<=1&&e>0){let i=t.size-e<=e+r.size;this.unplaced=new yt(Be(t,e-1,1),e-1,i?e-1:n)}else this.unplaced=new yt(Be(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:r,wrap:i}){for(;this.depth>e;)this.closeFrontierNode();if(i)for(let p=0;p1||0==l||t.content.size)&&(h=e,c.push(Le(t.mark(u.allowedMarks(t.marks)),1==a?l:0,a==s.childCount?d:-1)))}let f=a==s.childCount;f||(d=-1),this.placed=Ve(this.placed,e,ut.from(c)),this.frontier[e].match=h,f&&d<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let p=0,m=s;p1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],i=e=0;n--){let{match:e,type:r}=this.frontier[n],i=qe(t,n,r,e,!0);if(!i||i.childCount)continue t}return{depth:e,fit:o,move:i?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Ve(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=Ve(this.placed,this.depth,ut.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(ut.empty,!0);t.childCount&&(this.placed=Ve(this.placed,this.frontier.length,t))}}function Be(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Be(t.firstChild.content,e-1,n)))}function Ve(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ve(t.lastChild.content,e-1,n)))}function Fe(t,e){for(let n=0;n1&&(r=r.replaceChild(0,Le(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ut.empty,!0)))),t.copy(r)}function qe(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&&!function(t,e,n){for(let r=n;rr){let e=i.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(ut.empty,!0))}return t}function Ke(t,e){let n=[];for(let r=Math.min(t.depth,e.depth);r>=0;r--){let i=t.start(r);if(ie.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(i==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==i-1)&&n.push(r)}return n}class He extends be{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return xe.fail("No node at attribute step's position");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,null,e.marks);return xe.fromReplace(t,this.pos,this.pos+1,new yt(ut.from(r),0,e.isLeaf?0:1))}getMap(){return ye.empty}invert(t){return new He(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new He(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new He(e.pos,e.attr,e.value)}}be.jsonID("attr",He);let Ye=class extends Error{};Ye=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(Ye.prototype=Object.create(Error.prototype)).constructor=Ye,Ye.prototype.name="TransformError";class Ue{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ve}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new Ye(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=yt.empty){let r=_e(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new yt(ut.from(n),0,0))}delete(t,e){return this.replace(t,e,yt.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(ze(i,o,r))return t.step(new De(e,n,r));let s=Ke(i,t.doc.resolve(n));0==s[s.length-1]&&s.pop();let l=-(i.depth+1);s.unshift(l);for(let d=i.depth,f=i.pos-1;d>0;d--,f--){let t=i.node(d).type.spec;if(t.defining||t.definingAsContext||t.isolating)break;s.indexOf(d)>-1?l=d:i.before(d)==f&&s.splice(1,0,-d)}let a=s.indexOf(l),c=[],h=r.openStart;for(let d=r.content,f=0;;f++){let t=d.firstChild;if(c.push(t),f==r.openStart)break;d=t.content}for(let d=h-1;d>=0;d--){let t=c[d].type,e=We(t);if(e&&i.node(a).type!=t)h=d;else if(e||!t.isTextblock)break}for(let d=r.openStart;d>=0;d--){let e=(d+h+1)%(r.openStart+1),l=c[e];if(l)for(let c=0;c=0&&(t.replace(e,n,r),!(t.steps.length>u));d--){let t=s[d];t<0||(e=i.before(t),n=o.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return function(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let i=r.depth-1;i>=0;i--){let t=r.index(i);if(r.node(i).canReplaceWith(t,t,n))return r.before(i+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let t=r.indexAfter(i);if(r.node(i).canReplaceWith(t,t,n))return r.after(i+1);if(t0&&(n||r.node(e-1).canReplace(r.index(e-1),i.indexAfter(e-1))))return t.delete(r.before(e),i.after(e))}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)return t.delete(r.before(s),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return function(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),l=i.after(o+1),a=s,c=l,h=ut.empty,u=0;for(let p=o,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,h=ut.from(r.node(p).copy(h)),u++):a--;let d=ut.empty,f=0;for(let p=o,m=!1;p>n;p--)m||i.after(p+1)=0;s--){if(r.size){let t=n[s].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ut.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Ne(i,o,i,o,new yt(r,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,r=null){return function(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,((e,n)=>{if(e.isTextblock&&!e.hasMarkup(r,i)&&function(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(t.doc,t.mapping.slice(o).map(n),r)){t.clearIncompatible(t.mapping.slice(o).map(n,1),r);let s=t.mapping.slice(o),l=s.map(n,1),a=s.map(n+e.nodeSize,1);return t.step(new Ne(l,a,l+1,a-1,new yt(ut.from(r.create(i,null,e.marks)),0,0),1,!0)),!1}}))}(this,t,e,n,r),this}setNodeMarkup(t,e,n=null,r=[]){return function(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 Ne(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new yt(ut.from(s),0,0),1,!0))}(this,t,e,n,r),this}setNodeAttribute(t,e,n){return this.step(new He(t,e,n)),this}addNodeMark(t,e){return this.step(new Oe(t,e)),this}removeNodeMark(t,e){if(!(e instanceof mt)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new Ce(t,e)),this}split(t,e=1,n){return function(t,e,n=1,r){let i=t.doc.resolve(e),o=ut.empty,s=ut.empty;for(let l=i.depth,a=i.depth-n,c=n-1;l>a;l--,c--){o=ut.from(i.node(l).copy(o));let t=r&&r[c];s=ut.from(t?t.type.create(t.attrs,s):i.node(l).copy(s))}t.step(new De(e,e,new yt(o.append(s),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){return function(t,e,n,r){let i,o,s=[],l=[];t.doc.nodesBetween(e,n,((t,a,c)=>{if(!t.isInline)return;let h=t.marks;if(!r.isInSet(h)&&c.type.allowsMarkType(r.type)){let c=Math.max(a,e),u=Math.min(a+t.nodeSize,n),d=r.addToSet(h);for(let t=0;tt.step(e))),l.forEach((e=>t.step(e)))}(this,t,e,n),this}removeMark(t,e,n){return function(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,((t,s)=>{if(!t.isInline)return;o++;let l=null;if(r instanceof Xt){let e,n=t.marks;for(;e=r.isInSet(n);)(l||(l=[])).push(e),n=e.removeFromSet(n)}else r?r.isInSet(t.marks)&&(l=[r]):l=t.marks;if(l&&l.length){let r=Math.min(s+t.nodeSize,n);for(let t=0;tt.step(new Me(e.from,e.to,e.style))))}(this,t,e,n),this}clearIncompatible(t,e,n){return function(t,e,n,r=n.contentMatch){let i=t.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l=0;l--)t.step(o[l])}(this,t,e,n),this}}const Ge=Object.create(null);class Ze{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new Xe(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e=0;i--){let r=e<0?an(t.node(0),t.node(i),t.before(i+1),t.index(i),e,n):an(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,n);if(r)return r}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new sn(t.node(0))}static atStart(t){return an(t,t,0,0,1)||new sn(t)}static atEnd(t){return an(t,t,t.content.size,t.childCount,-1)||new sn(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Ge[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in Ge)throw new RangeError("Duplicate use of selection JSON ID "+t);return Ge[t]=e,e.prototype.jsonID=t,e}getBookmark(){return en.between(this.$anchor,this.$head).getBookmark()}}Ze.prototype.visible=!0;class Xe{constructor(t,e){this.$from=t,this.$to=e}}let Qe=!1;function tn(t){Qe||t.parent.inlineContent||(Qe=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class en extends Ze{constructor(t,e=t){tn(t),tn(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return Ze.near(n);let r=t.resolve(e.map(this.anchor));return new en(r.parent.inlineContent?r:n,n)}replace(t,e=yt.empty){if(super.replace(t,e),e==yt.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof en&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new nn(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new en(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if(n&&!r||(n=r>=0?1:-1),!e.parent.inlineContent){let t=Ze.findFrom(e,n,!0)||Ze.findFrom(e,-n,!0);if(!t)return Ze.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r||(t=(Ze.findFrom(t,-n,!0)||Ze.findFrom(t,n,!0)).$anchor).posnew sn(t)};function an(t,e,n,r,i,o=!1){if(e.inlineContent)return en.create(t,n);for(let s=r-(i>0?0:1);i>0?s=0;s+=i){let r=e.child(s);if(r.isAtom){if(!o&&rn.isSelectable(r))return rn.create(t,n-(i<0?r.nodeSize:0))}else{let e=an(t,r,n+i,i<0?r.childCount:0,i,o);if(e)return e}n+=r.nodeSize*i}return null}function cn(t,e,n){let r=t.steps.length-1;if(r{null==i&&(i=r)})),t.setSelection(Ze.near(t.doc.resolve(i),n)))}class hn extends Ue{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return mt.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||mt.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);let i=this.storedMarks;if(!i){let t=this.doc.resolve(e);i=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),this.selection.empty||this.setSelection(Ze.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function un(t,e){return e&&t?t.bind(e):t}class dn{constructor(t,e,n){this.name=t,this.init=un(e.init,n),this.apply=un(e.apply,n)}}const fn=[new dn("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new dn("selection",{init:(t,e)=>t.selection||Ze.atStart(e.doc),apply:t=>t.selection}),new dn("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new dn("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class pn{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=fn.slice(),e&&e.forEach((t=>{if(this.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new dn(t.key,t.spec.state,t))}))}}class mn{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;nt.toJSON()))),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],i=r.spec.state;i&&i.toJSON&&(e[n]=i.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let r=new pn(t.schema,t.plugins),i=new mn(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=Rt.fromJSON(t.schema,e.doc);else if("selection"==r.name)i.selection=Ze.fromJSON(i.doc,e.selection);else if("storedMarks"==r.name)e.storedMarks&&(i.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],l=s.spec.state;if(s.key==r.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(e,o))return void(i[r.name]=l.fromJSON.call(s,t,e[o],i))}i[r.name]=r.init(t,i)}})),i}}function gn(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):"handleDOMEvents"==r&&(i=gn(i,e,{})),n[r]=i}return n}class yn{constructor(t){this.spec=t,this.props={},t.props&&gn(t.props,this,this.props),this.key=t.key?t.key.key:wn("plugin")}getState(t){return t[this.key]}}const vn=Object.create(null);function wn(t){return t in vn?t+"$"+ ++vn[t]:(vn[t]=0,t+"$")}class bn{constructor(t="key"){this.key=wn(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const xn=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},Sn=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let kn=null;const Mn=function(t,e,n){let r=kn||(kn=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},On=function(t,e,n,r){return n&&(Dn(t,e,n,r,-1)||Dn(t,e,n,r,1))},Cn=/^(img|br|input|textarea|hr)$/i;function Dn(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Nn(t))){let n=t.parentNode;if(!n||1!=n.nodeType||Tn(t)||Cn.test(t.nodeName)||"false"==t.contentEditable)return!1;e=xn(t)+(i<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(i<0?-1:0)]).contentEditable)return!1;e=i<0?Nn(t):0}}}function Nn(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Tn(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const An=function(t){return t.focusNode&&On(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function $n(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const En="undefined"!=typeof navigator?navigator:null,Pn="undefined"!=typeof document?document:null,In=En&&En.userAgent||"",Rn=/Edge\/(\d+)/.exec(In),_n=/MSIE \d/.exec(In),zn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(In),jn=!!(_n||zn||Rn),Bn=_n?document.documentMode:zn?+zn[1]:Rn?+Rn[1]:0,Vn=!jn&&/gecko\/(\d+)/i.test(In);Vn&&(/Firefox\/(\d+)/.exec(In)||[0,0])[1];const Fn=!jn&&/Chrome\/(\d+)/.exec(In),Ln=!!Fn,qn=Fn?+Fn[1]:0,Wn=!jn&&!!En&&/Apple Computer/.test(En.vendor),Jn=Wn&&(/Mobile\/\w+/.test(In)||!!En&&En.maxTouchPoints>2),Kn=Jn||!!En&&/Mac/.test(En.platform),Hn=!!En&&/Win/.test(En.platform),Yn=/Android \d/.test(In),Un=!!Pn&&"webkitFontSmoothing"in Pn.documentElement.style,Gn=Un?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Zn(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Xn(t,e){return"number"==typeof t?t:t[e]}function Qn(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 tr(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=Sn(s)){if(1!=s.nodeType)continue;let t=s,n=t==o.body,l=n?Zn(o):Qn(t),a=0,c=0;if(e.topl.bottom-Xn(r,"bottom")&&(c=e.bottom-l.bottom+Xn(i,"bottom")),e.leftl.right-Xn(r,"right")&&(a=e.right-l.right+Xn(i,"right")),a||c)if(n)o.defaultView.scrollBy(a,c);else{let n=t.scrollLeft,r=t.scrollTop;c&&(t.scrollTop+=c),a&&(t.scrollLeft+=a);let i=t.scrollLeft-n,o=t.scrollTop-r;e={left:e.left-i,top:e.top-o,right:e.right-i,bottom:e.bottom-o}}if(n)break}}function er(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Sn(r));return e}function nr(t,e){for(let n=0;n=c){a=Math.max(f.bottom,a),c=Math.min(f.top,c);let t=f.left>e.left?f.left-e.left:f.right=(f.left+f.right)/2?1:0));continue}}else f.top>e.top&&!i&&f.left<=e.left&&f.right>=e.left&&(i=h,o={left:Math.max(f.left,Math.min(f.right,e.left)),top:f.top});!n&&(e.left>=f.right&&e.top>=f.top||e.left>=f.left&&e.top>=f.bottom)&&(l=u+1)}}return!n&&i&&(n=i,r=o,s=0),n&&3==n.nodeType?function(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(n.left+n.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:t,offset:l}:ir(n,r)}function or(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,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}n==t.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?s=t.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(s=function(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let e=t.docView.nearestDesc(o,!0);if(!e)return null;if(1==e.dom.nodeType&&(e.node.isBlock&&e.parent&&!s||!e.contentDOM)){let t=e.dom.getBoundingClientRect();if(e.node.isBlock&&e.parent&&!s&&(s=!0,t.left>r.left||t.top>r.top?i=e.posBefore:(t.right-1?i:t.docView.posFromDOM(e,n,-1)}(t,n,i,e))}null==s&&(s=function(t,e,n){let{node:r,offset:i}=ir(e,n),o=-1;if(1==r.nodeType&&!r.firstChild){let t=r.getBoundingClientRect();o=t.left!=t.right&&n.left>(t.left+t.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}(t,l,e));let a=t.docView.nearestDesc(l,!0);return{pos:s,inside:a?a.posAtStart-a.border:-1}}function ar(t){return t.top=0&&i==r.nodeValue.length?(t--,o=1):n<0?t--:e++,dr(cr(Mn(r,t,e),o),o<0)}{let t=cr(Mn(r,i,i),n);if(Vn&&i&&/\s/.test(r.nodeValue[i-1])&&i=0)}if(null==o&&i&&(n<0||i==Nn(r))){let t=r.childNodes[i-1],e=3==t.nodeType?Mn(t,Nn(t)-(s?0:1)):1!=t.nodeType||"BR"==t.nodeName&&t.nextSibling?null:t;if(e)return dr(cr(e,1),!1)}if(null==o&&i=0)}function dr(t,e){if(0==t.width)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function fr(t,e){if(0==t.height)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function pr(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()}}const mr=/[\u0590-\u08ac]/;let gr=null,yr=null,vr=!1;function wr(t,e,n){return gr==e&&yr==n?vr:(gr=e,yr=n,vr="up"==n||"down"==n?function(t,e,n){let r=e.selection,i="up"==n?r.$from:r.$to;return pr(t,e,(()=>{let{node:e}=t.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=t.docView.nearestDesc(e,!0);if(!n)break;if(n.node.isBlock){e=n.contentDOM||n.dom;break}e=n.dom.parentNode}let r=ur(t,i.pos,1);for(let t=e.firstChild;t;t=t.nextSibling){let e;if(1==t.nodeType)e=t.getClientRects();else{if(3!=t.nodeType)continue;e=Mn(t,0,t.nodeValue.length).getClientRects()}for(let t=0;ti.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(t,e,n):function(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 mr.test(r.parent.textContent)&&l.modify?pr(t,e,(()=>{let{focusNode:e,focusOffset:i,anchorNode:o,anchorOffset:s}=t.domSelectionRange(),a=l.caretBidiLevel;l.modify("move",n,"character");let c=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:u}=t.domSelectionRange(),d=h&&!c.contains(1==h.nodeType?h:h.parentNode)||e==h&&i==u;try{l.collapse(o,s),e&&(e!=o||i!=s)&&l.extend&&l.extend(e,i)}catch(f){}return null!=a&&(l.caretBidiLevel=a),d})):"left"==n||"backward"==n?o:s}(t,e,n))}class br{constructor(t,e,n,r){this.parent=t,this.children=e,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;exn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!1;break}if(e.previousSibling)break}if(null==r&&e==t.childNodes.length)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!0;break}if(e.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let n=!0,r=t;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!e||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==t.nodeType?t:t.parentNode):i==t))return o;n=!1}}}getDesc(t){let e=t.pmViewDesc;for(let n=e;n;n=n.parent)if(n==this)return e}posFromDOM(t,e,n){for(let r=t;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(t,e,n)}return-1}descAt(t){for(let e=0,n=0;et||e instanceof Dr){r=t-i;break}i=o}if(r)return this.children[n].domFromPos(r-this.children[n].border,e);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof xr&&i.side>=0;n--);if(e<=0){let t,r=!0;for(;t=n?this.children[n-1]:null,t&&t.dom.parentNode!=this.contentDOM;n--,r=!1);return t&&e&&r&&!t.border&&!t.domAtom?t.domFromPos(t.size,e):{node:this.contentDOM,offset:t?xn(t.dom)+1:0}}{let t,r=!0;for(;t=n=i&&e<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(t,e,i);t=o;for(let e=s;e>0;e--){let n=this.children[e-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=xn(n.dom)+1;break}t-=n.size}-1==r&&(r=0)}if(r>-1&&(l>e||s==this.children.length-1)){e=l;for(let t=s+1;tf&&oe){let t=s;s=l,l=t}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(s.node,s.offset),a.removeAllRanges(),a.addRange(n)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let n=0,r=0;r=n:tn){let r=n+i.border,s=o-i.border;if(t>=r&&e<=s)return this.dirty=t==n||e==o?2:1,void(t!=r||e!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(t-r,e-r):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let n=1==t?2:1;e.dirtyi?i.parent?i.parent.posBeforeChild(i):void 0:r))),!e.type.spec.raw){if(1!=o.nodeType){let t=document.createElement("span");t.appendChild(o),o=t}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(t,[],o,null),this.widget=e,this.widget=e,i=this}matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return!!e&&e(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Sr extends br{constructor(t,e,n,r){super(t,[],e,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class kr extends br{constructor(t,e,n,r){super(t,[],n,r),this.mark=e}static create(t,e,n,r){let i=r.nodeViews[e.type.name],o=i&&i(e,r,n);return o&&o.dom||(o=ue.renderSpec(document,e.type.spec.toDOM(e,n))),new kr(t,e,o.dom,o.contentDOM||o.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),0!=this.dirty){let t=this.parent;for(;!t.node;)t=t.parent;t.dirty0&&(i=Vr(i,0,t,n));for(let s=0;ss?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),c=a&&a.dom,h=a&&a.contentDOM;if(e.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(e.text);else c||({dom:c,contentDOM:h}=ue.renderSpec(document,e.type.spec.toDOM(e)));h||e.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),e.type.spec.draggable&&(c.draggable=!0));let u=c;return c=Rr(c,n,e),a?s=new Nr(t,e,n,r,c,h||null,u,a,i,o+1):e.isText?new Cr(t,e,n,r,c,u,i):new Mr(t,e,n,r,c,h||null,u,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>ut.empty)}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(t,e,n){return 0==this.dirty&&t.eq(this.node)&&_r(e,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let n=this.node.inlineContent,r=e,i=t.composing?this.localCompositionInfo(t,e):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,l=new jr(this,o&&o.node,t);!function(t,e,n,r){let i=e.locals(t),o=0;if(0==i.length){for(let n=0;no;)l.push(i[s++]);let d=o+h.nodeSize;if(h.isText){let t=d;s!t.inline)):l.slice(),e.forChild(o,h),u),o=d}}(this.node,this.innerDeco,((e,i,o)=>{e.spec.marks?l.syncToMarks(e.spec.marks,n,t):e.type.side>=0&&!o&&l.syncToMarks(i==this.node.childCount?mt.none:this.node.child(i).marks,n,t),l.placeWidget(e,t,r)}),((e,o,a,c)=>{let h;l.syncToMarks(e.marks,n,t),l.findNodeMatch(e,o,a,c)||s&&t.state.selection.from>r&&t.state.selection.to-1&&l.updateNodeAt(e,o,a,h,t)||l.updateNextNode(e,o,a,t,c,r)||l.addNode(e,o,a,t,r),r+=e.nodeSize})),l.syncToMarks([],n,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(o&&this.protectLocalComposition(t,o),Tr(this.contentDOM,this.children,t),Jn&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))}localCompositionInfo(t,e){let{from:n,to:r}=t.state.selection;if(!(t.state.selection instanceof en)||ne+this.node.content.size)return null;let i=t.domSelectionRange(),o=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];e=Nn(t=t.childNodes[e-1])}else{if(!(1==t.nodeType&&e=n){let t=l=0&&t+e.length+l>=n)return l+t;if(n==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}(this.node.content,t,n-e,r-e);return i<0?null:{node:o,pos:i,text:t}}return{node:o,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:n,text:r}){if(this.getDesc(e))return;let i=e;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new Sr(this,i,e,r);t.input.compositionNodes.push(o),this.children=Vr(this.children,n,n+r.length,t,o)}update(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)}updateInner(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(t){if(_r(t,this.outerDeco))return;let e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Pr(this.dom,this.nodeDOM,Er(this.outerDeco,this.node,e),Er(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Or(t,e,n,r,i){Rr(r,e,t);let o=new Mr(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Cr extends Mr{constructor(t,e,n,r,i,o,s){super(t,e,n,r,i,null,o,s,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0)}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,n){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,n)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,e,n){let r=this.node.cut(t,e),i=document.createTextNode(r.text);return new Cr(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(t,e){super.markDirty(t,e),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class Dr extends br{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Nr extends Mr{constructor(t,e,n,r,i,o,s,l,a,c){super(t,e,n,r,i,o,s,a,c),this.spec=l}update(t,e,n,r){if(3==this.dirty)return!1;if(this.spec.update){let i=this.spec.update(t,e,n);return i&&this.updateInner(t,e,n,r),i}return!(!this.contentDOM&&!t.isLeaf)&&super.update(t,e,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,n,r){this.spec.setSelection?this.spec.setSelection(t,e,n):super.setSelection(t,e,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function Tr(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o0;){let l;for(;;)if(r){let t=n.children[r-1];if(!(t instanceof kr)){l=t,r--;break}n=t,r=t.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let n=t;n>1,o=Math.min(i,t.length);for(;r-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=kr.create(this.top,t[i],e,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(t,e,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(t,e,n))o=this.top.children.indexOf(i,this.index);else for(let s=this.index,l=Math.min(this.top.children.length,s+5);s=n||h<=e?o.push(a):(cn&&o.push(a.slice(n-c,a.size,r)))}return o}function Fr(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&&0==i.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l,a,c=r.resolve(s);if(An(n)){for(l=c;i&&!i.node;)i=i.parent;let t=i.node;if(i&&t.isAtom&&rn.isSelectable(t)&&i.parent&&(!t.isInline||!function(t,e,n){for(let r=0==e,i=e==Nn(t);r||i;){if(t==n)return!0;let e=xn(t);if(!(t=t.parentNode))return!1;r=r&&0==e,i=i&&e==Nn(t)}}(n.focusNode,n.focusOffset,i.dom))){let t=i.posBefore;a=new rn(s==t?c:r.resolve(t))}}else{let e=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(e<0)return null;l=r.resolve(e)}if(!a){a=Gr(t,l,c,"pointer"==e||t.state.selection.head{n.anchorNode==r&&n.anchorOffset==i||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{Lr(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Wr=Wn||Ln&&qn<63;function Jr(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=rr(t,e,n)))||en.between(e,n,r)}function Zr(t){return!(t.editable&&!t.hasFocus())&&Xr(t)}function Xr(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(n){return!1}}function Qr(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&&Ze.findFrom(o,e)}function ti(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function ei(t,e,n){let r=t.state.selection;if(!(r instanceof en)){if(r instanceof rn&&r.node.isInline)return ti(t,new en(e>0?r.$to:r.$from));{let n=Qr(t.state,e);return!!n&&ti(t,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let n=Qr(t.state,e);return!!(n&&n instanceof rn)&&ti(t,n)}if(!(Kn&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=e<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=t.docView.descAt(s))&&!n.contentDOM)&&(rn.isSelectable(o)?ti(t,new rn(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):!!Un&&ti(t,new en(t.state.doc.resolve(e<0?s:s+o.nodeSize))))}}function ni(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function ri(t){let e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function ii(t,e){return e<0?function(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;Vn&&1==n.nodeType&&r0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(ri(t))i=n,o=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(si(n))break;{let e=n.previousSibling;for(;e&&ri(e);)i=n.parentNode,o=xn(e),e=e.previousSibling;if(e)n=e,r=ni(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?li(t,n,r):i&&li(t,i,o)}(t):oi(t)}function oi(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=ni(n);for(;;)if(r{t.state==i&&qr(t)}),50)}function ai(t,e){let n=t.state.doc.resolve(e);if(!Ln&&!Hn&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let n=t.coordsAtPos(e-1),i=(n.top+n.bottom)/2;if(i>r.top&&i1)return n.leftr.top&&i1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(t.dom).direction?"rtl":"ltr"}function ci(t,e,n){let r=t.state.selection;if(r instanceof en&&!r.empty||n.indexOf("s")>-1)return!1;if(Kn&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=Qr(t.state,e);if(n&&n instanceof rn)return ti(t,n)}if(!i.parent.inlineContent){let n=e<0?i:o,s=r instanceof sn?Ze.near(n,e):Ze.findFrom(n,e);return!!s&&ti(t,s)}return!1}function hi(t,e){if(!(t.state.selection instanceof en))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 r=t.state.tr;return e<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),t.dispatch(r),!0}return!1}function ui(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function di(t,e){let n=e.keyCode,r=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);if(8==n||Kn&&72==n&&"c"==r)return hi(t,-1)||ii(t,-1);if(46==n||Kn&&68==n&&"c"==r)return hi(t,1)||ii(t,1);if(13==n||27==n)return!0;if(37==n||Kn&&66==n&&"c"==r){let e=37==n?"ltr"==ai(t,t.state.selection.from)?-1:1:-1;return ei(t,e,r)||ii(t,e)}if(39==n||Kn&&70==n&&"c"==r){let e=39==n?"ltr"==ai(t,t.state.selection.from)?1:-1:1;return ei(t,e,r)||ii(t,e)}return 38==n||Kn&&80==n&&"c"==r?ci(t,-1,r)||ii(t,-1):40==n||Kn&&78==n&&"c"==r?function(t){if(!Wn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;ui(t,n,"true"),setTimeout((()=>ui(t,n,"false")),20)}return!1}(t)||ci(t,1,r)||oi(t):r==(Kn?"m":"c")&&(66==n||73==n||89==n||90==n)}function fi(t,e){t.someProp("transformCopied",(n=>{e=n(e,t)}));let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let s=t.someProp("clipboardSerializer")||ue.fromSchema(t.state.schema),l=ki(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c,h=a.firstChild,u=0;for(;h&&1==h.nodeType&&(c=xi[h.nodeName.toLowerCase()]);){for(let t=c.length-1;t>=0;t--){let e=l.createElement(c[t]);for(;a.firstChild;)e.appendChild(a.firstChild);a.appendChild(e),u++}h=a.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",`${i} ${o}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:a,text:t.someProp("clipboardTextSerializer",(n=>n(e,t)))||e.content.textBetween(0,e.content.size,"\n\n")}}function pi(t,e,n,r,i){let o,s,l=i.parent.type.spec.code;if(!n&&!e)return null;let a=e&&(r||l||!n);if(a){if(t.someProp("transformPastedText",(n=>{e=n(e,l||r,t)})),l)return e?new yt(ut.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):yt.empty;let n=t.someProp("clipboardTextParser",(n=>n(e,i,r,t)));if(n)s=n;else{let n=i.marks(),{schema:r}=t.state,s=ue.fromSchema(r);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((t=>{let e=o.appendChild(document.createElement("p"));t&&e.appendChild(s.serializeNode(r.text(t,n)))}))}}else t.someProp("transformPastedHTML",(e=>{n=e(n,t)})),o=function(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=ki().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t);(n=i&&xi[i[1].toLowerCase()])&&(t=n.map((t=>"<"+t+">")).join("")+t+n.map((t=>"")).reverse().join(""));if(r.innerHTML=t,n)for(let o=0;o0;u--){let t=o.firstChild;for(;t&&1!=t.nodeType;)t=t.nextSibling;if(!t)break;o=t}if(!s){let e=t.someProp("clipboardParser")||t.someProp("domParser")||ee.fromSchema(t.state.schema);s=e.parseSlice(o,{preserveWhitespace:!(!a&&!h),context:i,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||mi.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(h)s=function(t,e){if(!t.size)return t;let n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(l){return t}let{content:i,openStart:o,openEnd:s}=t;for(let a=n.length-2;a>=0;a-=2){let t=r.nodes[n[a]];if(!t||t.hasRequiredAttrs())break;i=ut.from(t.create(n[a+1],i)),o++,s++}return new yt(i,o,s)}(bi(s,+h[1],+h[2]),h[4]);else if(s=yt.maxOpen(function(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r,i=e.node(n).contentMatchAt(e.index(n)),o=[];if(t.forEach((t=>{if(!o)return;let e,n=i.findWrapping(t.type);if(!n)return o=null;if(e=o.length&&r.length&&yi(n,r,t,o[o.length-1],0))o[o.length-1]=e;else{o.length&&(o[o.length-1]=vi(o[o.length-1],r.length));let e=gi(t,n);o.push(e),i=i.matchType(e.type),r=n}})),o)return ut.from(o)}return t}(s.content,i),!0),s.openStart||s.openEnd){let t=0,e=0;for(let n=s.content.firstChild;t{s=e(s,t)})),s}const mi=/^(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 gi(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,ut.from(t));return t}function yi(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(ut.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function bi(t,e,n){return e{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=e=>Ai(t,e))}))}function Ai(t,e){return t.someProp("handleDOMEvents",(n=>{let r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)}))}function $i(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||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Ei(t){return{left:t.clientX,top:t.clientY}}function Pi(t,e,n,r,i){if(-1==r)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,(e=>s>o.depth?e(t,n,o.nodeAfter,o.before(s),i,!0):e(t,n,o.node(s),o.before(s),i,!1))))return!0;return!1}function Ii(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function Ri(t,e,n,r,i){return Pi(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(n=>n(t,e,r)))||(i?function(t,e){if(-1==e)return!1;let n,r,i=t.state.selection;i instanceof rn&&(n=i.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let t=s>o.depth?o.nodeAfter:o.node(s);if(rn.isSelectable(t)){r=n&&i.$from.depth>0&&s>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(s);break}}return null!=r&&(Ii(t,rn.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&rn.isSelectable(r))&&(Ii(t,new rn(n),"pointer"),!0)}(t,n))}function _i(t,e,n,r){return Pi(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(n=>n(t,e,r)))}function zi(t,e,n,r){return Pi(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(n=>n(t,e,r)))||function(t,e,n){if(0!=n.button)return!1;let r=t.state.doc;if(-1==e)return!!r.inlineContent&&(Ii(t,en.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let e=o>i.depth?i.nodeAfter:i.node(o),n=i.before(o);if(e.inlineContent)Ii(t,en.create(r,n+1,n+1+e.content.size),"pointer");else{if(!rn.isSelectable(e))continue;Ii(t,rn.create(r,n),"pointer")}return!0}}(t,n,r)}function ji(t){return Ji(t)}Oi.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!Fi(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!Yn||!Ln||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!Jn||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||di(t,n)?n.preventDefault():Ni(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,$n(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},Oi.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},Oi.keypress=(t,e)=>{let n=e;if(Fi(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Kn&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof en&&r.$from.sameParent(r.$to))){let e=String.fromCharCode(n.charCode);/[\r\n]/.test(e)||t.someProp("handleTextInput",(n=>n(t,r.$from.pos,r.$to.pos,e)))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const Bi=Kn?"metaKey":"ctrlKey";Mi.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=ji(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&function(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[Bi]&&("singleClick"==t.input.lastClick.type?o="doubleClick":"doubleClick"==t.input.lastClick.type&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(Ei(n));s&&("singleClick"==o?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Vi(t,s,n,!!r)):("doubleClick"==o?_i:zi)(t,s.pos,s.inside,n)?n.preventDefault():Ni(t,"pointer"))};class Vi{constructor(t,e,n,r){let i,o;if(this.view=t,this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[Bi],this.allowDefault=n.shiftKey,e.inside>-1)i=t.state.doc.nodeAt(e.inside),o=e.inside;else{let n=t.state.doc.resolve(e.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,l=s?t.docView.nearestDesc(s,!0):null;this.target=l?l.dom:null;let{selection:a}=t.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||a instanceof rn&&a.from<=o&&a.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Vn||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ni(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>qr(this.view))),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Ei(t))),this.updateAllowDefault(t),this.allowDefault||!e?Ni(this.view,"pointer"):Ri(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||Wn&&this.mightDrag&&!this.mightDrag.node.isAtom||Ln&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(Ii(this.view,Ze.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):Ni(this.view,"pointer")}move(t){this.updateAllowDefault(t),Ni(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function Fi(t,e){return!!t.composing||!!(Wn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}Mi.touchstart=t=>{t.input.lastTouch=Date.now(),ji(t),Ni(t,"pointer")},Mi.touchmove=t=>{t.input.lastTouch=Date.now(),Ni(t,"pointer")},Mi.contextmenu=t=>ji(t);const Li=Yn?5e3:-1;function qi(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>Ji(t)),e))}function Wi(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Ji(t,e=!1){if(!(Yn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Wi(t),e||t.docView&&t.docView.dirty){let e=Fr(t);return e&&!e.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(e)):t.updateState(t.state),!0}return!1}}Oi.compositionstart=Oi.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))))t.markCursor=t.state.storedMarks||n.marks(),Ji(t,!0),t.markCursor=null;else if(Ji(t),Vn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelectionRange();for(let n=e.focusNode,r=e.focusOffset;n&&1==n.nodeType&&0!=r;){let e=r<0?n.lastChild:n.childNodes[r-1];if(!e)break;if(3==e.nodeType){t.domSelection().collapse(e,e.nodeValue.length);break}n=e,r=-1}}t.input.composing=!0}qi(t,Li)},Oi.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionID++,qi(t,20))};const Ki=jn&&Bn<15||Jn&&Gn<604;function Hi(t,e,n,r,i){let o=pi(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,i,o||yt.empty))))return!0;if(!o)return!1;let s=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(o),l=s?t.state.tr.replaceSelectionWith(s,t.input.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Mi.copy=Oi.cut=(t,e)=>{let n=e,r=t.state.selection,i="cut"==n.type;if(r.empty)return;let o=Ki?null:n.clipboardData,s=r.content(),{dom:l,text:a}=fi(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):function(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)}(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Oi.paste=(t,e)=>{let n=e;if(t.composing&&!Yn)return;let r=Ki?null:n.clipboardData;r&&Hi(t,r.getData("text/plain"),r.getData("text/html"),t.input.shiftKey,n)?n.preventDefault():function(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(),setTimeout((()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Hi(t,r.value,null,t.input.shiftKey,e):Hi(t,r.textContent,r.innerHTML,t.input.shiftKey,e)}),50)}(t,n)};class Yi{constructor(t,e){this.slice=t,this.move=e}}const Ui=Kn?"altKey":"ctrlKey";Mi.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(Ei(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof rn?i.to-1:i.to));else if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(rn.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&t.dispatch(t.state.tr.setSelection(rn.create(t.state.doc,e.posBefore)))}let s=t.state.selection.content(),{dom:l,text:a}=fi(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Ki?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ki||n.dataTransfer.setData("text/plain",a),t.dragging=new Yi(s,!n[Ui])},Mi.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},Oi.dragover=Oi.dragenter=(t,e)=>e.preventDefault(),Oi.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Ei(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",(e=>{s=e(s,t)})):s=pi(t,n.dataTransfer.getData(Ki?"Text":"text/plain"),Ki?null:n.dataTransfer.getData("text/html"),!1,o);let l=!(!r||n[Ui]);if(t.someProp("handleDrop",(e=>e(t,n,s||yt.empty,l))))return void n.preventDefault();if(!s)return;n.preventDefault();let a=s?function(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o=0;t--){let e=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,n=r.index(t)+(e>0?1:0),s=r.node(t),l=!1;if(1==o)l=s.canReplace(n,n,i);else{let t=s.contentMatchAt(n).findWrapping(i.firstChild.type);l=t&&s.canReplaceWith(n,n,t[0])}if(l)return 0==e?r.pos:e<0?r.before(t+1):r.after(t+1)}return null}(t.state.doc,o.pos,s):o.pos;null==a&&(a=o.pos);let c=t.state.tr;l&&c.deleteSelection();let h=c.mapping.map(a),u=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,d=c.doc;if(u?c.replaceRangeWith(h,h,s.content.firstChild):c.replaceRange(h,h,s),c.doc.eq(d))return;let f=c.doc.resolve(h);if(u&&rn.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new rn(f));else{let e=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach(((t,n,r,i)=>e=i)),c.setSelection(Gr(t,f,c.doc.resolve(e)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Mi.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())&&qr(t)}),20))},Mi.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)},Mi.beforeinput=(t,e)=>{if(Ln&&Yn&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,$n(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let os in Oi)Mi[os]=Oi[os];function Gi(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}class Zi{constructor(t,e){this.toDOM=t,this.spec=e||no,this.side=this.spec.side||0}map(t,e,n,r){let{pos:i,deleted:o}=t.mapResult(e.from+r,this.side<0?-1:1);return o?null:new to(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof Zi&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Gi(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Xi{constructor(t,e){this.attrs=t,this.spec=e||no}map(t,e,n,r){let i=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,o=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new to(i,o,this)}valid(t,e){return e.from=t&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;ot){let s=this.children[o]+1;this.children[o+2].findInner(t-s,e-s,n,r+s,i)}}map(t,e,n){return this==io||0==t.maps.length?this:this.mapInner(t,e,0,0,n||no)}mapInner(t,e,n,r,i){let o;for(let s=0;s{let s=o-r-(n-e);for(let a=0;ao+h-t)continue;let c=l[a]+h-t;n>=c?l[a+1]=e<=c?-2:-1:r>=i&&s&&(l[a]+=s,l[a+1]+=s)}t+=s})),h=n.maps[c].map(h,-1)}let a=!1;for(let c=0;c=r.content.size){a=!0;continue}let u=n.map(t[c+1]+o,-1)-i,{index:d,offset:f}=r.content.findIndex(h),p=r.maybeChild(d);if(p&&f==h&&f+p.nodeSize==u){let r=l[c+2].mapInner(n,p,e+1,t[c]+o+1,s);r!=io?(l[c]=h,l[c+1]=u,l[c+2]=r):(l[c+1]=-2,a=!0)}else a=!0}if(a){let a=function(t,e,n,r,i,o,s){function l(t,e){for(let o=0;o{let s,l=o+n;if(s=lo(e,t,l)){for(r||(r=this.children.slice());io&&e.to=t){this.children[s]==t&&(n=this.children[s+2]);break}let i=t+1,o=i+e.content.size;for(let s=0;si&&t.type instanceof Xi){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;en.map(t,e,no)));return oo.from(n)}forChild(t,e){if(e.isLeaf)return ro.empty;let n=[];for(let r=0;rt instanceof ro))?t:t.reduce(((t,e)=>t.concat(e instanceof ro?e:e.members)),[]))}}}function so(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;rn&&o.to{let l=lo(t,e,s+n);if(l){o=!0;let t=co(l,e,n+s+1,r);t!=io&&i.push(s,s+e.nodeSize,t)}}));let s=so(o?ao(t):t,-n).sort(ho);for(let l=0;l0;)e++;t.splice(e,0,n)}function po(t){let e=[];return t.someProp("decorations",(n=>{let r=n(t.state);r&&r!=io&&e.push(r)})),t.cursorWrapper&&e.push(ro.create(t.state.doc,[t.cursorWrapper.deco])),oo.from(e)}const mo={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},go=jn&&Bn<=11;class yo{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class vo{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new yo,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((t=>{for(let e=0;e"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),go&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.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,mo)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;ethis.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(Zr(this.view)){if(this.suppressingSelectionUpdates)return qr(this.view);if(jn&&Bn<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&On(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e,n=new Set;for(let i=t.focusNode;i;i=Sn(i))n.add(i);for(let i=t.anchorNode;i;i=Sn(i))if(n.has(i)){e=i;break}let r=e&&this.view.docView.nearestDesc(e);return r&&r.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);let n=t.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Zr(t)&&!this.ignoreSelectionChange(n),i=-1,o=-1,s=!1,l=[];if(t.editable)for(let c=0;c1){let t=l.filter((t=>"BR"==t.nodeName));if(2==t.length){let e=t[0],n=t[1];e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}}let a=null;i<0&&r&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||r)&&(i>-1&&(t.docView.markDirty(i,o),function(t){if(wo.has(t))return;if(wo.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)){if(t.requiresGeckoHackNode=Vn,bo)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),bo=!0}}(t)),this.handleDOMChange(i,o,s,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||qr(t),this.currentSelection.set(n))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(let n=0;nDate.now()-50?t.input.lastSelectionOrigin:null,n=Fr(t,e);if(n&&!t.state.selection.eq(n)){if(Ln&&Yn&&13===t.input.lastKeyCode&&Date.now()-100e(t,$n(13,"Enter")))))return;let r=t.state.tr.setSelection(n);"pointer"==e?r.setMeta("pointer",!0):"key"==e&&r.scrollIntoView(),t.composing&&r.setMeta("composition",t.input.compositionID),t.dispatch(r)}return}let o=t.state.doc.resolve(e),s=o.sharedDepth(n);e=o.before(s+1),n=t.state.doc.resolve(n).after(s+1);let l,a,c=t.state.selection,h=function(t,e,n){let r,{node:i,fromOffset:o,toOffset:s,from:l,to:a}=t.docView.parseRange(e,n),c=t.domSelectionRange(),h=c.anchorNode;if(h&&t.dom.contains(1==h.nodeType?h:h.parentNode)&&(r=[{node:h,offset:c.anchorOffset}],An(c)||r.push({node:c.focusNode,offset:c.focusOffset})),Ln&&8===t.input.lastKeyCode)for(let g=s;g>o;g--){let t=i.childNodes[g-1],e=t.pmViewDesc;if("BR"==t.nodeName&&!e){s=g;break}if(!e||e.size)break}let u=t.state.doc,d=t.someProp("domParser")||ee.fromSchema(t.state.schema),f=u.resolve(l),p=null,m=d.parse(i,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:xo,context:f});if(r&&null!=r[0].pos){let t=r[0].pos,e=r[1]&&r[1].pos;null==e&&(e=t),p={anchor:t+l,head:e+l}}return{doc:m,sel:p,from:l,to:a}}(t,e,n),u=t.state.doc,d=u.slice(h.from,h.to);8===t.input.lastKeyCode&&Date.now()-100=s?o-r:0,l=o+(l-s),s=o}else if(l=l?o-r:0,s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}(d.content,h.doc.content,h.from,l,a);if((Jn&&t.input.lastIOSEnter>Date.now()-225||Yn)&&i.some((t=>1==t.nodeType&&!So.test(t.nodeName)))&&(!f||f.endA>=f.endB)&&t.someProp("handleKeyDown",(e=>e(t,$n(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(!f){if(!(r&&c instanceof en&&!c.empty&&c.$head.sameParent(c.$anchor))||t.composing||h.sel&&h.sel.anchor!=h.sel.head){if(h.sel){let e=Mo(t,t.state.doc,h.sel);if(e&&!e.eq(t.state.selection)){let n=t.state.tr.setSelection(e);t.composing&&n.setMeta("composition",t.input.compositionID),t.dispatch(n)}}return}f={start:c.from,endA:c.to,endB:c.to}}if(Ln&&t.cursorWrapper&&h.sel&&h.sel.anchor==t.cursorWrapper.deco.from&&h.sel.head==h.sel.anchor){let t=f.endB-f.start;h.sel={anchor:h.sel.anchor+t,head:h.sel.anchor+t}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&f.start<=t.state.selection.from+2&&t.state.selection.from>=h.from?f.start=t.state.selection.from:f.endA=t.state.selection.to-2&&t.state.selection.to<=h.to&&(f.endB+=t.state.selection.to-f.endA,f.endA=t.state.selection.to)),jn&&Bn<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>h.from&&"  "==h.doc.textBetween(f.start-h.from-1,f.start-h.from+1)&&(f.start--,f.endA--,f.endB--);let p,m=h.doc.resolveNoCache(f.start-h.from),g=h.doc.resolveNoCache(f.endB-h.from),y=u.resolve(f.start),v=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=f.endA;if((Jn&&t.input.lastIOSEnter>Date.now()-225&&(!v||i.some((t=>"DIV"==t.nodeName||"P"==t.nodeName)))||!v&&m.pose(t,$n(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>f.start&&function(t,e,n,r,i){if(!r.parent.isTextblock||n-e<=i.pos-r.pos||Oo(r,!0,!1)n||Oo(s,!0,!1)e(t,$n(8,"Backspace")))))return void(Yn&&Ln&&t.domObserver.suppressSelectionUpdates());Ln&&Yn&&f.endB==f.start&&(t.input.lastAndroidDelete=Date.now()),Yn&&!v&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==f.endA&&(f.endB-=2,g=h.doc.resolveNoCache(f.endB-h.from),setTimeout((()=>{t.someProp("handleKeyDown",(function(e){return e(t,$n(13,"Enter"))}))}),20));let w,b,x,S=f.start,k=f.endA;if(v)if(m.pos==g.pos)jn&&Bn<=11&&0==m.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((()=>qr(t)),20)),w=t.state.tr.delete(S,k),b=u.resolve(f.start).marksAcross(u.resolve(f.endA));else if(f.endA==f.endB&&(x=function(t,e){let n,r,i,o=t.firstChild.marks,s=e.firstChild.marks,l=o,a=s;for(let h=0;ht.mark(r.addToSet(t.marks));else{if(0!=l.length||1!=a.length)return null;r=a[0],n="remove",i=t=>t.mark(r.removeFromSet(t.marks))}let c=[];for(let h=0;hn(t,S,k,e))))return;w=t.state.tr.insertText(e,S,k)}if(w||(w=t.state.tr.replace(S,k,h.doc.slice(f.start-h.from,f.endB-h.from))),h.sel){let e=Mo(t,w.doc,h.sel);e&&!(Ln&&Yn&&t.composing&&e.empty&&(f.start!=f.endB||t.input.lastAndroidDeletee.content.size?null:Gr(t,e.resolve(n.anchor),e.resolve(n.head))}function Oo(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let e=t.node(r).maybeChild(t.indexAfter(r));for(;e&&!e.isLeaf;)e=e.firstChild,i++}return i}class Co{constructor(t,e){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 Di,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach($o),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=To(this),No(this),this.nodeViews=Ao(this),this.docView=Or(this.state.doc,Do(this),po(this),this.dom,this),this.domObserver=new vo(this,((t,e,n,r)=>ko(this,t,e,n,r))),this.domObserver.start(),function(t){for(let e in Mi){let n=Mi[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=e=>{!$i(t,e)||Ai(t,e)||!t.editable&&e.type in Oi||n(t,e)},Ci[e]?{passive:!0}:void 0)}Wn&&t.dom.addEventListener("input",(()=>null)),Ti(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Ti(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach($o),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let n in this._props)e[n]=this._props[n];e.state=this.state;for(let n in t)e[n]=t[n];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){let n=this.state,r=!1,i=!1;t.storedMarks&&this.composing&&(Wi(this),i=!0),this.state=t;let o=n.plugins!=t.plugins||this._props.plugins!=e.plugins;if(o||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let t=Ao(this);(function(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})(t,this.nodeViews)&&(this.nodeViews=t,r=!0)}(o||e.handleDOMEvents!=this._props.handleDOMEvents)&&Ti(this),this.editable=To(this),No(this);let s=po(this),l=Do(this),a=n.plugins==t.plugins||n.doc.eq(t.doc)?t.scrollToSelection>n.scrollToSelection?"to selection":"preserve":"reset",c=r||!this.docView.matchesNode(t.doc,l,s);!c&&t.selection.eq(n.selection)||(i=!0);let h="preserve"==a&&i&&null==this.dom.style.overflowAnchor&&function(t){let e,n,r=t.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s=i-20){e=r,n=l.top;break}}return{refDOM:e,refTop:n,stack:er(t.dom)}}(this);if(i){this.domObserver.stop();let e=c&&(jn||Ln)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&function(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)}(n.selection,t.selection);if(c){let n=Ln?this.trackWrites=this.domSelectionRange().focusNode:null;!r&&this.docView.update(t.doc,l,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Or(t.doc,l,s,this.dom,this)),n&&!this.trackWrites&&(e=!0)}e||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return On(e.node,e.offset,n.anchorNode,n.anchorOffset)}(this))?qr(this,e):(Yr(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==a?this.dom.scrollTop=0:"to selection"==a?this.scrollToSelection():h&&function({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;nr(n,0==r?0:r-e)}(h)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(t=>t(this))));else if(this.state.selection instanceof rn){let e=this.docView.domAfterPos(this.state.selection.from);1==e.nodeType&&tr(this,e.getBoundingClientRect(),t)}else tr(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let e=0;ee.ownerDocument.getSelection()),this._root=e;return t||document}posAtCoords(t){return lr(this,t)}coordsAtPos(t,e=1){return ur(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,n=-1){let r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,e){return wr(this,e||this.state,t)}pasteHTML(t,e){return Hi(this,"",t,!1,e||new ClipboardEvent("paste"))}pasteText(t,e){return Hi(this,t,null,!0,e||new ClipboardEvent("paste"))}destroy(){this.docView&&(!function(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)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],po(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){return function(t,e){Ai(t,e)||!Mi[e.type]||!t.editable&&e.type in Oi||Mi[e.type](t,e)}(this,t)}dispatch(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return Wn&&11===this.root.nodeType&&function(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom?function(t){let e;function n(t){t.preventDefault(),t.stopImmediatePropagation(),e=t.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0);let r=e.startContainer,i=e.startOffset,o=e.endContainer,s=e.endOffset,l=t.domAtPos(t.state.selection.anchor);return On(l.node,l.offset,o,s)&&([r,i,o,s]=[o,s,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Do(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(t.state)),n)for(let t in n)"class"==t?e.class+=" "+n[t]:"style"==t?e.style=(e.style?e.style+";":"")+n[t]:e[t]||"contenteditable"==t||"nodeName"==t||(e[t]=String(n[t]))})),e.translate||(e.translate="no"),[to.node(0,t.state.doc.content.size,e)]}function No(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:to.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function To(t){return!t.someProp("editable",(e=>!1===e(t.state)))}function Ao(t){let e=Object.create(null);function n(t){for(let n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function $o(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")}for(var Eo={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:"'"},Po={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Io="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Ro="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),_o="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),zo=Ro||Io&&+Io[1]<57,jo=0;jo<10;jo++)Eo[48+jo]=Eo[96+jo]=String(jo);for(jo=1;jo<=24;jo++)Eo[jo+111]="F"+jo;for(jo=65;jo<=90;jo++)Eo[jo]=String.fromCharCode(jo+32),Po[jo]=String.fromCharCode(jo);for(var Bo in Eo)Po.hasOwnProperty(Bo)||(Po[Bo]=Eo[Bo]);const Vo="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Fo(t){let e,n,r,i,o=t.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let l=0;l127)&&(r=Eo[n.keyCode])&&r!=i){let i=e[Lo(r,n)];if(i&&i(t.state,t.dispatch,t))return!0}}return!1}}const Jo=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Ko(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function Ho(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 Yo(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1{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=Uo(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let r=n.after(),i=t.tr.replaceWith(r,r,s.createAndFill());i.setSelection(Ze.near(i.doc.resolve(r),1)),e(i.scrollIntoView())}return!0};const Zo=(t,e)=>{let{$from:n,$to:r}=t.selection;if(t.selection instanceof rn&&t.selection.node.isBlock)return!(!n.parentOffset||!Ie(t.doc,n.pos)||(e&&e(t.tr.split(n.pos).scrollIntoView()),0));if(!n.parent.isBlock)return!1;if(e){let i=r.parentOffset==r.parent.content.size,o=t.tr;(t.selection instanceof en||t.selection instanceof sn)&&o.deleteSelection();let s=0==n.depth?null:Uo(n.node(-1).contentMatchAt(n.indexAfter(-1))),l=Xo&&Xo(r.parent,i),a=l?[l]:i&&s?[{type:s}]:void 0,c=Ie(o.doc,o.mapping.map(n.pos),1,a);if(a||c||!Ie(o.doc,o.mapping.map(n.pos),1,s?[{type:s}]:void 0)||(s&&(a=[{type:s}]),c=!0),c&&(o.split(o.mapping.map(n.pos),1,a),!i&&!n.parentOffset&&n.parent.type!=s)){let t=o.mapping.map(n.before()),e=o.doc.resolve(t);s&&n.node(-1).canReplaceWith(e.index(),e.index()+1,s)&&o.setNodeMarkup(o.mapping.map(n.before()),s)}e(o.scrollIntoView())}return!0};var Xo;function Qo(t,e,n){let r,i,o=e.nodeBefore,s=e.nodeAfter;if(o.type.spec.isolating||s.type.spec.isolating)return!1;if(function(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!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&&!Re(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(r=(i=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&i.matchType(r[0]||s.type).validEnd){if(n){let i=e.pos+s.nodeSize,l=ut.empty;for(let t=r.length-1;t>=0;t--)l=ut.from(r[t].create(null,l));l=ut.from(o.copy(l));let a=t.tr.step(new Ne(e.pos-1,i,e.pos,i,new yt(l,1,0),r.length,!0)),c=i+2*r.length;Re(a.doc,c)&&a.join(c),n(a.scrollIntoView())}return!0}let a=Ze.findFrom(e,1),c=a&&a.$from.blockRange(a.$to),h=c&&$e(c);if(null!=h&&h>=e.depth)return n&&n(t.tr.lift(c,h).scrollIntoView()),!0;if(l&&Ko(s,"start",!0)&&Ko(o,"end")){let r=o,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let l=s,a=1;for(;!l.isTextblock;l=l.firstChild)a++;if(r.canReplace(r.childCount,r.childCount,l.content)){if(n){let r=ut.empty;for(let t=i.length-1;t>=0;t--)r=ut.from(i[t].copy(r));n(t.tr.step(new Ne(e.pos-i.length,e.pos+s.nodeSize,e.pos+a,e.pos+s.nodeSize-a,new yt(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ts(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(en.create(e.doc,t<0?i.start(o):i.end(o)))),!0)}}const es=ts(-1),ns=ts(1);function rs(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)i=!0;else{let e=n.doc.resolve(o),r=e.index();i=e.parent.canReplaceWith(r,r+1,t)}}))}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r{if(s)return!1;s=t.inlineContent&&t.type.allowsMarkType(n)})),s)return!0}return!1}(n.doc,s,t))return!1;if(r)if(o)t.isInSet(n.storedMarks||o.marks())?r(n.tr.removeStoredMark(t)):r(n.tr.addStoredMark(t.create(e)));else{let i=!1,o=n.tr;for(let e=0;!i&&e{let r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}(t,n);if(!r)return!1;let i=Ho(r);if(!i){let n=r.blockRange(),i=n&&$e(n);return null!=i&&(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Qo(t,i,e))return!0;if(0==r.parent.content.size&&(Ko(o,"end")||rn.isSelectable(o))){let n=_e(t.doc,r.before(),r.after(),yt.empty);if(n&&n.slice.size{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=Ho(r)}let s=o&&o.nodeBefore;return!(!s||!rn.isSelectable(s))&&(e&&e(t.tr.setSelection(rn.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)})),as=ss(Jo,((t,e,n)=>{let r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{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{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}),((t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof sn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Uo(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let n=(!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 r=n.before();if(Ie(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&$e(r);return null!=i&&(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)}),Zo),"Mod-Enter":Go,Backspace:ls,"Mod-Backspace":ls,"Shift-Backspace":ls,Delete:as,"Mod-Delete":as,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new sn(t.doc))),!0)},hs={"Ctrl-h":cs.Backspace,"Alt-Backspace":cs["Mod-Backspace"],"Ctrl-d":cs.Delete,"Ctrl-Alt-Backspace":cs["Mod-Delete"],"Alt-Delete":cs["Mod-Delete"],"Alt-d":cs["Mod-Delete"],"Ctrl-a":es,"Ctrl-e":ns};for(let os in cs)hs[os]=cs[os];const us=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?hs:cs;class ds{constructor(t,e){var n;this.match=t,this.match=t,this.handler="string"==typeof e?(n=e,function(t,e,r,i){let o=n;if(e[1]){let t=e[0].lastIndexOf(e[1]);o+=e[0].slice(t+e[1].length);let n=(r+=t)-i;n>0&&(o=e[0].slice(t-n,t)+o,r=i)}return t.tr.insertText(o,r,i)}):e}}const fs=500;function ps({rules:t}){let e=new yn({state:{init:()=>null,apply(t,e){let n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:(n,r,i,o)=>ms(n,r,i,o,t,e),handleDOMEvents:{compositionend:n=>{setTimeout((()=>{let{$cursor:r}=n.state.selection;r&&ms(n,r.pos,r.pos,"",t,e)}))}}},isInputRules:!0});return e}function ms(t,e,n,r,i,o){if(t.composing)return!1;let s=t.state,l=s.doc.resolve(e);if(l.parent.type.spec.code)return!1;let a=l.parent.textBetween(Math.max(0,l.parentOffset-fs),l.parentOffset,null,"")+r;for(let c=0;c{let n=t.plugins;for(let r=0;r=0;t--)n.step(r.steps[t].invert(r.docs[t]));if(i.text){let e=n.doc.resolve(i.from).marks();n.replaceWith(i.from,i.to,t.schema.text(i.text,e))}else n.delete(i.from,i.to);e(n)}return!0}}return!1};function ys(t,e,n=null,r){return new ds(t,((t,i,o,s)=>{let l=n instanceof Function?n(i):n,a=t.tr.delete(o,s),c=a.doc.resolve(o).blockRange(),h=c&&Ee(c,e,l);if(!h)return null;a.wrap(c,h);let u=a.doc.resolve(o-1).nodeBefore;return u&&u.type==e&&Re(a.doc,o-1)&&(!r||r(i,u))&&a.join(o-1),a}))}function vs(t,e,n=null){return new ds(t,((t,r,i,o)=>{let s=t.doc.resolve(i),l=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e)?t.tr.delete(i,o).setBlockType(i,i,e,l):null}))}const ws=["ol",0],bs=["ul",0],xs=["li",0],Ss={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1==t.attrs.order?ws:["ol",{start:t.attrs.order},0]},ks={parseDOM:[{tag:"ul"}],toDOM:()=>bs},Ms={parseDOM:[{tag:"li"}],toDOM:()=>xs,defining:!0};function Os(t,e){let n={};for(let r in t)n[r]=t[r];for(let r in e)n[r]=e[r];return n}function Cs(t,e,n){return t.append({ordered_list:Os(Ss,{content:"list_item+",group:n}),bullet_list:Os(ks,{content:"list_item+",group:n}),list_item:Os(Ms,{content:e})})}function Ds(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=!1,a=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(t)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;let t=n.doc.resolve(s.start-2);a=new Pt(t,t,s.depth),s.endIndex=0;h--)o=ut.from(n[h].type.create(n[h].attrs,o));t.step(new Ne(e.start-(r?2:0),e.end,e.start,e.end,new yt(o,0,0),n.length,!0));let s=0;for(let h=0;h=r.depth-3;t--)i=ut.from(r.node(t).copy(i));let s=r.indexAfter(-1){if(c>-1)return!1;t.isTextblock&&0==t.content.size&&(c=e+1)})),c>-1&&a.setSelection(Ze.near(a.doc.resolve(c))),n(a.scrollIntoView())}return!0}let l=i.pos==r.end()?s.contentMatchAt(0).defaultType:null,a=e.tr.delete(r.pos,i.pos),c=l?[null,{type:l}]:void 0;return!!Ie(a.doc,r.pos,2,c)&&(n&&n(a.split(r.pos,2,c).scrollIntoView()),!0)}}function Ts(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,(e=>e.childCount>0&&e.firstChild.type==t));return!!o&&(!n||(r.node(o.depth-1).type==t?function(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);om;p--)f-=i.child(p).nodeSize,r.delete(f-1,f+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=0==n.startIndex,a=n.endIndex==i.childCount,c=o.node(-1),h=o.index(-1);if(!c.canReplace(h+(l?0:1),h+1,s.content.append(a?ut.empty:ut.from(i))))return!1;let u=o.pos,d=u+s.nodeSize;return r.step(new Ne(u-(l?1:0),d+(a?1:0),u+1,d-1,new yt((l?ut.empty:ut.from(i.copy(ut.empty))).append(a?ut.empty:ut.from(i.copy(ut.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}(e,n,o)))}}function As(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,(e=>e.childCount>0&&e.firstChild.type==t));if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let l=o.parent,a=l.child(s-1);if(a.type!=t)return!1;if(n){let r=a.lastChild&&a.lastChild.type==l.type,i=ut.from(r?t.create():null),s=new yt(ut.from(t.create(null,ut.from(l.type.create(null,i)))),r?3:1,0),c=o.start,h=o.end;n(e.tr.step(new Ne(c-(r?3:1),h,c,h,s,1,!0)).scrollIntoView())}return!0}}var $s=200,Es=function(){};Es.prototype.append=function(t){return t.length?(t=Es.from(t),!this.length&&t||t.length<$s&&this.leafAppend(t)||this.length<$s&&t.leafPrepend(this)||this.appendInner(t)):this},Es.prototype.prepend=function(t){return t.length?Es.from(t).append(this):this},Es.prototype.appendInner=function(t){return new Is(this,t)},Es.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?Es.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Es.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Es.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Es.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},Es.from=function(t){return t instanceof Es?t:t&&t.length?new Ps(t):Es.empty};var Ps=function(t){function e(e){t.call(this),this.values=e}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(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var i=e;i=n;i--)if(!1===t(this.values[i],r+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=$s)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=$s)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Es);Es.empty=new Ps([]);var Is=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.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(t){return ti&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var i=this.left.length;return!(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,r+i))&&(!(n=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Es),Rs=Es;class _s{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}e&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,l=t.tr,a=[],c=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(i,e+1),r=n.maps.length),r--,void c.push(t);if(n){c.push(new zs(t.map));let e,i=t.step.map(n.slice(r));i&&l.maybeStep(i).doc&&(e=l.mapping.maps[l.mapping.maps.length-1],a.push(new zs(e,void 0,void 0,a.length+c.length))),r--,e&&n.appendMap(e,r)}else l.maybeStep(t.step);return t.selection?(o=n?t.selection.map(n.slice(r)):t.selection,s=new _s(this.items.slice(0,i).append(c.reverse().concat(a)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:o}}addTransform(t,e,n,r){let i=[],o=this.eventCount,s=this.items,l=!r&&s.length?s.get(s.length-1):null;for(let c=0;cBs&&(s=function(t,e){let n;return t.forEach(((t,r)=>{if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,a),o-=a),new _s(s.append(i),o)}remapping(t,e){let n=new ve;return this.items.forEach(((e,r)=>{let i=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,i)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new _s(this.items.append(t.map((t=>new zs(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),i=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),r);let l=e;this.items.forEach((e=>{let r=i.getMirror(--l);if(null==r)return;o=Math.min(o,r);let a=i.maps[r];if(e.step){let o=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(i.slice(l+1,r));c&&s++,n.push(new zs(a,o,c))}else n.push(new zs(a))}),r);let a=[];for(let u=e;u500&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let t=0;return this.items.forEach((e=>{e.step||t++})),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=t)r.push(o),o.selection&&i++;else if(o.step){let t=o.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let l=o.selection&&o.selection.map(e.slice(n));l&&i++;let a,c=new zs(s.invert(),t,l),h=r.length-1;(a=r.length&&r[h].merge(c))?r[h]=a:r.push(c)}}else o.map&&n--}),this.items.length,0),new _s(Rs.from(r.reverse()),i)}}_s.empty=new _s(Rs.empty,0);class zs{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new zs(e.getMap().invert(),e,this.selection)}}}class js{constructor(t,e,n,r,i){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}const Bs=20;function Vs(t){let e=[];return t.forEach(((t,n,r,i)=>e.push(r,i))),e}function Fs(t,e){if(!t)return null;let n=[];for(let r=0;rnew js(_s.empty,_s.empty,null,0,-1),apply:(e,n,r)=>function(t,e,n,r){let i,o=n.getMeta(Ks);if(o)return o.historyState;n.getMeta(Hs)&&(t=new js(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(Ks))return s.getMeta(Ks).redo?new js(t.done.addTransform(n,void 0,r,Js(e)),t.undone,Vs(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new js(t.done,t.undone.addTransform(n,void 0,r,Js(e)),null,t.prevTime,t.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new js(t.done.rebased(n,i),t.undone.rebased(n,i),Fs(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new js(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Fs(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);{let i=n.getMeta("composition"),o=0==t.prevTime||!s&&t.prevComposition!=i&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach(((t,r)=>{for(let i=0;i=e[i]&&(n=!0)})),n}(n,t.prevRanges)),l=s?Fs(t.prevRanges,n.mapping):Vs(n.mapping.maps[n.steps.length-1]);return new js(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,Js(e)),_s.empty,l,n.time,null==i?t.prevComposition:i)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?Us:"historyRedo"==n?Gs:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}const Us=(t,e)=>{let n=Ks.getState(t);return!(!n||0==n.done.eventCount)&&(e&&Ls(n,t,e,!1),!0)},Gs=(t,e)=>{let n=Ks.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&Ls(n,t,e,!0),!0)};function Zs(t){let e=Ks.getState(t);return e?e.done.eventCount:0}function Xs(t){let e=Ks.getState(t);return e?e.undone.eventCount:0} +"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e={},n={},r={},i={},o={};function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function l(t){for(var e=1;e=+n}))};var M={};Object.defineProperty(M,"__esModule",{value:!0}),M.default=void 0;var O=(0,r.regex)("email",/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i);M.default=O;var C={};Object.defineProperty(C,"__esModule",{value:!0}),C.default=void 0;var D=r,N=(0,D.withParams)({type:"ipAddress"},(function(t){if(!(0,D.req)(t))return!0;if("string"!=typeof t)return!1;var e=t.split(".");return 4===e.length&&e.every(T)}));C.default=N;var T=function(t){if(t.length>3||0===t.length)return!1;if("0"===t[0]&&"0"!==t)return!1;if(!t.match(/^\d+$/))return!1;var e=0|+t;return e>=0&&e<=255},A={};Object.defineProperty(A,"__esModule",{value:!0}),A.default=void 0;var $=r;A.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:":";return(0,$.withParams)({type:"macAddress"},(function(e){if(!(0,$.req)(e))return!0;if("string"!=typeof e)return!1;var n="string"==typeof t&&""!==t?e.split(t):12===e.length||16===e.length?e.match(/.{2}/g):null;return null!==n&&(6===n.length||8===n.length)&&n.every(E)}))};var E=function(t){return t.toLowerCase().match(/^[0-9a-f]{2}$/)},P={};Object.defineProperty(P,"__esModule",{value:!0}),P.default=void 0;var I=r;P.default=function(t){return(0,I.withParams)({type:"maxLength",max:t},(function(e){return!(0,I.req)(e)||(0,I.len)(e)<=t}))};var R={};Object.defineProperty(R,"__esModule",{value:!0}),R.default=void 0;var _=r;R.default=function(t){return(0,_.withParams)({type:"minLength",min:t},(function(e){return!(0,_.req)(e)||(0,_.len)(e)>=t}))};var z={};Object.defineProperty(z,"__esModule",{value:!0}),z.default=void 0;var j=r,B=(0,j.withParams)({type:"required"},(function(t){return(0,j.req)("string"==typeof t?t.trim():t)}));z.default=B;var V={};Object.defineProperty(V,"__esModule",{value:!0}),V.default=void 0;var F=r;V.default=function(t){return(0,F.withParams)({type:"requiredIf",prop:t},(function(e,n){return!(0,F.ref)(t,this,n)||(0,F.req)(e)}))};var L={};Object.defineProperty(L,"__esModule",{value:!0}),L.default=void 0;var q=r;L.default=function(t){return(0,q.withParams)({type:"requiredUnless",prop:t},(function(e,n){return!!(0,q.ref)(t,this,n)||(0,q.req)(e)}))};var W={};Object.defineProperty(W,"__esModule",{value:!0}),W.default=void 0;var J=r;W.default=function(t){return(0,J.withParams)({type:"sameAs",eq:t},(function(e,n){return e===(0,J.ref)(t,this,n)}))};var K={};Object.defineProperty(K,"__esModule",{value:!0}),K.default=void 0;var H=(0,r.regex)("url",/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i);K.default=H;var Y={};Object.defineProperty(Y,"__esModule",{value:!0}),Y.default=void 0;var U=r;Y.default=function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&e.reduce((function(e,n){return e||n.apply(t,r)}),!1)}))};var G={};Object.defineProperty(G,"__esModule",{value:!0}),G.default=void 0;var Z=r;G.default=function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&e.reduce((function(e,n){return e&&n.apply(t,r)}),!0)}))};var X={};Object.defineProperty(X,"__esModule",{value:!0}),X.default=void 0;var Q=r;X.default=function(t){return(0,Q.withParams)({type:"not"},(function(e,n){return!(0,Q.req)(e)||!t.call(this,e,n)}))};var tt={};Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var et=r;tt.default=function(t){return(0,et.withParams)({type:"minValue",min:t},(function(e){return!(0,et.req)(e)||(!/\s/.test(e)||e instanceof Date)&&+e>=+t}))};var nt={};Object.defineProperty(nt,"__esModule",{value:!0}),nt.default=void 0;var rt=r;nt.default=function(t){return(0,rt.withParams)({type:"maxValue",max:t},(function(e){return!(0,rt.req)(e)||(!/\s/.test(e)||e instanceof Date)&&+e<=+t}))};var it={};Object.defineProperty(it,"__esModule",{value:!0}),it.default=void 0;var ot=(0,r.regex)("integer",/(^[0-9]*$)|(^-[0-9]+$)/);it.default=ot;var st={};Object.defineProperty(st,"__esModule",{value:!0}),st.default=void 0;var lt=(0,r.regex)("decimal",/^[-]?\d*(\.\d+)?$/);function at(t){this.content=t}function ct(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){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let t=0;i.text[t]==o.text[t];t++)n++;return n}if(i.content.size||o.content.size){let t=ct(i.content,o.content,n+1);if(null!=t)return t}n+=i.nodeSize}else n+=i.nodeSize}}function ht(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),a=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let t=0,e=Math.min(s.text.length,l.text.length);for(;t>1}},at.from=function(t){if(t instanceof at)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new at(e)};class ut{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let n=0;nt&&!1!==n(l,r+s,i||null,o)&&l.content.size){let i=s+1;l.nodesBetween(Math.max(0,t-i),Math.min(l.content.size,e-i),n,r+i)}s=a}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let i="",o=!0;return this.nodesBetween(t,e,((s,l)=>{s.isText?(i+=s.text.slice(Math.max(t,l)-l,e-l),o=!n):s.isLeaf?(r?i+="function"==typeof r?r(s):r:s.type.spec.leafText&&(i+=s.type.spec.leafText(s)),o=!n):!o&&s.isBlock&&(i+=n,o=!0)}),0),i}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),i=1);it)for(let i=0,o=0;ot&&((oe)&&(s=s.isText?s.cut(Math.max(0,t-o),Math.min(s.text.length,e-o)):s.cut(Math.max(0,t-o-1),Math.min(s.content.size,e-o-1))),n.push(s),r+=s.nodeSize),o=l}return new ut(n,r)}cutByIndex(t,e){return t==e?ut.empty:0==t&&e==this.content.length?this:new ut(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),i=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new ut(r,i)}addToStart(t){return new ut([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new ut(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;ethis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=t)return i==t||e>0?ft(n+1,i):ft(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((t=>t.toJSON())):null}static fromJSON(t,e){if(!e)return ut.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new ut(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return ut.empty;let e,n=0;for(let r=0;rthis.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;et.type.rank-e.type.rank)),e}}mt.none=[];class gt extends Error{}class yt{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=wt(this.content,t+this.openStart,e);return n&&new yt(n,this.openStart,this.openEnd)}removeBetween(t,e){return new yt(vt(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return yt.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new yt(ut.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let i=t.firstChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)r++;return new yt(t,n,r)}}function vt(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(vt(o.content,e-i-1,n-i-1)))}function wt(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=wt(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function bt(t,e,n){if(n.openStart>t.depth)throw new gt("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new gt("Inconsistent open depths");return xt(t,e,n,0)}function xt(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0;i--)r=e.node(i).copy(ut.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return Ct(o,Dt(t,i,s,e,r))}{let r=t.parent,i=r.content;return Ct(r,i.cut(0,t.parentOffset).append(n.content).append(i.cut(e.parentOffset)))}}return Ct(o,Nt(t,e,r))}function St(t,e){if(!e.type.compatibleContent(t.type))throw new gt("Cannot join "+e.type.name+" onto "+t.type.name)}function kt(t,e,n){let r=t.node(n);return St(r,e.node(n)),r}function Mt(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Ot(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&&(Mt(t.nodeAfter,r),o++));for(let l=o;li&&kt(t,e,i+1),s=r.depth>i&&kt(n,r,i+1),l=[];return Ot(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(St(o,s),Mt(Ct(o,Dt(t,e,n,r,i+1)),l)):(o&&Mt(Ct(o,Nt(t,e,i+1)),l),Ot(e,n,i,l),s&&Mt(Ct(s,Nt(n,r,i+1)),l)),Ot(r,null,i,l),new ut(l)}function Nt(t,e,n){let r=[];if(Ot(null,t,n,r),t.depth>n){Mt(Ct(kt(t,e,n+1),Nt(t,e,n+1)),r)}return Ot(e,null,n,r),new ut(r)}yt.empty=new yt(ut.empty,0,0);class Tt{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let i=0;i0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new Pt(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,i=e;for(let o=t;;){let{index:t,offset:e}=o.content.findIndex(i),s=i-e;if(n.push(o,t,r+e),!s)break;if(o=o.child(t),o.isText)break;i=s-1,r+=e+1}return new Tt(e,n,i)}static resolveCached(t,e){for(let r=0;rt&&this.nodesBetween(t,e,(t=>(n.isInSet(t.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),zt(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=ut.empty,r=0,i=n.childCount){let o=this.contentMatchAt(t).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let l=r;lt.type.name))}`);this.content.forEach((t=>t.check()))}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((t=>t.toJSON()))),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=ut.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}}Rt.prototype.text=void 0;class _t extends Rt{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):zt(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new _t(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new _t(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function zt(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class jt{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new Bt(t,e);if(null==n.next)return jt.empty;let r=Vt(n);n.next&&n.err("Unexpected trailing text");let i=function(t){let e=Object.create(null);return n(Kt(t,0));function n(r){let i=[];r.forEach((e=>{t[e].forEach((({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)}))}))}));let o=e[r.join(",")]=new jt(r.indexOf(t.length-1)>-1);for(let t=0;tt.to=e))}function o(t,e){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(o(n,e))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(e,s),i(o(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return i(o(t.expr,e),s),i(o(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(e)].concat(o(t.expr,e));if("range"==t.type){let s=e;for(let e=0;et.createAndFill())));for(let t=0;t=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function e(n){t.push(n);for(let r=0;r{let r=n+(e.validEnd?"*":" ")+" ";for(let i=0;i"+t.indexOf(e.next[i].next);return r})).join("\n")}}jt.empty=new jt(!0);class Bt{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function Vt(t){let e=[];do{e.push(Ft(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function Ft(t){let e=[];do{e.push(Lt(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function Lt(t){let e=function(t){if(t.eat("(")){let e=Vt(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let t=n[o];t.groups.indexOf(e)>-1&&i.push(t)}0==i.length&&t.err("No node type or group '"+e+"' found");return i}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(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("{"))break;e=Wt(t,e)}return e}function qt(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Wt(t,e){let n=qt(t),r=n;return t.eat(",")&&(r="}"!=t.next?qt(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Jt(t,e){return e-t}function Kt(t,e){let n=[];return function e(r){let i=t[r];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(r);for(let t=0;t-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;er[e]=new t(e,n,i)));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 t in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class Zt{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Xt{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=Ut(r.attrs),this.excluded=null;let i=Ht(this.attrs);this.instance=i?new mt(this,i):null}create(t=null){return!t&&this.instance?this.instance:new mt(this,Yt(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach(((t,i)=>n[t]=new Xt(t,r++,e,i))),n}removeFromSet(t){for(var e=0;e-1}}class Qt{constructor(t){this.cached=Object.create(null);let e=this.spec={};for(let r in t)e[r]=t[r];e.nodes=at.from(t.nodes),e.marks=at.from(t.marks||{}),this.nodes=Gt.compile(this.spec.nodes,this),this.marks=Xt.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let t=this.nodes[r],e=t.spec.content||"",i=t.spec.marks;t.contentMatch=n[e]||(n[e]=jt.parse(e,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.markSet="_"==i?null:i?te(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let r in this.marks){let t=this.marks[r],e=t.spec.excludes;t.excluded=null==e?[t]:""==e?[]:te(this,e.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof Gt))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new _t(n,n.defaultAttrs,t,mt.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return Rt.fromJSON(this,t)}markFromJSON(t){return mt.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function te(t,e){let n=[];for(let r=0;r-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class ee{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)})),this.normalizeLists=!this.tags.some((e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}parse(t,e={}){let n=new le(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new le(this,e,!0);return n.addAll(t,e.from,e.to),yt.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;rt.length&&(61!=o.charCodeAt(t.length)||o.slice(t.length+1)!=e))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r{n(t=ce(t)),t.mark||t.ignore||t.clearMark||(t.mark=r)}))}for(let r in t.nodes){let e=t.nodes[r].spec.parseDOM;e&&e.forEach((t=>{n(t=ce(t)),t.node||t.ignore||t.mark||(t.node=r)}))}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new ee(t,ee.schemaRules(t)))}}const ne={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},re={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ie={ol:!0,ul:!0};function oe(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class se{constructor(t,e,n,r,i,o,s){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=mt.none,this.stashMarks=[],this.match=o||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(ut.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=ut.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(ut.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;e{o.clearMark(t)&&(n=t.addToSet(n))})):e=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(e),!1!==o.consuming)break;i=o}return[e,n]}addElementByRule(t,e,n){let r,i,o;if(e.node)i=this.parser.schema.nodes[e.node],i.isLeaf?this.insertNode(i.create(e.attrs))||this.leafFallback(t):r=this.enter(i,e.attrs||null,e.preserveWhitespace);else{o=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(o)}let s=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((t=>this.insertNode(t)));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(t,e,n){let r=e||0;for(let i=e?t.childNodes[e]:t.firstChild,o=null==n?null:t.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(i);this.findAtPoint(t,r)}findPlace(t){let e,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(t);if(o&&(!e||e.length>o.length)&&(e=o,n=i,!o.length))break;if(i.solid)break}if(!e)return!1;this.sync(n);for(let r=0;rthis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(t,s)=>{for(;t>=0;t--){let l=e[t];if(""==l){if(t==e.length-1||0==t)continue;for(;s>=i;s--)if(o(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!t||t.name!=l&&-1==t.groups.indexOf(l))return!1;s--}}return!0};return o(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(t){let e=function(t,e){for(let n=0;n=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);let e=r.popFromStashMark(t);e&&r.type&&r.type.allowsMarkType(e.type)&&(r.activeMarks=e.addToSet(r.activeMarks))}if(r==e)break}}}function ae(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function ce(t){let e={};for(let n in t)e[n]=t[n];return e}function he(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=t=>{o.push(t);for(let n=0;n{if(i.length||t.marks.length){let n=0,o=0;for(;n=0;r--){let i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&ue.renderSpec(fe(n),r(t,e))}static renderSpec(t,e,n=null){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let r,i=e[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?t.createElementNS(n,i):t.createElement(i),l=e[1],a=1;if(l&&"object"==typeof l&&null==l.nodeType&&!Array.isArray(l)){a=2;for(let t in l)if(null!=l[t]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),l[t]):s.setAttribute(t,l[t])}}for(let c=a;ca)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:o}=ue.renderSpec(t,i,n);if(s.appendChild(e),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new ue(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=de(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return de(t.marks)}}function de(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function fe(t){return t.document||window.document}const pe=Math.pow(2,16);function me(t){return 65535&t}class ge{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class ye{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&ye.empty)return ye.empty}recover(t){let e=0,n=me(t);if(!this.inverted)for(let r=0;rt)break;let a=this.ranges[s+i],c=this.ranges[s+o],h=l+a;if(t<=h){let i=l+r+((a?t==l?-1:t==h?1:e:e)<0?0:c);if(n)return i;let o=t==(e<0?l:h)?null:s/3+(t-l)*pe,u=t==l?2:t==h?1:4;return(e<0?t!=l:t!=h)&&(u|=8),new ge(i,u,o)}r+=c-a}return n?t+r:new ge(t+r,0,null)}touches(t,e){let n=0,r=me(e),i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;st)break;let l=this.ranges[s+i];if(t<=e+l&&s==3*r)return!0;n+=this.ranges[s+o]-l}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new ve;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;ni&&et.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),r),e.openStart,e.openEnd);return xe.fromReplace(t,this.from,this.to,i)}invert(){return new Me(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new ke(e.pos,n.pos,this.mark)}merge(t){return t instanceof ke&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new ke(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ke(e.from,e.to,t.markFromJSON(e.mark))}}be.jsonID("addMark",ke);class Me extends be{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new yt(Se(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return xe.fromReplace(t,this.from,this.to,n)}invert(){return new ke(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new Me(e.pos,n.pos,this.mark)}merge(t){return t instanceof Me&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Me(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Me(e.from,e.to,t.markFromJSON(e.mark))}}be.jsonID("removeMark",Me);class Oe extends be{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return xe.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return xe.fromReplace(t,this.pos,this.pos+1,new yt(ut.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;nn.pos?null:new Ne(e.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ne(e.from,e.to,e.gapFrom,e.gapTo,yt.fromJSON(t,e.slice),e.insert,!!e.structure)}}function Te(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 t=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,i--}}return!1}function Ae(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function $e(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),i=t.$from.index(n),o=t.$to.indexAfter(n);if(no;c--,h--){let t=i.node(c),e=i.index(c);if(t.type.spec.isolating)return!1;let n=t.content.cutByIndex(e,t.childCount),o=r&&r[h+1];o&&(n=n.replaceChild(0,o.type.create(o.attrs)));let s=r&&r[h]||t;if(!t.canReplace(e+1,t.childCount)||!s.type.validContent(n))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function Re(t,e){let n=t.resolve(e),r=n.index();return i=n.nodeBefore,o=n.nodeAfter,!(!i||!o||i.isLeaf||!i.canAppend(o))&&n.parent.canReplace(r,r+1);var i,o}function _e(t,e,n=e,r=yt.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return ze(i,o,r)?new De(e,n,r):new je(i,o,r).fit()}function ze(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}be.jsonID("replaceAround",Ne);class je{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=ut.empty;for(let r=0;r<=t.depth;r++){let e=t.node(r);this.frontier.push({type:e.type,match:e.contentMatchAt(t.indexAfter(r))})}for(let r=t.depth;r>0;r--)this.placed=ut.from(t.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(t<0?this.$to:n.doc.resolve(t));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let l=new yt(i,o,s);return t>-1?new Ne(n.pos,t,this.$to.pos,this.$to.end(),l,e):l.size||n.pos!=this.$to.pos?new De(n.pos,r.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n1&&(r=0),i.type.spec.isolating&&r<=n){t=n;break}e=i.content}for(let e=1;e<=2;e++)for(let n=1==e?t:this.unplaced.openStart;n>=0;n--){let t,r=null;n?(r=Fe(this.unplaced.content,n-1).firstChild,t=r.content):t=this.unplaced.content;let i=t.firstChild;for(let o=this.depth;o>=0;o--){let t,{type:s,match:l}=this.frontier[o],a=null;if(1==e&&(i?l.matchType(i.type)||(a=l.fillBefore(ut.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:o,parent:r,inject:a};if(2==e&&i&&(t=l.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:o,parent:r,wrap:t};if(r&&l.matchType(r.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Fe(t,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new yt(t,e+1,Math.max(n,r.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Fe(t,e);if(r.childCount<=1&&e>0){let i=t.size-e<=e+r.size;this.unplaced=new yt(Be(t,e-1,1),e-1,i?e-1:n)}else this.unplaced=new yt(Be(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:r,wrap:i}){for(;this.depth>e;)this.closeFrontierNode();if(i)for(let p=0;p1||0==l||t.content.size)&&(h=e,c.push(Le(t.mark(u.allowedMarks(t.marks)),1==a?l:0,a==s.childCount?d:-1)))}let f=a==s.childCount;f||(d=-1),this.placed=Ve(this.placed,e,ut.from(c)),this.frontier[e].match=h,f&&d<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let p=0,m=s;p1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],i=e=0;n--){let{match:e,type:r}=this.frontier[n],i=qe(t,n,r,e,!0);if(!i||i.childCount)continue t}return{depth:e,fit:o,move:i?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Ve(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=Ve(this.placed,this.depth,ut.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(ut.empty,!0);t.childCount&&(this.placed=Ve(this.placed,this.frontier.length,t))}}function Be(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Be(t.firstChild.content,e-1,n)))}function Ve(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ve(t.lastChild.content,e-1,n)))}function Fe(t,e){for(let n=0;n1&&(r=r.replaceChild(0,Le(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ut.empty,!0)))),t.copy(r)}function qe(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&&!function(t,e,n){for(let r=n;rr){let e=i.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(ut.empty,!0))}return t}function Ke(t,e){let n=[];for(let r=Math.min(t.depth,e.depth);r>=0;r--){let i=t.start(r);if(ie.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(i==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==i-1)&&n.push(r)}return n}class He extends be{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return xe.fail("No node at attribute step's position");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,null,e.marks);return xe.fromReplace(t,this.pos,this.pos+1,new yt(ut.from(r),0,e.isLeaf?0:1))}getMap(){return ye.empty}invert(t){return new He(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new He(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new He(e.pos,e.attr,e.value)}}be.jsonID("attr",He);let Ye=class extends Error{};Ye=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(Ye.prototype=Object.create(Error.prototype)).constructor=Ye,Ye.prototype.name="TransformError";class Ue{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ve}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new Ye(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=yt.empty){let r=_e(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new yt(ut.from(n),0,0))}delete(t,e){return this.replace(t,e,yt.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(ze(i,o,r))return t.step(new De(e,n,r));let s=Ke(i,t.doc.resolve(n));0==s[s.length-1]&&s.pop();let l=-(i.depth+1);s.unshift(l);for(let d=i.depth,f=i.pos-1;d>0;d--,f--){let t=i.node(d).type.spec;if(t.defining||t.definingAsContext||t.isolating)break;s.indexOf(d)>-1?l=d:i.before(d)==f&&s.splice(1,0,-d)}let a=s.indexOf(l),c=[],h=r.openStart;for(let d=r.content,f=0;;f++){let t=d.firstChild;if(c.push(t),f==r.openStart)break;d=t.content}for(let d=h-1;d>=0;d--){let t=c[d].type,e=We(t);if(e&&i.node(a).type!=t)h=d;else if(e||!t.isTextblock)break}for(let d=r.openStart;d>=0;d--){let e=(d+h+1)%(r.openStart+1),l=c[e];if(l)for(let c=0;c=0&&(t.replace(e,n,r),!(t.steps.length>u));d--){let t=s[d];t<0||(e=i.before(t),n=o.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return function(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let i=r.depth-1;i>=0;i--){let t=r.index(i);if(r.node(i).canReplaceWith(t,t,n))return r.before(i+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let t=r.indexAfter(i);if(r.node(i).canReplaceWith(t,t,n))return r.after(i+1);if(t0&&(n||r.node(e-1).canReplace(r.index(e-1),i.indexAfter(e-1))))return t.delete(r.before(e),i.after(e))}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)return t.delete(r.before(s),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return function(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),l=i.after(o+1),a=s,c=l,h=ut.empty,u=0;for(let p=o,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,h=ut.from(r.node(p).copy(h)),u++):a--;let d=ut.empty,f=0;for(let p=o,m=!1;p>n;p--)m||i.after(p+1)=0;s--){if(r.size){let t=n[s].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ut.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Ne(i,o,i,o,new yt(r,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,r=null){return function(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,((e,n)=>{if(e.isTextblock&&!e.hasMarkup(r,i)&&function(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(t.doc,t.mapping.slice(o).map(n),r)){t.clearIncompatible(t.mapping.slice(o).map(n,1),r);let s=t.mapping.slice(o),l=s.map(n,1),a=s.map(n+e.nodeSize,1);return t.step(new Ne(l,a,l+1,a-1,new yt(ut.from(r.create(i,null,e.marks)),0,0),1,!0)),!1}}))}(this,t,e,n,r),this}setNodeMarkup(t,e,n=null,r){return function(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 Ne(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new yt(ut.from(s),0,0),1,!0))}(this,t,e,n,r),this}setNodeAttribute(t,e,n){return this.step(new He(t,e,n)),this}addNodeMark(t,e){return this.step(new Oe(t,e)),this}removeNodeMark(t,e){if(!(e instanceof mt)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new Ce(t,e)),this}split(t,e=1,n){return function(t,e,n=1,r){let i=t.doc.resolve(e),o=ut.empty,s=ut.empty;for(let l=i.depth,a=i.depth-n,c=n-1;l>a;l--,c--){o=ut.from(i.node(l).copy(o));let t=r&&r[c];s=ut.from(t?t.type.create(t.attrs,s):i.node(l).copy(s))}t.step(new De(e,e,new yt(o.append(s),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){return function(t,e,n,r){let i,o,s=[],l=[];t.doc.nodesBetween(e,n,((t,a,c)=>{if(!t.isInline)return;let h=t.marks;if(!r.isInSet(h)&&c.type.allowsMarkType(r.type)){let c=Math.max(a,e),u=Math.min(a+t.nodeSize,n),d=r.addToSet(h);for(let t=0;tt.step(e))),l.forEach((e=>t.step(e)))}(this,t,e,n),this}removeMark(t,e,n){return function(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,((t,s)=>{if(!t.isInline)return;o++;let l=null;if(r instanceof Xt){let e,n=t.marks;for(;e=r.isInSet(n);)(l||(l=[])).push(e),n=e.removeFromSet(n)}else r?r.isInSet(t.marks)&&(l=[r]):l=t.marks;if(l&&l.length){let r=Math.min(s+t.nodeSize,n);for(let t=0;tt.step(new Me(e.from,e.to,e.style))))}(this,t,e,n),this}clearIncompatible(t,e,n){return function(t,e,n,r=n.contentMatch){let i=t.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l=0;l--)t.step(o[l])}(this,t,e,n),this}}const Ge=Object.create(null);class Ze{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new Xe(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e=0;i--){let r=e<0?an(t.node(0),t.node(i),t.before(i+1),t.index(i),e,n):an(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,n);if(r)return r}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new sn(t.node(0))}static atStart(t){return an(t,t,0,0,1)||new sn(t)}static atEnd(t){return an(t,t,t.content.size,t.childCount,-1)||new sn(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Ge[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in Ge)throw new RangeError("Duplicate use of selection JSON ID "+t);return Ge[t]=e,e.prototype.jsonID=t,e}getBookmark(){return en.between(this.$anchor,this.$head).getBookmark()}}Ze.prototype.visible=!0;class Xe{constructor(t,e){this.$from=t,this.$to=e}}let Qe=!1;function tn(t){Qe||t.parent.inlineContent||(Qe=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class en extends Ze{constructor(t,e=t){tn(t),tn(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return Ze.near(n);let r=t.resolve(e.map(this.anchor));return new en(r.parent.inlineContent?r:n,n)}replace(t,e=yt.empty){if(super.replace(t,e),e==yt.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof en&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new nn(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new en(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if(n&&!r||(n=r>=0?1:-1),!e.parent.inlineContent){let t=Ze.findFrom(e,n,!0)||Ze.findFrom(e,-n,!0);if(!t)return Ze.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r||(t=(Ze.findFrom(t,-n,!0)||Ze.findFrom(t,n,!0)).$anchor).posnew sn(t)};function an(t,e,n,r,i,o=!1){if(e.inlineContent)return en.create(t,n);for(let s=r-(i>0?0:1);i>0?s=0;s+=i){let r=e.child(s);if(r.isAtom){if(!o&&rn.isSelectable(r))return rn.create(t,n-(i<0?r.nodeSize:0))}else{let e=an(t,r,n+i,i<0?r.childCount:0,i,o);if(e)return e}n+=r.nodeSize*i}return null}function cn(t,e,n){let r=t.steps.length-1;if(r{null==i&&(i=r)})),t.setSelection(Ze.near(t.doc.resolve(i),n)))}class hn extends Ue{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return mt.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||mt.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);let i=this.storedMarks;if(!i){let t=this.doc.resolve(e);i=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),this.selection.empty||this.setSelection(Ze.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function un(t,e){return e&&t?t.bind(e):t}class dn{constructor(t,e,n){this.name=t,this.init=un(e.init,n),this.apply=un(e.apply,n)}}const fn=[new dn("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new dn("selection",{init:(t,e)=>t.selection||Ze.atStart(e.doc),apply:t=>t.selection}),new dn("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new dn("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class pn{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=fn.slice(),e&&e.forEach((t=>{if(this.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new dn(t.key,t.spec.state,t))}))}}class mn{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;nt.toJSON()))),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],i=r.spec.state;i&&i.toJSON&&(e[n]=i.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let r=new pn(t.schema,t.plugins),i=new mn(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=Rt.fromJSON(t.schema,e.doc);else if("selection"==r.name)i.selection=Ze.fromJSON(i.doc,e.selection);else if("storedMarks"==r.name)e.storedMarks&&(i.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],l=s.spec.state;if(s.key==r.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(e,o))return void(i[r.name]=l.fromJSON.call(s,t,e[o],i))}i[r.name]=r.init(t,i)}})),i}}function gn(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):"handleDOMEvents"==r&&(i=gn(i,e,{})),n[r]=i}return n}class yn{constructor(t){this.spec=t,this.props={},t.props&&gn(t.props,this,this.props),this.key=t.key?t.key.key:wn("plugin")}getState(t){return t[this.key]}}const vn=Object.create(null);function wn(t){return t in vn?t+"$"+ ++vn[t]:(vn[t]=0,t+"$")}class bn{constructor(t="key"){this.key=wn(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const xn=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},Sn=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let kn=null;const Mn=function(t,e,n){let r=kn||(kn=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},On=function(t,e,n,r){return n&&(Dn(t,e,n,r,-1)||Dn(t,e,n,r,1))},Cn=/^(img|br|input|textarea|hr)$/i;function Dn(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Nn(t))){let n=t.parentNode;if(!n||1!=n.nodeType||Tn(t)||Cn.test(t.nodeName)||"false"==t.contentEditable)return!1;e=xn(t)+(i<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(i<0?-1:0)]).contentEditable)return!1;e=i<0?Nn(t):0}}}function Nn(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Tn(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const An=function(t){return t.focusNode&&On(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function $n(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const En="undefined"!=typeof navigator?navigator:null,Pn="undefined"!=typeof document?document:null,In=En&&En.userAgent||"",Rn=/Edge\/(\d+)/.exec(In),_n=/MSIE \d/.exec(In),zn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(In),jn=!!(_n||zn||Rn),Bn=_n?document.documentMode:zn?+zn[1]:Rn?+Rn[1]:0,Vn=!jn&&/gecko\/(\d+)/i.test(In);Vn&&(/Firefox\/(\d+)/.exec(In)||[0,0])[1];const Fn=!jn&&/Chrome\/(\d+)/.exec(In),Ln=!!Fn,qn=Fn?+Fn[1]:0,Wn=!jn&&!!En&&/Apple Computer/.test(En.vendor),Jn=Wn&&(/Mobile\/\w+/.test(In)||!!En&&En.maxTouchPoints>2),Kn=Jn||!!En&&/Mac/.test(En.platform),Hn=!!En&&/Win/.test(En.platform),Yn=/Android \d/.test(In),Un=!!Pn&&"webkitFontSmoothing"in Pn.documentElement.style,Gn=Un?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Zn(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Xn(t,e){return"number"==typeof t?t:t[e]}function Qn(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 tr(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=Sn(s)){if(1!=s.nodeType)continue;let t=s,n=t==o.body,l=n?Zn(o):Qn(t),a=0,c=0;if(e.topl.bottom-Xn(r,"bottom")&&(c=e.bottom-l.bottom+Xn(i,"bottom")),e.leftl.right-Xn(r,"right")&&(a=e.right-l.right+Xn(i,"right")),a||c)if(n)o.defaultView.scrollBy(a,c);else{let n=t.scrollLeft,r=t.scrollTop;c&&(t.scrollTop+=c),a&&(t.scrollLeft+=a);let i=t.scrollLeft-n,o=t.scrollTop-r;e={left:e.left-i,top:e.top-o,right:e.right-i,bottom:e.bottom-o}}if(n)break}}function er(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Sn(r));return e}function nr(t,e){for(let n=0;n=c){a=Math.max(f.bottom,a),c=Math.min(f.top,c);let t=f.left>e.left?f.left-e.left:f.right=(f.left+f.right)/2?1:0));continue}}else f.top>e.top&&!i&&f.left<=e.left&&f.right>=e.left&&(i=h,o={left:Math.max(f.left,Math.min(f.right,e.left)),top:f.top});!n&&(e.left>=f.right&&e.top>=f.top||e.left>=f.left&&e.top>=f.bottom)&&(l=u+1)}}return!n&&i&&(n=i,r=o,s=0),n&&3==n.nodeType?function(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(n.left+n.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:t,offset:l}:ir(n,r)}function or(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,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}n==t.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?s=t.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(s=function(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let e=t.docView.nearestDesc(o,!0);if(!e)return null;if(1==e.dom.nodeType&&(e.node.isBlock&&e.parent&&!s||!e.contentDOM)){let t=e.dom.getBoundingClientRect();if(e.node.isBlock&&e.parent&&!s&&(s=!0,t.left>r.left||t.top>r.top?i=e.posBefore:(t.right-1?i:t.docView.posFromDOM(e,n,-1)}(t,n,i,e))}null==s&&(s=function(t,e,n){let{node:r,offset:i}=ir(e,n),o=-1;if(1==r.nodeType&&!r.firstChild){let t=r.getBoundingClientRect();o=t.left!=t.right&&n.left>(t.left+t.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}(t,l,e));let a=t.docView.nearestDesc(l,!0);return{pos:s,inside:a?a.posAtStart-a.border:-1}}function ar(t){return t.top=0&&i==r.nodeValue.length?(t--,o=1):n<0?t--:e++,dr(cr(Mn(r,t,e),o),o<0)}{let t=cr(Mn(r,i,i),n);if(Vn&&i&&/\s/.test(r.nodeValue[i-1])&&i=0)}if(null==o&&i&&(n<0||i==Nn(r))){let t=r.childNodes[i-1],e=3==t.nodeType?Mn(t,Nn(t)-(s?0:1)):1!=t.nodeType||"BR"==t.nodeName&&t.nextSibling?null:t;if(e)return dr(cr(e,1),!1)}if(null==o&&i=0)}function dr(t,e){if(0==t.width)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function fr(t,e){if(0==t.height)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function pr(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()}}const mr=/[\u0590-\u08ac]/;let gr=null,yr=null,vr=!1;function wr(t,e,n){return gr==e&&yr==n?vr:(gr=e,yr=n,vr="up"==n||"down"==n?function(t,e,n){let r=e.selection,i="up"==n?r.$from:r.$to;return pr(t,e,(()=>{let{node:e}=t.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=t.docView.nearestDesc(e,!0);if(!n)break;if(n.node.isBlock){e=n.contentDOM||n.dom;break}e=n.dom.parentNode}let r=ur(t,i.pos,1);for(let t=e.firstChild;t;t=t.nextSibling){let e;if(1==t.nodeType)e=t.getClientRects();else{if(3!=t.nodeType)continue;e=Mn(t,0,t.nodeValue.length).getClientRects()}for(let t=0;ti.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(t,e,n):function(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 mr.test(r.parent.textContent)&&l.modify?pr(t,e,(()=>{let{focusNode:e,focusOffset:i,anchorNode:o,anchorOffset:s}=t.domSelectionRange(),a=l.caretBidiLevel;l.modify("move",n,"character");let c=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:u}=t.domSelectionRange(),d=h&&!c.contains(1==h.nodeType?h:h.parentNode)||e==h&&i==u;try{l.collapse(o,s),e&&(e!=o||i!=s)&&l.extend&&l.extend(e,i)}catch(f){}return null!=a&&(l.caretBidiLevel=a),d})):"left"==n||"backward"==n?o:s}(t,e,n))}class br{constructor(t,e,n,r){this.parent=t,this.children=e,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;exn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!1;break}if(e.previousSibling)break}if(null==r&&e==t.childNodes.length)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!0;break}if(e.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let n=!0,r=t;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!e||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==t.nodeType?t:t.parentNode):i==t))return o;n=!1}}}getDesc(t){let e=t.pmViewDesc;for(let n=e;n;n=n.parent)if(n==this)return e}posFromDOM(t,e,n){for(let r=t;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(t,e,n)}return-1}descAt(t){for(let e=0,n=0;et||e instanceof Dr){r=t-i;break}i=o}if(r)return this.children[n].domFromPos(r-this.children[n].border,e);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof xr&&i.side>=0;n--);if(e<=0){let t,r=!0;for(;t=n?this.children[n-1]:null,t&&t.dom.parentNode!=this.contentDOM;n--,r=!1);return t&&e&&r&&!t.border&&!t.domAtom?t.domFromPos(t.size,e):{node:this.contentDOM,offset:t?xn(t.dom)+1:0}}{let t,r=!0;for(;t=n=i&&e<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(t,e,i);t=o;for(let e=s;e>0;e--){let n=this.children[e-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=xn(n.dom)+1;break}t-=n.size}-1==r&&(r=0)}if(r>-1&&(l>e||s==this.children.length-1)){e=l;for(let t=s+1;tf&&oe){let t=s;s=l,l=t}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(s.node,s.offset),a.removeAllRanges(),a.addRange(n)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let n=0,r=0;r=n:tn){let r=n+i.border,s=o-i.border;if(t>=r&&e<=s)return this.dirty=t==n||e==o?2:1,void(t!=r||e!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(t-r,e-r):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let n=1==t?2:1;e.dirtyi?i.parent?i.parent.posBeforeChild(i):void 0:r))),!e.type.spec.raw){if(1!=o.nodeType){let t=document.createElement("span");t.appendChild(o),o=t}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(t,[],o,null),this.widget=e,this.widget=e,i=this}matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return!!e&&e(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Sr extends br{constructor(t,e,n,r){super(t,[],e,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class kr extends br{constructor(t,e,n,r){super(t,[],n,r),this.mark=e}static create(t,e,n,r){let i=r.nodeViews[e.type.name],o=i&&i(e,r,n);return o&&o.dom||(o=ue.renderSpec(document,e.type.spec.toDOM(e,n))),new kr(t,e,o.dom,o.contentDOM||o.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),0!=this.dirty){let t=this.parent;for(;!t.node;)t=t.parent;t.dirty0&&(i=Vr(i,0,t,n));for(let s=0;ss?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),c=a&&a.dom,h=a&&a.contentDOM;if(e.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(e.text);else c||({dom:c,contentDOM:h}=ue.renderSpec(document,e.type.spec.toDOM(e)));h||e.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),e.type.spec.draggable&&(c.draggable=!0));let u=c;return c=Rr(c,n,e),a?s=new Nr(t,e,n,r,c,h||null,u,a,i,o+1):e.isText?new Cr(t,e,n,r,c,u,i):new Mr(t,e,n,r,c,h||null,u,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>ut.empty)}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(t,e,n){return 0==this.dirty&&t.eq(this.node)&&_r(e,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let n=this.node.inlineContent,r=e,i=t.composing?this.localCompositionInfo(t,e):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,l=new jr(this,o&&o.node,t);!function(t,e,n,r){let i=e.locals(t),o=0;if(0==i.length){for(let n=0;no;)l.push(i[s++]);let d=o+h.nodeSize;if(h.isText){let t=d;s!t.inline)):l.slice(),e.forChild(o,h),u),o=d}}(this.node,this.innerDeco,((e,i,o)=>{e.spec.marks?l.syncToMarks(e.spec.marks,n,t):e.type.side>=0&&!o&&l.syncToMarks(i==this.node.childCount?mt.none:this.node.child(i).marks,n,t),l.placeWidget(e,t,r)}),((e,o,a,c)=>{let h;l.syncToMarks(e.marks,n,t),l.findNodeMatch(e,o,a,c)||s&&t.state.selection.from>r&&t.state.selection.to-1&&l.updateNodeAt(e,o,a,h,t)||l.updateNextNode(e,o,a,t,c,r)||l.addNode(e,o,a,t,r),r+=e.nodeSize})),l.syncToMarks([],n,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(o&&this.protectLocalComposition(t,o),Tr(this.contentDOM,this.children,t),Jn&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))}localCompositionInfo(t,e){let{from:n,to:r}=t.state.selection;if(!(t.state.selection instanceof en)||ne+this.node.content.size)return null;let i=t.domSelectionRange(),o=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];e=Nn(t=t.childNodes[e-1])}else{if(!(1==t.nodeType&&e=n){let t=l=0&&t+e.length+l>=n)return l+t;if(n==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}(this.node.content,t,n-e,r-e);return i<0?null:{node:o,pos:i,text:t}}return{node:o,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:n,text:r}){if(this.getDesc(e))return;let i=e;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new Sr(this,i,e,r);t.input.compositionNodes.push(o),this.children=Vr(this.children,n,n+r.length,t,o)}update(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)}updateInner(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(t){if(_r(t,this.outerDeco))return;let e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Pr(this.dom,this.nodeDOM,Er(this.outerDeco,this.node,e),Er(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Or(t,e,n,r,i){Rr(r,e,t);let o=new Mr(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Cr extends Mr{constructor(t,e,n,r,i,o,s){super(t,e,n,r,i,null,o,s,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0)}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,n){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,n)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,e,n){let r=this.node.cut(t,e),i=document.createTextNode(r.text);return new Cr(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(t,e){super.markDirty(t,e),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class Dr extends br{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Nr extends Mr{constructor(t,e,n,r,i,o,s,l,a,c){super(t,e,n,r,i,o,s,a,c),this.spec=l}update(t,e,n,r){if(3==this.dirty)return!1;if(this.spec.update){let i=this.spec.update(t,e,n);return i&&this.updateInner(t,e,n,r),i}return!(!this.contentDOM&&!t.isLeaf)&&super.update(t,e,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,n,r){this.spec.setSelection?this.spec.setSelection(t,e,n):super.setSelection(t,e,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function Tr(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o0;){let l;for(;;)if(r){let t=n.children[r-1];if(!(t instanceof kr)){l=t,r--;break}n=t,r=t.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let n=t;n>1,o=Math.min(i,t.length);for(;r-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=kr.create(this.top,t[i],e,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(t,e,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(t,e,n))o=this.top.children.indexOf(i,this.index);else for(let s=this.index,l=Math.min(this.top.children.length,s+5);s=n||h<=e?o.push(a):(cn&&o.push(a.slice(n-c,a.size,r)))}return o}function Fr(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&&0==i.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l,a,c=r.resolve(s);if(An(n)){for(l=c;i&&!i.node;)i=i.parent;let t=i.node;if(i&&t.isAtom&&rn.isSelectable(t)&&i.parent&&(!t.isInline||!function(t,e,n){for(let r=0==e,i=e==Nn(t);r||i;){if(t==n)return!0;let e=xn(t);if(!(t=t.parentNode))return!1;r=r&&0==e,i=i&&e==Nn(t)}}(n.focusNode,n.focusOffset,i.dom))){let t=i.posBefore;a=new rn(s==t?c:r.resolve(t))}}else{let e=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(e<0)return null;l=r.resolve(e)}if(!a){a=Gr(t,l,c,"pointer"==e||t.state.selection.head{n.anchorNode==r&&n.anchorOffset==i||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{Lr(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Wr=Wn||Ln&&qn<63;function Jr(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=rr(t,e,n)))||en.between(e,n,r)}function Zr(t){return!(t.editable&&!t.hasFocus())&&Xr(t)}function Xr(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(n){return!1}}function Qr(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&&Ze.findFrom(o,e)}function ti(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function ei(t,e,n){let r=t.state.selection;if(!(r instanceof en)){if(r instanceof rn&&r.node.isInline)return ti(t,new en(e>0?r.$to:r.$from));{let n=Qr(t.state,e);return!!n&&ti(t,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let n=Qr(t.state,e);return!!(n&&n instanceof rn)&&ti(t,n)}if(!(Kn&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=e<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=t.docView.descAt(s))&&!n.contentDOM)&&(rn.isSelectable(o)?ti(t,new rn(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):!!Un&&ti(t,new en(t.state.doc.resolve(e<0?s:s+o.nodeSize))))}}function ni(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function ri(t){let e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function ii(t,e){return e<0?function(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;Vn&&1==n.nodeType&&r0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(ri(t))i=n,o=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(si(n))break;{let e=n.previousSibling;for(;e&&ri(e);)i=n.parentNode,o=xn(e),e=e.previousSibling;if(e)n=e,r=ni(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?li(t,n,r):i&&li(t,i,o)}(t):oi(t)}function oi(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=ni(n);for(;;)if(r{t.state==i&&qr(t)}),50)}function ai(t,e){let n=t.state.doc.resolve(e);if(!Ln&&!Hn&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let n=t.coordsAtPos(e-1),i=(n.top+n.bottom)/2;if(i>r.top&&i1)return n.leftr.top&&i1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(t.dom).direction?"rtl":"ltr"}function ci(t,e,n){let r=t.state.selection;if(r instanceof en&&!r.empty||n.indexOf("s")>-1)return!1;if(Kn&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=Qr(t.state,e);if(n&&n instanceof rn)return ti(t,n)}if(!i.parent.inlineContent){let n=e<0?i:o,s=r instanceof sn?Ze.near(n,e):Ze.findFrom(n,e);return!!s&&ti(t,s)}return!1}function hi(t,e){if(!(t.state.selection instanceof en))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 r=t.state.tr;return e<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),t.dispatch(r),!0}return!1}function ui(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function di(t,e){let n=e.keyCode,r=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);if(8==n||Kn&&72==n&&"c"==r)return hi(t,-1)||ii(t,-1);if(46==n&&!e.shiftKey||Kn&&68==n&&"c"==r)return hi(t,1)||ii(t,1);if(13==n||27==n)return!0;if(37==n||Kn&&66==n&&"c"==r){let e=37==n?"ltr"==ai(t,t.state.selection.from)?-1:1:-1;return ei(t,e,r)||ii(t,e)}if(39==n||Kn&&70==n&&"c"==r){let e=39==n?"ltr"==ai(t,t.state.selection.from)?1:-1:1;return ei(t,e,r)||ii(t,e)}return 38==n||Kn&&80==n&&"c"==r?ci(t,-1,r)||ii(t,-1):40==n||Kn&&78==n&&"c"==r?function(t){if(!Wn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;ui(t,n,"true"),setTimeout((()=>ui(t,n,"false")),20)}return!1}(t)||ci(t,1,r)||oi(t):r==(Kn?"m":"c")&&(66==n||73==n||89==n||90==n)}function fi(t,e){t.someProp("transformCopied",(n=>{e=n(e,t)}));let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let s=t.someProp("clipboardSerializer")||ue.fromSchema(t.state.schema),l=ki(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c,h=a.firstChild,u=0;for(;h&&1==h.nodeType&&(c=xi[h.nodeName.toLowerCase()]);){for(let t=c.length-1;t>=0;t--){let e=l.createElement(c[t]);for(;a.firstChild;)e.appendChild(a.firstChild);a.appendChild(e),u++}h=a.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",`${i} ${o}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:a,text:t.someProp("clipboardTextSerializer",(n=>n(e,t)))||e.content.textBetween(0,e.content.size,"\n\n")}}function pi(t,e,n,r,i){let o,s,l=i.parent.type.spec.code;if(!n&&!e)return null;let a=e&&(r||l||!n);if(a){if(t.someProp("transformPastedText",(n=>{e=n(e,l||r,t)})),l)return e?new yt(ut.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):yt.empty;let n=t.someProp("clipboardTextParser",(n=>n(e,i,r,t)));if(n)s=n;else{let n=i.marks(),{schema:r}=t.state,s=ue.fromSchema(r);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((t=>{let e=o.appendChild(document.createElement("p"));t&&e.appendChild(s.serializeNode(r.text(t,n)))}))}}else t.someProp("transformPastedHTML",(e=>{n=e(n,t)})),o=function(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=ki().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t);(n=i&&xi[i[1].toLowerCase()])&&(t=n.map((t=>"<"+t+">")).join("")+t+n.map((t=>"")).reverse().join(""));if(r.innerHTML=t,n)for(let o=0;o0;u--){let t=o.firstChild;for(;t&&1!=t.nodeType;)t=t.nextSibling;if(!t)break;o=t}if(!s){let e=t.someProp("clipboardParser")||t.someProp("domParser")||ee.fromSchema(t.state.schema);s=e.parseSlice(o,{preserveWhitespace:!(!a&&!h),context:i,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||mi.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(h)s=function(t,e){if(!t.size)return t;let n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(l){return t}let{content:i,openStart:o,openEnd:s}=t;for(let a=n.length-2;a>=0;a-=2){let t=r.nodes[n[a]];if(!t||t.hasRequiredAttrs())break;i=ut.from(t.create(n[a+1],i)),o++,s++}return new yt(i,o,s)}(bi(s,+h[1],+h[2]),h[4]);else if(s=yt.maxOpen(function(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r,i=e.node(n).contentMatchAt(e.index(n)),o=[];if(t.forEach((t=>{if(!o)return;let e,n=i.findWrapping(t.type);if(!n)return o=null;if(e=o.length&&r.length&&yi(n,r,t,o[o.length-1],0))o[o.length-1]=e;else{o.length&&(o[o.length-1]=vi(o[o.length-1],r.length));let e=gi(t,n);o.push(e),i=i.matchType(e.type),r=n}})),o)return ut.from(o)}return t}(s.content,i),!0),s.openStart||s.openEnd){let t=0,e=0;for(let n=s.content.firstChild;t{s=e(s,t)})),s}const mi=/^(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 gi(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,ut.from(t));return t}function yi(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(ut.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function bi(t,e,n){return e{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=e=>Ai(t,e))}))}function Ai(t,e){return t.someProp("handleDOMEvents",(n=>{let r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)}))}function $i(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||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Ei(t){return{left:t.clientX,top:t.clientY}}function Pi(t,e,n,r,i){if(-1==r)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,(e=>s>o.depth?e(t,n,o.nodeAfter,o.before(s),i,!0):e(t,n,o.node(s),o.before(s),i,!1))))return!0;return!1}function Ii(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function Ri(t,e,n,r,i){return Pi(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(n=>n(t,e,r)))||(i?function(t,e){if(-1==e)return!1;let n,r,i=t.state.selection;i instanceof rn&&(n=i.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let t=s>o.depth?o.nodeAfter:o.node(s);if(rn.isSelectable(t)){r=n&&i.$from.depth>0&&s>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(s);break}}return null!=r&&(Ii(t,rn.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&rn.isSelectable(r))&&(Ii(t,new rn(n),"pointer"),!0)}(t,n))}function _i(t,e,n,r){return Pi(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(n=>n(t,e,r)))}function zi(t,e,n,r){return Pi(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(n=>n(t,e,r)))||function(t,e,n){if(0!=n.button)return!1;let r=t.state.doc;if(-1==e)return!!r.inlineContent&&(Ii(t,en.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let e=o>i.depth?i.nodeAfter:i.node(o),n=i.before(o);if(e.inlineContent)Ii(t,en.create(r,n+1,n+1+e.content.size),"pointer");else{if(!rn.isSelectable(e))continue;Ii(t,rn.create(r,n),"pointer")}return!0}}(t,n,r)}function ji(t){return Ji(t)}Oi.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!Fi(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!Yn||!Ln||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!Jn||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||di(t,n)?n.preventDefault():Ni(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,$n(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},Oi.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},Oi.keypress=(t,e)=>{let n=e;if(Fi(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Kn&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof en&&r.$from.sameParent(r.$to))){let e=String.fromCharCode(n.charCode);/[\r\n]/.test(e)||t.someProp("handleTextInput",(n=>n(t,r.$from.pos,r.$to.pos,e)))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const Bi=Kn?"metaKey":"ctrlKey";Mi.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=ji(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&function(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[Bi]&&("singleClick"==t.input.lastClick.type?o="doubleClick":"doubleClick"==t.input.lastClick.type&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(Ei(n));s&&("singleClick"==o?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Vi(t,s,n,!!r)):("doubleClick"==o?_i:zi)(t,s.pos,s.inside,n)?n.preventDefault():Ni(t,"pointer"))};class Vi{constructor(t,e,n,r){let i,o;if(this.view=t,this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[Bi],this.allowDefault=n.shiftKey,e.inside>-1)i=t.state.doc.nodeAt(e.inside),o=e.inside;else{let n=t.state.doc.resolve(e.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,l=s?t.docView.nearestDesc(s,!0):null;this.target=l?l.dom:null;let{selection:a}=t.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||a instanceof rn&&a.from<=o&&a.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Vn||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ni(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>qr(this.view))),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Ei(t))),this.updateAllowDefault(t),this.allowDefault||!e?Ni(this.view,"pointer"):Ri(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||Wn&&this.mightDrag&&!this.mightDrag.node.isAtom||Ln&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(Ii(this.view,Ze.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):Ni(this.view,"pointer")}move(t){this.updateAllowDefault(t),Ni(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function Fi(t,e){return!!t.composing||!!(Wn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}Mi.touchstart=t=>{t.input.lastTouch=Date.now(),ji(t),Ni(t,"pointer")},Mi.touchmove=t=>{t.input.lastTouch=Date.now(),Ni(t,"pointer")},Mi.contextmenu=t=>ji(t);const Li=Yn?5e3:-1;function qi(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>Ji(t)),e))}function Wi(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Ji(t,e=!1){if(!(Yn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Wi(t),e||t.docView&&t.docView.dirty){let e=Fr(t);return e&&!e.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(e)):t.updateState(t.state),!0}return!1}}Oi.compositionstart=Oi.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))))t.markCursor=t.state.storedMarks||n.marks(),Ji(t,!0),t.markCursor=null;else if(Ji(t),Vn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelectionRange();for(let n=e.focusNode,r=e.focusOffset;n&&1==n.nodeType&&0!=r;){let e=r<0?n.lastChild:n.childNodes[r-1];if(!e)break;if(3==e.nodeType){t.domSelection().collapse(e,e.nodeValue.length);break}n=e,r=-1}}t.input.composing=!0}qi(t,Li)},Oi.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionID++,qi(t,20))};const Ki=jn&&Bn<15||Jn&&Gn<604;function Hi(t,e,n,r,i){let o=pi(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,i,o||yt.empty))))return!0;if(!o)return!1;let s=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(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}Mi.copy=Oi.cut=(t,e)=>{let n=e,r=t.state.selection,i="cut"==n.type;if(r.empty)return;let o=Ki?null:n.clipboardData,s=r.content(),{dom:l,text:a}=fi(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):function(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)}(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Oi.paste=(t,e)=>{let n=e;if(t.composing&&!Yn)return;let r=Ki?null:n.clipboardData,i=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&Hi(t,r.getData("text/plain"),r.getData("text/html"),i,n)?n.preventDefault():function(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&&45!=t.input.lastKeyCode;setTimeout((()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Hi(t,r.value,null,i,e):Hi(t,r.textContent,r.innerHTML,i,e)}),50)}(t,n)};class Yi{constructor(t,e){this.slice=t,this.move=e}}const Ui=Kn?"altKey":"ctrlKey";Mi.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(Ei(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof rn?i.to-1:i.to));else if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(rn.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&t.dispatch(t.state.tr.setSelection(rn.create(t.state.doc,e.posBefore)))}let s=t.state.selection.content(),{dom:l,text:a}=fi(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Ki?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ki||n.dataTransfer.setData("text/plain",a),t.dragging=new Yi(s,!n[Ui])},Mi.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},Oi.dragover=Oi.dragenter=(t,e)=>e.preventDefault(),Oi.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Ei(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",(e=>{s=e(s,t)})):s=pi(t,n.dataTransfer.getData(Ki?"Text":"text/plain"),Ki?null:n.dataTransfer.getData("text/html"),!1,o);let l=!(!r||n[Ui]);if(t.someProp("handleDrop",(e=>e(t,n,s||yt.empty,l))))return void n.preventDefault();if(!s)return;n.preventDefault();let a=s?function(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o=0;t--){let e=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,n=r.index(t)+(e>0?1:0),s=r.node(t),l=!1;if(1==o)l=s.canReplace(n,n,i);else{let t=s.contentMatchAt(n).findWrapping(i.firstChild.type);l=t&&s.canReplaceWith(n,n,t[0])}if(l)return 0==e?r.pos:e<0?r.before(t+1):r.after(t+1)}return null}(t.state.doc,o.pos,s):o.pos;null==a&&(a=o.pos);let c=t.state.tr;l&&c.deleteSelection();let h=c.mapping.map(a),u=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,d=c.doc;if(u?c.replaceRangeWith(h,h,s.content.firstChild):c.replaceRange(h,h,s),c.doc.eq(d))return;let f=c.doc.resolve(h);if(u&&rn.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new rn(f));else{let e=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach(((t,n,r,i)=>e=i)),c.setSelection(Gr(t,f,c.doc.resolve(e)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Mi.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())&&qr(t)}),20))},Mi.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)},Mi.beforeinput=(t,e)=>{if(Ln&&Yn&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,$n(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let os in Oi)Mi[os]=Oi[os];function Gi(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}class Zi{constructor(t,e){this.toDOM=t,this.spec=e||no,this.side=this.spec.side||0}map(t,e,n,r){let{pos:i,deleted:o}=t.mapResult(e.from+r,this.side<0?-1:1);return o?null:new to(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof Zi&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Gi(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Xi{constructor(t,e){this.attrs=t,this.spec=e||no}map(t,e,n,r){let i=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,o=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new to(i,o,this)}valid(t,e){return e.from=t&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;ot){let s=this.children[o]+1;this.children[o+2].findInner(t-s,e-s,n,r+s,i)}}map(t,e,n){return this==io||0==t.maps.length?this:this.mapInner(t,e,0,0,n||no)}mapInner(t,e,n,r,i){let o;for(let s=0;s{let s=o-r-(n-e);for(let a=0;ao+h-t)continue;let c=l[a]+h-t;n>=c?l[a+1]=e<=c?-2:-1:r>=i&&s&&(l[a]+=s,l[a+1]+=s)}t+=s})),h=n.maps[c].map(h,-1)}let a=!1;for(let c=0;c=r.content.size){a=!0;continue}let u=n.map(t[c+1]+o,-1)-i,{index:d,offset:f}=r.content.findIndex(h),p=r.maybeChild(d);if(p&&f==h&&f+p.nodeSize==u){let r=l[c+2].mapInner(n,p,e+1,t[c]+o+1,s);r!=io?(l[c]=h,l[c+1]=u,l[c+2]=r):(l[c+1]=-2,a=!0)}else a=!0}if(a){let a=function(t,e,n,r,i,o,s){function l(t,e){for(let o=0;o{let s,l=o+n;if(s=lo(e,t,l)){for(r||(r=this.children.slice());io&&e.to=t){this.children[s]==t&&(n=this.children[s+2]);break}let i=t+1,o=i+e.content.size;for(let s=0;si&&t.type instanceof Xi){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;en.map(t,e,no)));return oo.from(n)}forChild(t,e){if(e.isLeaf)return ro.empty;let n=[];for(let r=0;rt instanceof ro))?t:t.reduce(((t,e)=>t.concat(e instanceof ro?e:e.members)),[]))}}}function so(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;rn&&o.to{let l=lo(t,e,s+n);if(l){o=!0;let t=co(l,e,n+s+1,r);t!=io&&i.push(s,s+e.nodeSize,t)}}));let s=so(o?ao(t):t,-n).sort(ho);for(let l=0;l0;)e++;t.splice(e,0,n)}function po(t){let e=[];return t.someProp("decorations",(n=>{let r=n(t.state);r&&r!=io&&e.push(r)})),t.cursorWrapper&&e.push(ro.create(t.state.doc,[t.cursorWrapper.deco])),oo.from(e)}const mo={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},go=jn&&Bn<=11;class yo{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class vo{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new yo,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((t=>{for(let e=0;e"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),go&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.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,mo)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;ethis.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(Zr(this.view)){if(this.suppressingSelectionUpdates)return qr(this.view);if(jn&&Bn<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&On(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e,n=new Set;for(let i=t.focusNode;i;i=Sn(i))n.add(i);for(let i=t.anchorNode;i;i=Sn(i))if(n.has(i)){e=i;break}let r=e&&this.view.docView.nearestDesc(e);return r&&r.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);let n=t.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Zr(t)&&!this.ignoreSelectionChange(n),i=-1,o=-1,s=!1,l=[];if(t.editable)for(let c=0;c1){let t=l.filter((t=>"BR"==t.nodeName));if(2==t.length){let e=t[0],n=t[1];e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}}let a=null;i<0&&r&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||r)&&(i>-1&&(t.docView.markDirty(i,o),function(t){if(wo.has(t))return;if(wo.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)){if(t.requiresGeckoHackNode=Vn,bo)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),bo=!0}}(t)),this.handleDOMChange(i,o,s,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||qr(t),this.currentSelection.set(n))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(let n=0;nDate.now()-50?t.input.lastSelectionOrigin:null,n=Fr(t,e);if(n&&!t.state.selection.eq(n)){if(Ln&&Yn&&13===t.input.lastKeyCode&&Date.now()-100e(t,$n(13,"Enter")))))return;let r=t.state.tr.setSelection(n);"pointer"==e?r.setMeta("pointer",!0):"key"==e&&r.scrollIntoView(),t.composing&&r.setMeta("composition",t.input.compositionID),t.dispatch(r)}return}let o=t.state.doc.resolve(e),s=o.sharedDepth(n);e=o.before(s+1),n=t.state.doc.resolve(n).after(s+1);let l,a,c=t.state.selection,h=function(t,e,n){let r,{node:i,fromOffset:o,toOffset:s,from:l,to:a}=t.docView.parseRange(e,n),c=t.domSelectionRange(),h=c.anchorNode;if(h&&t.dom.contains(1==h.nodeType?h:h.parentNode)&&(r=[{node:h,offset:c.anchorOffset}],An(c)||r.push({node:c.focusNode,offset:c.focusOffset})),Ln&&8===t.input.lastKeyCode)for(let g=s;g>o;g--){let t=i.childNodes[g-1],e=t.pmViewDesc;if("BR"==t.nodeName&&!e){s=g;break}if(!e||e.size)break}let u=t.state.doc,d=t.someProp("domParser")||ee.fromSchema(t.state.schema),f=u.resolve(l),p=null,m=d.parse(i,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:xo,context:f});if(r&&null!=r[0].pos){let t=r[0].pos,e=r[1]&&r[1].pos;null==e&&(e=t),p={anchor:t+l,head:e+l}}return{doc:m,sel:p,from:l,to:a}}(t,e,n),u=t.state.doc,d=u.slice(h.from,h.to);8===t.input.lastKeyCode&&Date.now()-100=s?o-r:0,l=o+(l-s),s=o}else if(l=l?o-r:0,s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}(d.content,h.doc.content,h.from,l,a);if((Jn&&t.input.lastIOSEnter>Date.now()-225||Yn)&&i.some((t=>1==t.nodeType&&!So.test(t.nodeName)))&&(!f||f.endA>=f.endB)&&t.someProp("handleKeyDown",(e=>e(t,$n(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(!f){if(!(r&&c instanceof en&&!c.empty&&c.$head.sameParent(c.$anchor))||t.composing||h.sel&&h.sel.anchor!=h.sel.head){if(h.sel){let e=Mo(t,t.state.doc,h.sel);if(e&&!e.eq(t.state.selection)){let n=t.state.tr.setSelection(e);t.composing&&n.setMeta("composition",t.input.compositionID),t.dispatch(n)}}return}f={start:c.from,endA:c.to,endB:c.to}}if(Ln&&t.cursorWrapper&&h.sel&&h.sel.anchor==t.cursorWrapper.deco.from&&h.sel.head==h.sel.anchor){let t=f.endB-f.start;h.sel={anchor:h.sel.anchor+t,head:h.sel.anchor+t}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&f.start<=t.state.selection.from+2&&t.state.selection.from>=h.from?f.start=t.state.selection.from:f.endA=t.state.selection.to-2&&t.state.selection.to<=h.to&&(f.endB+=t.state.selection.to-f.endA,f.endA=t.state.selection.to)),jn&&Bn<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>h.from&&"  "==h.doc.textBetween(f.start-h.from-1,f.start-h.from+1)&&(f.start--,f.endA--,f.endB--);let p,m=h.doc.resolveNoCache(f.start-h.from),g=h.doc.resolveNoCache(f.endB-h.from),y=u.resolve(f.start),v=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=f.endA;if((Jn&&t.input.lastIOSEnter>Date.now()-225&&(!v||i.some((t=>"DIV"==t.nodeName||"P"==t.nodeName)))||!v&&m.pose(t,$n(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>f.start&&function(t,e,n,r,i){if(!r.parent.isTextblock||n-e<=i.pos-r.pos||Oo(r,!0,!1)n||Oo(s,!0,!1)e(t,$n(8,"Backspace")))))return void(Yn&&Ln&&t.domObserver.suppressSelectionUpdates());Ln&&Yn&&f.endB==f.start&&(t.input.lastAndroidDelete=Date.now()),Yn&&!v&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==f.endA&&(f.endB-=2,g=h.doc.resolveNoCache(f.endB-h.from),setTimeout((()=>{t.someProp("handleKeyDown",(function(e){return e(t,$n(13,"Enter"))}))}),20));let w,b,x,S=f.start,k=f.endA;if(v)if(m.pos==g.pos)jn&&Bn<=11&&0==m.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((()=>qr(t)),20)),w=t.state.tr.delete(S,k),b=u.resolve(f.start).marksAcross(u.resolve(f.endA));else if(f.endA==f.endB&&(x=function(t,e){let n,r,i,o=t.firstChild.marks,s=e.firstChild.marks,l=o,a=s;for(let h=0;ht.mark(r.addToSet(t.marks));else{if(0!=l.length||1!=a.length)return null;r=a[0],n="remove",i=t=>t.mark(r.removeFromSet(t.marks))}let c=[];for(let h=0;hn(t,S,k,e))))return;w=t.state.tr.insertText(e,S,k)}if(w||(w=t.state.tr.replace(S,k,h.doc.slice(f.start-h.from,f.endB-h.from))),h.sel){let e=Mo(t,w.doc,h.sel);e&&!(Ln&&Yn&&t.composing&&e.empty&&(f.start!=f.endB||t.input.lastAndroidDeletee.content.size?null:Gr(t,e.resolve(n.anchor),e.resolve(n.head))}function Oo(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let e=t.node(r).maybeChild(t.indexAfter(r));for(;e&&!e.isLeaf;)e=e.firstChild,i++}return i}class Co{constructor(t,e){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 Di,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach($o),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=To(this),No(this),this.nodeViews=Ao(this),this.docView=Or(this.state.doc,Do(this),po(this),this.dom,this),this.domObserver=new vo(this,((t,e,n,r)=>ko(this,t,e,n,r))),this.domObserver.start(),function(t){for(let e in Mi){let n=Mi[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=e=>{!$i(t,e)||Ai(t,e)||!t.editable&&e.type in Oi||n(t,e)},Ci[e]?{passive:!0}:void 0)}Wn&&t.dom.addEventListener("input",(()=>null)),Ti(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Ti(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach($o),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let n in this._props)e[n]=this._props[n];e.state=this.state;for(let n in t)e[n]=t[n];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){let n=this.state,r=!1,i=!1;t.storedMarks&&this.composing&&(Wi(this),i=!0),this.state=t;let o=n.plugins!=t.plugins||this._props.plugins!=e.plugins;if(o||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let t=Ao(this);(function(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})(t,this.nodeViews)&&(this.nodeViews=t,r=!0)}(o||e.handleDOMEvents!=this._props.handleDOMEvents)&&Ti(this),this.editable=To(this),No(this);let s=po(this),l=Do(this),a=n.plugins==t.plugins||n.doc.eq(t.doc)?t.scrollToSelection>n.scrollToSelection?"to selection":"preserve":"reset",c=r||!this.docView.matchesNode(t.doc,l,s);!c&&t.selection.eq(n.selection)||(i=!0);let h="preserve"==a&&i&&null==this.dom.style.overflowAnchor&&function(t){let e,n,r=t.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s=i-20){e=r,n=l.top;break}}return{refDOM:e,refTop:n,stack:er(t.dom)}}(this);if(i){this.domObserver.stop();let e=c&&(jn||Ln)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&function(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)}(n.selection,t.selection);if(c){let n=Ln?this.trackWrites=this.domSelectionRange().focusNode:null;!r&&this.docView.update(t.doc,l,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Or(t.doc,l,s,this.dom,this)),n&&!this.trackWrites&&(e=!0)}e||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return On(e.node,e.offset,n.anchorNode,n.anchorOffset)}(this))?qr(this,e):(Yr(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==a?this.dom.scrollTop=0:"to selection"==a?this.scrollToSelection():h&&function({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;nr(n,0==r?0:r-e)}(h)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(t=>t(this))));else if(this.state.selection instanceof rn){let e=this.docView.domAfterPos(this.state.selection.from);1==e.nodeType&&tr(this,e.getBoundingClientRect(),t)}else tr(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let e=0;ee.ownerDocument.getSelection()),this._root=e;return t||document}posAtCoords(t){return lr(this,t)}coordsAtPos(t,e=1){return ur(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,n=-1){let r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,e){return wr(this,e||this.state,t)}pasteHTML(t,e){return Hi(this,"",t,!1,e||new ClipboardEvent("paste"))}pasteText(t,e){return Hi(this,t,null,!0,e||new ClipboardEvent("paste"))}destroy(){this.docView&&(!function(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)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],po(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){return function(t,e){Ai(t,e)||!Mi[e.type]||!t.editable&&e.type in Oi||Mi[e.type](t,e)}(this,t)}dispatch(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return Wn&&11===this.root.nodeType&&function(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom?function(t){let e;function n(t){t.preventDefault(),t.stopImmediatePropagation(),e=t.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0);let r=e.startContainer,i=e.startOffset,o=e.endContainer,s=e.endOffset,l=t.domAtPos(t.state.selection.anchor);return On(l.node,l.offset,o,s)&&([r,i,o,s]=[o,s,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Do(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(t.state)),n)for(let t in n)"class"==t?e.class+=" "+n[t]:"style"==t?e.style=(e.style?e.style+";":"")+n[t]:e[t]||"contenteditable"==t||"nodeName"==t||(e[t]=String(n[t]))})),e.translate||(e.translate="no"),[to.node(0,t.state.doc.content.size,e)]}function No(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:to.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function To(t){return!t.someProp("editable",(e=>!1===e(t.state)))}function Ao(t){let e=Object.create(null);function n(t){for(let n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function $o(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")}for(var Eo={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:"'"},Po={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Io="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Ro="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),_o="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),zo=Ro||Io&&+Io[1]<57,jo=0;jo<10;jo++)Eo[48+jo]=Eo[96+jo]=String(jo);for(jo=1;jo<=24;jo++)Eo[jo+111]="F"+jo;for(jo=65;jo<=90;jo++)Eo[jo]=String.fromCharCode(jo+32),Po[jo]=String.fromCharCode(jo);for(var Bo in Eo)Po.hasOwnProperty(Bo)||(Po[Bo]=Eo[Bo]);const Vo="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Fo(t){let e,n,r,i,o=t.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let l=0;l127)&&(r=Eo[n.keyCode])&&r!=i){let i=e[Lo(r,n)];if(i&&i(t.state,t.dispatch,t))return!0}}return!1}}const Jo=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Ko(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function Ho(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 Yo(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1{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=Uo(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let r=n.after(),i=t.tr.replaceWith(r,r,s.createAndFill());i.setSelection(Ze.near(i.doc.resolve(r),1)),e(i.scrollIntoView())}return!0};const Zo=(t,e)=>{let{$from:n,$to:r}=t.selection;if(t.selection instanceof rn&&t.selection.node.isBlock)return!(!n.parentOffset||!Ie(t.doc,n.pos)||(e&&e(t.tr.split(n.pos).scrollIntoView()),0));if(!n.parent.isBlock)return!1;if(e){let i=r.parentOffset==r.parent.content.size,o=t.tr;(t.selection instanceof en||t.selection instanceof sn)&&o.deleteSelection();let s=0==n.depth?null:Uo(n.node(-1).contentMatchAt(n.indexAfter(-1))),l=Xo&&Xo(r.parent,i),a=l?[l]:i&&s?[{type:s}]:void 0,c=Ie(o.doc,o.mapping.map(n.pos),1,a);if(a||c||!Ie(o.doc,o.mapping.map(n.pos),1,s?[{type:s}]:void 0)||(s&&(a=[{type:s}]),c=!0),c&&(o.split(o.mapping.map(n.pos),1,a),!i&&!n.parentOffset&&n.parent.type!=s)){let t=o.mapping.map(n.before()),e=o.doc.resolve(t);s&&n.node(-1).canReplaceWith(e.index(),e.index()+1,s)&&o.setNodeMarkup(o.mapping.map(n.before()),s)}e(o.scrollIntoView())}return!0};var Xo;function Qo(t,e,n){let r,i,o=e.nodeBefore,s=e.nodeAfter;if(o.type.spec.isolating||s.type.spec.isolating)return!1;if(function(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!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&&!Re(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(r=(i=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&i.matchType(r[0]||s.type).validEnd){if(n){let i=e.pos+s.nodeSize,l=ut.empty;for(let t=r.length-1;t>=0;t--)l=ut.from(r[t].create(null,l));l=ut.from(o.copy(l));let a=t.tr.step(new Ne(e.pos-1,i,e.pos,i,new yt(l,1,0),r.length,!0)),c=i+2*r.length;Re(a.doc,c)&&a.join(c),n(a.scrollIntoView())}return!0}let a=Ze.findFrom(e,1),c=a&&a.$from.blockRange(a.$to),h=c&&$e(c);if(null!=h&&h>=e.depth)return n&&n(t.tr.lift(c,h).scrollIntoView()),!0;if(l&&Ko(s,"start",!0)&&Ko(o,"end")){let r=o,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let l=s,a=1;for(;!l.isTextblock;l=l.firstChild)a++;if(r.canReplace(r.childCount,r.childCount,l.content)){if(n){let r=ut.empty;for(let t=i.length-1;t>=0;t--)r=ut.from(i[t].copy(r));n(t.tr.step(new Ne(e.pos-i.length,e.pos+s.nodeSize,e.pos+a,e.pos+s.nodeSize-a,new yt(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ts(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(en.create(e.doc,t<0?i.start(o):i.end(o)))),!0)}}const es=ts(-1),ns=ts(1);function rs(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)i=!0;else{let e=n.doc.resolve(o),r=e.index();i=e.parent.canReplaceWith(r,r+1,t)}}))}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r{if(s)return!1;s=t.inlineContent&&t.type.allowsMarkType(n)})),s)return!0}return!1}(n.doc,s,t))return!1;if(r)if(o)t.isInSet(n.storedMarks||o.marks())?r(n.tr.removeStoredMark(t)):r(n.tr.addStoredMark(t.create(e)));else{let i=!1,o=n.tr;for(let e=0;!i&&e{let r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}(t,n);if(!r)return!1;let i=Ho(r);if(!i){let n=r.blockRange(),i=n&&$e(n);return null!=i&&(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Qo(t,i,e))return!0;if(0==r.parent.content.size&&(Ko(o,"end")||rn.isSelectable(o))){let n=_e(t.doc,r.before(),r.after(),yt.empty);if(n&&n.slice.size{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=Ho(r)}let s=o&&o.nodeBefore;return!(!s||!rn.isSelectable(s))&&(e&&e(t.tr.setSelection(rn.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)})),as=ss(Jo,((t,e,n)=>{let r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{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{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}),((t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof sn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Uo(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let n=(!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 r=n.before();if(Ie(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&$e(r);return null!=i&&(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)}),Zo),"Mod-Enter":Go,Backspace:ls,"Mod-Backspace":ls,"Shift-Backspace":ls,Delete:as,"Mod-Delete":as,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new sn(t.doc))),!0)},hs={"Ctrl-h":cs.Backspace,"Alt-Backspace":cs["Mod-Backspace"],"Ctrl-d":cs.Delete,"Ctrl-Alt-Backspace":cs["Mod-Delete"],"Alt-Delete":cs["Mod-Delete"],"Alt-d":cs["Mod-Delete"],"Ctrl-a":es,"Ctrl-e":ns};for(let os in cs)hs[os]=cs[os];const us=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?hs:cs;class ds{constructor(t,e){var n;this.match=t,this.match=t,this.handler="string"==typeof e?(n=e,function(t,e,r,i){let o=n;if(e[1]){let t=e[0].lastIndexOf(e[1]);o+=e[0].slice(t+e[1].length);let n=(r+=t)-i;n>0&&(o=e[0].slice(t-n,t)+o,r=i)}return t.tr.insertText(o,r,i)}):e}}const fs=500;function ps({rules:t}){let e=new yn({state:{init:()=>null,apply(t,e){let n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:(n,r,i,o)=>ms(n,r,i,o,t,e),handleDOMEvents:{compositionend:n=>{setTimeout((()=>{let{$cursor:r}=n.state.selection;r&&ms(n,r.pos,r.pos,"",t,e)}))}}},isInputRules:!0});return e}function ms(t,e,n,r,i,o){if(t.composing)return!1;let s=t.state,l=s.doc.resolve(e);if(l.parent.type.spec.code)return!1;let a=l.parent.textBetween(Math.max(0,l.parentOffset-fs),l.parentOffset,null,"")+r;for(let c=0;c{let n=t.plugins;for(let r=0;r=0;t--)n.step(r.steps[t].invert(r.docs[t]));if(i.text){let e=n.doc.resolve(i.from).marks();n.replaceWith(i.from,i.to,t.schema.text(i.text,e))}else n.delete(i.from,i.to);e(n)}return!0}}return!1};function ys(t,e,n=null,r){return new ds(t,((t,i,o,s)=>{let l=n instanceof Function?n(i):n,a=t.tr.delete(o,s),c=a.doc.resolve(o).blockRange(),h=c&&Ee(c,e,l);if(!h)return null;a.wrap(c,h);let u=a.doc.resolve(o-1).nodeBefore;return u&&u.type==e&&Re(a.doc,o-1)&&(!r||r(i,u))&&a.join(o-1),a}))}function vs(t,e,n=null){return new ds(t,((t,r,i,o)=>{let s=t.doc.resolve(i),l=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e)?t.tr.delete(i,o).setBlockType(i,i,e,l):null}))}const ws=["ol",0],bs=["ul",0],xs=["li",0],Ss={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1==t.attrs.order?ws:["ol",{start:t.attrs.order},0]},ks={parseDOM:[{tag:"ul"}],toDOM:()=>bs},Ms={parseDOM:[{tag:"li"}],toDOM:()=>xs,defining:!0};function Os(t,e){let n={};for(let r in t)n[r]=t[r];for(let r in e)n[r]=e[r];return n}function Cs(t,e,n){return t.append({ordered_list:Os(Ss,{content:"list_item+",group:n}),bullet_list:Os(ks,{content:"list_item+",group:n}),list_item:Os(Ms,{content:e})})}function Ds(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=!1,a=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(t)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;let t=n.doc.resolve(s.start-2);a=new Pt(t,t,s.depth),s.endIndex=0;h--)o=ut.from(n[h].type.create(n[h].attrs,o));t.step(new Ne(e.start-(r?2:0),e.end,e.start,e.end,new yt(o,0,0),n.length,!0));let s=0;for(let h=0;h=i.depth-3;t--)e=ut.from(i.node(t).copy(e));let s=i.indexAfter(-1){if(c>-1)return!1;t.isTextblock&&0==t.content.size&&(c=e+1)})),c>-1&&a.setSelection(Ze.near(a.doc.resolve(c))),r(a.scrollIntoView())}return!0}let a=o.pos==i.end()?l.contentMatchAt(0).defaultType:null,c=n.tr.delete(i.pos,o.pos),h=a?[e?{type:t,attrs:e}:null,{type:a}]:void 0;return!!Ie(c.doc,i.pos,2,h)&&(r&&r(c.split(i.pos,2,h).scrollIntoView()),!0)}}function Ts(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,(e=>e.childCount>0&&e.firstChild.type==t));return!!o&&(!n||(r.node(o.depth-1).type==t?function(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);om;p--)f-=i.child(p).nodeSize,r.delete(f-1,f+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=0==n.startIndex,a=n.endIndex==i.childCount,c=o.node(-1),h=o.index(-1);if(!c.canReplace(h+(l?0:1),h+1,s.content.append(a?ut.empty:ut.from(i))))return!1;let u=o.pos,d=u+s.nodeSize;return r.step(new Ne(u-(l?1:0),d+(a?1:0),u+1,d-1,new yt((l?ut.empty:ut.from(i.copy(ut.empty))).append(a?ut.empty:ut.from(i.copy(ut.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}(e,n,o)))}}function As(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,(e=>e.childCount>0&&e.firstChild.type==t));if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let l=o.parent,a=l.child(s-1);if(a.type!=t)return!1;if(n){let r=a.lastChild&&a.lastChild.type==l.type,i=ut.from(r?t.create():null),s=new yt(ut.from(t.create(null,ut.from(l.type.create(null,i)))),r?3:1,0),c=o.start,h=o.end;n(e.tr.step(new Ne(c-(r?3:1),h,c,h,s,1,!0)).scrollIntoView())}return!0}}var $s=200,Es=function(){};Es.prototype.append=function(t){return t.length?(t=Es.from(t),!this.length&&t||t.length<$s&&this.leafAppend(t)||this.length<$s&&t.leafPrepend(this)||this.appendInner(t)):this},Es.prototype.prepend=function(t){return t.length?Es.from(t).append(this):this},Es.prototype.appendInner=function(t){return new Is(this,t)},Es.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?Es.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Es.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Es.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Es.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},Es.from=function(t){return t instanceof Es?t:t&&t.length?new Ps(t):Es.empty};var Ps=function(t){function e(e){t.call(this),this.values=e}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(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var i=e;i=n;i--)if(!1===t(this.values[i],r+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=$s)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=$s)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Es);Es.empty=new Ps([]);var Is=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.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(t){return ti&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var i=this.left.length;return!(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,r+i))&&(!(n=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Es),Rs=Es;class _s{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}e&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,l=t.tr,a=[],c=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(i,e+1),r=n.maps.length),r--,void c.push(t);if(n){c.push(new zs(t.map));let e,i=t.step.map(n.slice(r));i&&l.maybeStep(i).doc&&(e=l.mapping.maps[l.mapping.maps.length-1],a.push(new zs(e,void 0,void 0,a.length+c.length))),r--,e&&n.appendMap(e,r)}else l.maybeStep(t.step);return t.selection?(o=n?t.selection.map(n.slice(r)):t.selection,s=new _s(this.items.slice(0,i).append(c.reverse().concat(a)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:o}}addTransform(t,e,n,r){let i=[],o=this.eventCount,s=this.items,l=!r&&s.length?s.get(s.length-1):null;for(let c=0;cBs&&(s=function(t,e){let n;return t.forEach(((t,r)=>{if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,a),o-=a),new _s(s.append(i),o)}remapping(t,e){let n=new ve;return this.items.forEach(((e,r)=>{let i=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,i)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new _s(this.items.append(t.map((t=>new zs(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),i=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),r);let l=e;this.items.forEach((e=>{let r=i.getMirror(--l);if(null==r)return;o=Math.min(o,r);let a=i.maps[r];if(e.step){let o=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(i.slice(l+1,r));c&&s++,n.push(new zs(a,o,c))}else n.push(new zs(a))}),r);let a=[];for(let u=e;u500&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let t=0;return this.items.forEach((e=>{e.step||t++})),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=t)r.push(o),o.selection&&i++;else if(o.step){let t=o.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let l=o.selection&&o.selection.map(e.slice(n));l&&i++;let a,c=new zs(s.invert(),t,l),h=r.length-1;(a=r.length&&r[h].merge(c))?r[h]=a:r.push(c)}}else o.map&&n--}),this.items.length,0),new _s(Rs.from(r.reverse()),i)}}_s.empty=new _s(Rs.empty,0);class zs{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new zs(e.getMap().invert(),e,this.selection)}}}class js{constructor(t,e,n,r,i){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}const Bs=20;function Vs(t){let e=[];return t.forEach(((t,n,r,i)=>e.push(r,i))),e}function Fs(t,e){if(!t)return null;let n=[];for(let r=0;rnew js(_s.empty,_s.empty,null,0,-1),apply:(e,n,r)=>function(t,e,n,r){let i,o=n.getMeta(Ks);if(o)return o.historyState;n.getMeta(Hs)&&(t=new js(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(Ks))return s.getMeta(Ks).redo?new js(t.done.addTransform(n,void 0,r,Js(e)),t.undone,Vs(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new js(t.done,t.undone.addTransform(n,void 0,r,Js(e)),null,t.prevTime,t.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new js(t.done.rebased(n,i),t.undone.rebased(n,i),Fs(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new js(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Fs(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);{let i=n.getMeta("composition"),o=0==t.prevTime||!s&&t.prevComposition!=i&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach(((t,r)=>{for(let i=0;i=e[i]&&(n=!0)})),n}(n,t.prevRanges)),l=s?Fs(t.prevRanges,n.mapping):Vs(n.mapping.maps[n.steps.length-1]);return new js(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,Js(e)),_s.empty,l,n.time,null==i?t.prevComposition:i)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?Us:"historyRedo"==n?Gs:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}const Us=(t,e)=>{let n=Ks.getState(t);return!(!n||0==n.done.eventCount)&&(e&&Ls(n,t,e,!1),!0)},Gs=(t,e)=>{let n=Ks.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&Ls(n,t,e,!0),!0)};function Zs(t){let e=Ks.getState(t);return e?e.done.eventCount:0}function Xs(t){let e=Ks.getState(t);return e?e.undone.eventCount:0} /*! * portal-vue © Thorsten Lünborg, 2019 * @@ -8,7 +8,7 @@ * * https://github.com/linusborg/portal-vue * - */function Qs(t){return(Qs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tl(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&void 0!==arguments[1]&&arguments[1],n=t.to,r=t.from;if(n&&(r||!1!==e)&&this.transports[n])if(e)this.transports[n]=[];else{var i=this.$_getTransportIndex(t);if(i>=0){var o=this.transports[n].slice(0);o.splice(i,1),this.transports[n]=o}}},registerTarget:function(t,e,n){el&&(this.trackInstances&&!n&&this.targets[t]&&console.warn("[portal-vue]: Target ".concat(t," already exists")),this.$set(this.targets,t,Object.freeze([e])))},unregisterTarget:function(t){this.$delete(this.targets,t)},registerSource:function(t,e,n){el&&(this.trackInstances&&!n&&this.sources[t]&&console.warn("[portal-vue]: source ".concat(t," already exists")),this.$set(this.sources,t,Object.freeze([e])))},unregisterSource:function(t){this.$delete(this.sources,t)},hasTarget:function(t){return!(!this.targets[t]||!this.targets[t][0])},hasSource:function(t){return!(!this.sources[t]||!this.sources[t][0])},hasContentFor:function(t){return!!this.transports[t]&&!!this.transports[t].length},$_getTransportIndex:function(t){var e=t.to,n=t.from;for(var r in this.transports[e])if(this.transports[e][r].from===n)return+r;return-1}}}),ll=new sl(rl),al=1,cl=Vue.extend({name:"portal",props:{disabled:{type:Boolean},name:{type:String,default:function(){return String(al++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}}},created:function(){var t=this;this.$nextTick((function(){ll.registerSource(t.name,t)}))},mounted:function(){this.disabled||this.sendUpdate()},updated:function(){this.disabled?this.clear():this.sendUpdate()},beforeDestroy:function(){ll.unregisterSource(this.name),this.clear()},watch:{to:function(t,e){e&&e!==t&&this.clear(e),this.sendUpdate()}},methods:{clear:function(t){var e={from:this.name,to:t||this.to};ll.close(e)},normalizeSlots:function(){return this.$scopedSlots.default?[this.$scopedSlots.default]:this.$slots.default},normalizeOwnChildren:function(t){return"function"==typeof t?t(this.slotProps):t},sendUpdate:function(){var t=this.normalizeSlots();if(t){var e={from:this.name,to:this.to,passengers:tl(t),order:this.order};ll.open(e)}else this.clear()}},render:function(t){var e=this.$slots.default||this.$scopedSlots.default||[],n=this.tag;return e&&this.disabled?e.length<=1&&this.slim?this.normalizeOwnChildren(e)[0]:t(n,[this.normalizeOwnChildren(e)]):this.slim?t():t(n,{class:{"v-portal":!0},style:{display:"none"},key:"v-portal-placeholder"})}}),hl=Vue.extend({name:"portalTarget",props:{multiple:{type:Boolean,default:!1},name:{type:String,required:!0},slim:{type:Boolean,default:!1},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},data:function(){return{transports:ll.transports,firstRender:!0}},created:function(){var t=this;this.$nextTick((function(){ll.registerTarget(t.name,t)}))},watch:{ownTransports:function(){this.$emit("change",this.children().length>0)},name:function(t,e){ll.unregisterTarget(e),ll.registerTarget(t,this)}},mounted:function(){var t=this;this.transition&&this.$nextTick((function(){t.firstRender=!1}))},beforeDestroy:function(){ll.unregisterTarget(this.name)},computed:{ownTransports:function(){var t=this.transports[this.name]||[];return this.multiple?t:0===t.length?[]:[t[t.length-1]]},passengers:function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.reduce((function(t,n){var r=n.passengers[0],i="function"==typeof r?r(e):n.passengers;return t.concat(i)}),[])}(this.ownTransports,this.slotProps)}},methods:{children:function(){return 0!==this.passengers.length?this.passengers:this.$scopedSlots.default?this.$scopedSlots.default(this.slotProps):this.$slots.default||[]},noWrapper:function(){var t=this.slim&&!this.transition;return t&&this.children().length>1&&console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element."),t}},render:function(t){var e=this.noWrapper(),n=this.children(),r=this.transition||this.tag;return e?n[0]:this.slim&&!r?t():t(r,{props:{tag:this.transition&&this.tag?this.tag:void 0},class:{"vue-portal-target":!0}},n)}}),ul=0,dl=["disabled","name","order","slim","slotProps","tag","to"],fl=["multiple","transition"],pl=Vue.extend({name:"MountingPortal",inheritAttrs:!1,props:{append:{type:[Boolean,String]},bail:{type:Boolean},mountTo:{type:String,required:!0},disabled:{type:Boolean},name:{type:String,default:function(){return"mounted_"+String(ul++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}},multiple:{type:Boolean,default:!1},targetSlim:{type:Boolean},targetSlotProps:{type:Object,default:function(){return{}}},targetTag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},created:function(){if("undefined"!=typeof document){var t=document.querySelector(this.mountTo);if(t){var e=this.$props;if(ll.targets[e.name])e.bail?console.warn("[portal-vue]: Target ".concat(e.name," is already mounted.\n Aborting because 'bail: true' is set")):this.portalTarget=ll.targets[e.name];else{var n=e.append;if(n){var r="string"==typeof n?n:"DIV",i=document.createElement(r);t.appendChild(i),t=i}var o=nl(this.$props,fl);o.slim=this.targetSlim,o.tag=this.targetTag,o.slotProps=this.targetSlotProps,o.name=this.to,this.portalTarget=new hl({el:t,parent:this.$parent||this,propsData:o})}}else console.error("[portal-vue]: Mount Point '".concat(this.mountTo,"' not found in document"))}},beforeDestroy:function(){var t=this.portalTarget;if(this.append){var e=t.$el;e.parentNode.removeChild(e)}t.$destroy()},render:function(t){if(!this.portalTarget)return console.warn("[portal-vue] Target wasn't mounted"),t();if(!this.$scopedSlots.manual){var e=nl(this.$props,dl);return t(cl,{props:e,attrs:this.$attrs,on:this.$listeners,scopedSlots:this.$scopedSlots},this.$slots.default)}var n=this.$scopedSlots.manual({to:this.to});return Array.isArray(n)&&(n=n[0]),n||t()}});var ml={install:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.component(e.portalName||"Portal",cl),t.component(e.portalTargetName||"PortalTarget",hl),t.component(e.MountingPortalName||"MountingPortal",pl)}},gl={exports:{}};gl.exports=function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",o="minute",s="hour",l="day",a="week",c="month",h="quarter",u="year",d="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},y=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:y,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function t(e,n){if(e.date()1)return t(s[0])}else{var l=e.name;b[l]=e,i=l}return!r&&i&&(w=i),i||!r&&w},k=function(t,e){if(x(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new O(n)},M=v;M.l=S,M.i=x,M.w=function(t,e){return k(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var O=function(){function g(t){this.$L=S(t.locale,null,!0),this.parse(t)}var y=g.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(M.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(p);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},y.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},y.$utils=function(){return M},y.isValid=function(){return!(this.$d.toString()===f)},y.isSame=function(t,e){var n=k(t);return this.startOf(e)<=n&&n<=this.endOf(e)},y.isAfter=function(t,e){return k(t)68?1900:2e3)},l=function(t){return function(e){this[t]=+e}},a=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),n=60*e[1]+(+e[2]||0);return 0===n?0:"+"===e[0]?-n:n}(t)}],c=function(t){var e=o[t];return e&&(e.indexOf?e:e.s.concat(e.f))},h=function(t,e){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(t.indexOf(r(i,0,e))>-1){n=i>12;break}}else n=t===(e?"pm":"PM");return n},u={A:[i,function(t){this.afternoon=h(t,!1)}],a:[i,function(t){this.afternoon=h(t,!0)}],S:[/\d/,function(t){this.milliseconds=100*+t}],SS:[n,function(t){this.milliseconds=10*+t}],SSS:[/\d{3}/,function(t){this.milliseconds=+t}],s:[r,l("seconds")],ss:[r,l("seconds")],m:[r,l("minutes")],mm:[r,l("minutes")],H:[r,l("hours")],h:[r,l("hours")],HH:[r,l("hours")],hh:[r,l("hours")],D:[r,l("day")],DD:[n,l("day")],Do:[i,function(t){var e=o.ordinal,n=t.match(/\d+/);if(this.day=n[0],e)for(var r=1;r<=31;r+=1)e(r).replace(/\[|\]/g,"")===t&&(this.day=r)}],M:[r,l("month")],MM:[n,l("month")],MMM:[i,function(t){var e=c("months"),n=(c("monthsShort")||e.map((function(t){return t.slice(0,3)}))).indexOf(t)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(t){var e=c("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e}],Y:[/[+-]?\d+/,l("year")],YY:[n,function(t){this.year=s(t)}],YYYY:[/\d{4}/,l("year")],Z:a,ZZ:a};function d(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,n,r){var o=r&&r.toUpperCase();return n||i[r]||t[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))).match(e),l=s.length,a=0;a-1)return new Date(("X"===e?1e3:1)*t);var r=d(e)(t),i=r.year,o=r.month,s=r.day,l=r.hours,a=r.minutes,c=r.seconds,h=r.milliseconds,u=r.zone,f=new Date,p=s||(i||o?1:f.getDate()),m=i||f.getFullYear(),g=0;i&&!o||(g=o>0?o-1:f.getMonth());var y=l||0,v=a||0,w=c||0,b=h||0;return u?new Date(Date.UTC(m,g,p,y,v,w,b+60*u.offset*1e3)):n?new Date(Date.UTC(m,g,p,y,v,w,b)):new Date(m,g,p,y,v,w,b)}catch(x){return new Date("")}}(e,l,r),this.init(),u&&!0!==u&&(this.$L=this.locale(u).$L),h&&e!=this.format(l)&&(this.$d=new Date("")),o={}}else if(l instanceof Array)for(var f=l.length,p=1;p<=f;p+=1){s[1]=l[p-1];var m=n.apply(this,s);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}p===f&&(this.$d=new Date(""))}else i.call(this,t)}}}();const wl=t(vl.exports);function bl(t){return{all:t=t||new Map,on:function(e,n){var r=t.get(e);r?r.push(n):t.set(e,[n])},off:function(e,n){var r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var r=t.get(e);r&&r.slice().map((function(t){t(n)})),(r=t.get("*"))&&r.slice().map((function(t){t(e,n)}))}}} + */function Qs(t){return(Qs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tl(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&void 0!==arguments[1]&&arguments[1],n=t.to,r=t.from;if(n&&(r||!1!==e)&&this.transports[n])if(e)this.transports[n]=[];else{var i=this.$_getTransportIndex(t);if(i>=0){var o=this.transports[n].slice(0);o.splice(i,1),this.transports[n]=o}}},registerTarget:function(t,e,n){el&&(this.trackInstances&&!n&&this.targets[t]&&console.warn("[portal-vue]: Target ".concat(t," already exists")),this.$set(this.targets,t,Object.freeze([e])))},unregisterTarget:function(t){this.$delete(this.targets,t)},registerSource:function(t,e,n){el&&(this.trackInstances&&!n&&this.sources[t]&&console.warn("[portal-vue]: source ".concat(t," already exists")),this.$set(this.sources,t,Object.freeze([e])))},unregisterSource:function(t){this.$delete(this.sources,t)},hasTarget:function(t){return!(!this.targets[t]||!this.targets[t][0])},hasSource:function(t){return!(!this.sources[t]||!this.sources[t][0])},hasContentFor:function(t){return!!this.transports[t]&&!!this.transports[t].length},$_getTransportIndex:function(t){var e=t.to,n=t.from;for(var r in this.transports[e])if(this.transports[e][r].from===n)return+r;return-1}}}),ll=new sl(rl),al=1,cl=Vue.extend({name:"portal",props:{disabled:{type:Boolean},name:{type:String,default:function(){return String(al++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}}},created:function(){var t=this;this.$nextTick((function(){ll.registerSource(t.name,t)}))},mounted:function(){this.disabled||this.sendUpdate()},updated:function(){this.disabled?this.clear():this.sendUpdate()},beforeDestroy:function(){ll.unregisterSource(this.name),this.clear()},watch:{to:function(t,e){e&&e!==t&&this.clear(e),this.sendUpdate()}},methods:{clear:function(t){var e={from:this.name,to:t||this.to};ll.close(e)},normalizeSlots:function(){return this.$scopedSlots.default?[this.$scopedSlots.default]:this.$slots.default},normalizeOwnChildren:function(t){return"function"==typeof t?t(this.slotProps):t},sendUpdate:function(){var t=this.normalizeSlots();if(t){var e={from:this.name,to:this.to,passengers:tl(t),order:this.order};ll.open(e)}else this.clear()}},render:function(t){var e=this.$slots.default||this.$scopedSlots.default||[],n=this.tag;return e&&this.disabled?e.length<=1&&this.slim?this.normalizeOwnChildren(e)[0]:t(n,[this.normalizeOwnChildren(e)]):this.slim?t():t(n,{class:{"v-portal":!0},style:{display:"none"},key:"v-portal-placeholder"})}}),hl=Vue.extend({name:"portalTarget",props:{multiple:{type:Boolean,default:!1},name:{type:String,required:!0},slim:{type:Boolean,default:!1},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},data:function(){return{transports:ll.transports,firstRender:!0}},created:function(){var t=this;this.$nextTick((function(){ll.registerTarget(t.name,t)}))},watch:{ownTransports:function(){this.$emit("change",this.children().length>0)},name:function(t,e){ll.unregisterTarget(e),ll.registerTarget(t,this)}},mounted:function(){var t=this;this.transition&&this.$nextTick((function(){t.firstRender=!1}))},beforeDestroy:function(){ll.unregisterTarget(this.name)},computed:{ownTransports:function(){var t=this.transports[this.name]||[];return this.multiple?t:0===t.length?[]:[t[t.length-1]]},passengers:function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.reduce((function(t,n){var r=n.passengers[0],i="function"==typeof r?r(e):n.passengers;return t.concat(i)}),[])}(this.ownTransports,this.slotProps)}},methods:{children:function(){return 0!==this.passengers.length?this.passengers:this.$scopedSlots.default?this.$scopedSlots.default(this.slotProps):this.$slots.default||[]},noWrapper:function(){var t=this.slim&&!this.transition;return t&&this.children().length>1&&console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element."),t}},render:function(t){var e=this.noWrapper(),n=this.children(),r=this.transition||this.tag;return e?n[0]:this.slim&&!r?t():t(r,{props:{tag:this.transition&&this.tag?this.tag:void 0},class:{"vue-portal-target":!0}},n)}}),ul=0,dl=["disabled","name","order","slim","slotProps","tag","to"],fl=["multiple","transition"],pl=Vue.extend({name:"MountingPortal",inheritAttrs:!1,props:{append:{type:[Boolean,String]},bail:{type:Boolean},mountTo:{type:String,required:!0},disabled:{type:Boolean},name:{type:String,default:function(){return"mounted_"+String(ul++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}},multiple:{type:Boolean,default:!1},targetSlim:{type:Boolean},targetSlotProps:{type:Object,default:function(){return{}}},targetTag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},created:function(){if("undefined"!=typeof document){var t=document.querySelector(this.mountTo);if(t){var e=this.$props;if(ll.targets[e.name])e.bail?console.warn("[portal-vue]: Target ".concat(e.name," is already mounted.\n Aborting because 'bail: true' is set")):this.portalTarget=ll.targets[e.name];else{var n=e.append;if(n){var r="string"==typeof n?n:"DIV",i=document.createElement(r);t.appendChild(i),t=i}var o=nl(this.$props,fl);o.slim=this.targetSlim,o.tag=this.targetTag,o.slotProps=this.targetSlotProps,o.name=this.to,this.portalTarget=new hl({el:t,parent:this.$parent||this,propsData:o})}}else console.error("[portal-vue]: Mount Point '".concat(this.mountTo,"' not found in document"))}},beforeDestroy:function(){var t=this.portalTarget;if(this.append){var e=t.$el;e.parentNode.removeChild(e)}t.$destroy()},render:function(t){if(!this.portalTarget)return console.warn("[portal-vue] Target wasn't mounted"),t();if(!this.$scopedSlots.manual){var e=nl(this.$props,dl);return t(cl,{props:e,attrs:this.$attrs,on:this.$listeners,scopedSlots:this.$scopedSlots},this.$slots.default)}var n=this.$scopedSlots.manual({to:this.to});return Array.isArray(n)&&(n=n[0]),n||t()}});var ml={install:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.component(e.portalName||"Portal",cl),t.component(e.portalTargetName||"PortalTarget",hl),t.component(e.MountingPortalName||"MountingPortal",pl)}},gl={exports:{}};gl.exports=function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",o="minute",s="hour",l="day",a="week",c="month",h="quarter",u="year",d="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},y=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:y,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function t(e,n){if(e.date()1)return t(s[0])}else{var l=e.name;b[l]=e,i=l}return!r&&i&&(w=i),i||!r&&w},k=function(t,e){if(x(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new O(n)},M=v;M.l=S,M.i=x,M.w=function(t,e){return k(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var O=function(){function g(t){this.$L=S(t.locale,null,!0),this.parse(t)}var y=g.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(M.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(p);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},y.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},y.$utils=function(){return M},y.isValid=function(){return!(this.$d.toString()===f)},y.isSame=function(t,e){var n=k(t);return this.startOf(e)<=n&&n<=this.endOf(e)},y.isAfter=function(t,e){return k(t)68?1900:2e3)},l=function(t){return function(e){this[t]=+e}},a=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),n=60*e[1]+(+e[2]||0);return 0===n?0:"+"===e[0]?-n:n}(t)}],c=function(t){var e=o[t];return e&&(e.indexOf?e:e.s.concat(e.f))},h=function(t,e){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(t.indexOf(r(i,0,e))>-1){n=i>12;break}}else n=t===(e?"pm":"PM");return n},u={A:[i,function(t){this.afternoon=h(t,!1)}],a:[i,function(t){this.afternoon=h(t,!0)}],S:[/\d/,function(t){this.milliseconds=100*+t}],SS:[n,function(t){this.milliseconds=10*+t}],SSS:[/\d{3}/,function(t){this.milliseconds=+t}],s:[r,l("seconds")],ss:[r,l("seconds")],m:[r,l("minutes")],mm:[r,l("minutes")],H:[r,l("hours")],h:[r,l("hours")],HH:[r,l("hours")],hh:[r,l("hours")],D:[r,l("day")],DD:[n,l("day")],Do:[i,function(t){var e=o.ordinal,n=t.match(/\d+/);if(this.day=n[0],e)for(var r=1;r<=31;r+=1)e(r).replace(/\[|\]/g,"")===t&&(this.day=r)}],M:[r,l("month")],MM:[n,l("month")],MMM:[i,function(t){var e=c("months"),n=(c("monthsShort")||e.map((function(t){return t.slice(0,3)}))).indexOf(t)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(t){var e=c("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e}],Y:[/[+-]?\d+/,l("year")],YY:[n,function(t){this.year=s(t)}],YYYY:[/\d{4}/,l("year")],Z:a,ZZ:a};function d(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,n,r){var o=r&&r.toUpperCase();return n||i[r]||t[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))).match(e),l=s.length,a=0;a-1)return new Date(("X"===e?1e3:1)*t);var r=d(e)(t),i=r.year,o=r.month,s=r.day,l=r.hours,a=r.minutes,c=r.seconds,h=r.milliseconds,u=r.zone,f=new Date,p=s||(i||o?1:f.getDate()),m=i||f.getFullYear(),g=0;i&&!o||(g=o>0?o-1:f.getMonth());var y=l||0,v=a||0,w=c||0,b=h||0;return u?new Date(Date.UTC(m,g,p,y,v,w,b+60*u.offset*1e3)):n?new Date(Date.UTC(m,g,p,y,v,w,b)):new Date(m,g,p,y,v,w,b)}catch(x){return new Date("")}}(e,l,r),this.init(),u&&!0!==u&&(this.$L=this.locale(u).$L),h&&e!=this.format(l)&&(this.$d=new Date("")),o={}}else if(l instanceof Array)for(var f=l.length,p=1;p<=f;p+=1){s[1]=l[p-1];var m=n.apply(this,s);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}p===f&&(this.$d=new Date(""))}else i.call(this,t)}}}();const wl=t(vl.exports);function bl(t){return{all:t=t||new Map,on:function(e,n){var r=t.get(e);r?r.push(n):t.set(e,[n])},off:function(e,n){var r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var r=t.get(e);r&&r.slice().map((function(t){t(n)})),(r=t.get("*"))&&r.slice().map((function(t){t(e,n)}))}}} /*! * vuex v3.6.2 * (c) 2021 Evan You diff --git a/panel/package-lock.json b/panel/package-lock.json index 8e55823432..5e8943c437 100644 --- a/panel/package-lock.json +++ b/panel/package-lock.json @@ -8,7 +8,7 @@ "dependencies": { "container-query-polyfill": "^1.0.2", "css-has-pseudo": "^5.0.2", - "dayjs": "^1.11.7", + "dayjs": "^1.11.8", "mitt": "^3.0.0", "portal-vue": "^2.1.7", "prosemirror-commands": "^1.5.2", @@ -16,8 +16,8 @@ "prosemirror-inputrules": "^1.2.1", "prosemirror-keymap": "^1.2.2", "prosemirror-model": "^1.19.2", - "prosemirror-schema-list": "^1.2.3", - "prosemirror-view": "^1.31.3", + "prosemirror-schema-list": "^1.3.0", + "prosemirror-view": "^1.31.5", "vue": "^2.7.14", "vuedraggable": "^2.24.3", "vuelidate": "^0.7.7", @@ -25,26 +25,26 @@ }, "devDependencies": { "@vitejs/plugin-vue2": "^2.2.0", - "@vitest/coverage-c8": "^0.31.1", - "@vitest/ui": "^0.31.1", + "@vitest/coverage-v8": "^0.32.2", + "@vitest/ui": "^0.32.2", "@vue/test-utils": "^1.3.0", "autoprefixer": "^10.4.14", "cssnano": "^6.0.1", - "cypress": "^12.13.0", - "eslint": "^8.41.0", + "cypress": "^12.15.0", + "eslint": "^8.43.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-cypress": "^2.13.3", - "eslint-plugin-vue": "^9.14.1", + "eslint-plugin-vue": "^9.15.0", "jsdom": "^22.1.0", "postcss-dir-pseudo-class": "^7.0.2", "postcss-logical": "^6.2.0", "prettier": "^2.8.8", "rollup-plugin-external-globals": "^0.8.0", - "terser": "^5.17.6", + "terser": "^5.18.1", "vite": "^4.3.9", - "vite-plugin-static-copy": "^0.15.0", - "vitest": "^0.31.1", - "vue-docgen-api": "^4.72.3", + "vite-plugin-static-copy": "^0.16.0", + "vitest": "^0.32.2", + "vue-docgen-api": "^4.73.0", "vue-template-compiler": "^2.7.14" } }, @@ -247,18 +247,18 @@ } }, "node_modules/@eslint/js": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.41.0.tgz", - "integrity": "sha512-LxcyMGxwmTh2lY9FwHPGWOHmYFCZvbrFCBZL4FzSSsxsRPuhrYUg/49/0KDfW8tnIEaEHtfmn6+NPN+1DqaNmA==", + "version": "8.43.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.43.0.tgz", + "integrity": "sha512-s2UHCoiXfxMvmfzqoN+vrQ84ahUSYde9qNO1MdxmoEhyHWsfmwOpFlwYV+ePJEVc7gFnATGUi376WowX1N7tFg==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", + "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", @@ -330,9 +330,9 @@ } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", - "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.3.tgz", + "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", @@ -504,26 +504,32 @@ "vue": "^2.7.0-0" } }, - "node_modules/@vitest/coverage-c8": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@vitest/coverage-c8/-/coverage-c8-0.31.1.tgz", - "integrity": "sha512-6TkjQpmgYez7e3dbAUoYdRXxWN81BojCmUILJwgCy39uZFG33DsQ0rSRSZC9beAEdCZTpxR63nOvd9hxDQcJ0g==", + "node_modules/@vitest/coverage-v8": { + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-0.32.2.tgz", + "integrity": "sha512-/+V3nB3fyeuuSeKxCfi6XmWjDIxpky7AWSkGVfaMjAk7di8igBwRsThLjultwIZdTDH1RAxpjmCXEfSqsMFZOA==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.1", - "c8": "^7.13.0", + "@bcoe/v8-coverage": "^0.2.3", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.1", + "istanbul-reports": "^3.1.5", "magic-string": "^0.30.0", "picocolors": "^1.0.0", - "std-env": "^3.3.2" + "std-env": "^3.3.2", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^9.1.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "vitest": ">=0.30.0 <1" + "vitest": ">=0.32.0 <1" } }, - "node_modules/@vitest/coverage-c8/node_modules/magic-string": { + "node_modules/@vitest/coverage-v8/node_modules/magic-string": { "version": "0.30.0", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.0.tgz", "integrity": "sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==", @@ -536,13 +542,13 @@ } }, "node_modules/@vitest/expect": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.31.1.tgz", - "integrity": "sha512-BV1LyNvhnX+eNYzJxlHIGPWZpwJFZaCcOIzp2CNG0P+bbetenTupk6EO0LANm4QFt0TTit+yqx7Rxd1qxi/SQA==", + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.32.2.tgz", + "integrity": "sha512-6q5yzweLnyEv5Zz1fqK5u5E83LU+gOMVBDuxBl2d2Jfx1BAp5M+rZgc5mlyqdnxquyoiOXpXmFNkcGcfFnFH3Q==", "dev": true, "dependencies": { - "@vitest/spy": "0.31.1", - "@vitest/utils": "0.31.1", + "@vitest/spy": "0.32.2", + "@vitest/utils": "0.32.2", "chai": "^4.3.7" }, "funding": { @@ -550,12 +556,12 @@ } }, "node_modules/@vitest/runner": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.31.1.tgz", - "integrity": "sha512-imWuc82ngOtxdCUpXwtEzZIuc1KMr+VlQ3Ondph45VhWoQWit5yvG/fFcldbnCi8DUuFi+NmNx5ehMUw/cGLUw==", + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.32.2.tgz", + "integrity": "sha512-06vEL0C1pomOEktGoLjzZw+1Fb+7RBRhmw/06WkDrd1akkT9i12su0ku+R/0QM69dfkIL/rAIDTG+CSuQVDcKw==", "dev": true, "dependencies": { - "@vitest/utils": "0.31.1", + "@vitest/utils": "0.32.2", "concordance": "^5.0.4", "p-limit": "^4.0.0", "pathe": "^1.1.0" @@ -592,9 +598,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.31.1.tgz", - "integrity": "sha512-L3w5uU9bMe6asrNzJ8WZzN+jUTX4KSgCinEJPXyny0o90fG4FPQMV0OWsq7vrCWfQlAilMjDnOF9nP8lidsJ+g==", + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.32.2.tgz", + "integrity": "sha512-JwhpeH/PPc7GJX38vEfCy9LtRzf9F4er7i4OsAJyV7sjPwjj+AIR8cUgpMTWK4S3TiamzopcTyLsZDMuldoi5A==", "dev": true, "dependencies": { "magic-string": "^0.30.0", @@ -618,9 +624,9 @@ } }, "node_modules/@vitest/spy": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.31.1.tgz", - "integrity": "sha512-1cTpt2m9mdo3hRLDyCG2hDQvRrePTDgEJBFQQNz1ydHHZy03EiA6EpFxY+7ODaY7vMRCie+WlFZBZ0/dQWyssQ==", + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.32.2.tgz", + "integrity": "sha512-Q/ZNILJ4ca/VzQbRM8ur3Si5Sardsh1HofatG9wsJY1RfEaw0XKP8IVax2lI1qnrk9YPuG9LA2LkZ0EI/3d4ug==", "dev": true, "dependencies": { "tinyspy": "^2.1.0" @@ -630,12 +636,12 @@ } }, "node_modules/@vitest/ui": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-0.31.1.tgz", - "integrity": "sha512-+JJ2+rvRPAVxFLNE+WJOMzOjxqYPn7V2hl00uNwid6kquD+UHTa716Z7szfNeZMLnHOHv+fxq1UgLCymvVpE5w==", + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-0.32.2.tgz", + "integrity": "sha512-N5JKftnB8qzKFtpQC5OcUGxYTLo6wiB/95Lgyk6MF52t74Y7BJOWbf6EFYhXqt9J0MSbhOR2kapq+WKKUGDW0g==", "dev": true, "dependencies": { - "@vitest/utils": "0.31.1", + "@vitest/utils": "0.32.2", "fast-glob": "^3.2.12", "fflate": "^0.7.4", "flatted": "^3.2.7", @@ -651,12 +657,12 @@ } }, "node_modules/@vitest/utils": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.31.1.tgz", - "integrity": "sha512-yFyRD5ilwojsZfo3E0BnH72pSVSuLg2356cN1tCEe/0RtDzxTPYwOomIC+eQbot7m6DRy4tPZw+09mB7NkbMmA==", + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.32.2.tgz", + "integrity": "sha512-lnJ0T5i03j0IJaeW73hxe2AuVnZ/y1BhhCOuIcl9LIzXnbpXJT9Lrt6brwKHXLOiA7MZ6N5hSJjt0xE1dGNCzQ==", "dev": true, "dependencies": { - "concordance": "^5.0.4", + "diff-sequences": "^29.4.3", "loupe": "^2.3.6", "pretty-format": "^27.5.1" }, @@ -1244,32 +1250,6 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, - "node_modules/c8": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/c8/-/c8-7.13.0.tgz", - "integrity": "sha512-/NL4hQTv1gBL6J6ei80zu3IiTrmePDKXKXOTLpHvcIWZTVYQlDhVWjjWvkhICylE8EwwnMVzDZugCvdx0/DIIA==", - "dev": true, - "dependencies": { - "@bcoe/v8-coverage": "^0.2.3", - "@istanbuljs/schema": "^0.1.3", - "find-up": "^5.0.0", - "foreground-child": "^2.0.0", - "istanbul-lib-coverage": "^3.2.0", - "istanbul-lib-report": "^3.0.0", - "istanbul-reports": "^3.1.4", - "rimraf": "^3.0.2", - "test-exclude": "^6.0.0", - "v8-to-istanbul": "^9.0.0", - "yargs": "^16.2.0", - "yargs-parser": "^20.2.9" - }, - "bin": { - "c8": "bin/c8.js" - }, - "engines": { - "node": ">=10.12.0" - } - }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -1521,17 +1501,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1879,9 +1848,9 @@ "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" }, "node_modules/cypress": { - "version": "12.13.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.13.0.tgz", - "integrity": "sha512-QJlSmdPk+53Zhy69woJMySZQJoWfEWun3X5OOenGsXjRPVfByVTHorxNehbzhZrEzH9RDUDqVcck0ahtlS+N/Q==", + "version": "12.15.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.15.0.tgz", + "integrity": "sha512-FqGbxsH+QgjStuTO9onXMIeF44eOrgVwPvlcvuzLIaePQMkl72YgBvpuHlBGRcrw3Q4SvqKfajN8iV5XWShAiQ==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -1974,9 +1943,9 @@ } }, "node_modules/dayjs": { - "version": "1.11.7", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.7.tgz", - "integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==" + "version": "1.11.8", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.8.tgz", + "integrity": "sha512-LcgxzFoWMEPO7ggRv1Y2N31hUf2R0Vj7fuy/m+Bg1K8rr+KAs1AEy4y9jd5DXe8pbHgX+srkHNS7TH6Q6ZhYeQ==" }, "node_modules/de-indent": { "version": "1.0.2", @@ -2050,6 +2019,15 @@ "node": ">=0.4.0" } }, + "node_modules/diff-sequences": { + "version": "29.4.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz", + "integrity": "sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -2291,16 +2269,16 @@ } }, "node_modules/eslint": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.41.0.tgz", - "integrity": "sha512-WQDQpzGBOP5IrXPo4Hc0814r4/v2rrIsB0rhT7jtunIalgg6gYXWhRMOejVO8yH21T/FGaxjmFjBMNqcIlmH1Q==", + "version": "8.43.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.43.0.tgz", + "integrity": "sha512-aaCpf2JqqKesMFGgmRPessmVKjcGXqdlAYLLC3THM8t5nBRZRQ+st5WM/hoJXkdioEXLLbXgclUpM0TXo5HX5Q==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.4.0", "@eslint/eslintrc": "^2.0.3", - "@eslint/js": "8.41.0", - "@humanwhocodes/config-array": "^0.11.8", + "@eslint/js": "8.43.0", + "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", @@ -2380,9 +2358,9 @@ } }, "node_modules/eslint-plugin-vue": { - "version": "9.14.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.14.1.tgz", - "integrity": "sha512-LQazDB1qkNEKejLe/b5a9VfEbtbczcOaui5lQ4Qw0tbRBbQYREyxxOV5BQgNDTqGPs9pxqiEpbMi9ywuIaF7vw==", + "version": "9.15.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.15.0.tgz", + "integrity": "sha512-XYzpK6e2REli100+6iCeBA69v6Sm0D/yK2FZP+fCeNt0yH/m82qZQq+ztseyV0JsKdhFysuSEzeE1yCmSC92BA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.3.0", @@ -2762,19 +2740,6 @@ "is-callable": "^1.1.3" } }, - "node_modules/foreground-child": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -2852,15 +2817,6 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, "node_modules/get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", @@ -3604,6 +3560,20 @@ "node": ">=8" } }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/istanbul-reports": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", @@ -5170,13 +5140,13 @@ } }, "node_modules/prosemirror-schema-list": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.2.3.tgz", - "integrity": "sha512-HD8yjDOusz7JB3oBFCaMOpEN9Z9DZttLr6tcASjnvKMc0qTyX5xgAN8YiMFFEcwyhF7WZrZ2YQkAwzsn8ICVbQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.3.0.tgz", + "integrity": "sha512-Hz/7gM4skaaYfRPNgr421CU4GSwotmEwBVvJh5ltGiffUJwm7C8GfN/Bc6DR1EKEp5pDKhODmdXXyi9uIsZl5A==", "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", - "prosemirror-transform": "^1.0.0" + "prosemirror-transform": "^1.7.3" } }, "node_modules/prosemirror-state": { @@ -5190,17 +5160,17 @@ } }, "node_modules/prosemirror-transform": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.7.0.tgz", - "integrity": "sha512-O4T697Cqilw06Zvc3Wm+e237R6eZtJL/xGMliCi+Uo8VL6qHk6afz1qq0zNjT3eZMuYwnP8ZS0+YxX/tfcE9TQ==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.7.3.tgz", + "integrity": "sha512-qDapyx5lqYfxVeUWEw0xTGgeP2S8346QtE7DxkalsXlX89lpzkY6GZfulgfHyk1n4tf74sZ7CcXgcaCcGjsUtA==", "dependencies": { "prosemirror-model": "^1.0.0" } }, "node_modules/prosemirror-view": { - "version": "1.31.3", - "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.31.3.tgz", - "integrity": "sha512-UYDa8WxRFZm0xQLXiPJUVTl6H08Fn0IUVDootA7ZlQwzooqVWnBOXLovJyyTKgws1nprfsPhhlvWgt2jo4ZA6g==", + "version": "1.31.5", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.31.5.tgz", + "integrity": "sha512-tobRCDeCp61elR1d97XE/JTL9FDIfswZpWeNs7GKJjAJvWyMGHWYFCq29850p6bbG2bckP+i9n1vT56RifosbA==", "dependencies": { "prosemirror-model": "^1.16.0", "prosemirror-state": "^1.0.0", @@ -5452,15 +5422,6 @@ "throttleit": "^1.0.0" } }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -6007,13 +5968,13 @@ "dev": true }, "node_modules/terser": { - "version": "5.17.6", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.17.6.tgz", - "integrity": "sha512-V8QHcs8YuyLkLHsJO5ucyff1ykrLVsR4dNnS//L5Y3NiSXpbK1J+WMVUs67eI0KTxs9JtHhgEQpXQVHlHI92DQ==", + "version": "5.18.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.18.1.tgz", + "integrity": "sha512-j1n0Ao919h/Ai5r43VAnfV/7azUYW43GPxK7qSATzrsERfW7+y2QW9Cp9ufnRF5CQUWbnLSo7UJokSWCqg4tsQ==", "dev": true, "dependencies": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -6107,9 +6068,9 @@ } }, "node_modules/tinyspy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.1.0.tgz", - "integrity": "sha512-7eORpyqImoOvkQJCSkL0d0mB4NHHIFAy4b1u8PHdDa7SjGS2njzl6/lyGoZLm+eyYEtlUmFGE0rFj66SWxZgQQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.1.1.tgz", + "integrity": "sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w==", "dev": true, "engines": { "node": ">=14.0.0" @@ -6428,9 +6389,9 @@ } }, "node_modules/vite-node": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.31.1.tgz", - "integrity": "sha512-BajE/IsNQ6JyizPzu9zRgHrBwczkAs0erQf/JRpgTIESpKvNj9/Gd0vxX905klLkb0I0SJVCKbdrl5c6FnqYKA==", + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.32.2.tgz", + "integrity": "sha512-dTQ1DCLwl2aEseov7cfQ+kDMNJpM1ebpyMMMwWzBvLbis8Nla/6c9WQcqpPssTwS6Rp/+U6KwlIj8Eapw4bLdA==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -6451,9 +6412,9 @@ } }, "node_modules/vite-plugin-static-copy": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/vite-plugin-static-copy/-/vite-plugin-static-copy-0.15.0.tgz", - "integrity": "sha512-Ww+/Ug9guV45oIfIi/lA2z8v3K+lLHV9zCJqTVO4FTdqrJoZBj68VgGBSH1fi0N4q/EHW32RsL3ympi4Wlsq5w==", + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/vite-plugin-static-copy/-/vite-plugin-static-copy-0.16.0.tgz", + "integrity": "sha512-dMVEg5Z2SwYRgQnHZaeokvSKB4p/TOTf65JU4sP3U6ccSBsukqdtDOjpmT+xzTFHAA8WJjcS31RMLjUdWQCBzw==", "dev": true, "dependencies": { "chokidar": "^3.5.3", @@ -6483,19 +6444,19 @@ } }, "node_modules/vitest": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.31.1.tgz", - "integrity": "sha512-/dOoOgzoFk/5pTvg1E65WVaobknWREN15+HF+0ucudo3dDG/vCZoXTQrjIfEaWvQXmqScwkRodrTbM/ScMpRcQ==", + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.32.2.tgz", + "integrity": "sha512-hU8GNNuQfwuQmqTLfiKcqEhZY72Zxb7nnN07koCUNmntNxbKQnVbeIS6sqUgR3eXSlbOpit8+/gr1KpqoMgWCQ==", "dev": true, "dependencies": { "@types/chai": "^4.3.5", "@types/chai-subset": "^1.3.3", "@types/node": "*", - "@vitest/expect": "0.31.1", - "@vitest/runner": "0.31.1", - "@vitest/snapshot": "0.31.1", - "@vitest/spy": "0.31.1", - "@vitest/utils": "0.31.1", + "@vitest/expect": "0.32.2", + "@vitest/runner": "0.32.2", + "@vitest/snapshot": "0.32.2", + "@vitest/spy": "0.32.2", + "@vitest/utils": "0.32.2", "acorn": "^8.8.2", "acorn-walk": "^8.2.0", "cac": "^6.7.14", @@ -6511,7 +6472,7 @@ "tinybench": "^2.5.0", "tinypool": "^0.5.0", "vite": "^3.0.0 || ^4.0.0", - "vite-node": "0.31.1", + "vite-node": "0.32.2", "why-is-node-running": "^2.2.2" }, "bin": { @@ -6591,9 +6552,9 @@ } }, "node_modules/vue-docgen-api": { - "version": "4.72.3", - "resolved": "https://registry.npmjs.org/vue-docgen-api/-/vue-docgen-api-4.72.3.tgz", - "integrity": "sha512-76IpEW/pnY0Lfi+NaKkjYZGpEIxqVnDbCbzfZldLt0ldaKz2wvjepvCN1lhxWYtuucziXspFEEfvOY2shrrE3w==", + "version": "4.73.0", + "resolved": "https://registry.npmjs.org/vue-docgen-api/-/vue-docgen-api-4.73.0.tgz", + "integrity": "sha512-Hx3VZNi630q/JRhHsVo7qeLJdIDkz3JEp/LBITUZQoZBruGyQa7m80uxbEo4JGBpHMxWWHFO9AXrVy7jH4vzFA==", "dev": true, "dependencies": { "@babel/parser": "^7.21.4", @@ -6907,48 +6868,12 @@ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", "dev": true }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", @@ -7117,15 +7042,15 @@ } }, "@eslint/js": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.41.0.tgz", - "integrity": "sha512-LxcyMGxwmTh2lY9FwHPGWOHmYFCZvbrFCBZL4FzSSsxsRPuhrYUg/49/0KDfW8tnIEaEHtfmn6+NPN+1DqaNmA==", + "version": "8.43.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.43.0.tgz", + "integrity": "sha512-s2UHCoiXfxMvmfzqoN+vrQ84ahUSYde9qNO1MdxmoEhyHWsfmwOpFlwYV+ePJEVc7gFnATGUi376WowX1N7tFg==", "dev": true }, "@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", + "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", @@ -7175,9 +7100,9 @@ "dev": true }, "@jridgewell/source-map": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", - "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.3.tgz", + "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", "dev": true, "requires": { "@jridgewell/gen-mapping": "^0.3.0", @@ -7317,17 +7242,23 @@ "dev": true, "requires": {} }, - "@vitest/coverage-c8": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@vitest/coverage-c8/-/coverage-c8-0.31.1.tgz", - "integrity": "sha512-6TkjQpmgYez7e3dbAUoYdRXxWN81BojCmUILJwgCy39uZFG33DsQ0rSRSZC9beAEdCZTpxR63nOvd9hxDQcJ0g==", + "@vitest/coverage-v8": { + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-0.32.2.tgz", + "integrity": "sha512-/+V3nB3fyeuuSeKxCfi6XmWjDIxpky7AWSkGVfaMjAk7di8igBwRsThLjultwIZdTDH1RAxpjmCXEfSqsMFZOA==", "dev": true, "requires": { "@ampproject/remapping": "^2.2.1", - "c8": "^7.13.0", + "@bcoe/v8-coverage": "^0.2.3", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.1", + "istanbul-reports": "^3.1.5", "magic-string": "^0.30.0", "picocolors": "^1.0.0", - "std-env": "^3.3.2" + "std-env": "^3.3.2", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^9.1.0" }, "dependencies": { "magic-string": { @@ -7342,23 +7273,23 @@ } }, "@vitest/expect": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.31.1.tgz", - "integrity": "sha512-BV1LyNvhnX+eNYzJxlHIGPWZpwJFZaCcOIzp2CNG0P+bbetenTupk6EO0LANm4QFt0TTit+yqx7Rxd1qxi/SQA==", + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.32.2.tgz", + "integrity": "sha512-6q5yzweLnyEv5Zz1fqK5u5E83LU+gOMVBDuxBl2d2Jfx1BAp5M+rZgc5mlyqdnxquyoiOXpXmFNkcGcfFnFH3Q==", "dev": true, "requires": { - "@vitest/spy": "0.31.1", - "@vitest/utils": "0.31.1", + "@vitest/spy": "0.32.2", + "@vitest/utils": "0.32.2", "chai": "^4.3.7" } }, "@vitest/runner": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.31.1.tgz", - "integrity": "sha512-imWuc82ngOtxdCUpXwtEzZIuc1KMr+VlQ3Ondph45VhWoQWit5yvG/fFcldbnCi8DUuFi+NmNx5ehMUw/cGLUw==", + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.32.2.tgz", + "integrity": "sha512-06vEL0C1pomOEktGoLjzZw+1Fb+7RBRhmw/06WkDrd1akkT9i12su0ku+R/0QM69dfkIL/rAIDTG+CSuQVDcKw==", "dev": true, "requires": { - "@vitest/utils": "0.31.1", + "@vitest/utils": "0.32.2", "concordance": "^5.0.4", "p-limit": "^4.0.0", "pathe": "^1.1.0" @@ -7382,9 +7313,9 @@ } }, "@vitest/snapshot": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.31.1.tgz", - "integrity": "sha512-L3w5uU9bMe6asrNzJ8WZzN+jUTX4KSgCinEJPXyny0o90fG4FPQMV0OWsq7vrCWfQlAilMjDnOF9nP8lidsJ+g==", + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.32.2.tgz", + "integrity": "sha512-JwhpeH/PPc7GJX38vEfCy9LtRzf9F4er7i4OsAJyV7sjPwjj+AIR8cUgpMTWK4S3TiamzopcTyLsZDMuldoi5A==", "dev": true, "requires": { "magic-string": "^0.30.0", @@ -7404,21 +7335,21 @@ } }, "@vitest/spy": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.31.1.tgz", - "integrity": "sha512-1cTpt2m9mdo3hRLDyCG2hDQvRrePTDgEJBFQQNz1ydHHZy03EiA6EpFxY+7ODaY7vMRCie+WlFZBZ0/dQWyssQ==", + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.32.2.tgz", + "integrity": "sha512-Q/ZNILJ4ca/VzQbRM8ur3Si5Sardsh1HofatG9wsJY1RfEaw0XKP8IVax2lI1qnrk9YPuG9LA2LkZ0EI/3d4ug==", "dev": true, "requires": { "tinyspy": "^2.1.0" } }, "@vitest/ui": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-0.31.1.tgz", - "integrity": "sha512-+JJ2+rvRPAVxFLNE+WJOMzOjxqYPn7V2hl00uNwid6kquD+UHTa716Z7szfNeZMLnHOHv+fxq1UgLCymvVpE5w==", + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-0.32.2.tgz", + "integrity": "sha512-N5JKftnB8qzKFtpQC5OcUGxYTLo6wiB/95Lgyk6MF52t74Y7BJOWbf6EFYhXqt9J0MSbhOR2kapq+WKKUGDW0g==", "dev": true, "requires": { - "@vitest/utils": "0.31.1", + "@vitest/utils": "0.32.2", "fast-glob": "^3.2.12", "fflate": "^0.7.4", "flatted": "^3.2.7", @@ -7428,12 +7359,12 @@ } }, "@vitest/utils": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.31.1.tgz", - "integrity": "sha512-yFyRD5ilwojsZfo3E0BnH72pSVSuLg2356cN1tCEe/0RtDzxTPYwOomIC+eQbot7m6DRy4tPZw+09mB7NkbMmA==", + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.32.2.tgz", + "integrity": "sha512-lnJ0T5i03j0IJaeW73hxe2AuVnZ/y1BhhCOuIcl9LIzXnbpXJT9Lrt6brwKHXLOiA7MZ6N5hSJjt0xE1dGNCzQ==", "dev": true, "requires": { - "concordance": "^5.0.4", + "diff-sequences": "^29.4.3", "loupe": "^2.3.6", "pretty-format": "^27.5.1" } @@ -7855,26 +7786,6 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, - "c8": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/c8/-/c8-7.13.0.tgz", - "integrity": "sha512-/NL4hQTv1gBL6J6ei80zu3IiTrmePDKXKXOTLpHvcIWZTVYQlDhVWjjWvkhICylE8EwwnMVzDZugCvdx0/DIIA==", - "dev": true, - "requires": { - "@bcoe/v8-coverage": "^0.2.3", - "@istanbuljs/schema": "^0.1.3", - "find-up": "^5.0.0", - "foreground-child": "^2.0.0", - "istanbul-lib-coverage": "^3.2.0", - "istanbul-lib-report": "^3.0.0", - "istanbul-reports": "^3.1.4", - "rimraf": "^3.0.2", - "test-exclude": "^6.0.0", - "v8-to-istanbul": "^9.0.0", - "yargs": "^16.2.0", - "yargs-parser": "^20.2.9" - } - }, "cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -8052,17 +7963,6 @@ "string-width": "^4.2.0" } }, - "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -8329,9 +8229,9 @@ "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" }, "cypress": { - "version": "12.13.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.13.0.tgz", - "integrity": "sha512-QJlSmdPk+53Zhy69woJMySZQJoWfEWun3X5OOenGsXjRPVfByVTHorxNehbzhZrEzH9RDUDqVcck0ahtlS+N/Q==", + "version": "12.15.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.15.0.tgz", + "integrity": "sha512-FqGbxsH+QgjStuTO9onXMIeF44eOrgVwPvlcvuzLIaePQMkl72YgBvpuHlBGRcrw3Q4SvqKfajN8iV5XWShAiQ==", "dev": true, "requires": { "@cypress/request": "^2.88.10", @@ -8408,9 +8308,9 @@ } }, "dayjs": { - "version": "1.11.7", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.7.tgz", - "integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==" + "version": "1.11.8", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.8.tgz", + "integrity": "sha512-LcgxzFoWMEPO7ggRv1Y2N31hUf2R0Vj7fuy/m+Bg1K8rr+KAs1AEy4y9jd5DXe8pbHgX+srkHNS7TH6Q6ZhYeQ==" }, "de-indent": { "version": "1.0.2", @@ -8464,6 +8364,12 @@ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true }, + "diff-sequences": { + "version": "29.4.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz", + "integrity": "sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==", + "dev": true + }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -8652,16 +8558,16 @@ "dev": true }, "eslint": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.41.0.tgz", - "integrity": "sha512-WQDQpzGBOP5IrXPo4Hc0814r4/v2rrIsB0rhT7jtunIalgg6gYXWhRMOejVO8yH21T/FGaxjmFjBMNqcIlmH1Q==", + "version": "8.43.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.43.0.tgz", + "integrity": "sha512-aaCpf2JqqKesMFGgmRPessmVKjcGXqdlAYLLC3THM8t5nBRZRQ+st5WM/hoJXkdioEXLLbXgclUpM0TXo5HX5Q==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.4.0", "@eslint/eslintrc": "^2.0.3", - "@eslint/js": "8.41.0", - "@humanwhocodes/config-array": "^0.11.8", + "@eslint/js": "8.43.0", + "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", @@ -8723,9 +8629,9 @@ } }, "eslint-plugin-vue": { - "version": "9.14.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.14.1.tgz", - "integrity": "sha512-LQazDB1qkNEKejLe/b5a9VfEbtbczcOaui5lQ4Qw0tbRBbQYREyxxOV5BQgNDTqGPs9pxqiEpbMi9ywuIaF7vw==", + "version": "9.15.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.15.0.tgz", + "integrity": "sha512-XYzpK6e2REli100+6iCeBA69v6Sm0D/yK2FZP+fCeNt0yH/m82qZQq+ztseyV0JsKdhFysuSEzeE1yCmSC92BA==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.3.0", @@ -9013,16 +8919,6 @@ "is-callable": "^1.1.3" } }, - "foreground-child": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" - } - }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -9077,12 +8973,6 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, "get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", @@ -9620,6 +9510,17 @@ } } }, + "istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + } + }, "istanbul-reports": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", @@ -10729,13 +10630,13 @@ } }, "prosemirror-schema-list": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.2.3.tgz", - "integrity": "sha512-HD8yjDOusz7JB3oBFCaMOpEN9Z9DZttLr6tcASjnvKMc0qTyX5xgAN8YiMFFEcwyhF7WZrZ2YQkAwzsn8ICVbQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.3.0.tgz", + "integrity": "sha512-Hz/7gM4skaaYfRPNgr421CU4GSwotmEwBVvJh5ltGiffUJwm7C8GfN/Bc6DR1EKEp5pDKhODmdXXyi9uIsZl5A==", "requires": { "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", - "prosemirror-transform": "^1.0.0" + "prosemirror-transform": "^1.7.3" } }, "prosemirror-state": { @@ -10749,17 +10650,17 @@ } }, "prosemirror-transform": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.7.0.tgz", - "integrity": "sha512-O4T697Cqilw06Zvc3Wm+e237R6eZtJL/xGMliCi+Uo8VL6qHk6afz1qq0zNjT3eZMuYwnP8ZS0+YxX/tfcE9TQ==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.7.3.tgz", + "integrity": "sha512-qDapyx5lqYfxVeUWEw0xTGgeP2S8346QtE7DxkalsXlX89lpzkY6GZfulgfHyk1n4tf74sZ7CcXgcaCcGjsUtA==", "requires": { "prosemirror-model": "^1.0.0" } }, "prosemirror-view": { - "version": "1.31.3", - "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.31.3.tgz", - "integrity": "sha512-UYDa8WxRFZm0xQLXiPJUVTl6H08Fn0IUVDootA7ZlQwzooqVWnBOXLovJyyTKgws1nprfsPhhlvWgt2jo4ZA6g==", + "version": "1.31.5", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.31.5.tgz", + "integrity": "sha512-tobRCDeCp61elR1d97XE/JTL9FDIfswZpWeNs7GKJjAJvWyMGHWYFCq29850p6bbG2bckP+i9n1vT56RifosbA==", "requires": { "prosemirror-model": "^1.16.0", "prosemirror-state": "^1.0.0", @@ -10985,12 +10886,6 @@ "throttleit": "^1.0.0" } }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true - }, "requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -11388,13 +11283,13 @@ "dev": true }, "terser": { - "version": "5.17.6", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.17.6.tgz", - "integrity": "sha512-V8QHcs8YuyLkLHsJO5ucyff1ykrLVsR4dNnS//L5Y3NiSXpbK1J+WMVUs67eI0KTxs9JtHhgEQpXQVHlHI92DQ==", + "version": "5.18.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.18.1.tgz", + "integrity": "sha512-j1n0Ao919h/Ai5r43VAnfV/7azUYW43GPxK7qSATzrsERfW7+y2QW9Cp9ufnRF5CQUWbnLSo7UJokSWCqg4tsQ==", "dev": true, "requires": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -11471,9 +11366,9 @@ "dev": true }, "tinyspy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.1.0.tgz", - "integrity": "sha512-7eORpyqImoOvkQJCSkL0d0mB4NHHIFAy4b1u8PHdDa7SjGS2njzl6/lyGoZLm+eyYEtlUmFGE0rFj66SWxZgQQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.1.1.tgz", + "integrity": "sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w==", "dev": true }, "tmp": { @@ -11685,9 +11580,9 @@ } }, "vite-node": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.31.1.tgz", - "integrity": "sha512-BajE/IsNQ6JyizPzu9zRgHrBwczkAs0erQf/JRpgTIESpKvNj9/Gd0vxX905klLkb0I0SJVCKbdrl5c6FnqYKA==", + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.32.2.tgz", + "integrity": "sha512-dTQ1DCLwl2aEseov7cfQ+kDMNJpM1ebpyMMMwWzBvLbis8Nla/6c9WQcqpPssTwS6Rp/+U6KwlIj8Eapw4bLdA==", "dev": true, "requires": { "cac": "^6.7.14", @@ -11699,9 +11594,9 @@ } }, "vite-plugin-static-copy": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/vite-plugin-static-copy/-/vite-plugin-static-copy-0.15.0.tgz", - "integrity": "sha512-Ww+/Ug9guV45oIfIi/lA2z8v3K+lLHV9zCJqTVO4FTdqrJoZBj68VgGBSH1fi0N4q/EHW32RsL3ympi4Wlsq5w==", + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/vite-plugin-static-copy/-/vite-plugin-static-copy-0.16.0.tgz", + "integrity": "sha512-dMVEg5Z2SwYRgQnHZaeokvSKB4p/TOTf65JU4sP3U6ccSBsukqdtDOjpmT+xzTFHAA8WJjcS31RMLjUdWQCBzw==", "dev": true, "requires": { "chokidar": "^3.5.3", @@ -11724,19 +11619,19 @@ } }, "vitest": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.31.1.tgz", - "integrity": "sha512-/dOoOgzoFk/5pTvg1E65WVaobknWREN15+HF+0ucudo3dDG/vCZoXTQrjIfEaWvQXmqScwkRodrTbM/ScMpRcQ==", + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.32.2.tgz", + "integrity": "sha512-hU8GNNuQfwuQmqTLfiKcqEhZY72Zxb7nnN07koCUNmntNxbKQnVbeIS6sqUgR3eXSlbOpit8+/gr1KpqoMgWCQ==", "dev": true, "requires": { "@types/chai": "^4.3.5", "@types/chai-subset": "^1.3.3", "@types/node": "*", - "@vitest/expect": "0.31.1", - "@vitest/runner": "0.31.1", - "@vitest/snapshot": "0.31.1", - "@vitest/spy": "0.31.1", - "@vitest/utils": "0.31.1", + "@vitest/expect": "0.32.2", + "@vitest/runner": "0.32.2", + "@vitest/snapshot": "0.32.2", + "@vitest/spy": "0.32.2", + "@vitest/utils": "0.32.2", "acorn": "^8.8.2", "acorn-walk": "^8.2.0", "cac": "^6.7.14", @@ -11752,7 +11647,7 @@ "tinybench": "^2.5.0", "tinypool": "^0.5.0", "vite": "^3.0.0 || ^4.0.0", - "vite-node": "0.31.1", + "vite-node": "0.32.2", "why-is-node-running": "^2.2.2" }, "dependencies": { @@ -11783,9 +11678,9 @@ } }, "vue-docgen-api": { - "version": "4.72.3", - "resolved": "https://registry.npmjs.org/vue-docgen-api/-/vue-docgen-api-4.72.3.tgz", - "integrity": "sha512-76IpEW/pnY0Lfi+NaKkjYZGpEIxqVnDbCbzfZldLt0ldaKz2wvjepvCN1lhxWYtuucziXspFEEfvOY2shrrE3w==", + "version": "4.73.0", + "resolved": "https://registry.npmjs.org/vue-docgen-api/-/vue-docgen-api-4.73.0.tgz", + "integrity": "sha512-Hx3VZNi630q/JRhHsVo7qeLJdIDkz3JEp/LBITUZQoZBruGyQa7m80uxbEo4JGBpHMxWWHFO9AXrVy7jH4vzFA==", "dev": true, "requires": { "@babel/parser": "^7.21.4", @@ -12016,39 +11911,12 @@ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true - }, "yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", "dev": true }, - "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - } - }, - "yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true - }, "yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", diff --git a/panel/package.json b/panel/package.json index 8d53b69a88..248c2fc5f7 100644 --- a/panel/package.json +++ b/panel/package.json @@ -19,7 +19,7 @@ "dependencies": { "container-query-polyfill": "^1.0.2", "css-has-pseudo": "^5.0.2", - "dayjs": "^1.11.7", + "dayjs": "^1.11.8", "mitt": "^3.0.0", "portal-vue": "^2.1.7", "prosemirror-commands": "^1.5.2", @@ -27,8 +27,8 @@ "prosemirror-inputrules": "^1.2.1", "prosemirror-keymap": "^1.2.2", "prosemirror-model": "^1.19.2", - "prosemirror-schema-list": "^1.2.3", - "prosemirror-view": "^1.31.3", + "prosemirror-schema-list": "^1.3.0", + "prosemirror-view": "^1.31.5", "vue": "^2.7.14", "vuedraggable": "^2.24.3", "vuelidate": "^0.7.7", @@ -36,26 +36,26 @@ }, "devDependencies": { "@vitejs/plugin-vue2": "^2.2.0", - "@vitest/coverage-c8": "^0.31.1", - "@vitest/ui": "^0.31.1", + "@vitest/coverage-v8": "^0.32.2", + "@vitest/ui": "^0.32.2", "@vue/test-utils": "^1.3.0", "autoprefixer": "^10.4.14", "cssnano": "^6.0.1", - "cypress": "^12.13.0", - "eslint": "^8.41.0", + "cypress": "^12.15.0", + "eslint": "^8.43.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-cypress": "^2.13.3", - "eslint-plugin-vue": "^9.14.1", + "eslint-plugin-vue": "^9.15.0", "jsdom": "^22.1.0", "postcss-dir-pseudo-class": "^7.0.2", "postcss-logical": "^6.2.0", "prettier": "^2.8.8", "rollup-plugin-external-globals": "^0.8.0", - "terser": "^5.17.6", + "terser": "^5.18.1", "vite": "^4.3.9", - "vite-plugin-static-copy": "^0.15.0", - "vitest": "^0.31.1", - "vue-docgen-api": "^4.72.3", + "vite-plugin-static-copy": "^0.16.0", + "vitest": "^0.32.2", + "vue-docgen-api": "^4.73.0", "vue-template-compiler": "^2.7.14" }, "browserslist": [ diff --git a/panel/public/img/icons.svg b/panel/public/img/icons.svg index 437d89501f..5591c8861c 100644 --- a/panel/public/img/icons.svg +++ b/panel/public/img/icons.svg @@ -12,6 +12,9 @@ + + + diff --git a/panel/src/components/Forms/Blocks/Block.vue b/panel/src/components/Forms/Blocks/Block.vue index edc26b222a..841215d0b3 100644 --- a/panel/src/components/Forms/Blocks/Block.vue +++ b/panel/src/components/Forms/Blocks/Block.vue @@ -11,24 +11,14 @@ :data-translate="fieldset.translate" class="k-block-container" tabindex="0" - @keydown.meta.j.prevent="$emit('merge')" - @keydown.ctrl.j.prevent="$emit('merge')" - @keydown.meta.up.exact.prevent="$emit('focusPrev')" - @keydown.ctrl.up.exact.prevent="$emit('focusPrev')" - @keydown.meta.down.exact.prevent="$emit('focusNext')" - @keydown.ctrl.down.exact.prevent="$emit('focusNext')" - @keydown.meta.alt.down.prevent="$emit('selectDown')" - @keydown.ctrl.alt.down.prevent="$emit('selectDown')" - @keydown.meta.alt.up.prevent="$emit('selectUp')" - @keydown.ctrl.alt.up.prevent="$emit('selectUp')" - @keydown.meta.shift.down.prevent="$emit('sortDown')" - @keydown.ctrl.shift.down.prevent="$emit('sortDown')" - @keydown.meta.shift.up.prevent="$emit('sortUp')" - @keydown.ctrl.shift.up.prevent="$emit('sortUp')" - @keydown.meta.backspace.prevent="remove" - @keydown.ctrl.backspace.prevent="remove" - @focus="$emit('focus')" - @focusin="onFocusIn" + @keydown.ctrl.j.prevent.stop="$emit('merge')" + @keydown.ctrl.alt.down.prevent.stop="$emit('selectDown')" + @keydown.ctrl.alt.up.prevent.stop="$emit('selectUp')" + @keydown.ctrl.shift.down.prevent.stop="$emit('sortDown')" + @keydown.ctrl.shift.up.prevent.stop="$emit('sortUp')" + @keydown.ctrl.backspace.prevent.stop="remove" + @focus.stop="$emit('focus')" + @focusin.stop="onFocusIn" >
        diff --git a/panel/src/components/Forms/Field/ColorField.vue b/panel/src/components/Forms/Field/ColorField.vue index 2e95ad2ab2..0c6965d7b8 100644 --- a/panel/src/components/Forms/Field/ColorField.vue +++ b/panel/src/components/Forms/Field/ColorField.vue @@ -165,7 +165,7 @@ export default { .k-color-field .k-input .k-input-before { padding: var(--spacing-1); } -.k-color-field-preview { +.k-color-field .k-color-field-preview { --color-preview-size: calc(var(--field-input-height) - var(--spacing-2)); } @@ -181,11 +181,15 @@ export default { } .k-color-field-options { + --color-preview-size: var(--field-input-height); + display: grid; + grid-template-columns: repeat(auto-fill, var(--color-preview-size)); + gap: var(--spacing-2); +} +.k-color-field-picker .k-color-field-options { --color-preview-size: 100%; --color-preview-darkness: 100%; - display: grid; grid-template-columns: repeat(6, 1fr); - gap: var(--spacing-2); } .k-color-field .k-color-preview[aria-current] { diff --git a/panel/src/components/Forms/Field/LinkField.vue b/panel/src/components/Forms/Field/LinkField.vue index e1b7347c91..66e01d61e2 100644 --- a/panel/src/components/Forms/Field/LinkField.vue +++ b/panel/src/components/Forms/Field/LinkField.vue @@ -6,6 +6,7 @@ @@ -13,7 +14,7 @@ { + return /^(http|https):\/\//.test(value); + }, icon: "url", label: this.$t("url"), + link: (value) => value, placeholder: this.$t("url.placeholder"), input: "url", value: (value) => value }, page: { + detect: (value) => { + return this.isPageUUID(value) === true; + }, icon: "page", label: this.$t("page"), + link: (value) => value, placeholder: this.$t("select") + " …", input: "text", value: (value) => value }, file: { + detect: (value) => { + return this.isFileUUID(value) === true; + }, icon: "file", label: this.$t("file"), + link: (value) => value, placeholder: this.$t("select") + " …", value: (value) => value }, email: { + detect: (value) => { + return value.startsWith("mailto:"); + }, icon: "email", label: this.$t("email"), + link: (value) => value.replace(/^mailto:/, ""), placeholder: this.$t("email.placeholder"), input: "email", value: (value) => "mailto:" + value }, tel: { + detect: (value) => { + return value.startsWith("tel:"); + }, icon: "phone", - label: "Phone", + label: this.$t("tel"), + link: (value) => value.replace(/^tel:/, ""), pattern: "[+]{0,1}[0-9]+", - placeholder: "Enter a phone number …", + placeholder: this.$t("tel.placeholder"), input: "tel", value: (value) => "tel:" + value + }, + anchor: { + detect: (value) => { + return value.startsWith("#"); + }, + icon: "anchor", + label: "Anchor", + link: (value) => value, + pattern: "^#.+", + placeholder: "#element", + input: "text", + value: (value) => value + }, + custom: { + detect: () => true, + icon: "title", + label: this.$t("custom"), + link: (value) => value, + input: "text", + value: (value) => value } }; + }, + activeTypes() { + if (!this.options) { + return this.availableTypes; + } + + const available = {}; + + for (const type of this.options) { + available[type] = this.availableTypes[type]; + } + + return available; } }, watch: { value: { handler(value, old) { + if (value === old) { + return; + } + const parts = this.detect(value); this.linkType = this.linkType ?? parts.type; @@ -177,6 +236,12 @@ export default { immediate: true } }, + created() { + this.$events.on("click", this.onOutsideClick); + }, + destroyed() { + this.$events.off("click", this.onOutsideClick); + }, methods: { clear() { this.$emit("input", ""); @@ -185,38 +250,21 @@ export default { detect(value) { value = value ?? ""; - if (this.isPageUUID(value) === true) { + if (value.length === 0) { return { - type: "page", - link: value + type: "url", + link: "" }; } - if (this.isFileUUID(value) === true) { - return { - type: "file", - link: value - }; - } - - if (value.startsWith("tel:")) { - return { - type: "tel", - link: value.replace(/^tel:/, "") - }; - } - - if (value.startsWith("mailto:")) { - return { - type: "email", - link: value.replace(/^mailto:/, "") - }; + for (const type in this.availableTypes) { + if (this.availableTypes[type].detect(value) === true) { + return { + type: type, + link: this.availableTypes[type].link(value) + }; + } } - - return { - type: "url", - link: value - }; }, focus() { this.$refs.input?.focus(); @@ -251,6 +299,11 @@ export default { onInvalid(invalid) { this.isInvalid = invalid; }, + onOutsideClick(event) { + if (this.$el.contains(event.target) === false) { + this.expanded = false; + } + }, async preview() { if (this.linkType === "page" && this.linkValue) { this.model = await this.previewForPage(this.linkValue); diff --git a/panel/src/components/Forms/Field/StructureField.vue b/panel/src/components/Forms/Field/StructureField.vue index e5aca7cff2..0775a435ac 100644 --- a/panel/src/components/Forms/Field/StructureField.vue +++ b/panel/src/components/Forms/Field/StructureField.vue @@ -1,8 +1,12 @@