From d3acdea38dbbd30c912ef98167138f7c4b528a1b Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Wed, 23 Sep 2026 13:58:22 +0200 Subject: [PATCH 01/80] fix(package): Stop update tester offering an already-installed version The tester forced Cloudinary into the update list without checking the installed version, and self-deactivated via a hard-coded folder name that often did not match, so it could keep re-injecting the update forever. Compare against the installed version, drop a previously injected update once it is installed, use plugin_basename() for deactivation, and give the tester zip a top-level folder. --- gruntfile.js | 1 + package/package.php | 41 ++++++++++++++++++++++++----------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/gruntfile.js b/gruntfile.js index 02b96665f..56e23f74b 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -84,6 +84,7 @@ module.exports = function ( grunt ) { }, cwd: '<%= tester_dir %>', expand: true, + dest: 'cloudinary-update-tester', src: [ '**/*' ], }, }, diff --git a/package/package.php b/package/package.php index 3b89af9d5..7543ca63d 100644 --- a/package/package.php +++ b/package/package.php @@ -34,25 +34,32 @@ function cld_test_check_update( $data ) { $slug = 'cloudinary-image-management-and-manipulation-in-the-cloud-cdn/cloudinary.php'; $file = plugin_dir_path( __FILE__ ) . 'cloudinary-wordpress-STABLETAG.zip'; $version = 'STABLETAG'; - $this_plugin = 'cloudinary-update-tester-STABLETAG/cloudinary-update-tester.php'; - if ( ! empty( $data->no_update ) ) { - if ( ! empty( $data->no_update[ $slug ] ) ) { - $data->no_update[ $slug ]->package = $file; - $data->no_update[ $slug ]->new_version = $version; - $data->response[ $slug ] = $data->no_update[ $slug ]; - unset( $data->no_update[ $slug ] ); - deactivate_plugins( $this_plugin ); - } + $this_plugin = plugin_basename( __FILE__ ); + + if ( ! is_object( $data ) || empty( $data->checked[ $slug ] ) ) { + return $data; } - // Add if available. - if ( ! empty( $data->response ) ) { - $slug = 'cloudinary-image-management-and-manipulation-in-the-cloud-cdn/cloudinary.php'; - if ( ! empty( $data->response[ $slug ] ) ) { - $data->response[ $slug ]->package = $file; - $data->response[ $slug ]->new_version = $version; - $data->response[ $slug ] = $data->response[ $slug ]; - deactivate_plugins( $this_plugin ); + + // Already on the test version (or newer): nothing to offer, drop any update we injected earlier. + if ( version_compare( $data->checked[ $slug ], $version, '>=' ) ) { + if ( ! empty( $data->response[ $slug ] ) && $version === $data->response[ $slug ]->new_version ) { + $data->no_update[ $slug ] = $data->response[ $slug ]; + unset( $data->response[ $slug ] ); } + deactivate_plugins( $this_plugin ); + + return $data; + } + + if ( ! empty( $data->no_update[ $slug ] ) ) { + $data->response[ $slug ] = $data->no_update[ $slug ]; + unset( $data->no_update[ $slug ] ); + } + + if ( ! empty( $data->response[ $slug ] ) ) { + $data->response[ $slug ]->package = $file; + $data->response[ $slug ]->new_version = $version; + deactivate_plugins( $this_plugin ); } return $data; From 64e16381191070b0e9b0903b16fb11e8f89f62c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Sep 2026 01:02:47 +0000 Subject: [PATCH 02/80] chore(deps): bump @codemirror/state from 6.7.4 to 6.7.5 Bumps [@codemirror/state](https://github.com/codemirror/state) from 6.7.4 to 6.7.5. - [Changelog](https://github.com/codemirror/state/blob/main/CHANGELOG.md) - [Commits](https://github.com/codemirror/state/commits) --- updated-dependencies: - dependency-name: "@codemirror/state" dependency-version: 6.7.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 247b1289c..985cc5458 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,17 @@ { "name": "cloudinary", - "version": "3.3.7", + "version": "3.3.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cloudinary", - "version": "3.3.7", + "version": "3.3.8", "hasInstallScript": true, "license": "GPL-2.0+", "dependencies": { "@codemirror/lang-json": "^6.0.2", - "@codemirror/state": "^6.7.4", + "@codemirror/state": "^6.7.5", "@codemirror/theme-one-dark": "^6.1.3", "chart.js": "^4.5.1", "classnames": "^2.3.1", @@ -2498,9 +2498,9 @@ } }, "node_modules/@codemirror/state": { - "version": "6.7.4", - "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.7.4.tgz", - "integrity": "sha512-QhQIVRY+xHZDxwOSFrJ1eUMapJBUID3IdeAjf7dHO7zBUzSkyooHiodnalz5MG3iHzwixKMlAAyn7244y537EA==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.7.5.tgz", + "integrity": "sha512-QjLbZmY1Au3JiRrDVYFLRD0BZ3SOKS9pR3yjIkd7u27YY8TFD9/Q9fhPnLV5l1mHFSo3hHU/N31vpwEJOx4owQ==", "license": "MIT", "dependencies": { "@marijn/find-cluster-break": "^1.0.0" diff --git a/package.json b/package.json index 3ec378e99..4cca65789 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ }, "dependencies": { "@codemirror/lang-json": "^6.0.2", - "@codemirror/state": "^6.7.4", + "@codemirror/state": "^6.7.5", "@codemirror/theme-one-dark": "^6.1.3", "chart.js": "^4.5.1", "classnames": "^2.3.1", From c962a3125fbe86d73f44edaa4a4be72766631986 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Sep 2026 01:03:15 +0000 Subject: [PATCH 03/80] chore(deps-dev): bump dotenv from 17.4.2 to 18.0.2 Bumps [dotenv](https://github.com/motdotla/dotenv) from 17.4.2 to 18.0.2. - [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md) - [Commits](https://github.com/motdotla/dotenv/compare/v17.4.2...v18.0.2) --- updated-dependencies: - dependency-name: dotenv dependency-version: 18.0.2 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 15 +++++++++------ package.json | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 247b1289c..5395b0bbb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cloudinary", - "version": "3.3.7", + "version": "3.3.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cloudinary", - "version": "3.3.7", + "version": "3.3.8", "hasInstallScript": true, "license": "GPL-2.0+", "dependencies": { @@ -45,7 +45,7 @@ "css-minimizer-webpack-plugin": "^8.0.0", "css-unicode-loader": "^1.0.3", "cssnano": "^9.0.4", - "dotenv": "^17.3.1", + "dotenv": "^18.0.2", "eslint": "^10.10.0", "eslint-plugin-jest": "^29.16.6", "eslint-plugin-react-hooks": "^7.0.1", @@ -15958,11 +15958,14 @@ } }, "node_modules/dotenv": { - "version": "17.4.2", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz", - "integrity": "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==", + "version": "18.0.2", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-18.0.2.tgz", + "integrity": "sha512-wl0U3CxC0iobaryqEKpFJxzyp4AxQFYAKj/WWszXZr87vVHLi2yJv2syax5Vxt+u02xqNgE277rsc3lOKg9sPg==", "dev": true, "license": "BSD-2-Clause", + "bin": { + "dotenv": "dist/index.cjs" + }, "engines": { "node": ">=12" }, diff --git a/package.json b/package.json index 3ec378e99..605cf85e3 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "css-minimizer-webpack-plugin": "^8.0.0", "css-unicode-loader": "^1.0.3", "cssnano": "^9.0.4", - "dotenv": "^17.3.1", + "dotenv": "^18.0.2", "eslint": "^10.10.0", "eslint-plugin-jest": "^29.16.6", "eslint-plugin-react-hooks": "^7.0.1", From ab6e239f5c14ce33e761ccf7517de53166cb949e Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Wed, 30 Sep 2026 08:58:29 +0200 Subject: [PATCH 04/80] fix(media): hook wp_get_attachment_image_src to keep Cloudinary URLs as the last word WordPress applies its own filter after image_downsize() has already resolved, and CDN/ image-optimization plugins commonly target it directly -- so a competing plugin, or filter ordering on image_downsize, could leave a local URL in place with no second chance to correct it. The new filter is a cheap guard: it bows out immediately if the URL is already a Cloudinary URL, and otherwise reuses the same deliverable/re-entrancy checks as filter_downsize(), so it only does work in the rare case something else missed. Also extracts the shared save-state/ re-entrancy guard (in_downsize, content_save_pre, is_saving_metadata, video exclusion) into Media::is_replacement_paused(), reused by filter_downsize(), the new filter, and attachment_url() (WPP-1183). --- php/class-media.php | 100 +++++-- .../tests/test-attachment-image-src.php | 268 ++++++++++++++++++ 2 files changed, 350 insertions(+), 18 deletions(-) create mode 100644 tests/phpunit/tests/test-attachment-image-src.php diff --git a/php/class-media.php b/php/class-media.php index ea14b2ab6..412238ff8 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1186,23 +1186,20 @@ public function attachment_url( $url, $attachment_id ) { return str_replace( trailingslashit( $dirs['baseurl'] ), '', $url ); } - if ( - false === $this->in_downsize - && ! doing_filter( 'content_save_pre' ) - && ! Utils::is_saving_metadata() - /** - * Filter doing upload. - * If so, return the default attachment URL. - * - * @param bool Default false. - * - * @return bool - */ - && ! apply_filters( 'cloudinary_doing_upload', false ) - ) { - if ( ! $this->is_cloudinary_url( $url ) && $this->cloudinary_id( $attachment_id ) ) { - $url = $this->cloudinary_url( $attachment_id ); - } + /** + * Filter doing upload. + * If so, return the default attachment URL. + * + * @param bool Default false. + * + * @return bool + */ + if ( $this->is_replacement_paused( $attachment_id, false ) || apply_filters( 'cloudinary_doing_upload', false ) ) { + return $url; + } + + if ( ! $this->is_cloudinary_url( $url ) && $this->cloudinary_id( $attachment_id ) ) { + $url = $this->cloudinary_url( $attachment_id ); } return $url; @@ -1802,7 +1799,7 @@ public function filter_downsize( $image, $attachment_id, $size ) { } // Don't do this while saving. - if ( true === $this->in_downsize || doing_filter( 'content_save_pre' ) || wp_attachment_is( 'video', $attachment_id ) || Utils::is_saving_metadata() ) { + if ( $this->is_replacement_paused( $attachment_id ) ) { return $image; } @@ -1836,6 +1833,72 @@ public function filter_downsize( $image, $attachment_id, $size ) { return $image; } + /** + * Whether URL replacement should be paused for this attachment right now: while a + * downsize is already in progress (re-entrancy guard), while content or metadata is being + * saved, or -- unless explicitly included -- for a video attachment, since there is no + * "image size" to downsize a video to. + * + * Shared by filter_downsize(), filter_attachment_image_src(), and attachment_url(), so the + * save-state/re-entrancy logic lives in one place. + * + * @param int $attachment_id The attachment ID. + * @param bool $exclude_videos Whether a video attachment should also count as paused. + * + * @return bool + */ + private function is_replacement_paused( $attachment_id, $exclude_videos = true ) { + if ( true === $this->in_downsize || doing_filter( 'content_save_pre' ) || Utils::is_saving_metadata() ) { + return true; + } + + return $exclude_videos && wp_attachment_is( 'video', $attachment_id ); + } + + /** + * Correct wp_get_attachment_image_src() results that image_downsize() missed, or that a + * later-priority plugin overwrote, so Cloudinary keeps the last word on this specific, + * commonly-targeted core hook. + * + * @param array|false $image The image src array, or false. + * @param int $attachment_id The ID of the attachment. + * @param string|array $size The requested size of the image. + * @param bool $icon Whether the image should be treated as an icon. + * + * @return array|false The image array of size and url. + * @uses filter:wp_get_attachment_image_src + */ + public function filter_attachment_image_src( $image, $attachment_id, $size, $icon ) { + if ( empty( $image ) || $icon ) { + return $image; + } + + // Fast bow-out: already a Cloudinary URL, nothing to do. + if ( $this->is_cloudinary_url( $image[0] ) ) { + return $image; + } + + if ( $this->is_replacement_paused( $attachment_id ) ) { + return $image; + } + + if ( ! $this->plugin->get_component( 'delivery' )->is_deliverable( $attachment_id ) ) { + return $image; + } + + $cloudinary_id = $this->cloudinary_id( $attachment_id ); + if ( ! $cloudinary_id ) { + return $image; + } + + $url = $this->cloudinary_url( $attachment_id, $size, array(), $cloudinary_id ); + if ( $url ) { + $image[0] = $url; + } + + return $image; + } + /** * At the point of running wp_get_attachment_image_srcset, the $image_src Should be a Cloudinary URL, unless not synced. * This will fix the $image_meta so that the there's a match $src_matched on wp_calculate_image_srcset. @@ -3150,6 +3213,7 @@ public function add_live_url_filters() { add_filter( 'wp_get_attachment_url', array( $this, 'attachment_url' ), 10, 2 ); add_filter( 'wp_get_original_image_url', array( $this, 'original_attachment_url' ), 10, 2 ); add_filter( 'image_downsize', array( $this, 'filter_downsize' ), 10, 3 ); + add_filter( 'wp_get_attachment_image_src', array( $this, 'filter_attachment_image_src' ), PHP_INT_MAX, 4 ); add_filter( 'wp_calculate_image_srcset_meta', array( $this, 'calculate_image_srcset_meta' ), 10, 3 ); // Hook into Featured Image cycle. diff --git a/tests/phpunit/tests/test-attachment-image-src.php b/tests/phpunit/tests/test-attachment-image-src.php new file mode 100644 index 000000000..7de6d386d --- /dev/null +++ b/tests/phpunit/tests/test-attachment-image-src.php @@ -0,0 +1,268 @@ +attachment->create_upload_object( DIR_TESTDATA . '/images/canola.jpg' ); + } + + /** + * Build a Test_Attachment_Image_Src_Media instance wired to the real, already-booted plugin. + * + * @return Test_Attachment_Image_Src_Media + */ + protected function get_media() { + $media = new Test_Attachment_Image_Src_Media( \Cloudinary\get_plugin_instance() ); + $media->base_url = 'https://res.cloudinary.com/test-cloud'; + + return $media; + } + + /** + * Utils::is_saving_metadata() reads did_action() counters (add_post_meta, etc.) that + * WordPress never resets between tests within one PHPUnit process -- any earlier test, or + * even our own wpSetUpBeforeClass() fixture, already ticks them past zero. Momentarily + * clearing them here isolates the checks that come after that guard in + * filter_attachment_image_src(), so those tests exercise their own branch instead of + * always bowing out at is_saving_metadata() for an unrelated, process-wide reason. + * + * @param callable $callback Callback to run with the guard cleared. + * + * @return mixed + */ + protected function without_saving_metadata_guard( callable $callback ) { + $keys = array( 'add_post_meta', 'update_post_meta', 'add_term_meta', 'update_term_meta', 'add_user_meta', 'update_user_meta' ); + $saved = array(); + foreach ( $keys as $key ) { + if ( isset( $GLOBALS['wp_actions'][ $key ] ) ) { + $saved[ $key ] = $GLOBALS['wp_actions'][ $key ]; + unset( $GLOBALS['wp_actions'][ $key ] ); + } + } + try { + return $callback(); + } finally { + foreach ( $saved as $key => $value ) { + $GLOBALS['wp_actions'][ $key ] = $value; + } + } + } + + /** + * A URL that already lives on the configured Cloudinary domain is returned untouched -- the + * cheap bow-out path the ticket calls for, taken before any sync/delivery check runs. + * + * @return void + */ + public function test_already_cloudinary_url_is_returned_unchanged() { + $media = $this->get_media(); + $image = array( 'https://res.cloudinary.com/test-cloud/image/upload/v1/sample.jpg', 100, 100, true ); + + $result = $media->filter_attachment_image_src( $image, self::$attachment_id, 'thumbnail', false ); + + $this->assertSame( $image, $result ); + } + + /** + * The icon fallback path in wp_get_attachment_image_src() is left alone entirely. + * + * @return void + */ + public function test_icon_result_is_returned_unchanged() { + $media = $this->get_media(); + $image = array( 'http://example.org/wp-includes/images/media/default.png', 48, 64, false ); + + $result = $media->filter_attachment_image_src( $image, self::$attachment_id, 'thumbnail', true ); + + $this->assertSame( $image, $result ); + } + + /** + * A false (no image) result has nothing to correct and must pass through unchanged. + * + * @return void + */ + public function test_false_image_is_returned_unchanged() { + $media = $this->get_media(); + + $this->assertFalse( $media->filter_attachment_image_src( false, self::$attachment_id, 'thumbnail', false ) ); + } + + /** + * A video attachment is left untouched, mirroring the same guard filter_downsize() uses. + * + * @return void + */ + public function test_video_attachment_is_returned_unchanged() { + $video_id = self::factory()->post->create( + array( + 'post_type' => 'attachment', + 'post_mime_type' => 'video/mp4', + ) + ); + + $media = $this->get_media(); + $image = array( 'http://example.org/wp-content/uploads/video.mp4', 640, 360, true ); + + $result = $this->without_saving_metadata_guard( + function () use ( $media, $image, $video_id ) { + return $media->filter_attachment_image_src( $image, $video_id, 'thumbnail', false ); + } + ); + + $this->assertSame( $image, $result ); + } + + /** + * An image attachment with no generated metadata is not deliverable (no width/height to + * hand Cloudinary), so the local URL passes through unchanged. + * + * @return void + */ + public function test_non_deliverable_attachment_is_returned_unchanged() { + $bare_id = self::factory()->post->create( + array( + 'post_type' => 'attachment', + 'post_mime_type' => 'image/jpeg', + ) + ); + + $media = $this->get_media(); + $media->stub_cloudinary_id = 'sample.jpg'; + $image = array( 'http://example.org/wp-content/uploads/bare.jpg', 100, 100, true ); + + $result = $this->without_saving_metadata_guard( + function () use ( $media, $image, $bare_id ) { + return $media->filter_attachment_image_src( $image, $bare_id, 'thumbnail', false ); + } + ); + + $this->assertSame( $image, $result ); + } + + /** + * A deliverable attachment that has no Cloudinary ID (not synced) is left untouched -- there + * is nothing to correct it to. + * + * @return void + */ + public function test_no_cloudinary_id_returns_image_unchanged() { + $media = $this->get_media(); + $media->stub_cloudinary_id = false; + $media->stub_cloudinary_url = 'https://res.cloudinary.com/test-cloud/image/upload/should-not-be-used.jpg'; + $image = array( 'http://example.org/wp-content/uploads/canola.jpg', 100, 100, true ); + + $result = $this->without_saving_metadata_guard( + function () use ( $media, $image ) { + return $media->filter_attachment_image_src( $image, self::$attachment_id, 'thumbnail', false ); + } + ); + + $this->assertSame( $image, $result ); + } + + /** + * The actual fix: a local URL on a deliverable, synced attachment is corrected to the + * Cloudinary URL, with width/height/is-intermediate preserved from the original array. + * + * @return void + */ + public function test_local_url_is_corrected_to_cloudinary_url() { + $media = $this->get_media(); + $media->stub_cloudinary_id = 'sample.jpg'; + $media->stub_cloudinary_url = 'https://res.cloudinary.com/test-cloud/image/upload/sample.jpg'; + $image = array( 'http://example.org/wp-content/uploads/canola.jpg', 100, 100, true ); + + $result = $this->without_saving_metadata_guard( + function () use ( $media, $image ) { + return $media->filter_attachment_image_src( $image, self::$attachment_id, 'thumbnail', false ); + } + ); + + $this->assertSame( $media->stub_cloudinary_url, $result[0] ); + $this->assertSame( 100, $result[1] ); + $this->assertSame( 100, $result[2] ); + $this->assertTrue( $result[3] ); + } +} + +/** + * A Media subclass with cloudinary_id()/cloudinary_url() stubbed out, so + * filter_attachment_image_src() can be exercised without driving the real sync/signature + * pipeline (which needs a live Cloudinary account -- see tests/e2e for that coverage). + */ +class Test_Attachment_Image_Src_Media extends \Cloudinary\Media { + + /** + * Canned cloudinary_id() return value. + * + * @var string|false + */ + public $stub_cloudinary_id = false; + + /** + * Canned cloudinary_url() return value. + * + * @var string|false + */ + public $stub_cloudinary_url = false; + + /** + * Stubbed to avoid the real sync/signature pipeline. + * + * @param int $attachment_id The attachment ID. + * + * @return string|false + */ + public function cloudinary_id( $attachment_id ) { + return $this->stub_cloudinary_id; + } + + /** + * Stubbed to avoid the real sync/signature pipeline. + * + * @param int $attachment_id The attachment ID. + * @param array|string $size The requested size. + * @param array $transformations Transformations to apply. + * @param string|null $cloudinary_id A forced Cloudinary ID. + * @param bool $overwrite_transformations Whether to overwrite transformations. + * + * @return string|false + */ + public function cloudinary_url( $attachment_id, $size = array(), $transformations = array(), $cloudinary_id = null, $overwrite_transformations = false ) { + return $this->stub_cloudinary_url; + } +} From df197d1db2c4d2f1d293cf315d279789e8b73258 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Thu, 1 Oct 2026 10:51:14 +0200 Subject: [PATCH 05/80] fix(media): run image corrections on the front end, and fix a list-mode blind spot image_downsize()/wp_get_attachment_image_src() are exercised by ordinary front-end theme code (e.g. the_post_thumbnail()), not just wp-admin screens -- manual QA confirmed a featured image rendered by Twenty Twenty-Five's front-end template hit the filter, so scoping correction to Utils::is_admin() (admin screens only) left the front end exposed to the same "something overwrote the URL after image_downsize()" problem this hook was added to guard against. Registers both filters unconditionally instead of inside add_live_url_filters()'s admin-only set; that method's other filters are untouched. Also fixes a bug the broadened testing surfaced: wp_get_attachment_image_src() passes the caller's $icon argument straight through to the filter regardless of whether a real image was actually found (it just means "fall back to a mime icon if none is found"), but filter_attachment_image_src() treated $icon as "this is a fallback icon" and bowed out unconditionally. WP_Media_List_Table's list-mode thumbnail column always calls with icon=true, even for real synced images, which silently blocked correction there while grid mode (driven by image_downsize() instead) worked fine. Dropping the $icon check is safe: the existing is_deliverable()/cloudinary_id() checks already leave a genuine icon fallback alone, since an unsynced/non-deliverable attachment has no cloudinary_id to correct it to (WPP-1183). --- php/class-media.php | 12 +++-- .../tests/test-attachment-image-src.php | 51 +++++++++++++++++-- 2 files changed, 55 insertions(+), 8 deletions(-) diff --git a/php/class-media.php b/php/class-media.php index 412238ff8..8417bc224 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1869,7 +1869,7 @@ private function is_replacement_paused( $attachment_id, $exclude_videos = true ) * @uses filter:wp_get_attachment_image_src */ public function filter_attachment_image_src( $image, $attachment_id, $size, $icon ) { - if ( empty( $image ) || $icon ) { + if ( empty( $image ) ) { return $image; } @@ -3212,8 +3212,6 @@ public function add_live_url_filters() { add_filter( 'wp_calculate_image_srcset', array( $this, 'image_srcset' ), 10, 5 ); add_filter( 'wp_get_attachment_url', array( $this, 'attachment_url' ), 10, 2 ); add_filter( 'wp_get_original_image_url', array( $this, 'original_attachment_url' ), 10, 2 ); - add_filter( 'image_downsize', array( $this, 'filter_downsize' ), 10, 3 ); - add_filter( 'wp_get_attachment_image_src', array( $this, 'filter_attachment_image_src' ), PHP_INT_MAX, 4 ); add_filter( 'wp_calculate_image_srcset_meta', array( $this, 'calculate_image_srcset_meta' ), 10, 3 ); // Hook into Featured Image cycle. @@ -3255,6 +3253,14 @@ public function setup() { if ( Utils::is_admin() ) { $this->add_live_url_filters(); } + + // image_downsize() and wp_get_attachment_image_src() are exercised by ordinary + // front-end theme code (e.g. the_post_thumbnail()), not just wp-admin screens, so + // these run everywhere rather than being scoped to add_live_url_filters()'s + // admin-only set. + add_filter( 'image_downsize', array( $this, 'filter_downsize' ), 10, 3 ); + add_filter( 'wp_get_attachment_image_src', array( $this, 'filter_attachment_image_src' ), PHP_INT_MAX, 4 ); + // Filter default image Quality and Format transformations. add_filter( 'cloudinary_default_qf_transformations_image', array( $this, 'default_image_transformations' ), 10 ); add_filter( 'cloudinary_default_freeform_transformations_image', array( $this, 'default_image_freeform_transformations' ), 10 ); diff --git a/tests/phpunit/tests/test-attachment-image-src.php b/tests/phpunit/tests/test-attachment-image-src.php index 7de6d386d..ace091fb7 100644 --- a/tests/phpunit/tests/test-attachment-image-src.php +++ b/tests/phpunit/tests/test-attachment-image-src.php @@ -4,8 +4,11 @@ * * This covers the wp_get_attachment_image_src filter Cloudinary hooks so it keeps the last * word on that specific, commonly-targeted core hook (see WPP-1183): it must bow out cheaply - * when a URL is already a Cloudinary URL, leave icon/false results alone, and only correct a - * local URL when the attachment is actually deliverable and synced. + * when a URL is already a Cloudinary URL or there is no image at all, correct a local URL when + * the attachment is actually deliverable and synced regardless of the caller's $icon argument + * (WP_Media_List_Table's list-mode thumbnail column passes icon=true for every attachment, real + * images included -- see wp-admin/includes/class-wp-media-list-table.php), and otherwise leave + * the result alone. * * cloudinary_id() and cloudinary_url() are stubbed out (Test_Attachment_Image_Src_Media below) * rather than driven through the real sync/signature pipeline, matching the approach in @@ -97,15 +100,53 @@ public function test_already_cloudinary_url_is_returned_unchanged() { } /** - * The icon fallback path in wp_get_attachment_image_src() is left alone entirely. + * $icon is the caller's permission to fall back to a mime-type icon if image_downsize() + * found nothing -- WordPress passes the original argument through to the filter unchanged, + * regardless of whether $image is actually a real image or a fallback icon (see + * wp_get_attachment_image_src() in wp-includes/media.php). WP_Media_List_Table's list-mode + * thumbnail column calls wp_get_attachment_image() with icon=true for every attachment, real + * synced images included, so icon=true must not by itself block correction. * * @return void */ - public function test_icon_result_is_returned_unchanged() { + public function test_icon_true_does_not_block_correcting_a_real_synced_image() { + $media = $this->get_media(); + $media->stub_cloudinary_id = 'sample.jpg'; + $media->stub_cloudinary_url = 'https://res.cloudinary.com/test-cloud/image/upload/sample.jpg'; + $image = array( 'http://example.org/wp-content/uploads/canola.jpg', 100, 100, true ); + + $result = $this->without_saving_metadata_guard( + function () use ( $media, $image ) { + return $media->filter_attachment_image_src( $image, self::$attachment_id, 'thumbnail', true ); + } + ); + + $this->assertSame( $media->stub_cloudinary_url, $result[0] ); + } + + /** + * A genuine mime-icon fallback (no cloudinary_id to correct it to, e.g. an unsynced or + * non-deliverable attachment) is still left alone -- not because of the $icon flag, but + * because there is nothing to swap it for. + * + * @return void + */ + public function test_icon_fallback_is_unchanged_when_nothing_to_correct_it_to() { + $bare_id = self::factory()->post->create( + array( + 'post_type' => 'attachment', + 'post_mime_type' => 'image/jpeg', + ) + ); + $media = $this->get_media(); $image = array( 'http://example.org/wp-includes/images/media/default.png', 48, 64, false ); - $result = $media->filter_attachment_image_src( $image, self::$attachment_id, 'thumbnail', true ); + $result = $this->without_saving_metadata_guard( + function () use ( $media, $image, $bare_id ) { + return $media->filter_attachment_image_src( $image, $bare_id, 'thumbnail', true ); + } + ); $this->assertSame( $image, $result ); } From d4eb39dbabad67ece781a89306b22389611b5bd5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Oct 2026 01:05:57 +0000 Subject: [PATCH 06/80] chore(deps-dev): bump phpstan/phpstan from 2.2.14 to 2.2.16 Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan-phar-composer-source) from 2.2.14 to 2.2.16. - [Commits](https://github.com/phpstan/phpstan-phar-composer-source/commits) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-version: 2.2.16 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 1de8cb02a..7272c8dc8 100644 --- a/composer.lock +++ b/composer.lock @@ -992,11 +992,11 @@ }, { "name": "phpstan/phpstan", - "version": "2.2.14", + "version": "2.2.16", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9c672e7a8e791dfc3d30e55f683e73fc0b63a3ac", - "reference": "9c672e7a8e791dfc3d30e55f683e73fc0b63a3ac", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/46a6d9060e5a7763adfcc21ebcb8b504ebdbcb92", + "reference": "46a6d9060e5a7763adfcc21ebcb8b504ebdbcb92", "shasum": "" }, "require": { @@ -1052,7 +1052,7 @@ "type": "github" } ], - "time": "2026-09-12T21:39:33+00:00" + "time": "2026-09-25T09:31:51+00:00" }, { "name": "phpunit/php-code-coverage", From dd032b5e08d00cebc0c010072be6375bc642277f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Oct 2026 01:06:01 +0000 Subject: [PATCH 07/80] chore(deps-dev): bump php-stubs/woocommerce-stubs from 11.1.0 to 11.1.2 Bumps [php-stubs/woocommerce-stubs](https://github.com/php-stubs/woocommerce-stubs) from 11.1.0 to 11.1.2. - [Commits](https://github.com/php-stubs/woocommerce-stubs/compare/v11.1.0...v11.1.2) --- updated-dependencies: - dependency-name: php-stubs/woocommerce-stubs dependency-version: 11.1.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 1de8cb02a..cdd154c9b 100644 --- a/composer.lock +++ b/composer.lock @@ -464,16 +464,16 @@ }, { "name": "php-stubs/woocommerce-stubs", - "version": "v11.1.0", + "version": "v11.1.2", "source": { "type": "git", "url": "https://github.com/php-stubs/woocommerce-stubs.git", - "reference": "179fee63dba9c72a3f7bfcc3e7e2749f4650dd3b" + "reference": "06dfedfe33a46a12db99fd343b80f1f2f11e64f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/179fee63dba9c72a3f7bfcc3e7e2749f4650dd3b", - "reference": "179fee63dba9c72a3f7bfcc3e7e2749f4650dd3b", + "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/06dfedfe33a46a12db99fd343b80f1f2f11e64f6", + "reference": "06dfedfe33a46a12db99fd343b80f1f2f11e64f6", "shasum": "" }, "require": { @@ -502,9 +502,9 @@ ], "support": { "issues": "https://github.com/php-stubs/woocommerce-stubs/issues", - "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v11.1.0" + "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v11.1.2" }, - "time": "2026-09-03T14:42:36+00:00" + "time": "2026-09-22T23:29:58+00:00" }, { "name": "php-stubs/wordpress-stubs", From da113bf751af4bc960dc4f7b08c0818545faf8e9 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Mon, 5 Oct 2026 09:06:51 +0200 Subject: [PATCH 08/80] fix(media): restore hookdoc adjacency for cloudinary_doing_upload filter Moving the docblock above the if statement (rather than immediately before the apply_filters() call it documents) broke PHPStan's parsing of the @param tag, caught by composer phpstan ahead of opening the PR. Keeps the same relative position as before, just inside the inverted condition. --- php/class-media.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/php/class-media.php b/php/class-media.php index 8417bc224..32ef7ab7d 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1186,15 +1186,18 @@ public function attachment_url( $url, $attachment_id ) { return str_replace( trailingslashit( $dirs['baseurl'] ), '', $url ); } - /** - * Filter doing upload. - * If so, return the default attachment URL. - * - * @param bool Default false. - * - * @return bool - */ - if ( $this->is_replacement_paused( $attachment_id, false ) || apply_filters( 'cloudinary_doing_upload', false ) ) { + if ( + $this->is_replacement_paused( $attachment_id, false ) + /** + * Filter doing upload. + * If so, return the default attachment URL. + * + * @param bool Default false. + * + * @return bool + */ + || apply_filters( 'cloudinary_doing_upload', false ) + ) { return $url; } From 58c164ed40ebbcf4c5f660a771f7ef06b15327e0 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Mon, 5 Oct 2026 09:33:44 +0200 Subject: [PATCH 09/80] docs(media): clarify the positional false in attachment_url()'s is_replacement_paused() call Addresses a readability nit from PR review: the bool was unexplained at the call site, requiring a trip to the method signature to know what it toggles. --- php/class-media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-media.php b/php/class-media.php index 32ef7ab7d..84038bd69 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1187,7 +1187,7 @@ public function attachment_url( $url, $attachment_id ) { } if ( - $this->is_replacement_paused( $attachment_id, false ) + $this->is_replacement_paused( $attachment_id, false ) // false: videos still need their own URL corrected here. /** * Filter doing upload. * If so, return the default attachment URL. From 2a878b70ed9201ba6df3b60c4c2984895b27f5b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 08:08:17 +0000 Subject: [PATCH 10/80] chore(deps-dev): bump eslint from 10.10.0 to 10.11.0 Bumps [eslint](https://github.com/eslint/eslint) from 10.10.0 to 10.11.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](https://github.com/eslint/eslint/compare/v10.10.0...v10.11.0) --- updated-dependencies: - dependency-name: eslint dependency-version: 10.11.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0a6d0e9d1..f8e800b4a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,7 +46,7 @@ "css-unicode-loader": "^1.0.3", "cssnano": "^9.0.4", "dotenv": "^18.0.2", - "eslint": "^10.10.0", + "eslint": "^10.11.0", "eslint-plugin-jest": "^29.16.6", "eslint-plugin-react-hooks": "^7.0.1", "file-loader": "^6.2.0", @@ -16426,9 +16426,9 @@ } }, "node_modules/eslint": { - "version": "10.10.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.10.0.tgz", - "integrity": "sha512-NPXn6r5zl4uET1DAVPaOwzX3rut4c0wcmw3dWJAfOsTM5+TogXo0DDjz8pwm/hL8cyVNpHqeK4JpN0NjnyFFNw==", + "version": "10.11.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.11.0.tgz", + "integrity": "sha512-P7a6UEEqb9G95MYAtqkmsTbVXIYyzIfl6NGOIJk162PaahFxFyeGcrlXYFSiagECg4sEm8IseJdZBKR3rx6MsQ==", "dev": true, "license": "MIT", "workspaces": [ diff --git a/package.json b/package.json index dd440bf52..e12976b4b 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "css-unicode-loader": "^1.0.3", "cssnano": "^9.0.4", "dotenv": "^18.0.2", - "eslint": "^10.10.0", + "eslint": "^10.11.0", "eslint-plugin-jest": "^29.16.6", "eslint-plugin-react-hooks": "^7.0.1", "file-loader": "^6.2.0", From 193eff732478b190fd4c51d3a316c3d54d17fa8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 08:08:48 +0000 Subject: [PATCH 11/80] chore(deps-dev): bump cssnano from 9.0.4 to 9.1.2 Bumps [cssnano](https://github.com/cssnano/cssnano) from 9.0.4 to 9.1.2. - [Release notes](https://github.com/cssnano/cssnano/releases) - [Commits](https://github.com/cssnano/cssnano/compare/cssnano@9.0.4...cssnano@9.1.2) --- updated-dependencies: - dependency-name: cssnano dependency-version: 9.0.5 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 610 ++++++++++++++++++++-------------------------- package.json | 2 +- 2 files changed, 266 insertions(+), 346 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0a6d0e9d1..643373f67 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "css-loader": "^7.1.5", "css-minimizer-webpack-plugin": "^8.0.0", "css-unicode-loader": "^1.0.3", - "cssnano": "^9.0.4", + "cssnano": "^9.1.2", "dotenv": "^18.0.2", "eslint": "^10.10.0", "eslint-plugin-jest": "^29.16.6", @@ -2531,9 +2531,9 @@ } }, "node_modules/@colordx/core": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@colordx/core/-/core-6.4.0.tgz", - "integrity": "sha512-KJf2x955gXdCXTVQVd4kh4V89UJq/iUg366DHL1dv5+Bdugehak9lK2veBvOBwOqlusCCo+hKpVXDG437EW2/g==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@colordx/core/-/core-7.2.0.tgz", + "integrity": "sha512-Y5PPwWCWVP59qj2EMVSgD9QMXtMSwt9DseqKvRWOXefM7sRu4EjCRuXQXMaanUH32R8c89OCWJJWZe6jA1dvTg==", "dev": true, "license": "MIT" }, @@ -2630,9 +2630,9 @@ } }, "node_modules/@csstools/css-tokenizer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-4.0.0.tgz", - "integrity": "sha512-QxULHAm7cNu72w97JUNCBFODFaXpbDg+dP8b/oWFAZ2MTRppA3U00Y2L1HqaS4J6yBqxwa/Y3nMBaxVKbB/NsA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-4.0.2.tgz", + "integrity": "sha512-OoKoR0f76dCY666JlcbhmVTs2drYj1GUXZTYTcbUgJjh9Nv41aFfZ21bPQTERm5+L5cBDo466NltB2lplS5GBw==", "dev": true, "funding": [ { @@ -12935,9 +12935,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.11.23", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.23.tgz", - "integrity": "sha512-le521dGVfxM7yRX0EikCoSz+rOK+hHzdDt/E7mG1jOJB/6WAAUuwVroLwaB7ApaUsz5Q0kFlDXLSA9MheUIfRQ==", + "version": "2.11.27", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.27.tgz", + "integrity": "sha512-ElY12DaROGuan+lMmZ8Cvo/ZUbXPe7Enc/9VU/b1T3Kp4dwytRcNdR8DoSJN5SNJT/CuvcCA0DHDVmMOCePdRQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -13449,9 +13449,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001810", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001810.tgz", - "integrity": "sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==", + "version": "1.0.30001814", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001814.tgz", + "integrity": "sha512-/Uaf1lAzr59XcMpW0o96WoEfr+VXK2OX4U9AgFoiSHsVJ4HppnIFUjtYzsyDH2+tgANaQb2/oxYGwCPapN1FpA==", "dev": true, "funding": [ { @@ -15138,13 +15138,13 @@ } }, "node_modules/cssnano": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-9.0.4.tgz", - "integrity": "sha512-CdXjUnePN8UmFySZ65Oh83DUf/z/VV+yRc86PlMUA4JBJizXiwelynZvfLji+gY/Z94xH+RrCT48wZyqSJdhuw==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-9.1.2.tgz", + "integrity": "sha512-UJnrkOxzaK21cYEbxnp21vUohm/wg8B8R0eoLe7A6Jnm9nHeIQ0irn3L9HYzml9BFkrF97JwE7d6HV4UU6+1dQ==", "dev": true, "license": "MIT", "dependencies": { - "cssnano-preset-default": "^9.0.4" + "cssnano-preset-default": "^9.1.2" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -15158,41 +15158,41 @@ } }, "node_modules/cssnano-preset-default": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-9.0.4.tgz", - "integrity": "sha512-eHy3rfG0/TRGGG6gbgwLLlSs3Xr0xx2ShVwN94le+pydxAC3dXgmJTu8uIqdvBbrmEirUGuK9H5rUnxJRDXdoA==", - "dev": true, - "license": "MIT", - "dependencies": { - "browserslist": "^4.28.9", - "cssnano-utils": "^7.0.2", - "postcss-calc": "^11.1.1", - "postcss-colormin": "^9.0.2", - "postcss-convert-values": "^9.0.2", - "postcss-discard-comments": "^9.0.2", - "postcss-discard-duplicates": "^9.0.2", - "postcss-discard-empty": "^9.0.2", - "postcss-discard-overridden": "^9.0.2", - "postcss-merge-longhand": "^9.0.3", - "postcss-merge-rules": "^9.0.3", - "postcss-minify-font-values": "^9.0.2", - "postcss-minify-gradients": "^9.0.2", - "postcss-minify-params": "^9.0.2", - "postcss-minify-selectors": "^9.0.3", - "postcss-normalize-charset": "^9.0.2", - "postcss-normalize-display-values": "^9.0.2", - "postcss-normalize-positions": "^9.0.2", - "postcss-normalize-repeat-style": "^9.0.2", - "postcss-normalize-string": "^9.0.2", - "postcss-normalize-timing-functions": "^9.0.2", - "postcss-normalize-unicode": "^9.0.2", - "postcss-normalize-url": "^9.0.2", - "postcss-normalize-whitespace": "^9.0.2", - "postcss-ordered-values": "^9.0.2", - "postcss-reduce-initial": "^9.0.2", - "postcss-reduce-transforms": "^9.0.2", - "postcss-svgo": "^9.0.2", - "postcss-unique-selectors": "^9.0.2" + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-9.1.2.tgz", + "integrity": "sha512-prjUo7JkR3JD74ODNuBwhz1c/DyQLtj1Te0VijEI7PCY8So+Y1KYk84tQAP2F74Rmb9NUPzQjUCmLrn5MbjctA==", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.29.2", + "cssnano-utils": "^8.0.1", + "postcss-calc": "^11.2.1", + "postcss-colormin": "^9.0.5", + "postcss-convert-values": "^9.0.6", + "postcss-discard-comments": "^9.0.5", + "postcss-discard-duplicates": "^9.0.4", + "postcss-discard-empty": "^9.0.5", + "postcss-discard-overridden": "^9.0.5", + "postcss-merge-longhand": "^9.1.1", + "postcss-merge-rules": "^9.0.6", + "postcss-minify-font-values": "^9.0.5", + "postcss-minify-gradients": "^9.0.5", + "postcss-minify-params": "^9.0.5", + "postcss-minify-selectors": "^9.0.5", + "postcss-normalize-charset": "^9.0.5", + "postcss-normalize-display-values": "^9.0.5", + "postcss-normalize-positions": "^9.0.5", + "postcss-normalize-repeat-style": "^9.0.5", + "postcss-normalize-string": "^9.0.4", + "postcss-normalize-timing-functions": "^9.0.5", + "postcss-normalize-unicode": "^9.0.4", + "postcss-normalize-url": "^9.0.5", + "postcss-normalize-whitespace": "^9.0.5", + "postcss-ordered-values": "^9.0.5", + "postcss-reduce-initial": "^9.0.5", + "postcss-reduce-transforms": "^9.0.4", + "postcss-svgo": "^9.0.4", + "postcss-unique-selectors": "^9.0.5" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -15202,9 +15202,9 @@ } }, "node_modules/cssnano-preset-default/node_modules/browserslist": { - "version": "4.28.9", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.9.tgz", - "integrity": "sha512-EWazOblFYUvlGZcfGhPUPmYh3nikUxBVb+y9MJun5f3hBi812X+8MSQTujLBtgK3cf51fJWbWfOjyeO954d+Eg==", + "version": "4.29.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", + "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", "dev": true, "funding": [ { @@ -15222,11 +15222,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.11.20", - "caniuse-lite": "^1.0.30001810", - "electron-to-chromium": "^1.5.420", - "node-releases": "^2.0.54", - "update-browserslist-db": "^1.3.2" + "baseline-browser-mapping": "^2.11.26", + "caniuse-lite": "^1.0.30001813", + "electron-to-chromium": "^1.5.439", + "node-releases": "^2.0.57", + "update-browserslist-db": "^1.3.3" }, "bin": { "browserslist": "cli.js" @@ -15267,11 +15267,14 @@ } }, "node_modules/cssnano-utils": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-7.0.2.tgz", - "integrity": "sha512-X5B8Butd9TISH65XOoSYsq/wokHHjDK7eNujX3EcTf67T6uy2BySmT1SoaSXzlFdOsRf431FTENMsPrsc9JYHg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-8.0.1.tgz", + "integrity": "sha512-KF2NfGI/na0wEemV8X7KQbisJS0QY77vaGCJ/3RuXfWrgg/qlq8vHcfSAtzrCrOHwaGHW02Ra1anDyuQ7M520A==", "dev": true, "license": "MIT", + "dependencies": { + "@csstools/css-tokenizer": "^4.0.2" + }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, @@ -16020,9 +16023,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.427", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.427.tgz", - "integrity": "sha512-n14zb3FdsChZ2BNobqNHAJMcP3ifFv4paox2LvCrfVAQcqGiSURgbJl+PfMpHVCNFkStnNc+RRVtPBTVW5PDgw==", + "version": "1.5.444", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.444.tgz", + "integrity": "sha512-5ss/uJfoDYDHT0lfJzT6FbcskIzROIOPf0BbbFkGcvDzoJU7i//9GDrwwIHQVmIsrAGiF3ihpADBRIsrEFt1rQ==", "dev": true, "license": "ISC" }, @@ -23389,9 +23392,9 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.55", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.55.tgz", - "integrity": "sha512-mIrE/Cw9y+9Au6dS5vDKDhQza9YvG6w+ZrS6X+ZzA7yFW/soAeaups4Qzn1bL6g5FVy8WtP79+0j82oPIbqRjQ==", + "version": "2.0.57", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.57.tgz", + "integrity": "sha512-kQK9LGGFiHtrWiNhZtA7Qbw17AQz+dmsEKODRIVTXA9+e5MS/2gZEBhYJt13GrAz5/IOZKddH/0Z3TP/Zgo+yw==", "dev": true, "license": "MIT", "engines": { @@ -25141,13 +25144,13 @@ } }, "node_modules/postcss-calc": { - "version": "11.1.2", - "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-11.1.2.tgz", - "integrity": "sha512-VYTKcDyI+zrgd9xogzUf96ei8RZqwPP06KxZiE96HMEOx/jNqcKXheCZbZcXiEMxZ1UzY7/dUFPyCHLu/fUBEA==", + "version": "11.2.2", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-11.2.2.tgz", + "integrity": "sha512-wSquceGIY20fnsXcdIYtzW0r34aoXlT6iDYpYKpgR5Ax/KCZMDteE54Z+4Ee24ryYkjnRU5F3cxvhRfNp6t5VA==", "dev": true, "license": "MIT", "dependencies": { - "@csstools/css-tokenizer": "^4.0.0" + "@csstools/css-tokenizer": "^4.0.2" }, "engines": { "node": "^22.22.3 || ^24.15 || >=26.0" @@ -25156,37 +25159,18 @@ "postcss": "^8.5.28" } }, - "node_modules/postcss-calc/node_modules/@csstools/css-tokenizer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-4.0.0.tgz", - "integrity": "sha512-QxULHAm7cNu72w97JUNCBFODFaXpbDg+dP8b/oWFAZ2MTRppA3U00Y2L1HqaS4J6yBqxwa/Y3nMBaxVKbB/NsA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT", - "engines": { - "node": ">=20.19.0" - } - }, "node_modules/postcss-colormin": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-9.0.2.tgz", - "integrity": "sha512-h6uf6/HVT98tSLcQNQ8V0wuEQ8doBbxFwvgRqptdIeyCe8+aa29zNMPSVOkSLXXbCv25qDZaaGo/h/O4csTK3g==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-9.0.5.tgz", + "integrity": "sha512-eCi5AbyJdGf5b66FP5Nlu86zCQuuCBqNxGWDnNjP2rj5JLuNUwWE9nQT2KnhYFSVYFAiu2KQZToQzehnOJVZMw==", "dev": true, "license": "MIT", "dependencies": { - "@colordx/core": "^6.3.0", - "browserslist": "^4.28.9", + "@colordx/core": "^7.2.0", + "@csstools/css-tokenizer": "^4.0.2", + "browserslist": "^4.29.2", "caniuse-api": "^4.0.0", - "postcss-value-parser": "^4.2.0" + "cssnano-utils": "^8.0.1" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -25196,9 +25180,9 @@ } }, "node_modules/postcss-colormin/node_modules/browserslist": { - "version": "4.28.9", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.9.tgz", - "integrity": "sha512-EWazOblFYUvlGZcfGhPUPmYh3nikUxBVb+y9MJun5f3hBi812X+8MSQTujLBtgK3cf51fJWbWfOjyeO954d+Eg==", + "version": "4.29.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", + "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", "dev": true, "funding": [ { @@ -25216,11 +25200,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.11.20", - "caniuse-lite": "^1.0.30001810", - "electron-to-chromium": "^1.5.420", - "node-releases": "^2.0.54", - "update-browserslist-db": "^1.3.2" + "baseline-browser-mapping": "^2.11.26", + "caniuse-lite": "^1.0.30001813", + "electron-to-chromium": "^1.5.439", + "node-releases": "^2.0.57", + "update-browserslist-db": "^1.3.3" }, "bin": { "browserslist": "cli.js" @@ -25272,14 +25256,14 @@ } }, "node_modules/postcss-convert-values": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-9.0.2.tgz", - "integrity": "sha512-nsFL7tpxgaoF0G/w+fe8kkWvikxvwIb4ySW7PYzcmD1N60f0SA51sVnEuCrx7mHmwOvS1U1JIFvWHWHoK/bh8g==", + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-9.0.6.tgz", + "integrity": "sha512-t9iiO2g2+qTJfL5le9iu1gjX6CfeUkMZYfCOIMDvNQi/aHffEYVNP7+zZ+dBdc/PFo4zzYfzjVkw7/qb5ATGXw==", "dev": true, "license": "MIT", "dependencies": { - "browserslist": "^4.28.9", - "postcss-value-parser": "^4.2.0" + "browserslist": "^4.29.2", + "cssnano-utils": "^8.0.1" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -25289,9 +25273,9 @@ } }, "node_modules/postcss-convert-values/node_modules/browserslist": { - "version": "4.28.9", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.9.tgz", - "integrity": "sha512-EWazOblFYUvlGZcfGhPUPmYh3nikUxBVb+y9MJun5f3hBi812X+8MSQTujLBtgK3cf51fJWbWfOjyeO954d+Eg==", + "version": "4.29.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", + "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", "dev": true, "funding": [ { @@ -25309,11 +25293,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.11.20", - "caniuse-lite": "^1.0.30001810", - "electron-to-chromium": "^1.5.420", - "node-releases": "^2.0.54", - "update-browserslist-db": "^1.3.2" + "baseline-browser-mapping": "^2.11.26", + "caniuse-lite": "^1.0.30001813", + "electron-to-chromium": "^1.5.439", + "node-releases": "^2.0.57", + "update-browserslist-db": "^1.3.3" }, "bin": { "browserslist": "cli.js" @@ -25354,13 +25338,14 @@ } }, "node_modules/postcss-discard-comments": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-9.0.2.tgz", - "integrity": "sha512-QxOYI1haY3f9rPgY7i0W0+lQihsbvC/edPAAJAaSZmteI+UtGraWNnkWOZ/nCNZ6D+Ab8a9hksOCjJYBg/gF0A==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-9.0.5.tgz", + "integrity": "sha512-uoQqHq5CG9hK0DXXYxp5tukpEWxGjMW0V17xVmHXr31inR0/0oQLiXrWWmBu3wAZioQMuIrhWMf4uWsQUPXtKw==", "dev": true, "license": "MIT", "dependencies": { - "postcss-selector-parser": "^7.1.6" + "@csstools/css-tokenizer": "^4.0.2", + "cssnano-utils": "^8.0.1" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -25369,24 +25354,10 @@ "postcss": "^8.5.28" } }, - "node_modules/postcss-discard-comments/node_modules/postcss-selector-parser": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.6.tgz", - "integrity": "sha512-7qASPzhKF2l2KLboRZux8CCTRMdGiV08vWmyKzPz22qZ7ZjQBOeY7rNzNoCLSUiftJ7HUq0GERHmxw/t0dCdMw==", - "dev": true, - "license": "MIT", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/postcss-discard-duplicates": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-9.0.2.tgz", - "integrity": "sha512-FCTKRK9bH2ayM2AkhNicRw7z1ROmgk8p+QFsiLeG8MStgHkDH/NOjhJfQp1scvzk6u1szn1xvY52T1XVAaL68w==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-9.0.4.tgz", + "integrity": "sha512-6YtdksJWzWhciQyDwDJDd0He+ha8pOirA8pnpTU33ovXHBdjvYLUgOn9d8ajLY4sA2wYLmcs59PEiTLLwnw97A==", "dev": true, "license": "MIT", "engines": { @@ -25397,9 +25368,9 @@ } }, "node_modules/postcss-discard-empty": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-9.0.2.tgz", - "integrity": "sha512-skKth+zcP//uuDos1GD/M0DKwEMDCbUnOZxz/M+BvjflCAS94czq7wwXNt2eug87rxPCik/okyXKJ2kBitHGEQ==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-9.0.5.tgz", + "integrity": "sha512-XDfk8xuYDbdEsfKqqISbxLOJaF9d5vZR5xr+ZdqJcjwSu19C8gZSDMe30hgtYq9+4MrAA0ctUSCN4lkhUcpjjA==", "dev": true, "license": "MIT", "engines": { @@ -25410,9 +25381,9 @@ } }, "node_modules/postcss-discard-overridden": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-9.0.2.tgz", - "integrity": "sha512-cUGXcnnhOBZwE+dLFRYLoXYrLxCQtD0mp8nUEHlQI8KdDXhaIHL7DCWUkXXEcNFon11xROYOP9E+plzJ5MSjXw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-9.0.5.tgz", + "integrity": "sha512-R/pSAgkbHOdPi8op7b5IyeY8Z0hJ1yemvRpNP2dh41Lm2ldjA1N1lXBdopj7vbzLzzhXLNPnQTolV+vUJ3HGVA==", "dev": true, "license": "MIT", "engines": { @@ -25507,14 +25478,14 @@ "license": "MIT" }, "node_modules/postcss-merge-longhand": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-9.0.3.tgz", - "integrity": "sha512-JJLx47+h7TIIThb+VE3pFHZUY/HKXgXa+yAZlN0FBX2IsIURJuOavS8gQwUvj5oluzxxRA9IjR95rLllbeybBw==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-9.1.1.tgz", + "integrity": "sha512-qJ8JUmOujkHVEs7I8QDkLiS2DDM7ThY+FiZIlUPzfzP13SW+R3cXqwhzhIdYsD92G78doIa/TWKkBQtDDAR0sA==", "dev": true, "license": "MIT", "dependencies": { - "postcss-value-parser": "^4.2.0", - "stylehacks": "^9.0.3" + "cssnano-utils": "^8.0.1", + "stylehacks": "^9.0.6" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -25524,16 +25495,16 @@ } }, "node_modules/postcss-merge-rules": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-9.0.3.tgz", - "integrity": "sha512-Wd/r16vrGdC49ZeQesxgNrNdQkAGoKL51UGHd3MwyH3CHhvqHkRtXZKKEnblecuuWmvjWqptC4VA3BeAHAVrzQ==", + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-9.0.6.tgz", + "integrity": "sha512-SZd5UzGIIk5b1MAOLyo+pYoecyieaM1aMLzrVHGac0z4FTE05OwSfpmMKrPB82CcQJyJ0LnZVvZRZi3IjTRg4w==", "dev": true, "license": "MIT", "dependencies": { - "browserslist": "^4.28.9", + "@csstools/css-tokenizer": "^4.0.2", + "browserslist": "^4.29.2", "caniuse-api": "^4.0.0", - "cssnano-utils": "^7.0.2", - "postcss-selector-parser": "^7.1.6" + "cssnano-utils": "^8.0.1" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -25543,9 +25514,9 @@ } }, "node_modules/postcss-merge-rules/node_modules/browserslist": { - "version": "4.28.9", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.9.tgz", - "integrity": "sha512-EWazOblFYUvlGZcfGhPUPmYh3nikUxBVb+y9MJun5f3hBi812X+8MSQTujLBtgK3cf51fJWbWfOjyeO954d+Eg==", + "version": "4.29.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", + "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", "dev": true, "funding": [ { @@ -25563,11 +25534,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.11.20", - "caniuse-lite": "^1.0.30001810", - "electron-to-chromium": "^1.5.420", - "node-releases": "^2.0.54", - "update-browserslist-db": "^1.3.2" + "baseline-browser-mapping": "^2.11.26", + "caniuse-lite": "^1.0.30001813", + "electron-to-chromium": "^1.5.439", + "node-releases": "^2.0.57", + "update-browserslist-db": "^1.3.3" }, "bin": { "browserslist": "cli.js" @@ -25587,20 +25558,6 @@ "caniuse-lite": "^1.0.0" } }, - "node_modules/postcss-merge-rules/node_modules/postcss-selector-parser": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.6.tgz", - "integrity": "sha512-7qASPzhKF2l2KLboRZux8CCTRMdGiV08vWmyKzPz22qZ7ZjQBOeY7rNzNoCLSUiftJ7HUq0GERHmxw/t0dCdMw==", - "dev": true, - "license": "MIT", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/postcss-merge-rules/node_modules/update-browserslist-db": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", @@ -25633,13 +25590,14 @@ } }, "node_modules/postcss-minify-font-values": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-9.0.2.tgz", - "integrity": "sha512-+QEc9ILK7sz/6LDnFITuvipMnX71A+v7b7VX3AyiN3WCIoJtc4xQovogeiOsX7CxXtwPKmk2z1BuI8h3TSnQEA==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-9.0.5.tgz", + "integrity": "sha512-k1kU28FSV53d3vIfvbReTUral72EG3Nm+nJFfmziF2jis5KSytUb/A0MCX2UHrWAuIIY1EH5QFgbRf2OU0/E6g==", "dev": true, "license": "MIT", "dependencies": { - "postcss-value-parser": "^4.2.0" + "@csstools/css-tokenizer": "^4.0.2", + "cssnano-utils": "^8.0.1" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -25649,15 +25607,15 @@ } }, "node_modules/postcss-minify-gradients": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-9.0.2.tgz", - "integrity": "sha512-8EefxPsmS/RqMgJUBhx5N6hoWelHK8tW7DFUN8NLNrH1WSA4jvWRZc1OgzY0IheODiFsr/xiiOAHrPUQJFeMIg==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-9.0.5.tgz", + "integrity": "sha512-+CNxG/V/hCoi759Pg4TWnW5znjNlRyKMOhAlGhyb5JKuUy7r98v3PACq2Ium721flVMJkcsM3QNl3hWBrqYlpw==", "dev": true, "license": "MIT", "dependencies": { - "@colordx/core": "^6.3.0", - "cssnano-utils": "^7.0.2", - "postcss-value-parser": "^4.2.0" + "@colordx/core": "^7.2.0", + "@csstools/css-tokenizer": "^4.0.2", + "cssnano-utils": "^8.0.1" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -25667,15 +25625,14 @@ } }, "node_modules/postcss-minify-params": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-9.0.2.tgz", - "integrity": "sha512-T8h6+8/JZQzTUlsw8oF3xdWIgrjw6dCpqdpUrIatrL852HNqE7w47C4mFrZADuu7IgT+4a3zRAX1nd112sAvwQ==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-9.0.5.tgz", + "integrity": "sha512-itOFlj0KlaGtvlLZNwJEuCKGXJmc4SduXBDbQlFepMkGHshpc1Hu18YOZ1aego1dmpKn12jpKDhfbRhFRrz8+w==", "dev": true, "license": "MIT", "dependencies": { - "browserslist": "^4.28.9", - "cssnano-utils": "^7.0.2", - "postcss-value-parser": "^4.2.0" + "browserslist": "^4.29.2", + "cssnano-utils": "^8.0.1" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -25685,9 +25642,9 @@ } }, "node_modules/postcss-minify-params/node_modules/browserslist": { - "version": "4.28.9", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.9.tgz", - "integrity": "sha512-EWazOblFYUvlGZcfGhPUPmYh3nikUxBVb+y9MJun5f3hBi812X+8MSQTujLBtgK3cf51fJWbWfOjyeO954d+Eg==", + "version": "4.29.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", + "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", "dev": true, "funding": [ { @@ -25705,11 +25662,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.11.20", - "caniuse-lite": "^1.0.30001810", - "electron-to-chromium": "^1.5.420", - "node-releases": "^2.0.54", - "update-browserslist-db": "^1.3.2" + "baseline-browser-mapping": "^2.11.26", + "caniuse-lite": "^1.0.30001813", + "electron-to-chromium": "^1.5.439", + "node-releases": "^2.0.57", + "update-browserslist-db": "^1.3.3" }, "bin": { "browserslist": "cli.js" @@ -25750,16 +25707,16 @@ } }, "node_modules/postcss-minify-selectors": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-9.0.3.tgz", - "integrity": "sha512-mElz5y5+pMisgaN1VgschjOQBh8I9fga/OhJUX+VKyQ14ebukeB3xZRlbu+ebIKI/+qT8tj7dfx0AEQ6gWCPOg==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-9.0.5.tgz", + "integrity": "sha512-hdoDNFQIIDFMZ12huhigCELA6Jcig5WrnUYmcT2srqM+r+CTKxaH6CFZB7wwuqLrVYgqh1sLB5iE99UyriCB2A==", "dev": true, "license": "MIT", "dependencies": { - "browserslist": "^4.28.9", + "browserslist": "^4.29.1", "caniuse-api": "^4.0.0", "cssesc": "^3.0.0", - "postcss-selector-parser": "^7.1.6" + "cssnano-utils": "^8.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -25769,9 +25726,9 @@ } }, "node_modules/postcss-minify-selectors/node_modules/browserslist": { - "version": "4.28.9", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.9.tgz", - "integrity": "sha512-EWazOblFYUvlGZcfGhPUPmYh3nikUxBVb+y9MJun5f3hBi812X+8MSQTujLBtgK3cf51fJWbWfOjyeO954d+Eg==", + "version": "4.29.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", + "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", "dev": true, "funding": [ { @@ -25789,11 +25746,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.11.20", - "caniuse-lite": "^1.0.30001810", - "electron-to-chromium": "^1.5.420", - "node-releases": "^2.0.54", - "update-browserslist-db": "^1.3.2" + "baseline-browser-mapping": "^2.11.26", + "caniuse-lite": "^1.0.30001813", + "electron-to-chromium": "^1.5.439", + "node-releases": "^2.0.57", + "update-browserslist-db": "^1.3.3" }, "bin": { "browserslist": "cli.js" @@ -25813,20 +25770,6 @@ "caniuse-lite": "^1.0.0" } }, - "node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.6.tgz", - "integrity": "sha512-7qASPzhKF2l2KLboRZux8CCTRMdGiV08vWmyKzPz22qZ7ZjQBOeY7rNzNoCLSUiftJ7HUq0GERHmxw/t0dCdMw==", - "dev": true, - "license": "MIT", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/postcss-minify-selectors/node_modules/update-browserslist-db": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", @@ -25950,9 +25893,9 @@ } }, "node_modules/postcss-normalize-charset": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-9.0.2.tgz", - "integrity": "sha512-2mFe06u9nwCdG+swpN3YmcRBNAZTR1IocNvN6Lzi7kKXjB0LhEOSGeu4B6rbV84NtgdkJwdulzeh1AdABM9N5Q==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-9.0.5.tgz", + "integrity": "sha512-mmbQmD9mlz3pTo+r4KdwcfD23cNksQo7aYNa4lfL4Bsj0XkL+rtcbNOY7Oo+U82DP1syYXCyF1PRc32gb36MqA==", "dev": true, "license": "MIT", "engines": { @@ -25963,13 +25906,14 @@ } }, "node_modules/postcss-normalize-display-values": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-9.0.2.tgz", - "integrity": "sha512-SHON0J7MuPrwpDAz4fHQgVNBfivLNKW8hgtO0WM3d5P0vFargQ4tCUNYdVBHfXr1xRFmmifRvJKmahksaHHn+w==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-9.0.5.tgz", + "integrity": "sha512-V5tOZuYQtOpYNjoSjciDckB8Ry+s2NcHqVHloYe5Xh/6OA2Z3kVymAck3zipZ1uLBdMvg7BUvxoDIcH6dJCPug==", "dev": true, "license": "MIT", "dependencies": { - "postcss-value-parser": "^4.2.0" + "@csstools/css-tokenizer": "^4.0.2", + "cssnano-utils": "^8.0.1" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -25979,13 +25923,13 @@ } }, "node_modules/postcss-normalize-positions": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-9.0.2.tgz", - "integrity": "sha512-2KQaPVbXUm1oUViZXvD6nsuRiAr81J3X2dRSeK1mCdPyMSUBQ76TpAjrVvbceicdbs3Bo2j9qkfO9iZSMJBsGQ==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-9.0.5.tgz", + "integrity": "sha512-DZtXMQFhVlldnP3WhVIzjcT7x0jsy17UYuGXfdT31gggI6JISREGBhgOl/sadVTASyS6w+6ZVGuvDdrnplU0MA==", "dev": true, "license": "MIT", "dependencies": { - "postcss-value-parser": "^4.2.0" + "cssnano-utils": "^8.0.1" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -25995,13 +25939,13 @@ } }, "node_modules/postcss-normalize-repeat-style": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-9.0.2.tgz", - "integrity": "sha512-+EropmN1W6gVnmwbhP8Tb7BmmqXgRCFJqtWFTcA0nZBz7aGj4zXL9EWyQ20DkA0Vd+ladQOmNuaUsc0jCeXT5Q==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-9.0.5.tgz", + "integrity": "sha512-1QZ9ZdyWb4TRDCXIg8iqeACo6BWKjxtfeMgMSy6ORqX21gKN4lYYQqZpxPdILpvbLaEfXGVd0ptMCiKbxCObjA==", "dev": true, "license": "MIT", "dependencies": { - "postcss-value-parser": "^4.2.0" + "cssnano-utils": "^8.0.1" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -26011,13 +25955,13 @@ } }, "node_modules/postcss-normalize-string": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-9.0.2.tgz", - "integrity": "sha512-vzJqaYpeG/rYWVDMpfxA3I2XNRlkK7XKYFINAfYLKiXn0SDndmvQYZhYEQdpvapDy7QAiK1/4iPVcfxsjWfU1w==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-9.0.4.tgz", + "integrity": "sha512-neA1Diz0cNPr6RXKFUWZCX+bowHx1CG4LWgB+MoVcRT4JZXwhyA+B5E8/yE2yoLcSxk1MpXhZ0rsTnRPjUyVAw==", "dev": true, "license": "MIT", "dependencies": { - "postcss-value-parser": "^4.2.0" + "@csstools/css-tokenizer": "^4.0.2" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -26027,13 +25971,14 @@ } }, "node_modules/postcss-normalize-timing-functions": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-9.0.2.tgz", - "integrity": "sha512-CZ5T2XvUra6kJDBHZ+KQYuY0QJhpGv3atiLbkCLVk3BnBwh49zhNid/+IQrxQFwYkJ54oVJQuqrj6J4eaOFHTw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-9.0.5.tgz", + "integrity": "sha512-uw5Y1xNsnh1Z8XB1I4Sx6/T7GKfdBTpX7X7ywDibb35IIYjJLf68qjBRDl59ETYrWkoGxZXIYU74RcO6cAjjmw==", "dev": true, "license": "MIT", "dependencies": { - "postcss-value-parser": "^4.2.0" + "@csstools/css-tokenizer": "^4.0.2", + "cssnano-utils": "^8.0.1" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -26043,14 +25988,15 @@ } }, "node_modules/postcss-normalize-unicode": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-9.0.2.tgz", - "integrity": "sha512-AOT0whCCcKASm1Ee8pchg03xgFxJopQhP1/G7CEt5X9LBD6EV4zL3a8duDJEGXYaCwuxjtwywRm8K5L6o0OJLA==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-9.0.4.tgz", + "integrity": "sha512-7vXJt1nvvxv+tl8iSTpt13nBZF0eYP0gYu8C2C2UbfNFOSngcMCVAY3Bc0wXpnH3IeT+DRQNTBKY6upXzekKig==", "dev": true, "license": "MIT", "dependencies": { - "browserslist": "^4.28.9", - "postcss-value-parser": "^4.2.0" + "@csstools/css-tokenizer": "^4.0.2", + "browserslist": "^4.29.1", + "cssnano-utils": "^8.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -26060,9 +26006,9 @@ } }, "node_modules/postcss-normalize-unicode/node_modules/browserslist": { - "version": "4.28.9", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.9.tgz", - "integrity": "sha512-EWazOblFYUvlGZcfGhPUPmYh3nikUxBVb+y9MJun5f3hBi812X+8MSQTujLBtgK3cf51fJWbWfOjyeO954d+Eg==", + "version": "4.29.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", + "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", "dev": true, "funding": [ { @@ -26080,11 +26026,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.11.20", - "caniuse-lite": "^1.0.30001810", - "electron-to-chromium": "^1.5.420", - "node-releases": "^2.0.54", - "update-browserslist-db": "^1.3.2" + "baseline-browser-mapping": "^2.11.26", + "caniuse-lite": "^1.0.30001813", + "electron-to-chromium": "^1.5.439", + "node-releases": "^2.0.57", + "update-browserslist-db": "^1.3.3" }, "bin": { "browserslist": "cli.js" @@ -26125,13 +26071,14 @@ } }, "node_modules/postcss-normalize-url": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-9.0.2.tgz", - "integrity": "sha512-oGfMuPEcmjon+08+gKpuqFUPn6/B4uTAJSHRlJe6h0xeB0baq5Zm/Swk0Jyz8mzVTNOIh8PuMUvWP+tVeSpS4A==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-9.0.5.tgz", + "integrity": "sha512-iGf8SEx4Abu9XqmubHU7Prl7dWT0gk+VethwzfY40Zo9y3VItrz8QSDFMCxQmWpphXiU0jGq5K4uoiSi2ySnNw==", "dev": true, "license": "MIT", "dependencies": { - "postcss-value-parser": "^4.2.0" + "@csstools/css-tokenizer": "^4.0.2", + "cssnano-utils": "^8.0.1" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -26141,13 +26088,14 @@ } }, "node_modules/postcss-normalize-whitespace": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-9.0.2.tgz", - "integrity": "sha512-gLkQNyMsT5xx1kbeT7vUmxwoIt6o5MA+1pX4LBc89ipX1GPYUpf5sv5IA0iikKDn05Zo78IsSFWc/C5FcYxRCQ==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-9.0.5.tgz", + "integrity": "sha512-vaDslAUVqguYgC2jMb90Rc+N904rPx4XtYIWhaI/8m6OYx7+EOgsQmTLOGB4WjDAIMOgdBVTQqub8dQSoSVyww==", "dev": true, "license": "MIT", "dependencies": { - "postcss-value-parser": "^4.2.0" + "@csstools/css-tokenizer": "^4.0.2", + "cssnano-utils": "^8.0.1" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -26157,14 +26105,13 @@ } }, "node_modules/postcss-ordered-values": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-9.0.2.tgz", - "integrity": "sha512-9DDzlg3E8ZOU/5bgCF4RCVXaEeoOuh3v23BT+ka8Mh3RpEFfpCg1kfpt1v38voIqV4gRZ1S1QHlnHWrzSzWZoA==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-9.0.5.tgz", + "integrity": "sha512-FyN27f9bXqAQ+U/1ckWMBq1uPKk/J5C3gTuAP52EbV/ZedyXO2uF7RroclFz3jyTSAGPrXIaQKERQCLVl6uL7g==", "dev": true, "license": "MIT", "dependencies": { - "cssnano-utils": "^7.0.2", - "postcss-value-parser": "^4.2.0" + "cssnano-utils": "^8.0.1" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -26184,13 +26131,13 @@ } }, "node_modules/postcss-reduce-initial": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-9.0.2.tgz", - "integrity": "sha512-rzSZ5ns9W/OGfwKPSEmlGMr0DsZy2exNT8uEKNU49GK+lgNnF+pKbPq0ZcHvFYn9oO6U+C6RfVuWWNgzGwxCJw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-9.0.5.tgz", + "integrity": "sha512-GRH7thwmYiHh9b96usDIDUX1zdVa4Pq8Q2gCMcfEfG1R5oxEdUdsRseuvnOaTs8SjanMn/uIjIXTm6sbHoFTEA==", "dev": true, "license": "MIT", "dependencies": { - "browserslist": "^4.28.9", + "browserslist": "^4.29.2", "caniuse-api": "^4.0.0" }, "engines": { @@ -26201,9 +26148,9 @@ } }, "node_modules/postcss-reduce-initial/node_modules/browserslist": { - "version": "4.28.9", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.9.tgz", - "integrity": "sha512-EWazOblFYUvlGZcfGhPUPmYh3nikUxBVb+y9MJun5f3hBi812X+8MSQTujLBtgK3cf51fJWbWfOjyeO954d+Eg==", + "version": "4.29.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", + "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", "dev": true, "funding": [ { @@ -26221,11 +26168,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.11.20", - "caniuse-lite": "^1.0.30001810", - "electron-to-chromium": "^1.5.420", - "node-releases": "^2.0.54", - "update-browserslist-db": "^1.3.2" + "baseline-browser-mapping": "^2.11.26", + "caniuse-lite": "^1.0.30001813", + "electron-to-chromium": "^1.5.439", + "node-releases": "^2.0.57", + "update-browserslist-db": "^1.3.3" }, "bin": { "browserslist": "cli.js" @@ -26277,13 +26224,13 @@ } }, "node_modules/postcss-reduce-transforms": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-9.0.2.tgz", - "integrity": "sha512-UXR9hvucM/VKwLDdcPFxszYAMyxLmpYACdxlPnNJ+6MKi+sEJHTMiUlVY3KRRuO00kuOjZ+t8M/I7N/gFMvwfg==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-9.0.4.tgz", + "integrity": "sha512-hRzepc/cwIs1cCdIghQatRDFlxc7qQieXzkyCfyVl8KPTPhOZyOtdPp9Qt90fMbqWry6YdMQu/YfScxh47sTYg==", "dev": true, "license": "MIT", "dependencies": { - "postcss-value-parser": "^4.2.0" + "cssnano-utils": "^8.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -26368,13 +26315,14 @@ } }, "node_modules/postcss-svgo": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-9.0.2.tgz", - "integrity": "sha512-FY1/AvWkMyXIlc3dFtwGdZDLdK12VAQqdqLOBKIQPsh574UZ5GfzMigeccvnuzEWPOySh/4LkTfGELDtnuBPXg==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-9.0.4.tgz", + "integrity": "sha512-0QGF1sORc244E+DNJxEzQDK/zK24VO0CMzAMOwOW+cQ90Y65mVDR2yrSxp4/f+XcdxmAf5LPm22zlnhVUTbtAA==", "dev": true, "license": "MIT", "dependencies": { - "postcss-value-parser": "^4.2.0", + "@csstools/css-tokenizer": "^4.0.2", + "cssnano-utils": "^8.0.0", "svgo": "^4.1.0" }, "engines": { @@ -26451,13 +26399,13 @@ } }, "node_modules/postcss-unique-selectors": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-9.0.2.tgz", - "integrity": "sha512-Jyl/5yYy8VuWRCkSiI/5n75bEWty8wYho3eB1w4/ZK2XSW6AnNVJ6tGuWaCmJt0M5+ouHb/m+qXzFOsG3tOWww==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-9.0.5.tgz", + "integrity": "sha512-1otppE5FwWqmIM1jqBpeAdA0GSP9wwzRCRsbz7EtbSNunh3bJ9PPRuYYzByvqnz7L351ZA2fDHC0CcouYoPWfA==", "dev": true, "license": "MIT", "dependencies": { - "postcss-selector-parser": "^7.1.6" + "@csstools/css-tokenizer": "^4.0.2" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -26466,20 +26414,6 @@ "postcss": "^8.5.28" } }, - "node_modules/postcss-unique-selectors/node_modules/postcss-selector-parser": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.6.tgz", - "integrity": "sha512-7qASPzhKF2l2KLboRZux8CCTRMdGiV08vWmyKzPz22qZ7ZjQBOeY7rNzNoCLSUiftJ7HUq0GERHmxw/t0dCdMw==", - "dev": true, - "license": "MIT", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/postcss-urlrebase": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/postcss-urlrebase/-/postcss-urlrebase-1.4.0.tgz", @@ -29460,14 +29394,14 @@ "license": "ISC" }, "node_modules/stylehacks": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-9.0.3.tgz", - "integrity": "sha512-ffR7soMPCLSZoye/H4gEcOt7fpRmm+1/Mq7j4L9Hex2284Ci0oUkPSiRSpDW0X3tptLtZqGUsOxZ64fy6izthA==", + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-9.0.6.tgz", + "integrity": "sha512-LvntDgw9Eevn1sBLVa9qCA5qnbfhxo1MXXNkLabgqcByn+RadD6hjJQyRur7H8Pa/KZpTVf/6NgP4/pvtg4IBw==", "dev": true, "license": "MIT", "dependencies": { - "browserslist": "^4.28.9", - "postcss-selector-parser": "^7.1.6" + "@csstools/css-tokenizer": "^4.0.2", + "browserslist": "^4.29.2" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -29477,9 +29411,9 @@ } }, "node_modules/stylehacks/node_modules/browserslist": { - "version": "4.28.9", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.9.tgz", - "integrity": "sha512-EWazOblFYUvlGZcfGhPUPmYh3nikUxBVb+y9MJun5f3hBi812X+8MSQTujLBtgK3cf51fJWbWfOjyeO954d+Eg==", + "version": "4.29.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", + "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", "dev": true, "funding": [ { @@ -29497,11 +29431,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.11.20", - "caniuse-lite": "^1.0.30001810", - "electron-to-chromium": "^1.5.420", - "node-releases": "^2.0.54", - "update-browserslist-db": "^1.3.2" + "baseline-browser-mapping": "^2.11.26", + "caniuse-lite": "^1.0.30001813", + "electron-to-chromium": "^1.5.439", + "node-releases": "^2.0.57", + "update-browserslist-db": "^1.3.3" }, "bin": { "browserslist": "cli.js" @@ -29510,20 +29444,6 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/stylehacks/node_modules/postcss-selector-parser": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.6.tgz", - "integrity": "sha512-7qASPzhKF2l2KLboRZux8CCTRMdGiV08vWmyKzPz22qZ7ZjQBOeY7rNzNoCLSUiftJ7HUq0GERHmxw/t0dCdMw==", - "dev": true, - "license": "MIT", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/stylehacks/node_modules/update-browserslist-db": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", diff --git a/package.json b/package.json index dd440bf52..a57baead0 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "css-loader": "^7.1.5", "css-minimizer-webpack-plugin": "^8.0.0", "css-unicode-loader": "^1.0.3", - "cssnano": "^9.0.4", + "cssnano": "^9.1.2", "dotenv": "^18.0.2", "eslint": "^10.10.0", "eslint-plugin-jest": "^29.16.6", From c97f1605bcf35649180257c0fae56dbb48b3d302 Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Mon, 5 Oct 2026 15:13:45 +0530 Subject: [PATCH 12/80] chore(deps): Remove unused typescript-eslint plugin The project has no TypeScript and eslint.config.js does not use @typescript-eslint/eslint-plugin directly. @wordpress/eslint-plugin already brings it in through typescript-eslint, with a matching parser version. The direct entry made Dependabot bump only the plugin, which broke npm ci with a peer conflict on @typescript-eslint/parser (#1292). --- package-lock.json | 1 - package.json | 1 - 2 files changed, 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 96fdffbde..422123375 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,6 @@ }, "devDependencies": { "@playwright/test": "^1.63.0", - "@typescript-eslint/eslint-plugin": "^8.46.3", "@wordpress/api-fetch": "^7.55.0", "@wordpress/block-editor": "^17.1.0", "@wordpress/blocks": "^16.0.0", diff --git a/package.json b/package.json index b91230fbf..d1778c4cf 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,6 @@ }, "devDependencies": { "@playwright/test": "^1.63.0", - "@typescript-eslint/eslint-plugin": "^8.46.3", "@wordpress/api-fetch": "^7.55.0", "@wordpress/block-editor": "^17.1.0", "@wordpress/blocks": "^16.0.0", From 6bfc2a577b7d6be5c8ae54d07320f8d8705c97d1 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Mon, 5 Oct 2026 15:11:34 +0200 Subject: [PATCH 13/80] fix(media): address PR review feedback on wp_get_attachment_image_src filter Utils::is_saving_metadata() checked did_action(), which is cumulative for the whole request: any post/term/user meta write earlier in the request (a view counter, a session plugin, etc.) would leave it true for the rest of the page once filter_attachment_image_src()/filter_downsize() started running on the front end, permanently blocking correction. Switches to doing_action() to detect a write actually in progress. It has a single caller in the plugin (Media::is_replacement_paused()), so this is a contained fix. filter_attachment_image_src() also treated every deliverable+synced attachment as correctable, but Delivery::is_deliverable() returns true for any non-image, non-video type -- so a synced non-image attachment (audio, zip, docx, ...) requested with icon=true (as WP_Media_List_Table always does) would have its generic mime icon replaced with the raw asset's Cloudinary URL, breaking the resulting tag. Scopes correction to wp_attachment_is_image() || is_preview_only(), matching the preview-capable-formats carve-out filter_downsize() already uses. Test changes: added coverage for both fixes, including a regression test for an unrelated earlier meta write no longer blocking correction. Also fixed several existing tests that were passing for the wrong reason -- they relied on wp_attachment_is()/wp_attachment_is_image(), which return false unconditionally without a real _wp_attached_file postmeta regardless of post_mime_type, and a couple never set stub_cloudinary_url, so the asserted "stays unchanged" outcome held even with the check they meant to cover disabled. Every bow-out path was mutation-tested (temporarily disabled, confirmed the test fails, restored) rather than assumed correct. --- php/class-media.php | 9 + php/class-utils.php | 8 +- .../tests/test-attachment-image-src.php | 176 +++++++++++------- 3 files changed, 121 insertions(+), 72 deletions(-) diff --git a/php/class-media.php b/php/class-media.php index 84038bd69..cf4a3370b 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1881,6 +1881,15 @@ public function filter_attachment_image_src( $image, $attachment_id, $size, $ico return $image; } + // Only images and preview-capable formats (PDF, PSD) have a real image representation to + // correct to. is_deliverable() treats every other attachment type as deliverable too, so + // without this, a synced non-image (audio, zip, docx, ...) requested with icon=true would + // have its generic mime icon replaced with the raw asset's Cloudinary URL, breaking the + // resulting tag. + if ( ! wp_attachment_is_image( $attachment_id ) && ! $this->is_preview_only( $attachment_id ) ) { + return $image; + } + if ( $this->is_replacement_paused( $attachment_id ) ) { return $image; } diff --git a/php/class-utils.php b/php/class-utils.php index 8674a584a..2f3af7459 100644 --- a/php/class-utils.php +++ b/php/class-utils.php @@ -720,7 +720,11 @@ public static function strip_inline_svg_data_uris( $content ) { /** - * Is saving metadata. + * Is metadata currently being saved, right now. + * + * Uses doing_action(), not did_action(): the latter is cumulative for the whole request, so + * it would stay true for the rest of the page after any earlier, unrelated post/term/user + * meta write (a view counter, a session plugin, etc.), long after that write finished. * * @return bool */ @@ -731,7 +735,7 @@ public static function is_saving_metadata() { foreach ( $metadata['actions'] as $action ) { foreach ( $metadata['objects'] as $object ) { $inline_action = str_replace( array( '{object}', 'metadata' ), array( $object, 'meta' ), $action ); - if ( did_action( $inline_action ) ) { + if ( doing_action( $inline_action ) ) { $saving = true; break; } diff --git a/tests/phpunit/tests/test-attachment-image-src.php b/tests/phpunit/tests/test-attachment-image-src.php index ace091fb7..b5ab3efbf 100644 --- a/tests/phpunit/tests/test-attachment-image-src.php +++ b/tests/phpunit/tests/test-attachment-image-src.php @@ -4,11 +4,13 @@ * * This covers the wp_get_attachment_image_src filter Cloudinary hooks so it keeps the last * word on that specific, commonly-targeted core hook (see WPP-1183): it must bow out cheaply - * when a URL is already a Cloudinary URL or there is no image at all, correct a local URL when - * the attachment is actually deliverable and synced regardless of the caller's $icon argument - * (WP_Media_List_Table's list-mode thumbnail column passes icon=true for every attachment, real - * images included -- see wp-admin/includes/class-wp-media-list-table.php), and otherwise leave - * the result alone. + * when a URL is already a Cloudinary URL or there is no image at all, only correct an attachment + * that actually has a real image representation (an image, or a preview-capable format like PDF/ + * PSD -- anything else showing here with icon=true is a generic mime icon, not something to + * replace with the raw asset URL), correct a local URL when the attachment is actually + * deliverable and synced regardless of the caller's $icon argument (WP_Media_List_Table's + * list-mode thumbnail column passes icon=true for every attachment, real images included -- see + * wp-admin/includes/class-wp-media-list-table.php), and otherwise leave the result alone. * * cloudinary_id() and cloudinary_url() are stubbed out (Test_Attachment_Image_Src_Media below) * rather than driven through the real sync/signature pipeline, matching the approach in @@ -54,36 +56,6 @@ protected function get_media() { return $media; } - /** - * Utils::is_saving_metadata() reads did_action() counters (add_post_meta, etc.) that - * WordPress never resets between tests within one PHPUnit process -- any earlier test, or - * even our own wpSetUpBeforeClass() fixture, already ticks them past zero. Momentarily - * clearing them here isolates the checks that come after that guard in - * filter_attachment_image_src(), so those tests exercise their own branch instead of - * always bowing out at is_saving_metadata() for an unrelated, process-wide reason. - * - * @param callable $callback Callback to run with the guard cleared. - * - * @return mixed - */ - protected function without_saving_metadata_guard( callable $callback ) { - $keys = array( 'add_post_meta', 'update_post_meta', 'add_term_meta', 'update_term_meta', 'add_user_meta', 'update_user_meta' ); - $saved = array(); - foreach ( $keys as $key ) { - if ( isset( $GLOBALS['wp_actions'][ $key ] ) ) { - $saved[ $key ] = $GLOBALS['wp_actions'][ $key ]; - unset( $GLOBALS['wp_actions'][ $key ] ); - } - } - try { - return $callback(); - } finally { - foreach ( $saved as $key => $value ) { - $GLOBALS['wp_actions'][ $key ] = $value; - } - } - } - /** * A URL that already lives on the configured Cloudinary domain is returned untouched -- the * cheap bow-out path the ticket calls for, taken before any sync/delivery check runs. @@ -91,8 +63,10 @@ protected function without_saving_metadata_guard( callable $callback ) { * @return void */ public function test_already_cloudinary_url_is_returned_unchanged() { - $media = $this->get_media(); - $image = array( 'https://res.cloudinary.com/test-cloud/image/upload/v1/sample.jpg', 100, 100, true ); + $media = $this->get_media(); + $media->stub_cloudinary_id = 'sample.jpg'; + $media->stub_cloudinary_url = 'https://res.cloudinary.com/test-cloud/image/upload/should-not-be-used.jpg'; + $image = array( 'https://res.cloudinary.com/test-cloud/image/upload/v1/sample.jpg', 100, 100, true ); $result = $media->filter_attachment_image_src( $image, self::$attachment_id, 'thumbnail', false ); @@ -115,11 +89,7 @@ public function test_icon_true_does_not_block_correcting_a_real_synced_image() { $media->stub_cloudinary_url = 'https://res.cloudinary.com/test-cloud/image/upload/sample.jpg'; $image = array( 'http://example.org/wp-content/uploads/canola.jpg', 100, 100, true ); - $result = $this->without_saving_metadata_guard( - function () use ( $media, $image ) { - return $media->filter_attachment_image_src( $image, self::$attachment_id, 'thumbnail', true ); - } - ); + $result = $media->filter_attachment_image_src( $image, self::$attachment_id, 'thumbnail', true ); $this->assertSame( $media->stub_cloudinary_url, $result[0] ); } @@ -138,19 +108,71 @@ public function test_icon_fallback_is_unchanged_when_nothing_to_correct_it_to() 'post_mime_type' => 'image/jpeg', ) ); + // wp_attachment_is()/wp_attachment_is_image() return false unconditionally without a + // real _wp_attached_file, regardless of post_mime_type -- see wp-includes/post.php. + update_post_meta( $bare_id, '_wp_attached_file', 'bare.jpg' ); $media = $this->get_media(); $image = array( 'http://example.org/wp-includes/images/media/default.png', 48, 64, false ); - $result = $this->without_saving_metadata_guard( - function () use ( $media, $image, $bare_id ) { - return $media->filter_attachment_image_src( $image, $bare_id, 'thumbnail', true ); - } + $result = $media->filter_attachment_image_src( $image, $bare_id, 'thumbnail', true ); + + $this->assertSame( $image, $result ); + } + + /** + * A synced non-image, non-preview attachment (audio, zip, docx, ...) requested with icon=true + * must keep its generic mime icon. Delivery::is_deliverable() treats every non-image, + * non-video attachment as deliverable, so without a type check here, this would otherwise get + * "corrected" to the raw asset's Cloudinary URL -- breaking the resulting tag (caught in + * PR review: WP_Media_List_Table's list view requests icon=true for every attachment type). + * + * @return void + */ + public function test_synced_non_image_attachment_with_icon_is_returned_unchanged() { + $zip_id = self::factory()->post->create( + array( + 'post_type' => 'attachment', + 'post_mime_type' => 'application/zip', + ) ); + update_post_meta( $zip_id, '_wp_attached_file', 'archive.zip' ); + + $media = $this->get_media(); + $media->stub_cloudinary_id = 'archive.zip'; + $media->stub_cloudinary_url = 'https://res.cloudinary.com/test-cloud/raw/upload/archive.zip'; + $image = array( 'http://example.org/wp-includes/images/media/archive.png', 48, 64, false ); + + $result = $media->filter_attachment_image_src( $image, $zip_id, 'thumbnail', true ); $this->assertSame( $image, $result ); } + /** + * A synced preview-capable format (PDF/PSD) is the deliberate carve-out: it has a real image + * preview to correct to, so icon=true must not block it either, mirroring the image case. + * + * @return void + */ + public function test_synced_preview_only_attachment_with_icon_is_corrected() { + $pdf_id = self::factory()->post->create( + array( + 'post_type' => 'attachment', + 'post_mime_type' => 'application/pdf', + ) + ); + update_post_meta( $pdf_id, '_wp_attached_file', 'document.pdf' ); + + $media = $this->get_media(); + $media->stub_cloudinary_id = 'document.pdf'; + $media->stub_cloudinary_url = 'https://res.cloudinary.com/test-cloud/image/upload/document.jpg'; + $image = array( 'http://example.org/wp-includes/images/media/document.png', 48, 64, false ); + + $result = $media->filter_attachment_image_src( $image, $pdf_id, 'thumbnail', true ); + + $this->assertSame( $media->stub_cloudinary_url, $result[0] ); + } + /** * A false (no image) result has nothing to correct and must pass through unchanged. * @@ -163,7 +185,9 @@ public function test_false_image_is_returned_unchanged() { } /** - * A video attachment is left untouched, mirroring the same guard filter_downsize() uses. + * A video attachment is left untouched -- caught by the image/preview-only type check before + * ever reaching the deliverable/sync checks (a video has no image representation to correct + * to here; its own URL is handled by attachment_url() instead). * * @return void */ @@ -174,15 +198,12 @@ public function test_video_attachment_is_returned_unchanged() { 'post_mime_type' => 'video/mp4', ) ); + update_post_meta( $video_id, '_wp_attached_file', 'video.mp4' ); $media = $this->get_media(); $image = array( 'http://example.org/wp-content/uploads/video.mp4', 640, 360, true ); - $result = $this->without_saving_metadata_guard( - function () use ( $media, $image, $video_id ) { - return $media->filter_attachment_image_src( $image, $video_id, 'thumbnail', false ); - } - ); + $result = $media->filter_attachment_image_src( $image, $video_id, 'thumbnail', false ); $this->assertSame( $image, $result ); } @@ -200,16 +221,14 @@ public function test_non_deliverable_attachment_is_returned_unchanged() { 'post_mime_type' => 'image/jpeg', ) ); + update_post_meta( $bare_id, '_wp_attached_file', 'bare.jpg' ); - $media = $this->get_media(); - $media->stub_cloudinary_id = 'sample.jpg'; - $image = array( 'http://example.org/wp-content/uploads/bare.jpg', 100, 100, true ); + $media = $this->get_media(); + $media->stub_cloudinary_id = 'sample.jpg'; + $media->stub_cloudinary_url = 'https://res.cloudinary.com/test-cloud/image/upload/should-not-be-used.jpg'; + $image = array( 'http://example.org/wp-content/uploads/bare.jpg', 100, 100, true ); - $result = $this->without_saving_metadata_guard( - function () use ( $media, $image, $bare_id ) { - return $media->filter_attachment_image_src( $image, $bare_id, 'thumbnail', false ); - } - ); + $result = $media->filter_attachment_image_src( $image, $bare_id, 'thumbnail', false ); $this->assertSame( $image, $result ); } @@ -226,11 +245,7 @@ public function test_no_cloudinary_id_returns_image_unchanged() { $media->stub_cloudinary_url = 'https://res.cloudinary.com/test-cloud/image/upload/should-not-be-used.jpg'; $image = array( 'http://example.org/wp-content/uploads/canola.jpg', 100, 100, true ); - $result = $this->without_saving_metadata_guard( - function () use ( $media, $image ) { - return $media->filter_attachment_image_src( $image, self::$attachment_id, 'thumbnail', false ); - } - ); + $result = $media->filter_attachment_image_src( $image, self::$attachment_id, 'thumbnail', false ); $this->assertSame( $image, $result ); } @@ -247,17 +262,38 @@ public function test_local_url_is_corrected_to_cloudinary_url() { $media->stub_cloudinary_url = 'https://res.cloudinary.com/test-cloud/image/upload/sample.jpg'; $image = array( 'http://example.org/wp-content/uploads/canola.jpg', 100, 100, true ); - $result = $this->without_saving_metadata_guard( - function () use ( $media, $image ) { - return $media->filter_attachment_image_src( $image, self::$attachment_id, 'thumbnail', false ); - } - ); + $result = $media->filter_attachment_image_src( $image, self::$attachment_id, 'thumbnail', false ); $this->assertSame( $media->stub_cloudinary_url, $result[0] ); $this->assertSame( 100, $result[1] ); $this->assertSame( 100, $result[2] ); $this->assertTrue( $result[3] ); } + + /** + * Regression test for a PR review finding: Utils::is_saving_metadata() must reflect a meta + * write happening right now, not one that happened earlier in the request. It used to read + * did_action(), which is cumulative for the whole request -- so an unrelated post/term/user + * meta write anywhere earlier (a view counter, a session plugin, anything) would permanently + * block correction for the rest of the page once these filters started running on the front + * end. Writing unrelated meta here, before calling the filter, catches a regression back to + * that behaviour. + * + * @return void + */ + public function test_earlier_unrelated_meta_write_does_not_block_correction() { + $other_post_id = self::factory()->post->create(); + update_post_meta( $other_post_id, 'unrelated_counter', 1 ); + + $media = $this->get_media(); + $media->stub_cloudinary_id = 'sample.jpg'; + $media->stub_cloudinary_url = 'https://res.cloudinary.com/test-cloud/image/upload/sample.jpg'; + $image = array( 'http://example.org/wp-content/uploads/canola.jpg', 100, 100, true ); + + $result = $media->filter_attachment_image_src( $image, self::$attachment_id, 'thumbnail', false ); + + $this->assertSame( $media->stub_cloudinary_url, $result[0] ); + } } /** From 2d294a6be6f507e63fe4fdf94f8f5ea5ad893c12 Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Mon, 5 Oct 2026 19:50:48 +0530 Subject: [PATCH 14/80] test(e2e): Add Gallery block front-end delivery spec Publish a post with a Cloudinary Gallery block and assert the front end renders exactly N images, that every src/srcset is served from res.cloudinary.com//, and that switching the layout from expanded to classic in the editor and saving changes the rendered widget markup. Move expectCloudinaryUrl() to utils/delivery.js so the image and gallery delivery specs share one assertion. --- tests/e2e/cloudinary-gallery-delivery.spec.js | 321 ++++++++++++++++++ tests/e2e/cloudinary-image-delivery.spec.js | 24 +- tests/e2e/utils/delivery.js | 49 +++ 3 files changed, 371 insertions(+), 23 deletions(-) create mode 100644 tests/e2e/cloudinary-gallery-delivery.spec.js create mode 100644 tests/e2e/utils/delivery.js diff --git a/tests/e2e/cloudinary-gallery-delivery.spec.js b/tests/e2e/cloudinary-gallery-delivery.spec.js new file mode 100644 index 000000000..a301c2be0 --- /dev/null +++ b/tests/e2e/cloudinary-gallery-delivery.spec.js @@ -0,0 +1,321 @@ +/** + * External dependencies + */ +const fs = require( 'fs' ); +const path = require( 'path' ); +const { test, expect } = require( './fixtures' ); + +/** + * Internal dependencies + */ +const { ensureCloudinaryConnected } = require( './utils/connection' ); +const { expectCloudinaryUrl, srcsetUrls } = require( './utils/delivery' ); +const { wpCli } = require( './utils/wizard' ); + +const FIXTURE_PATH = path.join( __dirname, 'fixtures', 'test-image.jpg' ); + +const IMAGE_COUNT = 3; +const INITIAL_COLUMNS = 3; +const CONTAINER = 'cld-gallery-e2e'; + +// The Cloudinary Gallery Widget is loaded from product-gallery.cloudinary.com +// and renders on `window.load`, so allow for a slow third-party fetch. +const WIDGET_TIMEOUT = 30_000; + +let cloudName; + +/** + * State shared by the tests in this file. The layout test edits the post + * created in beforeAll, so the tests run in order (see `mode: 'serial'`). + * + * @type {{ postId: number, postLink: string, attachmentIds: number[], publicIds: string[] }|null} + */ +let created = null; + +/** + * Build the serialized `cloudinary/gallery` block. The inner markup must + * match the block's `save()` output exactly, or the editor flags the block + * as invalid when the layout test opens the post. + * + * @param {Object[]} selectedImages Response of the plugin's `image_data` endpoint. + * @param {Object} layout Layout attributes. + * @param {string} layout.mode `expanded` or `classic`. + * @param {number} layout.columns Column count (expanded mode only). + * @return {string} Block markup. + */ +function galleryBlock( selectedImages, { mode, columns } ) { + const attributes = { + container: CONTAINER, + selectedImages, + displayProps_mode: mode, + displayProps_columns: columns, + }; + + return ( + `\n` + + `
\n` + + `` + ); +} + +/** + * Open the published post and wait for the Gallery Widget to finish + * rendering every image in the main viewer. + * + * @param {import('@playwright/test').Page} page + * @return {Promise} The widget root. + */ +async function openGallery( page ) { + await page.goto( created.postLink ); + + const gallery = page.locator( + `.${ CONTAINER } [data-test="gallery-wrap"]` + ); + await expect( + gallery, + 'the Gallery Widget should render into the block container' + ).toBeVisible( { timeout: WIDGET_TIMEOUT } ); + + await expect( + gallery.locator( + '[data-test="gallery-viewer-wrap"] [data-test="image-wrap"][data-ready="true"]' + ) + ).toHaveCount( IMAGE_COUNT, { timeout: WIDGET_TIMEOUT } ); + + return gallery; +} + +/** + * Read the `src` and `srcset` attributes of the given images. + * + * @param {import('@playwright/test').Locator} images + * @return {Promise>} Attributes per image. + */ +async function collectImageUrls( images ) { + return images.evaluateAll( ( nodes ) => + nodes.map( ( img ) => ( { + src: img.getAttribute( 'src' ), + srcset: img.getAttribute( 'srcset' ), + } ) ) + ); +} + +// @serial: needs real credentials in `cloudinary_connect` to sync assets, +// while every analytics spec overwrites that option with fake ones. +test.describe( 'Cloudinary Gallery block delivery', { tag: '@serial' }, () => { + test.describe.configure( { mode: 'serial' } ); + + test.beforeAll( async ( { requestUtils } ) => { + ( { cloudName } = ensureCloudinaryConnected() ); + + const file = fs.readFileSync( FIXTURE_PATH ); + const attachmentIds = []; + for ( let i = 0; i < IMAGE_COUNT; i++ ) { + const media = await requestUtils.rest( { + method: 'POST', + path: '/wp/v2/media', + headers: { + 'Content-Type': 'image/jpeg', + 'Content-Disposition': `attachment; filename="gallery-e2e-${ Date.now() }-${ i }.jpg"`, + }, + data: file, + } ); + attachmentIds.push( media.id ); + } + + // Same endpoint the block editor calls when images are picked in + // the media modal. It uploads each attachment to Cloudinary if it + // is not synced yet and returns the `selectedImages` attribute. + const selectedImages = await requestUtils.rest( { + method: 'POST', + path: '/cloudinary/v1/image_data', + data: { images: attachmentIds.map( ( id ) => ( { id } ) ) }, + } ); + + expect( + selectedImages, + 'every attachment should sync to Cloudinary' + ).toHaveLength( IMAGE_COUNT ); + + const post = await requestUtils.rest( { + method: 'POST', + path: '/wp/v2/posts', + data: { + status: 'publish', + title: `Cloudinary gallery e2e ${ Date.now() }`, + content: galleryBlock( selectedImages, { + mode: 'expanded', + columns: INITIAL_COLUMNS, + } ), + }, + } ); + + created = { + postId: post.id, + postLink: post.link, + attachmentIds, + publicIds: selectedImages.map( ( image ) => image.publicId ), + }; + } ); + + test.afterAll( () => { + if ( ! created ) { + return; + } + const { postId, attachmentIds } = created; + created = null; + + // WP-CLI rather than REST for the same reason as the image delivery + // spec: `force=true` on a `?rest_route=` URL is fragile. + for ( const id of [ postId, ...attachmentIds ] ) { + try { + wpCli( [ 'post', 'delete', String( id ), '--force' ] ); + } catch ( e ) { + console.warn( `Cleanup of post ${ id } failed:`, e.message ); + } + } + } ); + + test( 'renders exactly N images, all served from Cloudinary', async ( { + page, + } ) => { + const gallery = await openGallery( page ); + + await expect( gallery ).toHaveAttribute( 'mode', 'expanded' ); + + const viewerImages = gallery.locator( + '[data-test="gallery-viewer-wrap"] img' + ); + await expect( + viewerImages, + `the gallery should show exactly ${ IMAGE_COUNT } images` + ).toHaveCount( IMAGE_COUNT ); + + // Every the widget renders, viewer and any thumbnails alike, + // must come from Cloudinary. + const attrs = await collectImageUrls( gallery.locator( 'img' ) ); + const urls = attrs.flatMap( ( { src, srcset } ) => [ + src, + ...srcsetUrls( srcset ), + ] ); + + expect( + attrs.every( ( { src } ) => !! src ), + 'every gallery image should have a src' + ).toBe( true ); + + for ( const url of urls ) { + expectCloudinaryUrl( url, cloudName ); + } + + // Each selected image appears once, identified by its public ID as + // the last path segment of the delivery URL. + const viewerUrls = ( await collectImageUrls( viewerImages ) ).map( + ( { src } ) => new URL( src ).pathname.split( '/' ).pop() + ); + expect( viewerUrls.sort() ).toEqual( + created.publicIds.map( ( id ) => id.split( '/' ).pop() ).sort() + ); + + // Expanded with 3 columns and 3 images: one row, no carousel or + // thumbnail strip. + const tops = await gallery + .locator( '[data-test="gallery-viewer-wrap"] button.assetWrapper' ) + .evaluateAll( ( nodes ) => + nodes.map( ( n ) => + Math.round( n.getBoundingClientRect().top ) + ) + ); + expect( + new Set( tops ).size, + `${ IMAGE_COUNT } images in ${ INITIAL_COLUMNS } columns should fit one row` + ).toBe( Math.ceil( IMAGE_COUNT / INITIAL_COLUMNS ) ); + await expect( gallery.locator( '[data-test="carousel"]' ) ).toHaveCount( + 0 + ); + await expect( + gallery.locator( '[data-test="gallery-thumbnail-wrap"]' ) + ).toHaveCount( 0 ); + } ); + + test( 'changing the layout and republishing changes the markup', async ( { + admin, + editor, + page, + } ) => { + await admin.editPost( created.postId ); + + // Select the block through the data store. Clicking it in the canvas + // would hit the widget's own buttons inside the block. + const clientId = await page.evaluate( () => { + const block = window.wp.data + .select( 'core/block-editor' ) + .getBlocks() + .find( ( b ) => b.name === 'cloudinary/gallery' ); + window.wp.data + .dispatch( 'core/block-editor' ) + .selectBlock( block.clientId ); + return block.clientId; + } ); + expect( clientId, 'the gallery block should load' ).toBeTruthy(); + + const isValid = await page.evaluate( + ( id ) => + window.wp.data.select( 'core/block-editor' ).getBlock( id ) + .isValid, + clientId + ); + expect( isValid, 'the gallery block should not be invalid' ).toBe( + true + ); + + await editor.openDocumentSettingsSidebar(); + + const settings = page.getByRole( 'region', { + name: 'Editor settings', + } ); + await settings + .locator( 'button.radio-select', { hasText: 'Classic' } ) + .click(); + await expect( + settings.locator( 'button.radio-select--active' ) + ).toContainText( 'Classic' ); + + await page + .getByRole( 'region', { name: 'Editor top bar' } ) + .getByRole( 'button', { name: 'Save', exact: true } ) + .click(); + await expect( + page + .getByRole( 'button', { name: 'Dismiss this notice' } ) + .filter( { hasText: 'updated' } ) + ).toBeVisible(); + + const gallery = await openGallery( page ); + + await expect( gallery ).toHaveAttribute( 'mode', 'classic' ); + + // Classic shows one image at a time in a carousel with a thumbnail + // strip, and no expanded scroll viewer. + await expect( + gallery.locator( + '[data-test="gallery-viewer-wrap"] [data-test="carousel"]' + ) + ).toBeVisible(); + await expect( + gallery.locator( '[data-test="scroll-viewer-wrap"]' ) + ).toHaveCount( 0 ); + await expect( + gallery.locator( + '[data-test="gallery-thumbnail-wrap"] [data-test="thumbnails-wrap"]' + ) + ).toHaveCount( IMAGE_COUNT ); + + const attrs = await collectImageUrls( gallery.locator( 'img' ) ); + for ( const { src, srcset } of attrs ) { + for ( const url of [ src, ...srcsetUrls( srcset ) ] ) { + expectCloudinaryUrl( url, cloudName ); + } + } + } ); +} ); diff --git a/tests/e2e/cloudinary-image-delivery.spec.js b/tests/e2e/cloudinary-image-delivery.spec.js index 2f081b98f..4aa93159e 100644 --- a/tests/e2e/cloudinary-image-delivery.spec.js +++ b/tests/e2e/cloudinary-image-delivery.spec.js @@ -9,6 +9,7 @@ const { test, expect } = require( './fixtures' ); * Internal dependencies */ const { ensureCloudinaryConnected } = require( './utils/connection' ); +const { expectCloudinaryUrl } = require( './utils/delivery' ); const { wpCli } = require( './utils/wizard' ); const FIXTURE_PATH = path.join( __dirname, 'fixtures', 'test-image.jpg' ); @@ -22,29 +23,6 @@ let cloudName; */ let created = null; -/** - * Assert that a given image URL is served by Cloudinary under the - * expected cloud name. We intentionally do not assert specific - * transformations — those are an implementation detail of the plugin - * and may change. - * - * @param {string} rawUrl The src or srcset candidate. - * @param {string} expectedCloud The cloud name parsed from CLOUDINARY_E2E_URL. - */ -function expectCloudinaryUrl( rawUrl, expectedCloud ) { - let parsed; - try { - parsed = new URL( rawUrl ); - } catch ( e ) { - throw new Error( `Image URL is not parseable: ${ rawUrl }` ); - } - expect( parsed.host, `host of ${ rawUrl }` ).toBe( 'res.cloudinary.com' ); - expect( - parsed.pathname.startsWith( `/${ expectedCloud }/` ), - `pathname of ${ rawUrl } should start with /${ expectedCloud }/` - ).toBe( true ); -} - // @serial: needs real credentials in `cloudinary_connect` for `wp cloudinary // sync`, while every analytics spec overwrites that option with fake ones. test.describe( 'Cloudinary image delivery', { tag: '@serial' }, () => { diff --git a/tests/e2e/utils/delivery.js b/tests/e2e/utils/delivery.js new file mode 100644 index 000000000..7f82c3bf0 --- /dev/null +++ b/tests/e2e/utils/delivery.js @@ -0,0 +1,49 @@ +/** + * Assertions shared by the front-end delivery specs. + */ + +const { expect } = require( '../fixtures' ); + +/** + * Assert that a given image URL is served by Cloudinary under the + * expected cloud name. We intentionally do not assert specific + * transformations — those are an implementation detail of the plugin + * and may change. + * + * @param {string} rawUrl The src or srcset candidate. + * @param {string} expectedCloud The cloud name parsed from CLOUDINARY_E2E_URL. + */ +function expectCloudinaryUrl( rawUrl, expectedCloud ) { + let parsed; + try { + parsed = new URL( rawUrl ); + } catch ( e ) { + throw new Error( `Image URL is not parseable: ${ rawUrl }` ); + } + expect( parsed.host, `host of ${ rawUrl }` ).toBe( 'res.cloudinary.com' ); + expect( + parsed.pathname.startsWith( `/${ expectedCloud }/` ), + `pathname of ${ rawUrl } should start with /${ expectedCloud }/` + ).toBe( true ); +} + +/** + * Split a `srcset` attribute into its candidate URLs. + * + * @param {string|null} srcset The raw attribute value. + * @return {string[]} Candidate URLs, without width/density descriptors. + */ +function srcsetUrls( srcset ) { + if ( ! srcset ) { + return []; + } + return srcset + .split( ',' ) + .map( ( candidate ) => candidate.trim().split( /\s+/ )[ 0 ] ) + .filter( Boolean ); +} + +module.exports = { + expectCloudinaryUrl, + srcsetUrls, +}; From ee5952390efcbec97df6bc8fbb7dd981148a2ba1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Oct 2026 01:07:19 +0000 Subject: [PATCH 15/80] chore(deps-dev): bump phpstan/phpstan from 2.2.16 to 2.2.17 Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan-phar-composer-source) from 2.2.16 to 2.2.17. - [Commits](https://github.com/phpstan/phpstan-phar-composer-source/commits) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-version: 2.2.17 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 88ad00791..822aea01c 100644 --- a/composer.lock +++ b/composer.lock @@ -992,11 +992,11 @@ }, { "name": "phpstan/phpstan", - "version": "2.2.16", + "version": "2.2.17", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/46a6d9060e5a7763adfcc21ebcb8b504ebdbcb92", - "reference": "46a6d9060e5a7763adfcc21ebcb8b504ebdbcb92", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e676a49fa70cee9f5bf6ff4796186b928a08673f", + "reference": "e676a49fa70cee9f5bf6ff4796186b928a08673f", "shasum": "" }, "require": { @@ -1052,7 +1052,7 @@ "type": "github" } ], - "time": "2026-09-25T09:31:51+00:00" + "time": "2026-10-04T19:40:09+00:00" }, { "name": "phpunit/php-code-coverage", From f50a50275861b3100aa4767cbe741f17bb827df8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Oct 2026 01:07:32 +0000 Subject: [PATCH 16/80] chore(deps-dev): bump eslint from 10.11.0 to 10.12.0 Bumps [eslint](https://github.com/eslint/eslint) from 10.11.0 to 10.12.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](https://github.com/eslint/eslint/compare/v10.11.0...v10.12.0) --- updated-dependencies: - dependency-name: eslint dependency-version: 10.12.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 422123375..a3aa88413 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "css-unicode-loader": "^1.0.3", "cssnano": "^9.1.2", "dotenv": "^18.0.2", - "eslint": "^10.11.0", + "eslint": "^10.12.0", "eslint-plugin-jest": "^29.16.6", "eslint-plugin-react-hooks": "^7.0.1", "file-loader": "^6.2.0", @@ -16428,9 +16428,9 @@ } }, "node_modules/eslint": { - "version": "10.11.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.11.0.tgz", - "integrity": "sha512-P7a6UEEqb9G95MYAtqkmsTbVXIYyzIfl6NGOIJk162PaahFxFyeGcrlXYFSiagECg4sEm8IseJdZBKR3rx6MsQ==", + "version": "10.12.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.12.0.tgz", + "integrity": "sha512-npHjrHb2o4ehH3mE+YuxABR+0gyb0aVWCIolgJDArwCiHEIsonBm3ZKjel5b0U5+a+MbEvIyRCGCzD3eKKK2NA==", "dev": true, "license": "MIT", "workspaces": [ diff --git a/package.json b/package.json index d1778c4cf..07948641d 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "css-unicode-loader": "^1.0.3", "cssnano": "^9.1.2", "dotenv": "^18.0.2", - "eslint": "^10.11.0", + "eslint": "^10.12.0", "eslint-plugin-jest": "^29.16.6", "eslint-plugin-react-hooks": "^7.0.1", "file-loader": "^6.2.0", From eb4c28c40644b3a1be06442508dcafb2834f46f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Oct 2026 01:07:40 +0000 Subject: [PATCH 17/80] chore(deps-dev): bump globals from 17.12.0 to 17.13.0 Bumps [globals](https://github.com/sindresorhus/globals) from 17.12.0 to 17.13.0. - [Release notes](https://github.com/sindresorhus/globals/releases) - [Commits](https://github.com/sindresorhus/globals/compare/v17.12.0...v17.13.0) --- updated-dependencies: - dependency-name: globals dependency-version: 17.13.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 422123375..140ffe46b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,7 +49,7 @@ "eslint-plugin-jest": "^29.16.6", "eslint-plugin-react-hooks": "^7.0.1", "file-loader": "^6.2.0", - "globals": "^17.12.0", + "globals": "^17.13.0", "grunt": "^1.5.2", "grunt-contrib-clean": "^2.0.0", "grunt-contrib-compress": "^2.0.0", @@ -18199,9 +18199,9 @@ } }, "node_modules/globals": { - "version": "17.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-17.12.0.tgz", - "integrity": "sha512-cezEd/DTyyht9cvSSURyygXPfy04GtWO/5e6ZPvH7fCtjKz9PYOmuawphw1Ctd1f6C+5JypXfGD7ahNMXvevBA==", + "version": "17.13.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.13.0.tgz", + "integrity": "sha512-RwMTC61u7hrG3ZJMkZQOK4JLJrKS8QtoTii63EmWvFXHqycY9FObBJQCbsLxSO8kjKhWE5kV1GC+Vb1g3RI0Zg==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index d1778c4cf..1a07b3e6d 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "eslint-plugin-jest": "^29.16.6", "eslint-plugin-react-hooks": "^7.0.1", "file-loader": "^6.2.0", - "globals": "^17.12.0", + "globals": "^17.13.0", "grunt": "^1.5.2", "grunt-contrib-clean": "^2.0.0", "grunt-contrib-compress": "^2.0.0", From 0de03277780ca3bf726f56ebf79afa242a0e1baa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Oct 2026 01:07:46 +0000 Subject: [PATCH 18/80] chore(deps): bump @codemirror/state from 6.7.5 to 6.7.6 Bumps [@codemirror/state](https://github.com/codemirror/state) from 6.7.5 to 6.7.6. - [Changelog](https://github.com/codemirror/state/blob/main/CHANGELOG.md) - [Commits](https://github.com/codemirror/state/commits) --- updated-dependencies: - dependency-name: "@codemirror/state" dependency-version: 6.7.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 422123375..b17105cc3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "license": "GPL-2.0+", "dependencies": { "@codemirror/lang-json": "^6.0.2", - "@codemirror/state": "^6.7.5", + "@codemirror/state": "^6.7.6", "@codemirror/theme-one-dark": "^6.1.3", "chart.js": "^4.5.1", "classnames": "^2.3.1", @@ -2497,9 +2497,9 @@ } }, "node_modules/@codemirror/state": { - "version": "6.7.5", - "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.7.5.tgz", - "integrity": "sha512-QjLbZmY1Au3JiRrDVYFLRD0BZ3SOKS9pR3yjIkd7u27YY8TFD9/Q9fhPnLV5l1mHFSo3hHU/N31vpwEJOx4owQ==", + "version": "6.7.6", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.7.6.tgz", + "integrity": "sha512-kAz+AncRtKuIknedxT1bq4XwXv4UowhbkHU1myPrtVb/jZtImWuV5BXzv5vK6i3kYACsdiZiQKFQQ5Mq7elW8w==", "license": "MIT", "dependencies": { "@marijn/find-cluster-break": "^1.0.0" diff --git a/package.json b/package.json index d1778c4cf..cb273f0fe 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ }, "dependencies": { "@codemirror/lang-json": "^6.0.2", - "@codemirror/state": "^6.7.5", + "@codemirror/state": "^6.7.6", "@codemirror/theme-one-dark": "^6.1.3", "chart.js": "^4.5.1", "classnames": "^2.3.1", From 55c4bb28dba4b94578a5b7b138d16f8b3810e465 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Oct 2026 01:07:59 +0000 Subject: [PATCH 19/80] chore(deps-dev): bump lint-staged from 17.5.1 to 17.6.0 Bumps [lint-staged](https://github.com/lint-staged/lint-staged) from 17.5.1 to 17.6.0. - [Release notes](https://github.com/lint-staged/lint-staged/releases) - [Changelog](https://github.com/lint-staged/lint-staged/blob/main/CHANGELOG.md) - [Commits](https://github.com/lint-staged/lint-staged/compare/v17.5.1...v17.6.0) --- updated-dependencies: - dependency-name: lint-staged dependency-version: 17.6.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 422123375..1ca1b355e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,7 +60,7 @@ "grunt-wp-i18n": "^1.0.3", "husky": "^9.1.7", "jsdoc": "^4.0.5", - "lint-staged": "^17.5.1", + "lint-staged": "^17.6.0", "load-grunt-tasks": "^5.1.0", "mini-css-extract-plugin": "^2.9.4", "npm-run-all2": "^9.0.3", @@ -22102,9 +22102,9 @@ } }, "node_modules/lint-staged": { - "version": "17.5.1", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-17.5.1.tgz", - "integrity": "sha512-7EDuco1xnBMeVpvAbeMq1U5KXwJGLmY8q6l+Ye78r36C4mPc+Vg1Z2SK8gHyRTyvPro90A0q5/FAZ+Au23d6QQ==", + "version": "17.6.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-17.6.0.tgz", + "integrity": "sha512-nOhBfYkZEwkFtNzD5pK9s9LkcWoxJ+whLzEnhqi9nl7zTB5n7tg8+9iYgMGx2Wm3VlLu8cbNj0RACzY+nWi5iQ==", "dev": true, "license": "MIT", "dependencies": { @@ -22122,7 +22122,7 @@ "url": "https://opencollective.com/lint-staged" }, "optionalDependencies": { - "yaml": "^2.9.0" + "yaml": "^2.9.1" } }, "node_modules/lint-staged/node_modules/picomatch": { @@ -22139,9 +22139,9 @@ } }, "node_modules/lint-staged/node_modules/yaml": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", - "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz", + "integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==", "dev": true, "license": "ISC", "optional": true, diff --git a/package.json b/package.json index d1778c4cf..2d663994a 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "grunt-wp-i18n": "^1.0.3", "husky": "^9.1.7", "jsdoc": "^4.0.5", - "lint-staged": "^17.5.1", + "lint-staged": "^17.6.0", "load-grunt-tasks": "^5.1.0", "mini-css-extract-plugin": "^2.9.4", "npm-run-all2": "^9.0.3", From d65f11332667684756880d952f137986f453fc88 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Mon, 12 Oct 2026 13:01:18 +0200 Subject: [PATCH 20/80] fix(sync): auto-regenerate thumbnail sizes left stale after an image edit Editing an image via the WP image editor can rename the main file without regenerating its registered thumbnail sizes, leaving `sizes` metadata pointing at filenames that no longer exist. This causes Delivery::find_attachment_size_urls() to run an uncached wp_postmeta lookup on every render of that attachment, since nothing resolves the stale URLs. Adds a `sizes` sync type (mirroring the existing `edit` type) that detects this drift on render via the existing realtime sync pipeline and regenerates the attachment metadata, self-healing both new edits and already-drifted attachments without any new cron job or bulk scan. --- php/class-media.php | 30 ++++++++++++++++++++++++++++++ php/class-sync.php | 27 +++++++++++++++++++++++++++ php/sync/class-upload-sync.php | 25 +++++++++++++++++++++++++ 3 files changed, 82 insertions(+) diff --git a/php/class-media.php b/php/class-media.php index cf4a3370b..3cd4acf78 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1693,6 +1693,36 @@ public function has_public_id( $attachment_id ) { return ! empty( $new_id ) || ! empty( $id ); } + /** + * Check if an attachment's registered sizes reference filenames that no longer match the current attached file. + * + * This happens when an image is edited (e.g. cropped) via the WordPress image editor: the main file gets + * renamed (an `-e{timestamp}` suffix is added), but the `sizes` metadata can be left pointing at the + * pre-edit filenames, leaving no local file matching that size record. + * + * @param int $attachment_id The Attachment ID. + * + * @return bool + */ + public function has_outdated_sizes( $attachment_id ) { + $metadata = wp_get_attachment_metadata( $attachment_id ); + if ( empty( $metadata['file'] ) || empty( $metadata['sizes'] ) || ! is_array( $metadata['sizes'] ) ) { + return false; + } + + $base = wp_basename( $metadata['file'] ); + $ext = pathinfo( $base, PATHINFO_EXTENSION ); + $base = ! empty( $ext ) ? substr( $base, 0, - ( strlen( $ext ) + 1 ) ) : $base; + + foreach ( $metadata['sizes'] as $size ) { + if ( empty( $size['file'] ) || 0 !== strpos( $size['file'], $base . '-' ) ) { + return true; + } + } + + return false; + } + /** * Get a Cloudinary ID which includes the file format extension. * diff --git a/php/class-sync.php b/php/class-sync.php index 30e73015d..e9bcd7d5e 100644 --- a/php/class-sync.php +++ b/php/class-sync.php @@ -568,6 +568,18 @@ public function setup_sync_base_struct() { 'required' => false, // Required to complete URL render flag. 'realtime' => true, ), + 'sizes' => array( + 'generate' => array( $this, 'generate_sizes_signature' ), + 'priority' => 5.25, + 'sync' => array( $this->managers['upload'], 'regenerate_sizes' ), + 'validate' => function ( $attachment_id ) { + return $this->managers['media']->has_outdated_sizes( $attachment_id ); + }, + 'state' => 'info syncing', + 'note' => __( 'Regenerating thumbnail sizes', 'cloudinary' ), + 'required' => false, + 'realtime' => true, + ), 'folder' => array( 'generate' => array( $this->managers['media'], 'get_cloudinary_folder' ), 'validate' => array( $this->managers['media'], 'is_folder_synced' ), @@ -1389,4 +1401,19 @@ public function generate_edit_signature( $attachment_id ) { return $str; } + + /** + * Generate a signature for an attachment's thumbnail sizes. + * + * @param int $attachment_id The attachment ID. + * + * @return string + */ + public function generate_sizes_signature( $attachment_id ) { + $metadata = wp_get_attachment_metadata( $attachment_id ); + $file = ! empty( $metadata['file'] ) ? wp_basename( $metadata['file'] ) : ''; + $sizes = ! empty( $metadata['sizes'] ) ? wp_json_encode( $metadata['sizes'] ) : ''; + + return $file . $sizes; + } } diff --git a/php/sync/class-upload-sync.php b/php/sync/class-upload-sync.php index aa8b7f9de..2c81adfe5 100644 --- a/php/sync/class-upload-sync.php +++ b/php/sync/class-upload-sync.php @@ -277,6 +277,31 @@ public function edit_upload( $attachment_id ) { return $this->upload_asset( $attachment_id, 'edit' ); } + /** + * Regenerate an attachment's thumbnail sizes when they no longer match the current attached file. + * + * @param int $attachment_id The attachment ID. + * + * @return array|\WP_Error + */ + public function regenerate_sizes( $attachment_id ) { + if ( ! function_exists( 'wp_generate_attachment_metadata' ) ) { + require_once ABSPATH . 'wp-admin/includes/image.php'; + } + + $file = get_attached_file( $attachment_id ); + $metadata = wp_generate_attachment_metadata( $attachment_id, $file ); + if ( empty( $metadata ) ) { + return new \WP_Error( 'cloudinary_regenerate_sizes_failed', __( 'Could not regenerate attachment sizes.', 'cloudinary' ) ); + } + + wp_update_attachment_metadata( $attachment_id, $metadata ); + // Persist the new signature, otherwise this would re-trigger on every subsequent render. + $this->sync->set_signature_item( $attachment_id, 'sizes' ); + + return $metadata; + } + /** * Upload an asset to Cloudinary. * From 25bee78a9c449d1f6137e48975a5402a9c79a2dd Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Mon, 12 Oct 2026 13:13:57 +0200 Subject: [PATCH 21/80] fix(sync): drop redundant is_array check flagged by PHPStan wp_get_attachment_metadata()'s PHPDoc already types 'sizes' as array, making the is_array() check dead code; empty() already covers the missing-key and empty-array cases. --- php/class-media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-media.php b/php/class-media.php index 3cd4acf78..1064c15c2 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1706,7 +1706,7 @@ public function has_public_id( $attachment_id ) { */ public function has_outdated_sizes( $attachment_id ) { $metadata = wp_get_attachment_metadata( $attachment_id ); - if ( empty( $metadata['file'] ) || empty( $metadata['sizes'] ) || ! is_array( $metadata['sizes'] ) ) { + if ( empty( $metadata['file'] ) || empty( $metadata['sizes'] ) ) { return false; } From 66715b975612388b1672fad34c6df4c7e2c214cd Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Tue, 13 Oct 2026 14:38:21 +0530 Subject: [PATCH 22/80] test(e2e): Add per-asset overlay and crop spec Drive the real Edit Asset UI to save a text overlay and a crop, then assert the front-end image delivery URL picks them up and reverts to the default once they are removed. --- tests/e2e/cloudinary-asset-edit.spec.js | 253 ++++++++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 tests/e2e/cloudinary-asset-edit.spec.js diff --git a/tests/e2e/cloudinary-asset-edit.spec.js b/tests/e2e/cloudinary-asset-edit.spec.js new file mode 100644 index 000000000..7e2142be9 --- /dev/null +++ b/tests/e2e/cloudinary-asset-edit.spec.js @@ -0,0 +1,253 @@ +/** + * External dependencies + */ +const fs = require( 'fs' ); +const path = require( 'path' ); +const { test, expect } = require( './fixtures' ); + +/** + * Internal dependencies + */ +const { ensureCloudinaryConnected } = require( './utils/connection' ); +const { expectCloudinaryUrl } = require( './utils/delivery' ); +const { wpCli } = require( './utils/wizard' ); + +const FIXTURE_PATH = path.join( __dirname, 'fixtures', 'test-image.jpg' ); + +const OVERLAY_TEXT = 'CldE2EOverlay'; +const CROP = 'c_crop,h_120,w_160'; + +let cloudName; + +/** + * State shared by the tests in this file. Every test edits the same + * attachment, so the tests run in order (see `mode: 'serial'`). + * + * @type {{ postId: number, postLink: string, attachmentId: number }|null} + */ +let created = null; + +/** + * Locate an Edit Asset field by its setting slug. The plugin's UI builds + * IDs such as `edit_asset.edit_affects.text_overlay_text`, which contain + * dots, so an attribute selector is used instead of `#id`. + * + * @param {import('@playwright/test').Page} page + * @param {string} slug Setting slug. + * @return {import('@playwright/test').Locator} The input. + */ +function assetField( page, slug ) { + return page.locator( `[id="edit_asset.edit_affects.${ slug }"]` ); +} + +/** + * Open the Edit Asset page for the test attachment and wait for the + * preview script to initialise. + * + * @param {import('@playwright/test').Page} page + */ +async function openEditAsset( page ) { + await page.goto( + `/wp-admin/admin.php?page=cloudinary§ion=edit-asset&asset=${ created.attachmentId }` + ); + + // `asset-edit.js` appends the preview image on `window.load`; once it + // is there, the save handlers are bound. + await expect( + page.locator( '#cld-asset-edit img' ), + 'the asset preview should render' + ).toBeVisible(); +} + +/** + * Click a save button on the Edit Asset page and wait for the REST call. + * + * @param {import('@playwright/test').Page} page + * @param {import('@playwright/test').Locator} button + * @return {Promise} The `save_asset` response body. + */ +async function saveAsset( page, button ) { + const [ response ] = await Promise.all( [ + page.waitForResponse( + ( res ) => + res.url().includes( 'save_asset' ) && + res.request().method() === 'POST' + ), + button.click(), + ] ); + expect( response.ok(), 'save_asset should succeed' ).toBe( true ); + + const body = await response.json(); + expect( + body.note, + 'the plugin should accept the transformation as valid' + ).toBeUndefined(); + + return body; +} + +/** + * Open the published post and read the delivery attributes of the inline + * image once the lazy-loader has swapped in the Cloudinary URL. + * + * @param {import('@playwright/test').Page} page + * @return {Promise<{ src: string, transformations: string }>} Delivery data. + */ +async function readDelivery( page ) { + await page.goto( created.postLink ); + + const img = page + .locator( `.wp-block-image img.wp-image-${ created.attachmentId }` ) + .first(); + await expect( img, 'the inline image should render' ).toBeVisible(); + await img.scrollIntoViewIfNeeded(); + + await expect( + img, + 'the lazy-loader should swap in the Cloudinary URL' + ).toHaveAttribute( 'src', /^https:\/\/res\.cloudinary\.com\// ); + + const src = await img.getAttribute( 'src' ); + expectCloudinaryUrl( src, cloudName ); + + return { + src, + transformations: + ( await img.getAttribute( 'data-transformations' ) ) || '', + }; +} + +// @serial: needs real credentials in `cloudinary_connect` to sync assets, +// while every analytics spec overwrites that option with fake ones. +test.describe( 'Cloudinary per-asset editing', { tag: '@serial' }, () => { + test.describe.configure( { mode: 'serial' } ); + + test.beforeAll( async ( { requestUtils } ) => { + ( { cloudName } = ensureCloudinaryConnected() ); + + const media = await requestUtils.rest( { + method: 'POST', + path: '/wp/v2/media', + headers: { + 'Content-Type': 'image/jpeg', + 'Content-Disposition': `attachment; filename="asset-edit-e2e-${ Date.now() }.jpg"`, + }, + data: fs.readFileSync( FIXTURE_PATH ), + } ); + + const content = + `\n` + + `
\n` + + ``; + + const post = await requestUtils.rest( { + method: 'POST', + path: '/wp/v2/posts', + data: { + status: 'publish', + title: `Cloudinary asset edit e2e ${ Date.now() }`, + content, + }, + } ); + + created = { + postId: post.id, + postLink: post.link, + attachmentId: media.id, + }; + + // The Edit Asset page and the front-end rewrite both need the + // asset to be synced to Cloudinary. + wpCli( [ 'cloudinary', 'sync' ] ); + } ); + + test.afterAll( () => { + if ( ! created ) { + return; + } + const { postId, attachmentId } = created; + created = null; + + // WP-CLI rather than REST for the same reason as the image delivery + // spec: `force=true` on a `?rest_route=` URL is fragile. + for ( const id of [ postId, attachmentId ] ) { + try { + wpCli( [ 'post', 'delete', String( id ), '--force' ] ); + } catch ( e ) { + console.warn( `Cleanup of post ${ id } failed:`, e.message ); + } + } + } ); + + test( 'text overlay updates the delivery URL and reverts when removed', async ( { + page, + } ) => { + const baseline = await readDelivery( page ); + expect( baseline.src ).not.toContain( 'l_text:' ); + + await openEditAsset( page ); + await assetField( page, 'text_overlay_text' ).fill( OVERLAY_TEXT ); + const saved = await saveAsset( + page, + page.locator( '#cld-asset-save-text-overlay' ) + ); + expect( saved.text_overlay ).toContain( OVERLAY_TEXT ); + + const withOverlay = await readDelivery( page ); + for ( const value of [ + withOverlay.transformations, + withOverlay.src, + ] ) { + expect( value ).toContain( `l_text:Arial_20:${ OVERLAY_TEXT }` ); + expect( value ).toContain( 'fl_layer_apply' ); + } + + // "Reset All" only clears the form; saving persists the empty overlay. + await openEditAsset( page ); + await expect( assetField( page, 'text_overlay_text' ) ).toHaveValue( + OVERLAY_TEXT + ); + await page.locator( '#cld-asset-remove-text-overlay' ).click(); + await expect( assetField( page, 'text_overlay_text' ) ).toHaveValue( + '' + ); + const cleared = await saveAsset( + page, + page.locator( '#cld-asset-save-text-overlay' ) + ); + expect( cleared.text_overlay ).toBe( '' ); + + expect( await readDelivery( page ) ).toEqual( baseline ); + } ); + + test( 'crop updates the delivery URL and reverts when removed', async ( { + page, + } ) => { + const baseline = await readDelivery( page ); + expect( baseline.src ).not.toContain( CROP ); + + await openEditAsset( page ); + const input = assetField( page, 'transformations' ); + await input.fill( CROP ); + const saved = await saveAsset( + page, + page.locator( '#cld-asset-edit-save' ) + ); + expect( saved.transformations ).toBe( CROP ); + + const withCrop = await readDelivery( page ); + expect( withCrop.transformations ).toContain( CROP ); + expect( withCrop.src ).toContain( CROP ); + + await openEditAsset( page ); + await expect( input ).toHaveValue( CROP ); + await input.fill( '' ); + const cleared = await saveAsset( + page, + page.locator( '#cld-asset-edit-save' ) + ); + expect( cleared.transformations ).toBe( '' ); + + expect( await readDelivery( page ) ).toEqual( baseline ); + } ); +} ); From 42ba66626b931c6845f863257605f858cbb50374 Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Tue, 13 Oct 2026 15:05:21 +0530 Subject: [PATCH 23/80] test(e2e): Read delivered URL from currentSrc When the theme emits a srcset, the lazy-loader restores it and keeps the SVG placeholder in src, so the src check failed in CI. Assert on currentSrc, which is the URL the browser loads in both cases. --- tests/e2e/cloudinary-asset-edit.spec.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/e2e/cloudinary-asset-edit.spec.js b/tests/e2e/cloudinary-asset-edit.spec.js index 7e2142be9..ca4eb3d94 100644 --- a/tests/e2e/cloudinary-asset-edit.spec.js +++ b/tests/e2e/cloudinary-asset-edit.spec.js @@ -88,7 +88,8 @@ async function saveAsset( page, button ) { /** * Open the published post and read the delivery attributes of the inline - * image once the lazy-loader has swapped in the Cloudinary URL. + * image once the lazy-loader has swapped in the Cloudinary URL. `src` in + * the result is the URL the browser loaded. * * @param {import('@playwright/test').Page} page * @return {Promise<{ src: string, transformations: string }>} Delivery data. @@ -102,12 +103,18 @@ async function readDelivery( page ) { await expect( img, 'the inline image should render' ).toBeVisible(); await img.scrollIntoViewIfNeeded(); - await expect( - img, - 'the lazy-loader should swap in the Cloudinary URL' - ).toHaveAttribute( 'src', /^https:\/\/res\.cloudinary\.com\// ); - - const src = await img.getAttribute( 'src' ); + // The lazy-loader either writes the delivery URL to `src` or, when the + // theme emits a srcset, restores `data-srcset` and leaves the SVG + // placeholder in `src`. `currentSrc` is the URL the browser picked in + // both cases. + const currentSrc = () => img.evaluate( ( node ) => node.currentSrc ); + await expect + .poll( currentSrc, { + message: 'the lazy-loader should swap in the Cloudinary URL', + } ) + .toMatch( /^https:\/\/res\.cloudinary\.com\// ); + + const src = await currentSrc(); expectCloudinaryUrl( src, cloudName ); return { From c016b8c233ea96d377b060300eea0b14dcf3aa13 Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Tue, 13 Oct 2026 15:06:42 +0530 Subject: [PATCH 24/80] test(e2e): Add SVG upload and delivery spec Cover the SVG Support feature end to end against a real Cloudinary account: - A valid SVG uploads, syncs, gets a Cloudinary attachment URL, and the front end serves it as image/svg+xml with its content intact. - An SVG with an inline diff --git a/tests/e2e/fixtures/svg-valid.svg b/tests/e2e/fixtures/svg-valid.svg new file mode 100644 index 000000000..328da1aa7 --- /dev/null +++ b/tests/e2e/fixtures/svg-valid.svg @@ -0,0 +1,2 @@ + + From d11f82b31837b71d6d8b32ef4577dc68a47b6196 Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Tue, 13 Oct 2026 15:24:46 +0530 Subject: [PATCH 25/80] test(e2e): Pin image format and quality in SVG spec The analytics specs flip image_format to webp and image_quality to 80 and leave them changed. With a fixed global format, the first render after sync delivers an SVG as f_webp without fl_sanitize, because Media::get_cloudinary_id() replaces the extension with the global format. CI ran the analytics specs first, so both SVG tests got image/webp. Pin both settings to auto for the spec and restore the previous values afterwards. --- tests/e2e/cloudinary-svg-delivery.spec.js | 60 +++++++++++++++++------ 1 file changed, 44 insertions(+), 16 deletions(-) diff --git a/tests/e2e/cloudinary-svg-delivery.spec.js b/tests/e2e/cloudinary-svg-delivery.spec.js index f99dda704..7d86990ef 100644 --- a/tests/e2e/cloudinary-svg-delivery.spec.js +++ b/tests/e2e/cloudinary-svg-delivery.spec.js @@ -15,8 +15,27 @@ const { wpCli, wpEvalFile } = require( './utils/wizard' ); const VALID_FIXTURE = path.join( __dirname, 'fixtures', 'svg-valid.svg' ); const UNSAFE_FIXTURE = path.join( __dirname, 'fixtures', 'svg-unsafe.svg' ); +/** + * Settings the spec depends on. + * + * `image_format` and `image_quality` are pinned because the analytics specs + * flip them and leave them changed. With a fixed global format such as + * `webp`, the first render after sync delivers the SVG as `f_webp` without + * `fl_sanitize`, because `Media::get_cloudinary_id()` swaps the extension + * for the global format. + * + * @type {Record} + */ +const SETTINGS = { + svg_support: 'on', + image_format: 'auto', + image_quality: 'auto', +}; + let cloudName; -let previousSvgSupport; + +/** @type {Record|null} */ +let previousSettings = null; /** * Attachments and posts created by the current test, removed in afterEach. @@ -26,21 +45,29 @@ let previousSvgSupport; let createdIds = []; /** - * Read or write the plugin's `svg_support` setting. + * Save plugin settings and return their previous values. * - * Goes through the settings API rather than `wp option patch` so the value - * lands in the same place the settings screen saves it. + * Goes through the settings API rather than `wp option patch` so the values + * land in the same place the settings screen saves them. * - * @param {string} [value] `on` or `off`. Omit to only read. - * @return {string} The value before the write. + * @param {Record} values Setting slug to value. + * @return {Record} Setting slug to the value before the write. */ -function svgSupport( value ) { - const write = value ? `$setting->save_value( '${ value }' );` : ''; - return wpEvalFile( ` - $setting = get_plugin_instance()->settings->get_setting( 'svg_support' ); - echo $setting->get_value(); - ${ write } - ` ); +function saveSettings( values ) { + return JSON.parse( + wpEvalFile( ` + $settings = get_plugin_instance()->settings; + $previous = array(); + foreach ( json_decode( '${ JSON.stringify( + values + ) }', true ) as $slug => $value ) { + $setting = $settings->get_setting( $slug ); + $previous[ $slug ] = $setting->get_value(); + $setting->save_value( $value ); + } + echo wp_json_encode( $previous ); + ` ) + ); } /** @@ -169,12 +196,13 @@ test.describe( 'Cloudinary SVG upload and delivery', { tag: '@serial' }, () => { // SVG support is off by default. Without it WordPress rejects the // upload and the plugin does not sync or sanitize SVGs. - previousSvgSupport = svgSupport( 'on' ); + previousSettings = saveSettings( SETTINGS ); } ); test.afterAll( () => { - if ( previousSvgSupport ) { - svgSupport( previousSvgSupport ); + if ( previousSettings ) { + saveSettings( previousSettings ); + previousSettings = null; } } ); From ab8b3bf05efebab18eb3f04980121e4f224f322e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Oct 2026 01:02:49 +0000 Subject: [PATCH 26/80] chore(deps-dev): bump cssnano from 9.1.2 to 9.8.0 Bumps [cssnano](https://github.com/cssnano/cssnano) from 9.1.2 to 9.8.0. - [Release notes](https://github.com/cssnano/cssnano/releases) - [Commits](https://github.com/cssnano/cssnano/compare/cssnano@9.1.2...cssnano@9.8.0) --- updated-dependencies: - dependency-name: cssnano dependency-version: 9.8.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 609 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 300 insertions(+), 311 deletions(-) diff --git a/package-lock.json b/package-lock.json index ba0d88faf..14cc7d84b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "css-loader": "^7.1.5", "css-minimizer-webpack-plugin": "^8.0.0", "css-unicode-loader": "^1.0.3", - "cssnano": "^9.1.2", + "cssnano": "^9.8.0", "dotenv": "^18.0.2", "eslint": "^10.12.0", "eslint-plugin-jest": "^29.16.6", @@ -2530,9 +2530,9 @@ } }, "node_modules/@colordx/core": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@colordx/core/-/core-7.2.0.tgz", - "integrity": "sha512-Y5PPwWCWVP59qj2EMVSgD9QMXtMSwt9DseqKvRWOXefM7sRu4EjCRuXQXMaanUH32R8c89OCWJJWZe6jA1dvTg==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/@colordx/core/-/core-7.3.0.tgz", + "integrity": "sha512-LVzTTPhX7wpy7TkGjouA9zbbCBIw92RGm7ZQqSKFE0oYE3sMx2FGXz90eVpgw7k/+wrrY+qJ86nHXifZWMS5jA==", "dev": true, "license": "MIT" }, @@ -15137,13 +15137,13 @@ } }, "node_modules/cssnano": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-9.1.2.tgz", - "integrity": "sha512-UJnrkOxzaK21cYEbxnp21vUohm/wg8B8R0eoLe7A6Jnm9nHeIQ0irn3L9HYzml9BFkrF97JwE7d6HV4UU6+1dQ==", + "version": "9.8.0", + "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-9.8.0.tgz", + "integrity": "sha512-sNgrmVv7rtwR3j6VwjlgoDPq52ptYAKbsBQBm3SR1rEAg0e1feS8N2OqkPp1ZKmyGkpNr80kerYNCCbdQXhDtg==", "dev": true, "license": "MIT", "dependencies": { - "cssnano-preset-default": "^9.1.2" + "cssnano-preset-default": "^9.8.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -15153,51 +15153,50 @@ "url": "https://opencollective.com/cssnano" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/cssnano-preset-default": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-9.1.2.tgz", - "integrity": "sha512-prjUo7JkR3JD74ODNuBwhz1c/DyQLtj1Te0VijEI7PCY8So+Y1KYk84tQAP2F74Rmb9NUPzQjUCmLrn5MbjctA==", - "dev": true, - "license": "MIT", - "dependencies": { - "browserslist": "^4.29.2", - "cssnano-utils": "^8.0.1", - "postcss-calc": "^11.2.1", - "postcss-colormin": "^9.0.5", - "postcss-convert-values": "^9.0.6", - "postcss-discard-comments": "^9.0.5", - "postcss-discard-duplicates": "^9.0.4", - "postcss-discard-empty": "^9.0.5", - "postcss-discard-overridden": "^9.0.5", - "postcss-merge-longhand": "^9.1.1", - "postcss-merge-rules": "^9.0.6", - "postcss-minify-font-values": "^9.0.5", - "postcss-minify-gradients": "^9.0.5", - "postcss-minify-params": "^9.0.5", - "postcss-minify-selectors": "^9.0.5", - "postcss-normalize-charset": "^9.0.5", - "postcss-normalize-display-values": "^9.0.5", - "postcss-normalize-positions": "^9.0.5", - "postcss-normalize-repeat-style": "^9.0.5", - "postcss-normalize-string": "^9.0.4", - "postcss-normalize-timing-functions": "^9.0.5", - "postcss-normalize-unicode": "^9.0.4", - "postcss-normalize-url": "^9.0.5", - "postcss-normalize-whitespace": "^9.0.5", - "postcss-ordered-values": "^9.0.5", - "postcss-reduce-initial": "^9.0.5", - "postcss-reduce-transforms": "^9.0.4", - "postcss-svgo": "^9.0.4", - "postcss-unique-selectors": "^9.0.5" + "version": "9.8.0", + "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-9.8.0.tgz", + "integrity": "sha512-BIZvo83PsVGlCErJrFOVTTYgESKzPP3NnQwXVGwYQT6YfGnVHC3TKyVKSSyaAZPmu8pvDco58+5nnDfVniz86g==", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.29.3", + "cssnano-utils": "^9.0.0", + "postcss-calc": "^11.2.2", + "postcss-colormin": "^9.0.8", + "postcss-convert-values": "^9.1.0", + "postcss-discard-comments": "^9.0.8", + "postcss-discard-duplicates": "^9.0.7", + "postcss-discard-empty": "^9.0.8", + "postcss-discard-overridden": "^9.0.6", + "postcss-merge-longhand": "^9.4.0", + "postcss-merge-rules": "^9.1.5", + "postcss-minify-font-values": "^9.0.9", + "postcss-minify-gradients": "^9.0.8", + "postcss-minify-params": "^9.1.0", + "postcss-minify-selectors": "^9.0.8", + "postcss-normalize-charset": "^9.0.6", + "postcss-normalize-display-values": "^9.0.7", + "postcss-normalize-positions": "^9.0.8", + "postcss-normalize-repeat-style": "^9.0.7", + "postcss-normalize-string": "^9.0.7", + "postcss-normalize-timing-functions": "^9.0.7", + "postcss-normalize-unicode": "^9.1.1", + "postcss-normalize-url": "^10.0.0", + "postcss-normalize-whitespace": "^9.0.8", + "postcss-ordered-values": "^9.0.9", + "postcss-reduce-initial": "^9.0.7", + "postcss-reduce-transforms": "^9.0.6", + "postcss-unique-selectors": "^9.0.6" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/cssnano-preset-default/node_modules/browserslist": { @@ -15235,9 +15234,9 @@ } }, "node_modules/cssnano-preset-default/node_modules/update-browserslist-db": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", - "integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", "dev": true, "funding": [ { @@ -15266,9 +15265,9 @@ } }, "node_modules/cssnano-utils": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-8.0.1.tgz", - "integrity": "sha512-KF2NfGI/na0wEemV8X7KQbisJS0QY77vaGCJ/3RuXfWrgg/qlq8vHcfSAtzrCrOHwaGHW02Ra1anDyuQ7M520A==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-9.0.0.tgz", + "integrity": "sha512-HIdFG2S06bygEl6+bZYPvA0/UyoYseXR/RpcvvwyE2NxWBbkZ70y9uRnvFwlQ4ztSlIeBqQBcwOMQG6DVrRHuA==", "dev": true, "license": "MIT", "dependencies": { @@ -15278,7 +15277,7 @@ "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/csso": { @@ -23278,9 +23277,9 @@ "license": "MIT" }, "node_modules/nanoid": { - "version": "3.3.18", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz", - "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==", + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", "dev": true, "funding": [ { @@ -25114,9 +25113,9 @@ } }, "node_modules/postcss": { - "version": "8.5.28", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.28.tgz", - "integrity": "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==", + "version": "8.5.30", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.30.tgz", + "integrity": "sha512-zkd+e9S1AQHhmaBKye9zlFHWjOwVgqXl1q3ECYy8561K7qxR2cREf/STLskulBFd78k6AOFeA+ff1TtEzk9bAA==", "dev": true, "funding": [ { @@ -25134,18 +25133,18 @@ ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.18", + "nanoid": "^3.3.20", "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" + "source-map-js": "^1.2.2" }, "engines": { "node": "^10 || ^12 || >=14" } }, "node_modules/postcss-calc": { - "version": "11.2.2", - "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-11.2.2.tgz", - "integrity": "sha512-wSquceGIY20fnsXcdIYtzW0r34aoXlT6iDYpYKpgR5Ax/KCZMDteE54Z+4Ee24ryYkjnRU5F3cxvhRfNp6t5VA==", + "version": "11.2.3", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-11.2.3.tgz", + "integrity": "sha512-pFW3MR2a4W7uHcSGUiyQGGXZWHon83ljbNwnUJ1mRKublWQbv+3o9NiqhlV4TJfNby+U+zLY2OgiywzhA5eFqw==", "dev": true, "license": "MIT", "dependencies": { @@ -25155,27 +25154,27 @@ "node": "^22.22.3 || ^24.15 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-colormin": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-9.0.5.tgz", - "integrity": "sha512-eCi5AbyJdGf5b66FP5Nlu86zCQuuCBqNxGWDnNjP2rj5JLuNUwWE9nQT2KnhYFSVYFAiu2KQZToQzehnOJVZMw==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-9.0.8.tgz", + "integrity": "sha512-rQBcLCyI54KbpedRpCYMGoqY1IRGx/erQwh8+QjyeUCRM32sQYLAuZTJFh17VVEAV/4QuIl1RPzF3boCugHAiQ==", "dev": true, "license": "MIT", "dependencies": { - "@colordx/core": "^7.2.0", + "@colordx/core": "^7.3.0", "@csstools/css-tokenizer": "^4.0.2", - "browserslist": "^4.29.2", + "browserslist": "^4.29.3", "caniuse-api": "^4.0.0", - "cssnano-utils": "^8.0.1" + "cssnano-utils": "^9.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-colormin/node_modules/browserslist": { @@ -25224,9 +25223,9 @@ } }, "node_modules/postcss-colormin/node_modules/update-browserslist-db": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", - "integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", "dev": true, "funding": [ { @@ -25255,20 +25254,20 @@ } }, "node_modules/postcss-convert-values": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-9.0.6.tgz", - "integrity": "sha512-t9iiO2g2+qTJfL5le9iu1gjX6CfeUkMZYfCOIMDvNQi/aHffEYVNP7+zZ+dBdc/PFo4zzYfzjVkw7/qb5ATGXw==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-9.1.0.tgz", + "integrity": "sha512-dI9//PzLr93HjLBtrsam6sYItqQvwBvt+DWNgIw4yyRJKnAo63jF8Sfy7d03DyuY7UHkEtGHKVrsI4SyxsmGpQ==", "dev": true, "license": "MIT", "dependencies": { - "browserslist": "^4.29.2", - "cssnano-utils": "^8.0.1" + "browserslist": "^4.29.3", + "cssnano-utils": "^9.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-convert-values/node_modules/browserslist": { @@ -25306,9 +25305,9 @@ } }, "node_modules/postcss-convert-values/node_modules/update-browserslist-db": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", - "integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", "dev": true, "funding": [ { @@ -25337,59 +25336,65 @@ } }, "node_modules/postcss-discard-comments": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-9.0.5.tgz", - "integrity": "sha512-uoQqHq5CG9hK0DXXYxp5tukpEWxGjMW0V17xVmHXr31inR0/0oQLiXrWWmBu3wAZioQMuIrhWMf4uWsQUPXtKw==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-9.0.8.tgz", + "integrity": "sha512-YaHPbph+EYK2TXx1UieOtLKpBecoQE+wQmrlz6ob+OWaRwabniUJ1ugkTvHxX43inPsd1iEeJ2qxLaHJFte84Q==", "dev": true, "license": "MIT", "dependencies": { "@csstools/css-tokenizer": "^4.0.2", - "cssnano-utils": "^8.0.1" + "cssnano-utils": "^9.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-discard-duplicates": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-9.0.4.tgz", - "integrity": "sha512-6YtdksJWzWhciQyDwDJDd0He+ha8pOirA8pnpTU33ovXHBdjvYLUgOn9d8ajLY4sA2wYLmcs59PEiTLLwnw97A==", + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-9.0.7.tgz", + "integrity": "sha512-rbsx1SvhBzCetQDbHVNfQrf0mG83Cyz5SPChQT2kPiXO32hWKPFtd00sy+j1NPPQJOGIVp1VHEgI55tGeqc3Kw==", "dev": true, "license": "MIT", + "dependencies": { + "cssnano-utils": "^9.0.0" + }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-discard-empty": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-9.0.5.tgz", - "integrity": "sha512-XDfk8xuYDbdEsfKqqISbxLOJaF9d5vZR5xr+ZdqJcjwSu19C8gZSDMe30hgtYq9+4MrAA0ctUSCN4lkhUcpjjA==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-9.0.8.tgz", + "integrity": "sha512-hCGjUuCd/IxKRyVl/uaJOLJTeACXo4GkS+0kRTvO8bBs0OxrGJWhxRaRPKXCdftCI+At0aAlosIgS0yjWNubuQ==", "dev": true, "license": "MIT", + "dependencies": { + "cssnano-utils": "^9.0.0" + }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-discard-overridden": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-9.0.5.tgz", - "integrity": "sha512-R/pSAgkbHOdPi8op7b5IyeY8Z0hJ1yemvRpNP2dh41Lm2ldjA1N1lXBdopj7vbzLzzhXLNPnQTolV+vUJ3HGVA==", + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-9.0.6.tgz", + "integrity": "sha512-9wT4dst0GdTpi3QWh/UP6ft1UiRhqNCfCKvyB4THpYzsHdpF7r2QduDBdeNUlVsgqaQhvzs+r43z3ZVZFequzQ==", "dev": true, "license": "MIT", "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-import": { @@ -25477,39 +25482,107 @@ "license": "MIT" }, "node_modules/postcss-merge-longhand": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-9.1.1.tgz", - "integrity": "sha512-qJ8JUmOujkHVEs7I8QDkLiS2DDM7ThY+FiZIlUPzfzP13SW+R3cXqwhzhIdYsD92G78doIa/TWKkBQtDDAR0sA==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-9.4.0.tgz", + "integrity": "sha512-FZqaPk9Frs6Ecxpeeb303N8DGAeYF3TpLG01mYQ1ws9FVVisQJqqHomoEmXvaEyrNyANZaHCAR5ShA1r/chM1Q==", "dev": true, "license": "MIT", "dependencies": { - "cssnano-utils": "^8.0.1", - "stylehacks": "^9.0.6" + "@csstools/css-tokenizer": "^4.0.2", + "browserslist": "^4.29.3", + "cssnano-utils": "^9.0.0", + "stylehacks": "^9.0.8" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" + } + }, + "node_modules/postcss-merge-longhand/node_modules/browserslist": { + "version": "4.29.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", + "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.11.26", + "caniuse-lite": "^1.0.30001813", + "electron-to-chromium": "^1.5.439", + "node-releases": "^2.0.57", + "update-browserslist-db": "^1.3.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/postcss-merge-longhand/node_modules/update-browserslist-db": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" } }, "node_modules/postcss-merge-rules": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-9.0.6.tgz", - "integrity": "sha512-SZd5UzGIIk5b1MAOLyo+pYoecyieaM1aMLzrVHGac0z4FTE05OwSfpmMKrPB82CcQJyJ0LnZVvZRZi3IjTRg4w==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-9.1.5.tgz", + "integrity": "sha512-URhX03eaZ1lwYS+A573lNCsioCd6kNUkJUYXSq30uYDmRKSI+3FfR3a4c0lNqmYkgBPFzI8bY94QPdoQh5zNeA==", "dev": true, "license": "MIT", "dependencies": { "@csstools/css-tokenizer": "^4.0.2", - "browserslist": "^4.29.2", + "browserslist": "^4.29.3", "caniuse-api": "^4.0.0", - "cssnano-utils": "^8.0.1" + "cssnano-utils": "^9.0.0", + "postcss-minify-selectors": "^9.0.8" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-merge-rules/node_modules/browserslist": { @@ -25558,9 +25631,9 @@ } }, "node_modules/postcss-merge-rules/node_modules/update-browserslist-db": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", - "integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", "dev": true, "funding": [ { @@ -25589,55 +25662,55 @@ } }, "node_modules/postcss-minify-font-values": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-9.0.5.tgz", - "integrity": "sha512-k1kU28FSV53d3vIfvbReTUral72EG3Nm+nJFfmziF2jis5KSytUb/A0MCX2UHrWAuIIY1EH5QFgbRf2OU0/E6g==", + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-9.0.9.tgz", + "integrity": "sha512-eJkOtHU/zZWJJ7c1MWgalpACGV0sERvtowpWDrgr9Ys0seX5vFBx9pWLOrN8eYO2TIOfMvatMhvgtGKtre1gsg==", "dev": true, "license": "MIT", "dependencies": { "@csstools/css-tokenizer": "^4.0.2", - "cssnano-utils": "^8.0.1" + "cssnano-utils": "^9.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-minify-gradients": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-9.0.5.tgz", - "integrity": "sha512-+CNxG/V/hCoi759Pg4TWnW5znjNlRyKMOhAlGhyb5JKuUy7r98v3PACq2Ium721flVMJkcsM3QNl3hWBrqYlpw==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-9.0.8.tgz", + "integrity": "sha512-3xGO5lvhSz5m60ElGvU8HJYt0XmYpFkJ+HDK8CYoRvwdmQIjhurClan2z4lDEVkYpeKfrc5dNWIYKie01xhpng==", "dev": true, "license": "MIT", "dependencies": { - "@colordx/core": "^7.2.0", + "@colordx/core": "^7.3.0", "@csstools/css-tokenizer": "^4.0.2", - "cssnano-utils": "^8.0.1" + "cssnano-utils": "^9.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-minify-params": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-9.0.5.tgz", - "integrity": "sha512-itOFlj0KlaGtvlLZNwJEuCKGXJmc4SduXBDbQlFepMkGHshpc1Hu18YOZ1aego1dmpKn12jpKDhfbRhFRrz8+w==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-9.1.0.tgz", + "integrity": "sha512-czaf0nUl7mKq1cpMUZ29rQ/2p5zE4TvszK+OkaaaiWuzLhyeaT9qvxxEgO2aNog8eQxCKD1oV6dX6NroAaOAaw==", "dev": true, "license": "MIT", "dependencies": { - "browserslist": "^4.29.2", - "cssnano-utils": "^8.0.1" + "browserslist": "^4.29.3", + "cssnano-utils": "^9.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-minify-params/node_modules/browserslist": { @@ -25675,9 +25748,9 @@ } }, "node_modules/postcss-minify-params/node_modules/update-browserslist-db": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", - "integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", "dev": true, "funding": [ { @@ -25706,22 +25779,21 @@ } }, "node_modules/postcss-minify-selectors": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-9.0.5.tgz", - "integrity": "sha512-hdoDNFQIIDFMZ12huhigCELA6Jcig5WrnUYmcT2srqM+r+CTKxaH6CFZB7wwuqLrVYgqh1sLB5iE99UyriCB2A==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-9.0.8.tgz", + "integrity": "sha512-qMeQvr3ODymnvoDSwml4uTWufma0T2FhRxce4htQ+45otzsm1QyNAg98DXGrawVpGooU2vElaBd8qI+YCwF0UQ==", "dev": true, "license": "MIT", "dependencies": { - "browserslist": "^4.29.1", + "browserslist": "^4.29.3", "caniuse-api": "^4.0.0", - "cssesc": "^3.0.0", - "cssnano-utils": "^8.0.0" + "cssnano-utils": "^9.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-minify-selectors/node_modules/browserslist": { @@ -25770,9 +25842,9 @@ } }, "node_modules/postcss-minify-selectors/node_modules/update-browserslist-db": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", - "integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", "dev": true, "funding": [ { @@ -25892,116 +25964,117 @@ } }, "node_modules/postcss-normalize-charset": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-9.0.5.tgz", - "integrity": "sha512-mmbQmD9mlz3pTo+r4KdwcfD23cNksQo7aYNa4lfL4Bsj0XkL+rtcbNOY7Oo+U82DP1syYXCyF1PRc32gb36MqA==", + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-9.0.6.tgz", + "integrity": "sha512-H336j3ofJ5nM6TLW1nbKHj3zIMtGkycfS0KetU1cmcTtTwQ0f9CvdLVZUmBja6+IO3xuqMogjkYtB91K2slshQ==", "dev": true, "license": "MIT", "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-normalize-display-values": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-9.0.5.tgz", - "integrity": "sha512-V5tOZuYQtOpYNjoSjciDckB8Ry+s2NcHqVHloYe5Xh/6OA2Z3kVymAck3zipZ1uLBdMvg7BUvxoDIcH6dJCPug==", + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-9.0.7.tgz", + "integrity": "sha512-M9eGIjAdIjuO6t4HqQJBOjbC+rI+9hF/srxppXa7xAY7EpCwdYVepq8PEAad1pb8EfEWoSCGpK9++nCcw5rl+w==", "dev": true, "license": "MIT", "dependencies": { "@csstools/css-tokenizer": "^4.0.2", - "cssnano-utils": "^8.0.1" + "cssnano-utils": "^9.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-normalize-positions": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-9.0.5.tgz", - "integrity": "sha512-DZtXMQFhVlldnP3WhVIzjcT7x0jsy17UYuGXfdT31gggI6JISREGBhgOl/sadVTASyS6w+6ZVGuvDdrnplU0MA==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-9.0.8.tgz", + "integrity": "sha512-LymeX5GrQjS2N6xyBUpKsVMX+DSufYr1OSJYmM3iWVYre0zeBkKiaWNNqLeiJZMcdHgfcRw0HsLnhh7mNhO60A==", "dev": true, "license": "MIT", "dependencies": { - "cssnano-utils": "^8.0.1" + "cssnano-utils": "^9.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-normalize-repeat-style": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-9.0.5.tgz", - "integrity": "sha512-1QZ9ZdyWb4TRDCXIg8iqeACo6BWKjxtfeMgMSy6ORqX21gKN4lYYQqZpxPdILpvbLaEfXGVd0ptMCiKbxCObjA==", + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-9.0.7.tgz", + "integrity": "sha512-13iZyi8hUtMEUO3vSQVOH20ByhT8zzEx/2cmONY/tcfZYnMwgPGxn+p5OvJZTbmxhUDqSFsIWpBVBIEA5fJeYQ==", "dev": true, "license": "MIT", "dependencies": { - "cssnano-utils": "^8.0.1" + "cssnano-utils": "^9.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-normalize-string": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-9.0.4.tgz", - "integrity": "sha512-neA1Diz0cNPr6RXKFUWZCX+bowHx1CG4LWgB+MoVcRT4JZXwhyA+B5E8/yE2yoLcSxk1MpXhZ0rsTnRPjUyVAw==", + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-9.0.7.tgz", + "integrity": "sha512-1XZyPwvQpoYewPpveU70LjTA/L17vxECuHnSf4Fg3lRgTzFza9Nxbk1lztTQ41+6PlNKxB2lXX/HGRX5QCbLQg==", "dev": true, "license": "MIT", "dependencies": { - "@csstools/css-tokenizer": "^4.0.2" + "@csstools/css-tokenizer": "^4.0.2", + "cssnano-utils": "^9.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-normalize-timing-functions": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-9.0.5.tgz", - "integrity": "sha512-uw5Y1xNsnh1Z8XB1I4Sx6/T7GKfdBTpX7X7ywDibb35IIYjJLf68qjBRDl59ETYrWkoGxZXIYU74RcO6cAjjmw==", + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-9.0.7.tgz", + "integrity": "sha512-fWFD289YZXKgIsi28EjT5FuM2NMkEp/5zj1uZZJj/OCXTXun3KFVn2/cbU9iSfgmEbNlJ+uxyFw6GW2aQybKgw==", "dev": true, "license": "MIT", "dependencies": { "@csstools/css-tokenizer": "^4.0.2", - "cssnano-utils": "^8.0.1" + "cssnano-utils": "^9.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-normalize-unicode": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-9.0.4.tgz", - "integrity": "sha512-7vXJt1nvvxv+tl8iSTpt13nBZF0eYP0gYu8C2C2UbfNFOSngcMCVAY3Bc0wXpnH3IeT+DRQNTBKY6upXzekKig==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-9.1.1.tgz", + "integrity": "sha512-DRS7ywJHmYDvxWoMc5ran1Yc18tbnvx5g3o8rX6N1JFGrwdlsOcRZ8NyGx35/y+GxgjdpWEBXdnSGmoF7mK4mQ==", "dev": true, "license": "MIT", "dependencies": { "@csstools/css-tokenizer": "^4.0.2", - "browserslist": "^4.29.1", - "cssnano-utils": "^8.0.0" + "browserslist": "^4.29.3", + "cssnano-utils": "^9.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-normalize-unicode/node_modules/browserslist": { @@ -26039,9 +26112,9 @@ } }, "node_modules/postcss-normalize-unicode/node_modules/update-browserslist-db": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", - "integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", "dev": true, "funding": [ { @@ -26070,53 +26143,53 @@ } }, "node_modules/postcss-normalize-url": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-9.0.5.tgz", - "integrity": "sha512-iGf8SEx4Abu9XqmubHU7Prl7dWT0gk+VethwzfY40Zo9y3VItrz8QSDFMCxQmWpphXiU0jGq5K4uoiSi2ySnNw==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-10.0.0.tgz", + "integrity": "sha512-AJmPYk7SofTPfeOWvU9AUxKWDWAB0G7vdP9tbn5dXaWBwbqr5x/dmHvbXeWNDF9pqJdq51afuz4cod/a9/ogdw==", "dev": true, "license": "MIT", "dependencies": { "@csstools/css-tokenizer": "^4.0.2", - "cssnano-utils": "^8.0.1" + "cssnano-utils": "^9.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-normalize-whitespace": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-9.0.5.tgz", - "integrity": "sha512-vaDslAUVqguYgC2jMb90Rc+N904rPx4XtYIWhaI/8m6OYx7+EOgsQmTLOGB4WjDAIMOgdBVTQqub8dQSoSVyww==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-9.0.8.tgz", + "integrity": "sha512-YhqcSyZX6fVIM6sZFf/nd3ZOEEclNZmLSgork6NgetpnQK0QOCyIuT/h3nVja+up5hXCVffl6VcGVqSL8kS4OA==", "dev": true, "license": "MIT", "dependencies": { "@csstools/css-tokenizer": "^4.0.2", - "cssnano-utils": "^8.0.1" + "cssnano-utils": "^9.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-ordered-values": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-9.0.5.tgz", - "integrity": "sha512-FyN27f9bXqAQ+U/1ckWMBq1uPKk/J5C3gTuAP52EbV/ZedyXO2uF7RroclFz3jyTSAGPrXIaQKERQCLVl6uL7g==", + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-9.0.9.tgz", + "integrity": "sha512-bEeFjrZITn6H81YjFgctaoY5XPXEQeS5NOwMroB47CocSfgnbpc9wH2QzNLXxnhcfEdsGCkTAi8kATYY/EkyTw==", "dev": true, "license": "MIT", "dependencies": { - "cssnano-utils": "^8.0.1" + "cssnano-utils": "^9.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-prefix-selector": { @@ -26130,20 +26203,20 @@ } }, "node_modules/postcss-reduce-initial": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-9.0.5.tgz", - "integrity": "sha512-GRH7thwmYiHh9b96usDIDUX1zdVa4Pq8Q2gCMcfEfG1R5oxEdUdsRseuvnOaTs8SjanMn/uIjIXTm6sbHoFTEA==", + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-9.0.7.tgz", + "integrity": "sha512-5mnNVdVCf7tI1j2uYtiopoLZ6Dm+M7y4Fz32STAtTEZa7LbOf44zYBYduwd952xXshTJkRHpT2Q2UmK+XLo5ew==", "dev": true, "license": "MIT", "dependencies": { - "browserslist": "^4.29.2", + "browserslist": "^4.29.3", "caniuse-api": "^4.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-reduce-initial/node_modules/browserslist": { @@ -26192,9 +26265,9 @@ } }, "node_modules/postcss-reduce-initial/node_modules/update-browserslist-db": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", - "integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", "dev": true, "funding": [ { @@ -26223,19 +26296,19 @@ } }, "node_modules/postcss-reduce-transforms": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-9.0.4.tgz", - "integrity": "sha512-hRzepc/cwIs1cCdIghQatRDFlxc7qQieXzkyCfyVl8KPTPhOZyOtdPp9Qt90fMbqWry6YdMQu/YfScxh47sTYg==", + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-9.0.6.tgz", + "integrity": "sha512-xW/3eNKeL9vVXNMiJdI7ythFkC4CGDq04ziTN0/oJwJXIKeJCenLbM9IXU5ton/iNrwtqzZphERdtad4auQ9wQ==", "dev": true, "license": "MIT", "dependencies": { - "cssnano-utils": "^8.0.0" + "cssnano-utils": "^9.0.0" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-resolve-nested-selector": { @@ -26313,94 +26386,10 @@ "node": ">=4" } }, - "node_modules/postcss-svgo": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-9.0.4.tgz", - "integrity": "sha512-0QGF1sORc244E+DNJxEzQDK/zK24VO0CMzAMOwOW+cQ90Y65mVDR2yrSxp4/f+XcdxmAf5LPm22zlnhVUTbtAA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@csstools/css-tokenizer": "^4.0.2", - "cssnano-utils": "^8.0.0", - "svgo": "^4.1.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.28" - } - }, - "node_modules/postcss-svgo/node_modules/commander": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", - "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=16" - } - }, - "node_modules/postcss-svgo/node_modules/css-select": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-6.0.0.tgz", - "integrity": "sha512-rZZVSLle8v0+EY8QAkDWrKhpgt6SA5OtHsgBnsj6ZaLb5dmDVOWUDtQitd9ydxxvEjhewNudS6eTVU7uOyzvXw==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^7.0.0", - "domhandler": "^5.0.3", - "domutils": "^3.2.2", - "nth-check": "^2.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/postcss-svgo/node_modules/css-what": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-7.0.0.tgz", - "integrity": "sha512-wD5oz5xibMOPHzy13CyGmogB3phdvcDaB5t0W/Nr5Z2O/agcB8YwOz6e2Lsp10pNDzBoDO9nVa3RGs/2BttpHQ==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">= 6" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/postcss-svgo/node_modules/svgo": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-4.1.0.tgz", - "integrity": "sha512-bkxnTg1kSU0guhIBmibA6UUhrQmPVA1XsQLN+ylCd+UWzbnLkySOcXpyk1mrl05f+pcaCx2eHb+sp6BgMZWX+Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "commander": "^11.1.0", - "css-select": "^6.0.0", - "css-tree": "^3.0.1", - "css-what": "^7.0.0", - "csso": "^5.0.5", - "picocolors": "^1.1.1", - "sax": "1.6.1" - }, - "bin": { - "svgo": "bin/svgo.js" - }, - "engines": { - "node": ">=16" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/svgo" - } - }, "node_modules/postcss-unique-selectors": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-9.0.5.tgz", - "integrity": "sha512-1otppE5FwWqmIM1jqBpeAdA0GSP9wwzRCRsbz7EtbSNunh3bJ9PPRuYYzByvqnz7L351ZA2fDHC0CcouYoPWfA==", + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-9.0.6.tgz", + "integrity": "sha512-mhXCmLZbqDtzM2JbtjGP36555/aob2fbOXSW8cP0SiNtssVSKB8aG7EbiAhVZKV/toJLqKJm1ayWArvzc5+huA==", "dev": true, "license": "MIT", "dependencies": { @@ -26410,7 +26399,7 @@ "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/postcss-urlrebase": { @@ -28807,9 +28796,9 @@ } }, "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -29393,20 +29382,20 @@ "license": "ISC" }, "node_modules/stylehacks": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-9.0.6.tgz", - "integrity": "sha512-LvntDgw9Eevn1sBLVa9qCA5qnbfhxo1MXXNkLabgqcByn+RadD6hjJQyRur7H8Pa/KZpTVf/6NgP4/pvtg4IBw==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-9.0.8.tgz", + "integrity": "sha512-PIopN/yo+/Queh2lTvJLQuXJ5yrqxWk6fQTN10daJVjnEaqkM+i+IjQdc8Jzl2fnJ8Ngq1vb57vI0hoLkKs22w==", "dev": true, "license": "MIT", "dependencies": { "@csstools/css-tokenizer": "^4.0.2", - "browserslist": "^4.29.2" + "browserslist": "^4.29.3" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" }, "peerDependencies": { - "postcss": "^8.5.28" + "postcss": "^8.5.29" } }, "node_modules/stylehacks/node_modules/browserslist": { @@ -29444,9 +29433,9 @@ } }, "node_modules/stylehacks/node_modules/update-browserslist-db": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", - "integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", "dev": true, "funding": [ { diff --git a/package.json b/package.json index eb7616764..2647c988a 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "css-loader": "^7.1.5", "css-minimizer-webpack-plugin": "^8.0.0", "css-unicode-loader": "^1.0.3", - "cssnano": "^9.1.2", + "cssnano": "^9.8.0", "dotenv": "^18.0.2", "eslint": "^10.12.0", "eslint-plugin-jest": "^29.16.6", From 6ce0966bcac9f6cf4912640b38fee049788353ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Oct 2026 01:03:00 +0000 Subject: [PATCH 27/80] chore(deps-dev): bump eslint-plugin-jest from 29.16.6 to 29.17.0 Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 29.16.6 to 29.17.0. - [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases) - [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v29.16.6...v29.17.0) --- updated-dependencies: - dependency-name: eslint-plugin-jest dependency-version: 29.17.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index ba0d88faf..65099e906 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,7 +46,7 @@ "cssnano": "^9.1.2", "dotenv": "^18.0.2", "eslint": "^10.12.0", - "eslint-plugin-jest": "^29.16.6", + "eslint-plugin-jest": "^29.17.0", "eslint-plugin-react-hooks": "^7.0.1", "file-loader": "^6.2.0", "globals": "^17.13.0", @@ -16577,9 +16577,9 @@ } }, "node_modules/eslint-plugin-jest": { - "version": "29.16.6", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.16.6.tgz", - "integrity": "sha512-q8TVr0rlNvUD0XnafGWkwtPeX+tTl2llP86EDl3sJtwWrQA/JT9SIu2hLLZbhhX6fT5SDE4O0gIKyZUujKnkYA==", + "version": "29.17.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.17.0.tgz", + "integrity": "sha512-6jtpU6MhYKbagkES02TupWAUUooJpZtKg94Ax0b8HhUorv3InSTBU8RRtlSBe0LocOcShXOpyec3PHzPDkJCSg==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index eb7616764..525a051ea 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "cssnano": "^9.1.2", "dotenv": "^18.0.2", "eslint": "^10.12.0", - "eslint-plugin-jest": "^29.16.6", + "eslint-plugin-jest": "^29.17.0", "eslint-plugin-react-hooks": "^7.0.1", "file-loader": "^6.2.0", "globals": "^17.13.0", From ee30fcb8c4e5a9539f1998667d6c6d8a639d4715 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Oct 2026 01:03:26 +0000 Subject: [PATCH 28/80] chore(deps): bump human-format from 1.2.1 to 1.4.0 Bumps [human-format](https://github.com/JsCommunity/human-format) from 1.2.1 to 1.4.0. - [Changelog](https://github.com/JsCommunity/human-format/blob/master/CHANGELOG.md) - [Commits](https://github.com/JsCommunity/human-format/compare/v1.2.1...v1.4.0) --- updated-dependencies: - dependency-name: human-format dependency-version: 1.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index ba0d88faf..643dd8800 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "codemirror": "^6.0.2", "dot-object": "^2.1.4", "file-size": "^1.0.0", - "human-format": "^1.2.1", + "human-format": "^1.4.0", "loading-attribute-polyfill": "^2.1.1", "lodash": "^4.17.21", "progressbar.js": "^1.1.1", @@ -19219,9 +19219,9 @@ } }, "node_modules/human-format": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/human-format/-/human-format-1.2.1.tgz", - "integrity": "sha512-o5Ldz62VWR5lYUZ8aVQaLKiN37NsHnmk3xjMoUjza3mGkk8MvMofgZT0T6HKSCKSJIir+AWk9Dx8KhxvZAUgCg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/human-format/-/human-format-1.4.0.tgz", + "integrity": "sha512-c7nc9W5j1NsYwJJG5SUEwsZb5yvZNeHEdQspQTx3Q8uLvGYjS+7Oyoh/giaGd0aZN4kBIzGhlqmAvl4MEypJig==", "license": "ISC", "engines": { "node": ">=4" diff --git a/package.json b/package.json index eb7616764..998242c32 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "codemirror": "^6.0.2", "dot-object": "^2.1.4", "file-size": "^1.0.0", - "human-format": "^1.2.1", + "human-format": "^1.4.0", "loading-attribute-polyfill": "^2.1.1", "lodash": "^4.17.21", "progressbar.js": "^1.1.1", From 1c6551f8d2db493963b244b44c5f16b3956bcbaa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Oct 2026 01:04:42 +0000 Subject: [PATCH 29/80] chore(deps-dev): bump phpstan/phpstan from 2.2.17 to 2.3.1 Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan-phar-composer-source) from 2.2.17 to 2.3.1. - [Commits](https://github.com/phpstan/phpstan-phar-composer-source/commits) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-version: 2.3.1 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 822aea01c..e40bef3bf 100644 --- a/composer.lock +++ b/composer.lock @@ -992,11 +992,11 @@ }, { "name": "phpstan/phpstan", - "version": "2.2.17", + "version": "2.3.1", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e676a49fa70cee9f5bf6ff4796186b928a08673f", - "reference": "e676a49fa70cee9f5bf6ff4796186b928a08673f", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/6155239b488e95d26d1ebd95c6b4bb294d7f09db", + "reference": "6155239b488e95d26d1ebd95c6b4bb294d7f09db", "shasum": "" }, "require": { @@ -1052,7 +1052,7 @@ "type": "github" } ], - "time": "2026-10-04T19:40:09+00:00" + "time": "2026-10-08T21:09:11+00:00" }, { "name": "phpunit/php-code-coverage", From ca98e6459891eb667b8eaa5182e13bc5ad1c5450 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Oct 2026 01:04:46 +0000 Subject: [PATCH 30/80] chore(deps-dev): bump php-stubs/woocommerce-stubs from 11.1.2 to 11.2.0 Bumps [php-stubs/woocommerce-stubs](https://github.com/php-stubs/woocommerce-stubs) from 11.1.2 to 11.2.0. - [Commits](https://github.com/php-stubs/woocommerce-stubs/compare/v11.1.2...v11.2.0) --- updated-dependencies: - dependency-name: php-stubs/woocommerce-stubs dependency-version: 11.2.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 822aea01c..d0de6ce3e 100644 --- a/composer.lock +++ b/composer.lock @@ -464,16 +464,16 @@ }, { "name": "php-stubs/woocommerce-stubs", - "version": "v11.1.2", + "version": "v11.2.0", "source": { "type": "git", "url": "https://github.com/php-stubs/woocommerce-stubs.git", - "reference": "06dfedfe33a46a12db99fd343b80f1f2f11e64f6" + "reference": "fb590c1c2a26c47aa5da2c6c51a707130e8a389c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/06dfedfe33a46a12db99fd343b80f1f2f11e64f6", - "reference": "06dfedfe33a46a12db99fd343b80f1f2f11e64f6", + "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/fb590c1c2a26c47aa5da2c6c51a707130e8a389c", + "reference": "fb590c1c2a26c47aa5da2c6c51a707130e8a389c", "shasum": "" }, "require": { @@ -502,9 +502,9 @@ ], "support": { "issues": "https://github.com/php-stubs/woocommerce-stubs/issues", - "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v11.1.2" + "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v11.2.0" }, - "time": "2026-09-22T23:29:58+00:00" + "time": "2026-10-07T19:02:59+00:00" }, { "name": "php-stubs/wordpress-stubs", From 41a37424bf4f5ca1d59f7924efd40873f20d8b64 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Mon, 19 Oct 2026 12:36:26 +0200 Subject: [PATCH 31/80] fix(sync): address review feedback on thumbnail-size drift detection - Media::has_outdated_sizes() now checks that each registered size's file actually exists on disk, instead of comparing filename prefixes. A prefix check misflags valid WordPress states as broken -- e.g. editing with "all sizes except thumbnail" deliberately keeps the old thumbnail, and a size too small to regenerate from the edited image is legitimately left as-is. Both would have been wrongly overwritten. - Upload_Sync::regenerate_sizes() now preserves the rest of the attachment's metadata record instead of replacing it wholesale. wp_generate_attachment_metadata() writes its own metadata to the database as a side effect partway through execution, so "current" metadata must be captured before calling it, not after, or the capture already sees the clobbered record. Without this, keys like original_image (breaks wp_get_original_image_path()) and third-party plugin data were silently dropped. Reported in PR review (https://github.com/cloudinary/cloudinary_wordpress/pull/1314). --- php/class-media.php | 13 ++++++++----- php/sync/class-upload-sync.php | 15 ++++++++++++--- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/php/class-media.php b/php/class-media.php index 1064c15c2..b7e51dd15 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1694,12 +1694,17 @@ public function has_public_id( $attachment_id ) { } /** - * Check if an attachment's registered sizes reference filenames that no longer match the current attached file. + * Check if an attachment's registered sizes reference files that no longer exist on disk. * * This happens when an image is edited (e.g. cropped) via the WordPress image editor: the main file gets * renamed (an `-e{timestamp}` suffix is added), but the `sizes` metadata can be left pointing at the * pre-edit filenames, leaving no local file matching that size record. * + * This intentionally checks file existence rather than filename prefix: WordPress core has valid states + * where a size's filename legitimately keeps the pre-edit base (e.g. editing with "all sizes except + * thumbnail" deliberately preserves the thumbnail, or a size too small to regenerate from the edited + * image is left as-is). A prefix-only check would misflag those as broken and overwrite valid files. + * * @param int $attachment_id The Attachment ID. * * @return bool @@ -1710,12 +1715,10 @@ public function has_outdated_sizes( $attachment_id ) { return false; } - $base = wp_basename( $metadata['file'] ); - $ext = pathinfo( $base, PATHINFO_EXTENSION ); - $base = ! empty( $ext ) ? substr( $base, 0, - ( strlen( $ext ) + 1 ) ) : $base; + $dir = dirname( get_attached_file( $attachment_id ) ); foreach ( $metadata['sizes'] as $size ) { - if ( empty( $size['file'] ) || 0 !== strpos( $size['file'], $base . '-' ) ) { + if ( empty( $size['file'] ) || ! file_exists( path_join( $dir, $size['file'] ) ) ) { return true; } } diff --git a/php/sync/class-upload-sync.php b/php/sync/class-upload-sync.php index 2c81adfe5..440f58c9e 100644 --- a/php/sync/class-upload-sync.php +++ b/php/sync/class-upload-sync.php @@ -289,12 +289,21 @@ public function regenerate_sizes( $attachment_id ) { require_once ABSPATH . 'wp-admin/includes/image.php'; } - $file = get_attached_file( $attachment_id ); - $metadata = wp_generate_attachment_metadata( $attachment_id, $file ); - if ( empty( $metadata ) ) { + // Captured before wp_generate_attachment_metadata(), which writes its own (incomplete) metadata + // to the database as a side effect while it runs -- reading "current" metadata after that call + // would already return the clobbered record. + $metadata = wp_get_attachment_metadata( $attachment_id ); + + $file = get_attached_file( $attachment_id ); + $regenerated = wp_generate_attachment_metadata( $attachment_id, $file ); + if ( empty( $regenerated['sizes'] ) ) { return new \WP_Error( 'cloudinary_regenerate_sizes_failed', __( 'Could not regenerate attachment sizes.', 'cloudinary' ) ); } + // wp_generate_attachment_metadata() builds a fresh metadata array, so only merge in the + // regenerated sizes rather than overwriting the whole record -- other keys (e.g. original_image, + // third-party plugin data) must be preserved. + $metadata['sizes'] = $regenerated['sizes']; wp_update_attachment_metadata( $attachment_id, $metadata ); // Persist the new signature, otherwise this would re-trigger on every subsequent render. $this->sync->set_signature_item( $attachment_id, 'sizes' ); From d017a4846fe455768574df007fa01dd956c4bee3 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Mon, 19 Oct 2026 13:53:24 +0200 Subject: [PATCH 32/80] fix(sync): Break the sync loop that can overload a server (#1301) Two independent fixes for a scenario where an attachment's sync state stops advancing and the plugin ends up repeatedly reprocessing it, overloading the server with internal /cloudinary/v1/queue requests: 1. Sync::validate_sync_type() recurses into get_sync_type() after saving a signature. If that save doesn't stick, the recursion never terminates, pinning a PHP worker indefinitely. Add a bounded retry counter (filterable via cloudinary_sync_type_retry_limit) that flags a sync error once a type clearly isn't resolving, instead of recursing forever. 2. Push_Sync::process_assets() already had an outer loop guard for when the same sync type repeats in one pass, but it only broke the loop without flagging the attachment. That left it unsynced, unqueued and un-errored, so the next build_queue() run picked it straight back up, repeating the same stuck request. Flag a sync error there too, so build_queue()'s own `_cld_error NOT EXISTS` check excludes it afterwards. Root cause: Media::update_post_meta() / delete_post_meta() do a non-atomic read-modify-write of the whole `_cloudinary` meta blob. Two of these racing for the same attachment -- e.g. a bulk-sync thread and an autosync thread both reaching it, which the existing add_to_thread_queue() "steal" logic allows -- can silently lose one side's write entirely, with nothing logged. Reproduced locally with two concurrent writers and no filter needed. Harden both methods with a compare-and-swap retry (via update_post_meta()'s $prev_value arg), invalidating the primed post-meta cache between attempts so a retry actually sees a concurrent write instead of replaying a stale read. Covered by three new PHPUnit suites: the retry-limit circuit breaker, the outer loop guard flagging + excluding the attachment from the next queue build, and the meta race (on first creation, on an existing row, and for delete_post_meta()). --- php/class-media.php | 73 ++++++- php/class-sync.php | 37 ++++ php/sync/class-push-sync.php | 10 +- .../tests/test-media-concurrent-meta.php | 179 ++++++++++++++++++ .../tests/test-push-sync-outer-loop-guard.php | 152 +++++++++++++++ tests/phpunit/tests/test-sync-loop-guard.php | 169 +++++++++++++++++ 6 files changed, 611 insertions(+), 9 deletions(-) create mode 100644 tests/phpunit/tests/test-media-concurrent-meta.php create mode 100644 tests/phpunit/tests/test-push-sync-outer-loop-guard.php create mode 100644 tests/phpunit/tests/test-sync-loop-guard.php diff --git a/php/class-media.php b/php/class-media.php index cf4a3370b..03fcc4ac8 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -2787,15 +2787,50 @@ public function build_cached_meta( $post_id, $key, $single ) { */ public function update_post_meta( $post_id, $key, $data ) { - $meta = $this->get_post_meta( $post_id ); - if ( ! isset( $meta[ $key ] ) ) { - $meta[ $key ] = ''; - } - - if ( $meta[ $key ] !== $data ) { + // The `_cloudinary` meta is a single serialized array shared by every sync type, so + // this is a read-modify-write: fetch the whole thing, change one key, write the whole + // thing back. Two of these running concurrently for the same attachment (e.g. a + // bulk-sync thread and an autosync thread both reaching it, see GitHub issue #1301) can + // race -- whichever writes last overwrites the other's change outright, silently. Use + // WP's compare-and-swap (the $prev_value arg) to detect that and retry against the + // now-current value instead of clobbering it. + $max_attempts = 3; + for ( $attempt = 0; $attempt < $max_attempts; $attempt++ ) { + // WP primes and caches ALL of a post's meta on first access, so a plain re-read + // here would just replay this same process's first (possibly already stale) read on + // every retry, never seeing what a concurrent process wrote in the meantime. Drop it + // so each attempt re-queries the DB. + wp_cache_delete( $post_id, 'post_meta' ); + + $exists = metadata_exists( 'post', $post_id, Sync::META_KEYS['cloudinary'] ); + $meta = $this->get_post_meta( $post_id ); + if ( isset( $meta[ $key ] ) && $meta[ $key ] === $data ) { + return true; // Already set to this value, including by a racing write. + } + $prev = $meta; $meta[ $key ] = $data; + + if ( $exists ) { + $result = update_post_meta( $post_id, Sync::META_KEYS['cloudinary'], $meta, $prev ); + } else { + // No row yet: add it uniquely so a concurrent first write can't be silently + // dropped the way an unconditional update_post_meta() would allow. + $result = add_post_meta( $post_id, Sync::META_KEYS['cloudinary'], $meta, true ); + } + + if ( false !== $result ) { + return $result; + } + // Lost the race to a concurrent write; loop and retry against the new state. } + // Still contended after retries: write unconditionally rather than looping forever. + // This can still lose a concurrent change, but only after genuinely sustained + // contention, not on the first overlap. + wp_cache_delete( $post_id, 'post_meta' ); + $meta = $this->get_post_meta( $post_id ); + $meta[ $key ] = $data; + return update_post_meta( $post_id, Sync::META_KEYS['cloudinary'], $meta ); } @@ -2809,11 +2844,33 @@ public function update_post_meta( $post_id, $key, $data ) { */ public function delete_post_meta( $post_id, $key ) { - $meta = $this->get_post_meta( $post_id ); - if ( isset( $meta[ $key ] ) ) { + // Same shared-blob read-modify-write as update_post_meta() above, so apply the same + // compare-and-swap retry against concurrent writers. + $max_attempts = 3; + for ( $attempt = 0; $attempt < $max_attempts; $attempt++ ) { + // See the matching note in update_post_meta(): drop the cached meta so this + // actually re-reads the DB instead of replaying an earlier, possibly stale read. + wp_cache_delete( $post_id, 'post_meta' ); + + $meta = $this->get_post_meta( $post_id ); + if ( ! isset( $meta[ $key ] ) ) { + return true; // Already gone, including by a racing write. + } + $prev = $meta; unset( $meta[ $key ] ); + + $result = update_post_meta( $post_id, Sync::META_KEYS['cloudinary'], $meta, $prev ); + if ( false !== $result ) { + return $result; + } + // Lost the race to a concurrent write; loop and retry against the new state. } + // Still contended after retries: write unconditionally rather than looping forever. + wp_cache_delete( $post_id, 'post_meta' ); + $meta = $this->get_post_meta( $post_id ); + unset( $meta[ $key ] ); + return update_post_meta( $post_id, Sync::META_KEYS['cloudinary'], $meta ); } diff --git a/php/class-sync.php b/php/class-sync.php index 30e73015d..878736c98 100644 --- a/php/class-sync.php +++ b/php/class-sync.php @@ -905,6 +905,43 @@ function ( $item, $key ) use ( $required_signature ) { * @return string|null */ public function validate_sync_type( $type, $attachment_id ) { + // Both branches below save a signature and then re-check get_sync_type() for what's + // next. If that save doesn't stick -- e.g. a concurrent request overwrites it before + // it's read back, see GitHub issue #1301 -- get_sync_type() keeps handing back this + // same $type and this method recurses on it forever, pinning a PHP worker and hammering + // the DB. Count re-entries per attachment+type and bail out to a sync error once it's + // clearly not resolving, rather than let the recursion run unbounded. + static $attempts = array(); + $key = $attachment_id . ':' . $type; + $attempts[ $key ] = isset( $attempts[ $key ] ) ? $attempts[ $key ] + 1 : 1; + + /** + * Filter the number of times a single sync type may be re-validated for the same + * attachment within one request before it's treated as stuck in a loop. + * + * @hook cloudinary_sync_type_retry_limit + * + * @param int $limit The retry limit. Default 50. + * @param string $type The sync type being validated. + * @param int $attachment_id The attachment ID. + * + * @return int + */ + $limit = apply_filters( 'cloudinary_sync_type_retry_limit', 50, $type, $attachment_id ); + if ( $attempts[ $key ] > $limit ) { + update_post_meta( + $attachment_id, + self::META_KEYS['sync_error'], + sprintf( + /* translators: %s is the sync type that would not advance. */ + __( 'Sync loop detected: the "%s" sync state could not be saved.', 'cloudinary' ), + $type + ) + ); + + return null; + } + // Validate that this sync type applied (for optional types like upgrade). if ( false === $this->run_sync_method( $type, 'validate', $attachment_id ) ) { // If invalid, save the new signature. diff --git a/php/sync/class-push-sync.php b/php/sync/class-push-sync.php index b24761e71..f4d4b19a7 100644 --- a/php/sync/class-push-sync.php +++ b/php/sync/class-push-sync.php @@ -278,7 +278,15 @@ public function process_assets( $attachments = array() ) { $action_message = sprintf( __( 'Sync type: %s', 'cloudinary' ), $type ); do_action( '_cloudinary_queue_action', $action_message, $thread ); if ( isset( $stat[ $attachment_id ][ $type ] ) ) { - // Loop prevention. + // Loop prevention: the same sync type came up twice for this attachment in + // one pass, so its state isn't advancing. Flag it instead of leaving it + // unsynced, unqueued and un-errored -- which would just queue it right back + // up on the next build_queue() run. See GitHub issue #1301. + update_post_meta( + $attachment_id, + Sync::META_KEYS['sync_error'], + __( 'Sync loop detected: sync state is not advancing.', 'cloudinary' ) + ); break; } $stat[ $attachment_id ][ $type ] = true; diff --git a/tests/phpunit/tests/test-media-concurrent-meta.php b/tests/phpunit/tests/test-media-concurrent-meta.php new file mode 100644 index 000000000..06427a877 --- /dev/null +++ b/tests/phpunit/tests/test-media-concurrent-meta.php @@ -0,0 +1,179 @@ +attachment->create_upload_object( DIR_TESTDATA . '/images/canola.jpg' ); + } + + /** + * Start each test with no `_cloudinary` meta, so "the row doesn't exist yet" and "the row + * already exists" are both exercised from a clean, known state. + * + * @return void + */ + public function set_up() { + parent::set_up(); + delete_post_meta( self::$attachment_id, '_cloudinary' ); + } + + /** + * @return Media + */ + protected function get_media() { + return \Cloudinary\get_plugin_instance()->get_component( 'media' ); + } + + /** + * Simulates a second process's write landing in the DB in between this call's read and its + * own write, by performing it from inside a filter that fires at exactly that point. + * + * @param string $hook The filter to inject the concurrent write at. + * @param string $concurrent_key The meta sub-key the "other process" writes. + * @param mixed $concurrent_val The value the "other process" writes. + * + * @return void + */ + protected function inject_concurrent_write( $hook, $concurrent_key, $concurrent_val ) { + $attachment_id = self::$attachment_id; + $did_run = false; + + add_filter( + $hook, + function ( $check, $object_id, $meta_key ) use ( $attachment_id, $concurrent_key, $concurrent_val, &$did_run ) { + if ( ! $did_run && $object_id === $attachment_id && '_cloudinary' === $meta_key ) { + $did_run = true; + wp_cache_delete( $attachment_id, 'post_meta' ); + $meta = get_post_meta( $attachment_id, '_cloudinary', true ); + $meta = is_array( $meta ) ? $meta : array(); + $meta[ $concurrent_key ] = $concurrent_val; + if ( metadata_exists( 'post', $attachment_id, '_cloudinary' ) ) { + update_post_meta( $attachment_id, '_cloudinary', $meta ); + } else { + add_post_meta( $attachment_id, '_cloudinary', $meta, true ); + } + } + + return $check; + }, + 10, + 3 + ); + } + + /** + * Writing a brand new key, with no concurrent writer, behaves exactly as before. + * + * @return void + */ + public function test_writes_normally_with_no_concurrent_writer() { + $media = $this->get_media(); + + $this->assertNotFalse( $media->update_post_meta( self::$attachment_id, 'public_id', 'solo-value' ) ); + $this->assertSame( 'solo-value', $media->get_post_meta( self::$attachment_id, 'public_id', true ) ); + } + + /** + * The race this issue reports: the `_cloudinary` row doesn't exist yet, and a concurrent + * process creates it (with a different key) in the gap between this call's read and its + * write. Before the fix, the write landed via a plain update_post_meta() with no compare-and- + * swap, so it was free to overwrite the concurrent row outright. It should instead retry and + * merge, so both keys survive. + * + * @return void + */ + public function test_merges_a_concurrent_write_on_first_creation() { + $this->inject_concurrent_write( 'add_post_metadata', 'version', 'from-concurrent-writer' ); + + $media = $this->get_media(); + $media->update_post_meta( self::$attachment_id, 'public_id', 'from-this-writer' ); + + $meta = $media->get_post_meta( self::$attachment_id ); + $this->assertSame( 'from-this-writer', $meta['public_id'] ); + $this->assertSame( 'from-concurrent-writer', $meta['version'] ); + } + + /** + * Same race, but against an attachment that's already partway synced, so the `_cloudinary` + * row already exists and the write goes through update_post_meta()'s compare-and-swap + * ($prev_value) path instead of add_post_meta()'s. + * + * @return void + */ + public function test_merges_a_concurrent_write_on_an_existing_row() { + $media = $this->get_media(); + $media->update_post_meta( self::$attachment_id, 'folder_sync', true ); + + $this->inject_concurrent_write( 'update_post_metadata', 'remote_size', '1024' ); + + $media->update_post_meta( self::$attachment_id, 'public_id', 'from-this-writer' ); + + $meta = $media->get_post_meta( self::$attachment_id ); + $this->assertSame( 'from-this-writer', $meta['public_id'] ); + $this->assertSame( '1024', $meta['remote_size'] ); + $this->assertTrue( $meta['folder_sync'] ); + } + + /** + * delete_post_meta() reads, removes the key and writes the same shared blob back, so it has + * the identical race -- confirm it also merges rather than clobbering. + * + * @return void + */ + public function test_delete_merges_a_concurrent_write() { + $media = $this->get_media(); + $media->update_post_meta( self::$attachment_id, 'to_delete', 'gone-soon' ); + + $this->inject_concurrent_write( 'update_post_metadata', 'remote_size', '2048' ); + + $media->delete_post_meta( self::$attachment_id, 'to_delete' ); + + $meta = $media->get_post_meta( self::$attachment_id ); + $this->assertArrayNotHasKey( 'to_delete', $meta ); + $this->assertSame( '2048', $meta['remote_size'] ); + } + + /** + * Writing the same value that a concurrent writer just set is a no-op, not a conflict -- + * confirms the early-exit path doesn't needlessly retry or error. + * + * @return void + */ + public function test_no_retry_needed_when_value_already_matches() { + $media = $this->get_media(); + $media->update_post_meta( self::$attachment_id, 'public_id', 'already-set' ); + + $this->assertTrue( $media->update_post_meta( self::$attachment_id, 'public_id', 'already-set' ) ); + } +} diff --git a/tests/phpunit/tests/test-push-sync-outer-loop-guard.php b/tests/phpunit/tests/test-push-sync-outer-loop-guard.php new file mode 100644 index 000000000..ab3d7fdb1 --- /dev/null +++ b/tests/phpunit/tests/test-push-sync-outer-loop-guard.php @@ -0,0 +1,152 @@ +attachment->create_upload_object( DIR_TESTDATA . '/images/canola.jpg' ); + } + + /** + * register_sync_type() writes directly into the Sync component singleton, which outlives any + * one test, and nothing in the plugin ever needs to remove a registered type -- so the lowest- + * priority 'test_stuck_type' registered below would otherwise leak into every other test in + * the same PHPUnit run (and always win, being the lowest priority), including Test_Sync_Loop_ + * Guard's. Reflection is the only way at sync_base_struct from the outside to undo it. + * + * @return void + */ + public function tear_down() { + $sync = \Cloudinary\get_plugin_instance()->get_component( 'sync' ); + $reflection = new ReflectionProperty( $sync, 'sync_base_struct' ); + $reflection->setAccessible( true ); + $struct = $reflection->getValue( $sync ); + unset( $struct['test_stuck_type'] ); + $reflection->setValue( $sync, $struct ); + $sync->setup_sync_types(); + + parent::tear_down(); + } + + /** + * Registers a sync type that never resolves -- its 'sync' callback runs but never saves a + * matching signature -- so get_sync_type() keeps handing it back. Given the lowest possible + * priority, it is always the type process_assets() picks, regardless of every real type's own + * state, isolating the outer loop's own behaviour from the rest of the sync system (which is + * covered separately in Test_Sync_Loop_Guard). + * + * This also does the manager wiring that normally only happens once the site is "connected" + * -- which the PHPUnit bootstrap never is -- so that process_assets() and build_queue() have + * what they read directly ($managers['media'] etc.). It fakes that with a syntactically valid + * but make-believe `cloudinary_url`, with the usage-stats transient pre-seeded so + * Connect::setup()'s usage_stats() finds it non-empty and skips the one live API call it would + * otherwise make; everything downstream (Media's, Sync's and Delivery's own setup()) then runs + * as it would on a real connected site, without reaching the network itself. + * + * @return \Cloudinary\Sync + */ + protected function register_never_resolving_sync_type() { + $plugin = \Cloudinary\get_plugin_instance(); + $connect = $plugin->get_component( 'connect' ); + + $plugin->settings->set_param( 'connected', true ); + set_transient( Connect::META_KEYS['usage'], array( 'placeholder' => true ), HOUR_IN_SECONDS ); + $plugin->settings->set_value( 'cloudinary_url', 'cloudinary://123456789012345:abcdefghijklmnopqrstuvwxyzABCDEF@test-cloud' ); + $connect->setup(); + + do_action( 'cloudinary_connected', $plugin ); // Delivery::init() etc. + + $plugin->get_component( 'media' )->setup(); + $plugin->get_component( 'sync' )->setup(); + $plugin->get_component( 'delivery' )->setup(); + + $sync = $plugin->get_component( 'sync' ); + $sync->register_assets(); + + $sync->register_sync_type( + 'test_stuck_type', + array( + 'asset_state' => 0, + 'generate' => '__return_true', + 'validate' => '__return_true', + 'priority' => -1, + 'sync' => '__return_null', // Runs, but never saves a signature. + 'realtime' => false, + ) + ); + $sync->setup_sync_types(); + + return $sync; + } + + /** + * @return void + */ + public function test_flags_a_sync_error_when_a_type_repeats() { + $this->register_never_resolving_sync_type(); + + $push = \Cloudinary\get_plugin_instance()->get_component( 'sync' )->managers['push']; + $stat = $push->process_assets( self::$attachment_id ); + + $error = get_post_meta( self::$attachment_id, Sync::META_KEYS['sync_error'], true ); + $this->assertNotEmpty( $error, 'Loop prevention should flag a sync error.' ); + + $this->assertCount( + 1, + $stat[ self::$attachment_id ], + 'The loop should have broken after the type repeated once, not kept running.' + ); + } + + /** + * Once errored, build_queue()'s own meta_query (`_cld_error` NOT EXISTS) is what keeps a + * stuck attachment from being queued again -- confirm the flag this guard sets actually + * satisfies that, end to end. + * + * @return void + */ + public function test_flagged_attachment_is_excluded_from_the_next_queue_build() { + $this->register_never_resolving_sync_type(); + + $sync = \Cloudinary\get_plugin_instance()->get_component( 'sync' ); + $sync->managers['push']->process_assets( self::$attachment_id ); + + $queue = $sync->managers['queue']; + $queue->build_queue(); + + $this->assertSame( + 0, + $queue->get_last_built_total(), + 'The flagged attachment should not be re-queued.' + ); + } +} diff --git a/tests/phpunit/tests/test-sync-loop-guard.php b/tests/phpunit/tests/test-sync-loop-guard.php new file mode 100644 index 000000000..a343fb909 --- /dev/null +++ b/tests/phpunit/tests/test-sync-loop-guard.php @@ -0,0 +1,169 @@ +attachment_id = self::factory()->attachment->create_upload_object( DIR_TESTDATA . '/images/canola.jpg' ); + } + + /** + * Sync-type registration (incl. 'delivery') and every component's manager wiring -- + * Sync::$managers['media'], Media::$sync, Delivery::$sync, and so on -- only happen once the + * site is "connected". The PHPUnit bootstrap never connects to a real Cloudinary account, so + * this fakes one: a syntactically valid but make-believe `cloudinary_url`, with the usage- + * stats transient pre-seeded so Connect::setup()'s usage_stats() finds it non-empty and skips + * the one live API call it would otherwise make. Everything downstream of that (Media's, + * Sync's and Delivery's own setup()) then runs exactly as it would on a real connected site, + * without reaching the network itself. + * + * @return Sync + */ + protected function get_sync() { + $plugin = \Cloudinary\get_plugin_instance(); + $connect = $plugin->get_component( 'connect' ); + + $plugin->settings->set_param( 'connected', true ); + set_transient( Connect::META_KEYS['usage'], array( 'placeholder' => true ), HOUR_IN_SECONDS ); + $plugin->settings->set_value( 'cloudinary_url', 'cloudinary://123456789012345:abcdefghijklmnopqrstuvwxyzABCDEF@test-cloud' ); + $connect->setup(); + + do_action( 'cloudinary_connected', $plugin ); // Delivery::init() etc. + + $plugin->get_component( 'media' )->setup(); + $plugin->get_component( 'sync' )->setup(); + $plugin->get_component( 'delivery' )->setup(); + + $sync = $plugin->get_component( 'sync' ); + $sync->register_assets(); // Populates sync_base_struct / sync_types (incl. 'delivery'). + + return $sync; + } + + /** + * Blocks every write to `_cloudinary` meta for this attachment, the same way the issue's own + * reproduction filter does, so no sync type's signature can ever be saved. + * + * @return void + */ + protected function block_cloudinary_meta_writes() { + $attachment_id = $this->attachment_id; + + add_filter( + 'update_post_metadata', + function ( $check, $object_id, $meta_key ) use ( $attachment_id ) { + if ( $object_id === $attachment_id && '_cloudinary' === $meta_key ) { + return true; // Pretend the write succeeded; don't actually let it through. + } + + return $check; + }, + 10, + 3 + ); + add_filter( + 'add_post_metadata', + function ( $check, $object_id, $meta_key ) use ( $attachment_id ) { + if ( $object_id === $attachment_id && '_cloudinary' === $meta_key ) { + return true; + } + + return $check; + }, + 10, + 3 + ); + } + + /** + * With a low retry limit and the write blocked, get_sync_type() must return (not recurse + * forever) and the attachment must come out flagged with a sync error naming the stuck type. + * + * @return void + */ + public function test_stops_and_flags_a_sync_error_once_the_retry_limit_is_hit() { + $this->block_cloudinary_meta_writes(); + add_filter( + 'cloudinary_sync_type_retry_limit', + function () { + return 5; + } + ); + + $sync = $this->get_sync(); + $type = $sync->get_sync_type( $this->attachment_id, false ); + + $this->assertNull( $type, 'get_sync_type() should give up rather than recurse forever.' ); + + $error = get_post_meta( $this->attachment_id, Sync::META_KEYS['sync_error'], true ); + $this->assertNotEmpty( $error ); + $this->assertStringContainsString( 'delivery', $error ); + } + + /** + * Once flagged, get_sync_type()'s own existing short-circuit for errored attachments must + * take over on the next call, rather than this re-entering (and re-counting against) the + * retry logic. + * + * @return void + */ + public function test_errored_attachment_short_circuits_on_the_next_call() { + $this->block_cloudinary_meta_writes(); + add_filter( 'cloudinary_sync_type_retry_limit', fn() => 5 ); + + $sync = $this->get_sync(); + $sync->get_sync_type( $this->attachment_id, false ); + + $this->assertNull( $sync->get_sync_type( $this->attachment_id, false ) ); + } + + /** + * A healthy attachment -- no write ever blocked -- must resolve 'delivery' in well under the + * retry limit, so the breaker can never be mistaken for normal operation. + * + * @return void + */ + public function test_does_not_trip_during_normal_resolution() { + add_filter( 'cloudinary_sync_type_retry_limit', fn() => 5 ); + + $sync = $this->get_sync(); + $sync->get_sync_type( $this->attachment_id, false ); + + $this->assertEmpty( get_post_meta( $this->attachment_id, Sync::META_KEYS['sync_error'], true ) ); + } +} From f650686efb7bab9ae3ff5d6c0ed2d3344db50945 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 13:00:16 +0000 Subject: [PATCH 33/80] chore(deps-dev): bump dotenv from 18.0.2 to 18.0.8 Bumps [dotenv](https://github.com/motdotla/dotenv) from 18.0.2 to 18.0.8. - [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md) - [Commits](https://github.com/motdotla/dotenv/compare/v18.0.2...v18.0.8) --- updated-dependencies: - dependency-name: dotenv dependency-version: 18.0.7 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index a2df956dc..8db25de91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "css-minimizer-webpack-plugin": "^8.0.0", "css-unicode-loader": "^1.0.3", "cssnano": "^9.8.0", - "dotenv": "^18.0.2", + "dotenv": "^18.0.8", "eslint": "^10.12.0", "eslint-plugin-jest": "^29.17.0", "eslint-plugin-react-hooks": "^7.0.1", @@ -15959,9 +15959,9 @@ } }, "node_modules/dotenv": { - "version": "18.0.2", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-18.0.2.tgz", - "integrity": "sha512-wl0U3CxC0iobaryqEKpFJxzyp4AxQFYAKj/WWszXZr87vVHLi2yJv2syax5Vxt+u02xqNgE277rsc3lOKg9sPg==", + "version": "18.0.8", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-18.0.8.tgz", + "integrity": "sha512-2KDeoFoK/zRtcnbunCDlLG5VWVMcyqeQc6iK65o231nfNAcuGrKoqUQfJFUtBI+QlShk5HKIHxwebBtUl3rEfA==", "dev": true, "license": "BSD-2-Clause", "bin": { diff --git a/package.json b/package.json index bf1dcecc7..76e2026df 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "css-minimizer-webpack-plugin": "^8.0.0", "css-unicode-loader": "^1.0.3", "cssnano": "^9.8.0", - "dotenv": "^18.0.2", + "dotenv": "^18.0.8", "eslint": "^10.12.0", "eslint-plugin-jest": "^29.17.0", "eslint-plugin-react-hooks": "^7.0.1", From 2266d851a94051e0f6b435c25e932b7f11f6401a Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Mon, 19 Oct 2026 23:01:29 +0000 Subject: [PATCH 34/80] fix: upgrade @codemirror/state from 6.7.4 to 6.7.6 Snyk has created this PR to upgrade @codemirror/state from 6.7.4 to 6.7.6. See this package in npm: @codemirror/state See this project in Snyk: https://app.snyk.io/org/cloudinaryltd/project/96b8a37d-7953-4bdc-a10b-bd7b659552ac?utm_source=github&utm_medium=referral&page=upgrade-pr --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7639003e4..d5fc1f34e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "license": "GPL-2.0+", "dependencies": { "@codemirror/lang-json": "^6.0.2", - "@codemirror/state": "^6.7.4", + "@codemirror/state": "^6.7.6", "@codemirror/theme-one-dark": "^6.1.3", "chart.js": "^4.5.1", "classnames": "^2.3.1", @@ -2184,9 +2184,9 @@ } }, "node_modules/@codemirror/state": { - "version": "6.7.4", - "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.7.4.tgz", - "integrity": "sha512-QhQIVRY+xHZDxwOSFrJ1eUMapJBUID3IdeAjf7dHO7zBUzSkyooHiodnalz5MG3iHzwixKMlAAyn7244y537EA==", + "version": "6.7.6", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.7.6.tgz", + "integrity": "sha512-kAz+AncRtKuIknedxT1bq4XwXv4UowhbkHU1myPrtVb/jZtImWuV5BXzv5vK6i3kYACsdiZiQKFQQ5Mq7elW8w==", "license": "MIT", "dependencies": { "@marijn/find-cluster-break": "^1.0.0" diff --git a/package.json b/package.json index 8a9b2fc69..39c3a5c35 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ }, "dependencies": { "@codemirror/lang-json": "^6.0.2", - "@codemirror/state": "^6.7.4", + "@codemirror/state": "^6.7.6", "@codemirror/theme-one-dark": "^6.1.3", "chart.js": "^4.5.1", "classnames": "^2.3.1", From b1f6322a001e2cfa33847d83df17e981bf446896 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Tue, 20 Oct 2026 09:25:43 +0200 Subject: [PATCH 35/80] fix(sync): address second round of review feedback on size regeneration - Media::has_outdated_sizes() now also bails out when the attachment's main file doesn't exist on disk, not just when individual size files are missing. This covers cloud-only ('cld') offload mode, which intentionally deletes every local file without updating the stored metadata -- previously every such attachment was flagged as outdated on every render, and the resulting regeneration failure set the attachment's global sync-error meta, blocking all other sync types for it. - Upload_Sync::regenerate_sizes() now uses WP core's low-level _wp_make_subsizes() instead of wp_generate_attachment_metadata(), and only regenerates the specific sizes whose backing file is actually missing. Two problems this fixes together: - wp_generate_attachment_metadata() always rebuilds the full sizes set from the current (edited) image, which could silently overwrite a size a user deliberately kept (e.g. editing with "all sizes except thumbnail" intentionally preserves the old thumbnail). - wp_generate_attachment_metadata() also writes its own metadata to the database as a side effect partway through its own execution; _wp_make_subsizes() builds on the metadata array passed into it instead of a fresh one, so there's no clobber-then-restore step needed to keep keys like original_image or third-party plugin data intact. Reported in PR review (https://github.com/cloudinary/cloudinary_wordpress/pull/1314). --- php/class-media.php | 9 +++++-- php/sync/class-upload-sync.php | 47 ++++++++++++++++++++++++++-------- 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/php/class-media.php b/php/class-media.php index b7e51dd15..0fe10b6ca 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1711,11 +1711,16 @@ public function has_public_id( $attachment_id ) { */ public function has_outdated_sizes( $attachment_id ) { $metadata = wp_get_attachment_metadata( $attachment_id ); - if ( empty( $metadata['file'] ) || empty( $metadata['sizes'] ) ) { + $path = get_attached_file( $attachment_id ); + + // Also covers cloud-only storage mode, which intentionally removes every local file (see + // Storage::remove_local_assets()) without updating the stored metadata: if the main file itself + // is gone, there is nothing to regenerate from, so this is not "outdated", it's expected. + if ( empty( $metadata['file'] ) || empty( $metadata['sizes'] ) || empty( $path ) || ! file_exists( $path ) ) { return false; } - $dir = dirname( get_attached_file( $attachment_id ) ); + $dir = dirname( $path ); foreach ( $metadata['sizes'] as $size ) { if ( empty( $size['file'] ) || ! file_exists( path_join( $dir, $size['file'] ) ) ) { diff --git a/php/sync/class-upload-sync.php b/php/sync/class-upload-sync.php index 440f58c9e..f92a81e37 100644 --- a/php/sync/class-upload-sync.php +++ b/php/sync/class-upload-sync.php @@ -285,25 +285,50 @@ public function edit_upload( $attachment_id ) { * @return array|\WP_Error */ public function regenerate_sizes( $attachment_id ) { - if ( ! function_exists( 'wp_generate_attachment_metadata' ) ) { + if ( ! function_exists( '_wp_make_subsizes' ) ) { require_once ABSPATH . 'wp-admin/includes/image.php'; } - // Captured before wp_generate_attachment_metadata(), which writes its own (incomplete) metadata - // to the database as a side effect while it runs -- reading "current" metadata after that call - // would already return the clobbered record. $metadata = wp_get_attachment_metadata( $attachment_id ); + $file = get_attached_file( $attachment_id ); - $file = get_attached_file( $attachment_id ); - $regenerated = wp_generate_attachment_metadata( $attachment_id, $file ); - if ( empty( $regenerated['sizes'] ) ) { + if ( empty( $metadata['sizes'] ) || empty( $file ) || ! file_exists( $file ) ) { return new \WP_Error( 'cloudinary_regenerate_sizes_failed', __( 'Could not regenerate attachment sizes.', 'cloudinary' ) ); } - // wp_generate_attachment_metadata() builds a fresh metadata array, so only merge in the - // regenerated sizes rather than overwriting the whole record -- other keys (e.g. original_image, - // third-party plugin data) must be preserved. - $metadata['sizes'] = $regenerated['sizes']; + // Only the sizes whose backing file is actually missing get regenerated -- every other size, + // including one a user deliberately kept (e.g. editing with "all sizes except thumbnail"), is + // left completely untouched. The missing entries are removed from $metadata first so + // _wp_make_subsizes() treats them as new sizes to create rather than skipping them as already + // present (it only checks whether the size *name* already has an entry, not whether the file + // behind it still exists). + $dir = dirname( $file ); + $missing = array(); + foreach ( $metadata['sizes'] as $size_name => $size_data ) { + if ( ! empty( $size_data['file'] ) && file_exists( path_join( $dir, $size_data['file'] ) ) ) { + continue; + } + unset( $metadata['sizes'][ $size_name ] ); + $missing[ $size_name ] = true; + } + + if ( empty( $missing ) ) { + return $metadata; + } + + $registered = wp_get_registered_image_subsizes(); + /** This filter is documented in wp-admin/includes/image.php */ + $registered = apply_filters( 'intermediate_image_sizes_advanced', $registered, $metadata, $attachment_id ); + $new_sizes = array_intersect_key( $registered, $missing ); + + // _wp_make_subsizes() is WP core's own low-level size-creation step (used internally by + // wp_create_image_subsizes()). Unlike wp_generate_attachment_metadata(), it builds on the + // $metadata we pass in rather than a fresh array, so unrelated keys (original_image, + // third-party plugin data) are never at risk of being dropped. It also silently leaves a size + // out of the result if the image is too small for it, rather than erroring, so that case never + // reaches the sync-error path below. + $metadata = _wp_make_subsizes( $new_sizes, $file, $metadata, $attachment_id ); + wp_update_attachment_metadata( $attachment_id, $metadata ); // Persist the new signature, otherwise this would re-trigger on every subsequent render. $this->sync->set_signature_item( $attachment_id, 'sizes' ); From ff835575fd9a15beb736b7c56d9e7c662a5fde14 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Tue, 20 Oct 2026 09:53:12 +0200 Subject: [PATCH 36/80] fix(sync): address PR review feedback on the loop guards and CAS retry Addresses @utkarshcloudinary's review on #1328: - blocker: Sync::validate_sync_type()'s retry counter counted every call for an attachment+type, not recursion depth, so a type that resolves immediately but is legitimately checked many times across a long request (status rendered for several references to the same attachment, media library pages, etc.) could falsely trip the breaker after 50 *total* calls. Switch to a depth counter that increments on entry and decrements on every return via `finally`, so only an actual, still-unresolved recursive chain accumulates. - warning: Push_Sync::process_assets()'s outer loop guard flagged a permanent `_cld_error` the first time a type repeated in one pass, removing the self-healing the plugin had before this PR (the attachment would just get reprocessed on the next queue build). A single repeat can be transient. Track consecutive loop detections across passes in postmeta and only flag the error once that reaches a (filterable) limit, clearing it again on any pass that completes without repeating. Also names the stuck $type in the message, same as the other guard. - warning: Media::update_post_meta()/delete_post_meta() dropped the primed post-meta cache on every attempt, including the first, where it isn't needed -- the compare-and-swap ($prev_value) already catches a stale read by failing against the DB's actual current value. Only invalidate the cache before a retry, once the CAS has actually failed. - nit: reordered the existence check after the read in update_post_meta(), since a cold cache's `cloudinary_migrate_legacy_meta` filter can itself create the row as a side effect; checking existence first could miss that and cost an avoidable extra retry. - nit: documented that update_metadata()'s CAS is skipped when $prev is empty (e.g. right after meta_cleanup) or not an array, so that specific transition falls through to an unconditional write. Test changes: - test-sync-loop-guard.php: added a regression test confirming 20 independent, non-recursing calls for a stable pending type never trip the breaker (4x the test's own retry limit), matching the blocker above. Added matching sync_base_struct teardown so its custom type doesn't leak into other tests. - test-push-sync-outer-loop-guard.php: updated for the 3-strike behaviour -- a single repeat no longer errors, the error only lands (naming the type) once the limit is reached, and a successful pass resets the strike count. Re-verified manually against the live, connected wp-env instance: the original issue's exact repro still resolves via the inner guard in one pass; a genuine two-process race on a fresh attachment still merges both writes; and a normal upload still fully syncs. --- php/class-media.php | 33 +++++-- php/class-sync.php | 98 +++++++++++-------- php/sync/class-push-sync.php | 52 ++++++++-- .../tests/test-push-sync-outer-loop-guard.php | 90 +++++++++++++++-- tests/phpunit/tests/test-sync-loop-guard.php | 71 +++++++++++++- 5 files changed, 274 insertions(+), 70 deletions(-) diff --git a/php/class-media.php b/php/class-media.php index 03fcc4ac8..cdfefb3f2 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -2796,14 +2796,22 @@ public function update_post_meta( $post_id, $key, $data ) { // now-current value instead of clobbering it. $max_attempts = 3; for ( $attempt = 0; $attempt < $max_attempts; $attempt++ ) { - // WP primes and caches ALL of a post's meta on first access, so a plain re-read - // here would just replay this same process's first (possibly already stale) read on - // every retry, never seeing what a concurrent process wrote in the meantime. Drop it - // so each attempt re-queries the DB. - wp_cache_delete( $post_id, 'post_meta' ); + if ( $attempt > 0 ) { + // Only before a retry, not the first attempt: the compare-and-swap below + // ($prev_value) is what catches a stale read, by failing against the DB's actual + // current value regardless of what's cached. Forcing a fresh read up front would + // cost every single meta write here -- and there are many per sync -- a full + // reload for no benefit, since nothing has failed yet to justify distrusting the + // cache. + wp_cache_delete( $post_id, 'post_meta' ); + } - $exists = metadata_exists( 'post', $post_id, Sync::META_KEYS['cloudinary'] ); + // Read before checking existence: when the row is missing, get_post_meta() below + // runs the `cloudinary_migrate_legacy_meta` filter, whose callbacks can create this + // row themselves as a side effect (e.g. legacy-plugin migration). Checking existence + // first would miss that and cost an extra, avoidable retry. $meta = $this->get_post_meta( $post_id ); + $exists = metadata_exists( 'post', $post_id, Sync::META_KEYS['cloudinary'] ); if ( isset( $meta[ $key ] ) && $meta[ $key ] === $data ) { return true; // Already set to this value, including by a racing write. } @@ -2811,6 +2819,11 @@ public function update_post_meta( $post_id, $key, $data ) { $meta[ $key ] = $data; if ( $exists ) { + // Note: update_metadata() only applies $prev_value (and so only detects a race) + // when it's non-empty. If `_cloudinary` currently holds an empty array (e.g. + // right after meta_cleanup) or something that didn't come back as an array, this + // falls through to an unconditional write instead -- still correct, just unable + // to tell a race apart from an ordinary write in that specific case. $result = update_post_meta( $post_id, Sync::META_KEYS['cloudinary'], $meta, $prev ); } else { // No row yet: add it uniquely so a concurrent first write can't be silently @@ -2848,9 +2861,11 @@ public function delete_post_meta( $post_id, $key ) { // compare-and-swap retry against concurrent writers. $max_attempts = 3; for ( $attempt = 0; $attempt < $max_attempts; $attempt++ ) { - // See the matching note in update_post_meta(): drop the cached meta so this - // actually re-reads the DB instead of replaying an earlier, possibly stale read. - wp_cache_delete( $post_id, 'post_meta' ); + if ( $attempt > 0 ) { + // See the matching note in update_post_meta(): only before a retry, once the + // compare-and-swap below has actually failed against the DB's current value. + wp_cache_delete( $post_id, 'post_meta' ); + } $meta = $this->get_post_meta( $post_id ); if ( ! isset( $meta[ $key ] ) ) { diff --git a/php/class-sync.php b/php/class-sync.php index 878736c98..98e16008a 100644 --- a/php/class-sync.php +++ b/php/class-sync.php @@ -90,6 +90,7 @@ class Sync implements Setup, Assets { 'folder_sync' => '_folder_sync', 'last_oversize_check' => '_last_oversize_check', 'local_size' => '_cld_local_size', + 'loop_count' => '_cld_loop_count', 'pending' => '_cloudinary_pending', 'plugin_version' => '_plugin_version', 'process_log' => '_cloudinary_process_log', @@ -909,56 +910,67 @@ public function validate_sync_type( $type, $attachment_id ) { // next. If that save doesn't stick -- e.g. a concurrent request overwrites it before // it's read back, see GitHub issue #1301 -- get_sync_type() keeps handing back this // same $type and this method recurses on it forever, pinning a PHP worker and hammering - // the DB. Count re-entries per attachment+type and bail out to a sync error once it's - // clearly not resolving, rather than let the recursion run unbounded. - static $attempts = array(); - $key = $attachment_id . ':' . $type; - $attempts[ $key ] = isset( $attempts[ $key ] ) ? $attempts[ $key ] + 1 : 1; + // the DB. Guard against that by tracking how deep the current, still-unresolved + // recursion chain for this attachment+type is -- NOT how many times this method has + // been entered overall. A long request can legitimately call this dozens of times for + // the same attachment+type without ever recursing (e.g. rendering sync status for many + // references to the same attachment); each of those returns before the next begins, so + // the depth count must drop back to zero between them and never accumulate. + static $depth = array(); + $key = $attachment_id . ':' . $type; + $depth[ $key ] = isset( $depth[ $key ] ) ? $depth[ $key ] + 1 : 1; + + try { + /** + * Filter the number of times a single sync type may recurse for the same attachment + * before it's treated as stuck in a loop. + * + * @hook cloudinary_sync_type_retry_limit + * + * @param int $limit The retry limit. Default 50. + * @param string $type The sync type being validated. + * @param int $attachment_id The attachment ID. + * + * @return int + */ + $limit = apply_filters( 'cloudinary_sync_type_retry_limit', 50, $type, $attachment_id ); + if ( $depth[ $key ] > $limit ) { + update_post_meta( + $attachment_id, + self::META_KEYS['sync_error'], + sprintf( + /* translators: %s is the sync type that would not advance. */ + __( 'Sync loop detected: the "%s" sync state could not be saved.', 'cloudinary' ), + $type + ) + ); - /** - * Filter the number of times a single sync type may be re-validated for the same - * attachment within one request before it's treated as stuck in a loop. - * - * @hook cloudinary_sync_type_retry_limit - * - * @param int $limit The retry limit. Default 50. - * @param string $type The sync type being validated. - * @param int $attachment_id The attachment ID. - * - * @return int - */ - $limit = apply_filters( 'cloudinary_sync_type_retry_limit', 50, $type, $attachment_id ); - if ( $attempts[ $key ] > $limit ) { - update_post_meta( - $attachment_id, - self::META_KEYS['sync_error'], - sprintf( - /* translators: %s is the sync type that would not advance. */ - __( 'Sync loop detected: the "%s" sync state could not be saved.', 'cloudinary' ), - $type - ) - ); + return null; + } - return null; - } + // Validate that this sync type applied (for optional types like upgrade). + if ( false === $this->run_sync_method( $type, 'validate', $attachment_id ) ) { + // If invalid, save the new signature. + $this->set_signature_item( $attachment_id, $type ); - // Validate that this sync type applied (for optional types like upgrade). - if ( false === $this->run_sync_method( $type, 'validate', $attachment_id ) ) { - // If invalid, save the new signature. - $this->set_signature_item( $attachment_id, $type ); + $type = $this->get_sync_type( $attachment_id, false ); // Set cache to false to get the new signature. - $type = $this->get_sync_type( $attachment_id, false ); // Set cache to false to get the new signature. + // Check if this is a realtime process. + } elseif ( ! empty( $this->sync_base_struct[ $type ]['realtime'] ) ) { + $result = $this->run_sync_method( $type, 'sync', $attachment_id ); + if ( ! empty( $result ) ) { + $this->log_sync_result( $attachment_id, $type, $result ); + } + $type = $this->get_sync_type( $attachment_id, false ); // Set cache to false to get the new signature. + } - // Check if this is a realtime process. - } elseif ( ! empty( $this->sync_base_struct[ $type ]['realtime'] ) ) { - $result = $this->run_sync_method( $type, 'sync', $attachment_id ); - if ( ! empty( $result ) ) { - $this->log_sync_result( $attachment_id, $type, $result ); + return $type; + } finally { + --$depth[ $key ]; + if ( 0 >= $depth[ $key ] ) { + unset( $depth[ $key ] ); } - $type = $this->get_sync_type( $attachment_id, false ); // Set cache to false to get the new signature. } - - return $type; } /** diff --git a/php/sync/class-push-sync.php b/php/sync/class-push-sync.php index f4d4b19a7..f7ca50246 100644 --- a/php/sync/class-push-sync.php +++ b/php/sync/class-push-sync.php @@ -273,20 +273,50 @@ public function process_assets( $attachments = array() ) { // Flag attachment as being processed. update_post_meta( $attachment_id, Sync::META_KEYS['syncing'], time() ); $stat[ $attachment_id ] = array(); + $looped = false; while ( $type = $this->sync->get_sync_type( $attachment_id, false ) ) { // phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition // translators: variable is sync type. $action_message = sprintf( __( 'Sync type: %s', 'cloudinary' ), $type ); do_action( '_cloudinary_queue_action', $action_message, $thread ); if ( isset( $stat[ $attachment_id ][ $type ] ) ) { // Loop prevention: the same sync type came up twice for this attachment in - // one pass, so its state isn't advancing. Flag it instead of leaving it - // unsynced, unqueued and un-errored -- which would just queue it right back - // up on the next build_queue() run. See GitHub issue #1301. - update_post_meta( - $attachment_id, - Sync::META_KEYS['sync_error'], - __( 'Sync loop detected: sync state is not advancing.', 'cloudinary' ) - ); + // one pass, so its state isn't advancing. This can happen for a transient + // reason (e.g. a 'sync' callback that returns early without an error), so + // don't jump straight to a permanent error -- that would require a manual + // "clean up errors" step to recover from, where the attachment previously + // would have just been picked up again on the next run. Instead, count + // consecutive passes that ended this way across requests and only flag it + // once that's happened a few times in a row. See GitHub issue #1301. + $looped = true; + $loop_count = (int) get_post_meta( $attachment_id, Sync::META_KEYS['loop_count'], true ) + 1; + + /** + * Filter how many consecutive passes may end in a repeated, non-advancing + * sync type for the same attachment before it's flagged with a sync error. + * + * @hook cloudinary_sync_loop_strikes + * + * @param int $strikes The number of strikes allowed. Default 3. + * @param string $type The sync type that repeated. + * @param int $attachment_id The attachment ID. + * + * @return int + */ + $loop_limit = apply_filters( 'cloudinary_sync_loop_strikes', 3, $type, $attachment_id ); + if ( $loop_count >= $loop_limit ) { + update_post_meta( + $attachment_id, + Sync::META_KEYS['sync_error'], + sprintf( + /* translators: %s is the sync type that would not advance. */ + __( 'Sync loop detected: the "%s" sync state is not advancing.', 'cloudinary' ), + $type + ) + ); + delete_post_meta( $attachment_id, Sync::META_KEYS['loop_count'] ); + } else { + update_post_meta( $attachment_id, Sync::META_KEYS['loop_count'], $loop_count ); + } break; } $stat[ $attachment_id ][ $type ] = true; @@ -296,6 +326,12 @@ public function process_assets( $attachments = array() ) { } } + if ( ! $looped ) { + // A full, successful pass: this attachment isn't stuck, so clear any count a + // previous, transient loop detection may have left behind. + delete_post_meta( $attachment_id, Sync::META_KEYS['loop_count'] ); + } + Utils::clean_up_sync_meta( $attachment_id ); } diff --git a/tests/phpunit/tests/test-push-sync-outer-loop-guard.php b/tests/phpunit/tests/test-push-sync-outer-loop-guard.php index ab3d7fdb1..050dc678c 100644 --- a/tests/phpunit/tests/test-push-sync-outer-loop-guard.php +++ b/tests/phpunit/tests/test-push-sync-outer-loop-guard.php @@ -6,8 +6,14 @@ * same type comes back a second time in that same pass, its state isn't advancing, so the loop * breaks. Before this fix that break left the attachment unsynced, unqueued and un-errored -- * build_queue() would just pick it straight back up on the next run, repeating the same stuck - * request forever (GitHub issue #1301). These confirm the break now also flags a sync error, so - * build_queue()'s own `_cld_error NOT EXISTS` check excludes it afterwards. + * request forever (GitHub issue #1301). + * + * A single repeat can be a transient hiccup rather than a genuinely stuck attachment, so the fix + * doesn't flag a sync error the first time: it counts consecutive passes that ended this way + * (persisted in postmeta, across requests) and only errors once that count reaches a limit, + * clearing it again the moment a pass completes without repeating. These cover both ends of that: + * early repeats that still self-heal, and a sync error once the limit is actually reached -- at + * which point build_queue()'s own `_cld_error NOT EXISTS` check excludes the attachment. * * @package Cloudinary */ @@ -109,17 +115,20 @@ protected function register_never_resolving_sync_type() { } /** + * A single repeated pass is not enough to flag a permanent error: the loop still breaks (so + * the request doesn't hang), but the attachment is left to be picked up again, the same as + * before this fix, since one repeat alone doesn't prove it's genuinely stuck. + * * @return void */ - public function test_flags_a_sync_error_when_a_type_repeats() { + public function test_a_single_repeat_does_not_flag_a_sync_error() { $this->register_never_resolving_sync_type(); $push = \Cloudinary\get_plugin_instance()->get_component( 'sync' )->managers['push']; $stat = $push->process_assets( self::$attachment_id ); - $error = get_post_meta( self::$attachment_id, Sync::META_KEYS['sync_error'], true ); - $this->assertNotEmpty( $error, 'Loop prevention should flag a sync error.' ); - + $this->assertEmpty( get_post_meta( self::$attachment_id, Sync::META_KEYS['sync_error'], true ) ); + $this->assertSame( '1', get_post_meta( self::$attachment_id, Sync::META_KEYS['loop_count'], true ) ); $this->assertCount( 1, $stat[ self::$attachment_id ], @@ -127,6 +136,70 @@ public function test_flags_a_sync_error_when_a_type_repeats() { ); } + /** + * Once the same repeat has happened on enough consecutive passes (the default is 3, matching + * the filter's default), it's no longer a plausible one-off: flag the sync error, naming the + * type that wouldn't advance. + * + * @return void + */ + public function test_flags_a_sync_error_once_the_strike_limit_is_reached() { + $this->register_never_resolving_sync_type(); + $push = \Cloudinary\get_plugin_instance()->get_component( 'sync' )->managers['push']; + + $push->process_assets( self::$attachment_id ); + $push->process_assets( self::$attachment_id ); + $this->assertEmpty( + get_post_meta( self::$attachment_id, Sync::META_KEYS['sync_error'], true ), + 'Two strikes should not have flagged it yet.' + ); + + $push->process_assets( self::$attachment_id ); + + $error = get_post_meta( self::$attachment_id, Sync::META_KEYS['sync_error'], true ); + $this->assertNotEmpty( $error, 'The third strike should flag a sync error.' ); + $this->assertStringContainsString( 'test_stuck_type', $error ); + $this->assertEmpty( + get_post_meta( self::$attachment_id, Sync::META_KEYS['loop_count'], true ), + 'The strike count should be cleared once it has done its job.' + ); + } + + /** + * A pass that completes without repeating -- the attachment recovering on its own after an + * earlier, transient repeat -- must clear the strike count, not leave it to accumulate with + * unrelated future repeats. + * + * @return void + */ + public function test_a_successful_pass_resets_the_strike_count() { + $sync = $this->register_never_resolving_sync_type(); + $push = $sync->managers['push']; + + $push->process_assets( self::$attachment_id ); + $this->assertSame( '1', get_post_meta( self::$attachment_id, Sync::META_KEYS['loop_count'], true ) ); + + // Make the type resolve this time, instead of repeating. + $sync->register_sync_type( + 'test_stuck_type', + array( + 'asset_state' => 0, + 'generate' => '__return_true', + 'validate' => '__return_true', + 'priority' => -1, + 'sync' => function ( $attachment_id ) use ( $sync ) { + $sync->set_signature_item( $attachment_id, 'test_stuck_type' ); + }, + 'realtime' => false, + ) + ); + $sync->setup_sync_types(); + + $push->process_assets( self::$attachment_id ); + + $this->assertEmpty( get_post_meta( self::$attachment_id, Sync::META_KEYS['loop_count'], true ) ); + } + /** * Once errored, build_queue()'s own meta_query (`_cld_error` NOT EXISTS) is what keeps a * stuck attachment from being queued again -- confirm the flag this guard sets actually @@ -138,7 +211,10 @@ public function test_flagged_attachment_is_excluded_from_the_next_queue_build() $this->register_never_resolving_sync_type(); $sync = \Cloudinary\get_plugin_instance()->get_component( 'sync' ); - $sync->managers['push']->process_assets( self::$attachment_id ); + $push = $sync->managers['push']; + $push->process_assets( self::$attachment_id ); + $push->process_assets( self::$attachment_id ); + $push->process_assets( self::$attachment_id ); $queue = $sync->managers['queue']; $queue->build_queue(); diff --git a/tests/phpunit/tests/test-sync-loop-guard.php b/tests/phpunit/tests/test-sync-loop-guard.php index a343fb909..b98842a09 100644 --- a/tests/phpunit/tests/test-sync-loop-guard.php +++ b/tests/phpunit/tests/test-sync-loop-guard.php @@ -10,6 +10,11 @@ * over and over. These confirm it instead bails out to a sync error once a type clearly isn't * resolving. * + * The guard counts how deep the current, still-unresolved recursion chain is, not how many times + * validate_sync_type() has been entered overall, since a type that resolves immediately (no + * recursion) can legitimately be checked many times across a long request without ever being + * stuck -- confirmed below alongside the stuck case. + * * @package Cloudinary */ @@ -26,9 +31,9 @@ class Test_Sync_Loop_Guard extends WP_UnitTestCase { * attachment, is realtime, and (unlike 'file') does no network calls, so it is exactly the * type the live incident got stuck recursing on. * - * A fresh one per test, not a shared static: validate_sync_type()'s retry counter is a - * function-static, so it persists for this whole PHPUnit process. Reusing one attachment - * across test methods would let one test's count carry over into the next. + * A fresh one per test, not a shared static, for isolation: validate_sync_type()'s counter is + * a function-static keyed by attachment ID, so a fresh ID per test rules out one test's calls + * being counted against another's, on top of the counter's own per-chain reset. * * @var int */ @@ -42,6 +47,26 @@ public function set_up() { $this->attachment_id = self::factory()->attachment->create_upload_object( DIR_TESTDATA . '/images/canola.jpg' ); } + /** + * register_sync_type() (used below for 'test_pending_type') writes directly into the Sync + * component singleton, which outlives any one test -- see the matching note in + * Test_Push_Sync_Outer_Loop_Guard, whose own custom type this would otherwise collide with if + * both ran in the same PHPUnit process. + * + * @return void + */ + public function tear_down() { + $sync = \Cloudinary\get_plugin_instance()->get_component( 'sync' ); + $reflection = new ReflectionProperty( $sync, 'sync_base_struct' ); + $reflection->setAccessible( true ); + $struct = $reflection->getValue( $sync ); + unset( $struct['test_pending_type'] ); + $reflection->setValue( $sync, $struct ); + $sync->setup_sync_types(); + + parent::tear_down(); + } + /** * Sync-type registration (incl. 'delivery') and every component's manager wiring -- * Sync::$managers['media'], Media::$sync, Delivery::$sync, and so on -- only happen once the @@ -166,4 +191,44 @@ public function test_does_not_trip_during_normal_resolution() { $this->assertEmpty( get_post_meta( $this->attachment_id, Sync::META_KEYS['sync_error'], true ) ); } + + /** + * A type that's simply pending -- not stuck, just not synced yet, and not realtime so nothing + * recurses -- can legitimately be checked many times in one long request (status rendered for + * several references to the same attachment, the process_assets() loop itself, and so on). + * None of those calls recurse into one another, so the guard must never mistake their total + * count for one unresolved chain, however many of them there are. + * + * @return void + */ + public function test_many_independent_calls_for_a_stable_pending_type_do_not_trip_the_guard() { + $sync = $this->get_sync(); + add_filter( 'cloudinary_sync_type_retry_limit', fn() => 5 ); + + // A type that never resolves but also never recurses: validate() is true and it isn't + // realtime, so validate_sync_type() returns it directly every time, same as a type simply + // waiting its turn. Lowest priority so it's always what get_sync_type() picks. + $sync->register_sync_type( + 'test_pending_type', + array( + 'asset_state' => 0, + 'generate' => '__return_true', + 'validate' => '__return_true', + 'priority' => -1, + 'sync' => '__return_null', + 'realtime' => false, + ) + ); + $sync->setup_sync_types(); + + for ( $i = 0; $i < 20; $i++ ) { + $type = $sync->get_sync_type( $this->attachment_id, false ); + $this->assertSame( 'test_pending_type', $type ); + } + + $this->assertEmpty( + get_post_meta( $this->attachment_id, Sync::META_KEYS['sync_error'], true ), + '20 independent, non-recursing calls (4x the 5-call limit) must not trip the guard.' + ); + } } From f7c1cf0286a2a455463368f6a2b5dc2abf3a46a7 Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Tue, 20 Oct 2026 15:39:29 +0530 Subject: [PATCH 37/80] ci: Fix Composer cache and speed up lint The Composer cache never restored or saved. The workflow cached ~/.composer/cache, but Composer on the runner writes to ~/.cache/composer, so every job downloaded all packages again and logged a "Path Validation Error" on save. Read the real path from `composer config cache-files-dir`. The build matrix key also used the undefined `matrix.php`, so both PHP versions shared one key. Cancel superseded PR runs so a new push does not wait behind an obsolete one. Pushes to develop and master still run to completion. Run PHPCS in parallel processes. Locally this cuts `composer lint` from about 24s to 8s. --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++------ phpcs.xml.dist | 1 + 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5638fdb46..392591456 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,12 @@ on: workflow_call: pull_request: +# A new push to a PR makes the previous run for it obsolete, so cancel it. +# Pushes to develop and master still run to completion. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: build: runs-on: ubuntu-latest @@ -28,13 +34,19 @@ jobs: node-version-file: '.nvmrc' cache: 'npm' + # Composer on the runner uses ~/.cache/composer, not ~/.composer/cache, + # so ask it for the directory instead of hard-coding one. + - name: Get Composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" + - name: Cache Composer uses: actions/cache@v4 with: - path: ~/.composer/cache - key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} restore-keys: | - ${{ runner.os }}-composer-${{ matrix.php }}- + ${{ runner.os }}-composer-${{ matrix.php-version }}- - name: Install dependencies run: npm ci @@ -57,10 +69,14 @@ jobs: with: php-version: '8.5' + - name: Get Composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" + - name: Cache Composer uses: actions/cache@v4 with: - path: ~/.composer/cache + path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-phpstan-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ runner.os }}-composer-phpstan- @@ -98,10 +114,14 @@ jobs: node-version-file: '.nvmrc' cache: 'npm' + - name: Get Composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" + - name: Cache Composer uses: actions/cache@v4 with: - path: ~/.composer/cache + path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-unit-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ runner.os }}-composer-unit- @@ -163,10 +183,14 @@ jobs: node-version-file: '.nvmrc' cache: 'npm' + - name: Get Composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" + - name: Cache Composer uses: actions/cache@v4 with: - path: ~/.composer/cache + path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-e2e-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ runner.os }}-composer-e2e- diff --git a/phpcs.xml.dist b/phpcs.xml.dist index b53454d9d..6bc6255da 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -32,6 +32,7 @@ + From 0eedfedb849b6214c0ac42361074f24c7d3e1555 Mon Sep 17 00:00:00 2001 From: robertgray-topflight Date: Thu, 15 Oct 2026 13:00:54 +0100 Subject: [PATCH 38/80] =?UTF-8?q?Fix=20undefined=20array=20key=20=E2=80=9C?= =?UTF-8?q?id=E2=80=9D=20warning=20in=20filter=5Fimage=5Fblock=5Frender=5F?= =?UTF-8?q?block?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit filter_image_block_render_block reads $block[‘attrs’][‘id’] whenever a core/image block has overwrite_transformations set. If the block has no id attribute, for example an image block that points at a URL rather than a media library image, PHP logs “Undefined array key id” on every render. This adds a check that the id is not empty before the str_replace runs. Blocks with an id behave as before. QA notes Add a core/image block that uses an external image URL and has overwrite_transformations set in its attributes, and view the page on PHP 8.2 or later with WP_DEBUG on. Before the change, the warning appears in the log for class-filter.php line 733. After the change, it does not. Confirm an image block from the media library with overwrite transformations still gets the cld-overwrite class. --- php/media/class-filter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/media/class-filter.php b/php/media/class-filter.php index 8fe23347b..3a30aee35 100644 --- a/php/media/class-filter.php +++ b/php/media/class-filter.php @@ -729,7 +729,7 @@ public function catch_media_templates_maybe() { * @return string */ public function filter_image_block_render_block( $block_content, array $block ) { - if ( 'core/image' === $block['blockName'] && ! empty( $block['attrs']['overwrite_transformations'] ) ) { + if ( 'core/image' === $block['blockName'] && ! empty( $block['attrs']['overwrite_transformations'] ) && ! empty( $block['attrs']['id'] )) { $block_content = str_replace( 'wp-image-' . $block['attrs']['id'], 'wp-image-' . $block['attrs']['id'] . ' cld-overwrite', $block_content ); } From 2d22cd089def25e9cf2a3a3a5ff4997e5954b525 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Tue, 20 Oct 2026 15:24:16 +0200 Subject: [PATCH 39/80] Fix missing space before closing parenthesis --- php/media/class-filter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/media/class-filter.php b/php/media/class-filter.php index 3a30aee35..dd2876d94 100644 --- a/php/media/class-filter.php +++ b/php/media/class-filter.php @@ -729,7 +729,7 @@ public function catch_media_templates_maybe() { * @return string */ public function filter_image_block_render_block( $block_content, array $block ) { - if ( 'core/image' === $block['blockName'] && ! empty( $block['attrs']['overwrite_transformations'] ) && ! empty( $block['attrs']['id'] )) { + if ( 'core/image' === $block['blockName'] && ! empty( $block['attrs']['overwrite_transformations'] ) && ! empty( $block['attrs']['id'] ) ) { $block_content = str_replace( 'wp-image-' . $block['attrs']['id'], 'wp-image-' . $block['attrs']['id'] . ' cld-overwrite', $block_content ); } From 37cb590909e97783f268abe65d23b39f542af16e Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Tue, 20 Oct 2026 15:39:40 +0200 Subject: [PATCH 40/80] fix(sync): surface genuine size-regeneration failures instead of silently dropping them _wp_make_subsizes() never returns a WP_Error -- a size it can't create is just left out of the result, whether that's because the image is legitimately too small for it (expected) or because of a real, possibly transient failure (disk/permissions/memory/missing image editor). Since the missing entries were already unset before calling it, an unreported real failure was being saved as a success and the signature persisted, so it would never be retried. Distinguish the two with image_resize_dimensions() -- the same check core itself uses to decide whether a size applies to a given image. A size that could have been made but wasn't is now treated as a real failure: the original metadata is restored (_wp_make_subsizes() saves progress to the database after each size it does make, so a partial failure can leave a partial record there) and a WP_Error is returned, so the normal retry path picks it up again on the next render. Reported in PR review (https://github.com/cloudinary/cloudinary_wordpress/pull/1314). --- php/sync/class-upload-sync.php | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/php/sync/class-upload-sync.php b/php/sync/class-upload-sync.php index f92a81e37..1c690cc74 100644 --- a/php/sync/class-upload-sync.php +++ b/php/sync/class-upload-sync.php @@ -302,8 +302,9 @@ public function regenerate_sizes( $attachment_id ) { // _wp_make_subsizes() treats them as new sizes to create rather than skipping them as already // present (it only checks whether the size *name* already has an entry, not whether the file // behind it still exists). - $dir = dirname( $file ); - $missing = array(); + $original = $metadata; + $dir = dirname( $file ); + $missing = array(); foreach ( $metadata['sizes'] as $size_name => $size_data ) { if ( ! empty( $size_data['file'] ) && file_exists( path_join( $dir, $size_data['file'] ) ) ) { continue; @@ -324,11 +325,34 @@ public function regenerate_sizes( $attachment_id ) { // _wp_make_subsizes() is WP core's own low-level size-creation step (used internally by // wp_create_image_subsizes()). Unlike wp_generate_attachment_metadata(), it builds on the // $metadata we pass in rather than a fresh array, so unrelated keys (original_image, - // third-party plugin data) are never at risk of being dropped. It also silently leaves a size - // out of the result if the image is too small for it, rather than erroring, so that case never - // reaches the sync-error path below. + // third-party plugin data) are never at risk of being dropped. $metadata = _wp_make_subsizes( $new_sizes, $file, $metadata, $attachment_id ); + // _wp_make_subsizes() never returns a WP_Error: a size it couldn't create is just left out of + // the result, silently, whether that's because the image is legitimately too small for it (fine, + // expected) or because of a real, possibly transient failure (disk/permissions/memory/missing + // image editor). Since the "missing" entries were already unset above, an unreported real failure + // would otherwise be saved as if it were a success and never retried. Tell the two apart with + // image_resize_dimensions() -- the same check core itself uses to decide whether a size applies. + $failed = array(); + foreach ( $new_sizes as $size_name => $size_data ) { + if ( isset( $metadata['sizes'][ $size_name ] ) ) { + continue; + } + if ( ! image_resize_dimensions( $metadata['width'], $metadata['height'], $size_data['width'], $size_data['height'], $size_data['crop'] ) ) { + continue; // Too small for this size: leaving it out is expected. + } + $failed[] = $size_name; + } + + if ( ! empty( $failed ) ) { + // _wp_make_subsizes() saves metadata to the database after each size it successfully makes, + // so a partial failure may have already left a partial record there; restore the original. + wp_update_attachment_metadata( $attachment_id, $original ); + + return new \WP_Error( 'cloudinary_regenerate_sizes_failed', __( 'Could not regenerate attachment sizes.', 'cloudinary' ) ); + } + wp_update_attachment_metadata( $attachment_id, $metadata ); // Persist the new signature, otherwise this would re-trigger on every subsequent render. $this->sync->set_signature_item( $attachment_id, 'sizes' ); From 9153887c881d786023e632036b588a8e7a76f31c Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Wed, 21 Oct 2026 14:48:11 +0200 Subject: [PATCH 41/80] fix(sync): don't count an intentional sync delay as a loop strike Addresses review comment on #1328 (discussion_r4323662606): Storage's "Cloudinary only" offload mode deliberately delays removing the local file for a minute after upload (DELETE_DELAY). While that delay is active, Storage::validate() still returns true (the local file exists) and 'storage' isn't realtime, so validate_sync_type() hands it straight back without recursing; Storage::sync() then returns early via can_sync()'s delay_cld_only() filter, without saving a matching signature. process_assets() sees 'storage' repeat in the same pass -- an entirely expected, intentional wait, not a stuck attachment. Auto sync can run process_assets() on the same attachment several times within that one-minute window, so the strike counter added in the previous commit could reach its limit purely from this normal behaviour and permanently error out a healthy attachment. Skip the strike (but still break out of the pass, same as always) when can_sync() says the repeated type isn't meant to run right now. This generalizes beyond storage: any sync type gated the same way behind can_sync() gets the same treatment. Added a test that reproduces the real scenario -- 'cld' offload, a freshly-set delay, process_assets() called three times -- and confirms no sync error is set. Verified it fails without the fix (reverted the can_sync() check locally, confirmed the new test catches it, then restored the fix) before adding it. --- php/sync/class-push-sync.php | 65 ++++++++++--------- .../tests/test-push-sync-outer-loop-guard.php | 63 ++++++++++++++++++ 2 files changed, 99 insertions(+), 29 deletions(-) diff --git a/php/sync/class-push-sync.php b/php/sync/class-push-sync.php index f7ca50246..673101c52 100644 --- a/php/sync/class-push-sync.php +++ b/php/sync/class-push-sync.php @@ -287,36 +287,43 @@ public function process_assets( $attachments = array() ) { // would have just been picked up again on the next run. Instead, count // consecutive passes that ended this way across requests and only flag it // once that's happened a few times in a row. See GitHub issue #1301. - $looped = true; - $loop_count = (int) get_post_meta( $attachment_id, Sync::META_KEYS['loop_count'], true ) + 1; - - /** - * Filter how many consecutive passes may end in a repeated, non-advancing - * sync type for the same attachment before it's flagged with a sync error. - * - * @hook cloudinary_sync_loop_strikes - * - * @param int $strikes The number of strikes allowed. Default 3. - * @param string $type The sync type that repeated. - * @param int $attachment_id The attachment ID. - * - * @return int - */ - $loop_limit = apply_filters( 'cloudinary_sync_loop_strikes', 3, $type, $attachment_id ); - if ( $loop_count >= $loop_limit ) { - update_post_meta( - $attachment_id, - Sync::META_KEYS['sync_error'], - sprintf( - /* translators: %s is the sync type that would not advance. */ - __( 'Sync loop detected: the "%s" sync state is not advancing.', 'cloudinary' ), - $type - ) - ); - delete_post_meta( $attachment_id, Sync::META_KEYS['loop_count'] ); - } else { - update_post_meta( $attachment_id, Sync::META_KEYS['loop_count'], $loop_count ); + $looped = true; + + if ( $this->sync->can_sync( $attachment_id, $type ) ) { + $loop_count = (int) get_post_meta( $attachment_id, Sync::META_KEYS['loop_count'], true ) + 1; + + /** + * Filter how many consecutive passes may end in a repeated, non-advancing + * sync type for the same attachment before it's flagged with a sync error. + * + * @hook cloudinary_sync_loop_strikes + * + * @param int $strikes The number of strikes allowed. Default 3. + * @param string $type The sync type that repeated. + * @param int $attachment_id The attachment ID. + * + * @return int + */ + $loop_limit = apply_filters( 'cloudinary_sync_loop_strikes', 3, $type, $attachment_id ); + if ( $loop_count >= $loop_limit ) { + update_post_meta( + $attachment_id, + Sync::META_KEYS['sync_error'], + sprintf( + /* translators: %s is the sync type that would not advance. */ + __( 'Sync loop detected: the "%s" sync state is not advancing.', 'cloudinary' ), + $type + ) + ); + delete_post_meta( $attachment_id, Sync::META_KEYS['loop_count'] ); + } else { + update_post_meta( $attachment_id, Sync::META_KEYS['loop_count'], $loop_count ); + } } + // Else: can_sync() says this type isn't meant to run right now -- e.g. + // Storage's own delay before offloading to "Cloudinary only" storage -- so + // the repeat is an intentional wait, not evidence of being stuck. Don't count + // a strike for it; just stop this pass the same way the guard always has. break; } $stat[ $attachment_id ][ $type ] = true; diff --git a/tests/phpunit/tests/test-push-sync-outer-loop-guard.php b/tests/phpunit/tests/test-push-sync-outer-loop-guard.php index 050dc678c..7235a6de0 100644 --- a/tests/phpunit/tests/test-push-sync-outer-loop-guard.php +++ b/tests/phpunit/tests/test-push-sync-outer-loop-guard.php @@ -200,6 +200,69 @@ public function test_a_successful_pass_resets_the_strike_count() { $this->assertEmpty( get_post_meta( self::$attachment_id, Sync::META_KEYS['loop_count'], true ) ); } + /** + * A real sync type can repeat for a reason that isn't being stuck at all: Storage's "Cloudinary + * only" offload mode deliberately delays removing the local file for a minute after upload, so + * its own sync() returns early (via can_sync()'s delay_cld_only() filter) without saving a + * matching signature -- get_sync_type() keeps handing 'storage' back for as long as that delay + * lasts. Auto sync can easily run process_assets() on the same attachment three times within + * that one minute, so without this check those three ordinary, expected repeats would + * permanently error out a perfectly healthy attachment. + * + * @return void + */ + public function test_an_intentional_sync_delay_does_not_count_as_a_strike() { + $plugin = \Cloudinary\get_plugin_instance(); + $connect = $plugin->get_component( 'connect' ); + + $plugin->settings->set_param( 'connected', true ); + set_transient( Connect::META_KEYS['usage'], array( 'placeholder' => true ), HOUR_IN_SECONDS ); + $plugin->settings->set_value( 'cloudinary_url', 'cloudinary://123456789012345:abcdefghijklmnopqrstuvwxyzABCDEF@test-cloud' ); + $plugin->settings->set_value( 'offload', 'cld' ); + $connect->setup(); + + do_action( 'cloudinary_connected', $plugin ); // Delivery::init() etc. + + $plugin->get_component( 'media' )->setup(); + $sync = $plugin->get_component( 'sync' ); + $sync->setup(); + $plugin->get_component( 'delivery' )->setup(); + // Registers 'storage' and 'size' plus the delay_cld_only() filter, reading the 'cld' + // offload mode just set above. Must run before register_assets() below, which is what + // actually rebuilds $sync_types to include whatever is registered by this point. + $plugin->get_component( 'storage' )->setup(); + + $sync->register_assets(); + + // Act as if the attachment is already fully synced for everything except storage/size -- + // matching the real scenario this guards against, where auto sync has already uploaded a + // new attachment and the offload delay is the only thing left pending. $sync_types is + // protected, so read it the same way the other tests in this file reach sync_base_struct. + update_post_meta( self::$attachment_id, '_public_id', 'fake-public-id' ); + $reflection = new ReflectionProperty( $sync, 'sync_types' ); + $reflection->setAccessible( true ); + foreach ( array_keys( $reflection->getValue( $sync ) ) as $type ) { + if ( in_array( $type, array( 'storage', 'size' ), true ) ) { + continue; + } + $sync->set_signature_item( self::$attachment_id, $type ); + } + + // A delay that was just set, so delay_cld_only() blocks the actual offload for the next + // minute -- an intentional wait, not a stuck attachment. + update_post_meta( self::$attachment_id, Sync::META_KEYS['delay'], time() ); + + $push = $sync->managers['push']; + $push->process_assets( self::$attachment_id ); + $push->process_assets( self::$attachment_id ); + $push->process_assets( self::$attachment_id ); + + $this->assertEmpty( + get_post_meta( self::$attachment_id, Sync::META_KEYS['sync_error'], true ), + 'An intentional wait on the offload delay must never be counted as a stuck loop.' + ); + } + /** * Once errored, build_queue()'s own meta_query (`_cld_error` NOT EXISTS) is what keeps a * stuck attachment from being queued again -- confirm the flag this guard sets actually From bc7dfd692b7cea82b10ea9c175ba4f79eb9f7b97 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Oct 2026 01:02:54 +0000 Subject: [PATCH 42/80] chore(deps-dev): bump eslint from 10.12.0 to 10.13.0 Bumps [eslint](https://github.com/eslint/eslint) from 10.12.0 to 10.13.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](https://github.com/eslint/eslint/compare/v10.12.0...v10.13.0) --- updated-dependencies: - dependency-name: eslint dependency-version: 10.13.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index fdc2a526b..1ef9c9de2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "css-unicode-loader": "^1.0.3", "cssnano": "^9.8.0", "dotenv": "^18.0.8", - "eslint": "^10.12.0", + "eslint": "^10.13.0", "eslint-plugin-jest": "^29.17.0", "eslint-plugin-react-hooks": "^7.0.1", "file-loader": "^6.2.0", @@ -16427,9 +16427,9 @@ } }, "node_modules/eslint": { - "version": "10.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.12.0.tgz", - "integrity": "sha512-npHjrHb2o4ehH3mE+YuxABR+0gyb0aVWCIolgJDArwCiHEIsonBm3ZKjel5b0U5+a+MbEvIyRCGCzD3eKKK2NA==", + "version": "10.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.13.0.tgz", + "integrity": "sha512-UohDjD4zSzEwhf58M3O7vc/ycc8O1I7dNlhtD0WxE8Px8EHNJKtUwzBqrzeGhisRuv2ag4sAYswszCJRgKXYUg==", "dev": true, "license": "MIT", "workspaces": [ diff --git a/package.json b/package.json index 1d809f29f..564a6447e 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "css-unicode-loader": "^1.0.3", "cssnano": "^9.8.0", "dotenv": "^18.0.8", - "eslint": "^10.12.0", + "eslint": "^10.13.0", "eslint-plugin-jest": "^29.17.0", "eslint-plugin-react-hooks": "^7.0.1", "file-loader": "^6.2.0", From fcc92f3349c604d142f077f7df2e100618f3dcd0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Oct 2026 01:03:11 +0000 Subject: [PATCH 43/80] chore(deps-dev): bump @playwright/test from 1.63.0 to 1.64.1 Bumps [@playwright/test](https://github.com/microsoft/playwright) from 1.63.0 to 1.64.1. - [Release notes](https://github.com/microsoft/playwright/releases) - [Commits](https://github.com/microsoft/playwright/compare/v1.63.0...v1.64.1) --- updated-dependencies: - dependency-name: "@playwright/test" dependency-version: 1.64.1 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 24 ++++++++++++------------ package.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index fdc2a526b..7d3d7c64b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "tippy.js": "^6.3.1" }, "devDependencies": { - "@playwright/test": "^1.63.0", + "@playwright/test": "^1.64.1", "@wordpress/api-fetch": "^7.55.0", "@wordpress/block-editor": "^17.1.0", "@wordpress/blocks": "^16.0.0", @@ -6337,13 +6337,13 @@ } }, "node_modules/@playwright/test": { - "version": "1.63.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.63.0.tgz", - "integrity": "sha512-oxMK4vllB9RK5NQ2l1pq1IfOf2AvnEuj/vYGDj0H2nMtmtZpKtCwt/l00GEO6xjGfpBNAvjovvYdCm50dRQkpQ==", + "version": "1.64.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.64.1.tgz", + "integrity": "sha512-IaYGml/nSOiZWROfPtuIL7neuu9qDOZ3TNvNljUIrhDMxiGTgPjzj/g9p9RxpS2tSepPDRY+UwAaEeiKtUvIAg==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.63.0" + "playwright": "1.64.1" }, "bin": { "playwright": "cli.js" @@ -25058,13 +25058,13 @@ } }, "node_modules/playwright": { - "version": "1.63.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.63.0.tgz", - "integrity": "sha512-+7ziBLidS4NaNCdt57SUDT+wYmmd5fmiQejUic/kb+YsYSCPyOOE9sebzMjNmQrsnNpDJqd4WHvV/8lfKfUDUg==", + "version": "1.64.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.64.1.tgz", + "integrity": "sha512-HCrVhHr5QQuwYoswEUGTb7gGp522yflbv/ST8nF4sFWGuLjQCt17Q/EubpGGSNKYn1tsTCPZxqHhHCfVURu7UA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.63.0" + "playwright-core": "1.64.1" }, "bin": { "playwright": "cli.js" @@ -25074,9 +25074,9 @@ } }, "node_modules/playwright-core": { - "version": "1.63.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.63.0.tgz", - "integrity": "sha512-rYCsBF/M5HjUch52bbtVONEFjv6Xu8sm8h72dNlR5bzIE1fvC/bxgspzkjSfU+MweEMmPM8KJebG6nnyxo5mCg==", + "version": "1.64.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.64.1.tgz", + "integrity": "sha512-BC4s8y6SEVA6Q1rSxZTto8hI1KUI3xXlHGZgvGqP4IqPdI/a6FX9H29IDNz7vKo9l21b6LfYosScPL6M3xxyDQ==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index 1d809f29f..50d8782de 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "tippy.js": "^6.3.1" }, "devDependencies": { - "@playwright/test": "^1.63.0", + "@playwright/test": "^1.64.1", "@wordpress/api-fetch": "^7.55.0", "@wordpress/block-editor": "^17.1.0", "@wordpress/blocks": "^16.0.0", From 170714cfa6d672abf43a229d2bbe39aff0442eef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Oct 2026 01:03:23 +0000 Subject: [PATCH 44/80] chore(deps-dev): bump cssnano from 9.8.0 to 9.9.0 Bumps [cssnano](https://github.com/cssnano/cssnano) from 9.8.0 to 9.9.0. - [Release notes](https://github.com/cssnano/cssnano/releases) - [Commits](https://github.com/cssnano/cssnano/compare/cssnano@9.8.0...cssnano@9.9.0) --- updated-dependencies: - dependency-name: cssnano dependency-version: 9.9.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 1291 ++++----------------------------------------- package.json | 2 +- 2 files changed, 91 insertions(+), 1202 deletions(-) diff --git a/package-lock.json b/package-lock.json index fdc2a526b..8931f5eb9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "css-loader": "^7.1.5", "css-minimizer-webpack-plugin": "^8.0.0", "css-unicode-loader": "^1.0.3", - "cssnano": "^9.8.0", + "cssnano": "^9.9.0", "dotenv": "^18.0.8", "eslint": "^10.12.0", "eslint-plugin-jest": "^29.17.0", @@ -12934,9 +12934,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.11.27", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.27.tgz", - "integrity": "sha512-ElY12DaROGuan+lMmZ8Cvo/ZUbXPe7Enc/9VU/b1T3Kp4dwytRcNdR8DoSJN5SNJT/CuvcCA0DHDVmMOCePdRQ==", + "version": "2.11.30", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.30.tgz", + "integrity": "sha512-YJs6Pz17RMNv8HoyKREtCY38E3BV1nPkWVmIb+XN1uHC1Vqt3KZCH/uJH9ZKRoiKb/icZ6tvehyee6RZNbFfRA==", "dev": true, "license": "Apache-2.0", "bin": { @@ -13448,9 +13448,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001814", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001814.tgz", - "integrity": "sha512-/Uaf1lAzr59XcMpW0o96WoEfr+VXK2OX4U9AgFoiSHsVJ4HppnIFUjtYzsyDH2+tgANaQb2/oxYGwCPapN1FpA==", + "version": "1.0.30001816", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001816.tgz", + "integrity": "sha512-+8Yx7BXCoqk6IF8yTicjfUR6D/ldJzdlsodlEOiOSPmhK844WIgk67/zIQaGAOxNkZyyvBlrRFnLvqKIoqbAFw==", "dev": true, "funding": [ { @@ -15137,13 +15137,17 @@ } }, "node_modules/cssnano": { - "version": "9.8.0", - "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-9.8.0.tgz", - "integrity": "sha512-sNgrmVv7rtwR3j6VwjlgoDPq52ptYAKbsBQBm3SR1rEAg0e1feS8N2OqkPp1ZKmyGkpNr80kerYNCCbdQXhDtg==", + "version": "9.9.0", + "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-9.9.0.tgz", + "integrity": "sha512-JS914Th2NRk2979JHJvbE3UjPtLmyXtPnr23NNul9BOQwEt9r/A2aM1STrKtKHAPc3XRaUDwMoqkXnjEpgHkAw==", "dev": true, "license": "MIT", "dependencies": { - "cssnano-preset-default": "^9.8.0" + "@colordx/core": "^7.3.0", + "@csstools/css-tokenizer": "^4.0.2", + "browserslist": "^4.29.3", + "caniuse-api": "^4.0.0", + "postcss-calc": "^11.2.2" }, "engines": { "node": "^22.22.3 || ^24.15.0 || >=26.0" @@ -15156,53 +15160,10 @@ "postcss": "^8.5.29" } }, - "node_modules/cssnano-preset-default": { - "version": "9.8.0", - "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-9.8.0.tgz", - "integrity": "sha512-BIZvo83PsVGlCErJrFOVTTYgESKzPP3NnQwXVGwYQT6YfGnVHC3TKyVKSSyaAZPmu8pvDco58+5nnDfVniz86g==", - "dev": true, - "license": "MIT", - "dependencies": { - "browserslist": "^4.29.3", - "cssnano-utils": "^9.0.0", - "postcss-calc": "^11.2.2", - "postcss-colormin": "^9.0.8", - "postcss-convert-values": "^9.1.0", - "postcss-discard-comments": "^9.0.8", - "postcss-discard-duplicates": "^9.0.7", - "postcss-discard-empty": "^9.0.8", - "postcss-discard-overridden": "^9.0.6", - "postcss-merge-longhand": "^9.4.0", - "postcss-merge-rules": "^9.1.5", - "postcss-minify-font-values": "^9.0.9", - "postcss-minify-gradients": "^9.0.8", - "postcss-minify-params": "^9.1.0", - "postcss-minify-selectors": "^9.0.8", - "postcss-normalize-charset": "^9.0.6", - "postcss-normalize-display-values": "^9.0.7", - "postcss-normalize-positions": "^9.0.8", - "postcss-normalize-repeat-style": "^9.0.7", - "postcss-normalize-string": "^9.0.7", - "postcss-normalize-timing-functions": "^9.0.7", - "postcss-normalize-unicode": "^9.1.1", - "postcss-normalize-url": "^10.0.0", - "postcss-normalize-whitespace": "^9.0.8", - "postcss-ordered-values": "^9.0.9", - "postcss-reduce-initial": "^9.0.7", - "postcss-reduce-transforms": "^9.0.6", - "postcss-unique-selectors": "^9.0.6" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/cssnano-preset-default/node_modules/browserslist": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", - "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", + "node_modules/cssnano/node_modules/browserslist": { + "version": "4.29.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.4.tgz", + "integrity": "sha512-2TcbbiwXEq+N0kD36tykpCfyyQigUXmuwNQbnPp4Xk4PX9JOqVIKjJlIDjpH7uY6tmRGoAd+apeT1p60T8wsdA==", "dev": true, "funding": [ { @@ -15220,11 +15181,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.11.26", - "caniuse-lite": "^1.0.30001813", - "electron-to-chromium": "^1.5.439", - "node-releases": "^2.0.57", - "update-browserslist-db": "^1.3.3" + "baseline-browser-mapping": "^2.11.29", + "caniuse-lite": "^1.0.30001816", + "electron-to-chromium": "^1.5.459", + "node-releases": "^2.0.59", + "update-browserslist-db": "^1.3.4" }, "bin": { "browserslist": "cli.js" @@ -15233,7 +15194,18 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/cssnano-preset-default/node_modules/update-browserslist-db": { + "node_modules/cssnano/node_modules/caniuse-api": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-4.0.0.tgz", + "integrity": "sha512-B0hQ1OLyJuHTQSOWXvwibWqM6DCoqJdvBA6X1S/53bd4XU7LJ1yurIPlrsouol3mw1jh9pGI4ivubSpmJeIqCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.0.0", + "caniuse-lite": "^1.0.0" + } + }, + "node_modules/cssnano/node_modules/update-browserslist-db": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", @@ -15264,22 +15236,6 @@ "browserslist": ">= 4.21.0" } }, - "node_modules/cssnano-utils": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-9.0.0.tgz", - "integrity": "sha512-HIdFG2S06bygEl6+bZYPvA0/UyoYseXR/RpcvvwyE2NxWBbkZ70y9uRnvFwlQ4ztSlIeBqQBcwOMQG6DVrRHuA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@csstools/css-tokenizer": "^4.0.2" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, "node_modules/csso": { "version": "5.0.5", "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", @@ -16021,9 +15977,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.444", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.444.tgz", - "integrity": "sha512-5ss/uJfoDYDHT0lfJzT6FbcskIzROIOPf0BbbFkGcvDzoJU7i//9GDrwwIHQVmIsrAGiF3ihpADBRIsrEFt1rQ==", + "version": "1.5.459", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.459.tgz", + "integrity": "sha512-4SC9HHSFjO/liAhifpdOL5hG9b4BP7/5G3y3UPZVO8trlAXr1CaUEEJL0gWK3kOcYcZrOA5rkwG45Gra/lTIgg==", "dev": true, "license": "ISC" }, @@ -23390,9 +23346,9 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.57", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.57.tgz", - "integrity": "sha512-kQK9LGGFiHtrWiNhZtA7Qbw17AQz+dmsEKODRIVTXA9+e5MS/2gZEBhYJt13GrAz5/IOZKddH/0Z3TP/Zgo+yw==", + "version": "2.0.59", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.59.tgz", + "integrity": "sha512-5qr2okC4ItAI0hG5SaV0HoYMpnM/Y6+Oqr7AmPYy/2uEoGvS+GbSKLeRxSS1uAdu59yz0ouzcuXievSgg///WA==", "dev": true, "license": "MIT", "engines": { @@ -25157,246 +25113,6 @@ "postcss": "^8.5.29" } }, - "node_modules/postcss-colormin": { - "version": "9.0.8", - "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-9.0.8.tgz", - "integrity": "sha512-rQBcLCyI54KbpedRpCYMGoqY1IRGx/erQwh8+QjyeUCRM32sQYLAuZTJFh17VVEAV/4QuIl1RPzF3boCugHAiQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@colordx/core": "^7.3.0", - "@csstools/css-tokenizer": "^4.0.2", - "browserslist": "^4.29.3", - "caniuse-api": "^4.0.0", - "cssnano-utils": "^9.0.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-colormin/node_modules/browserslist": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", - "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "baseline-browser-mapping": "^2.11.26", - "caniuse-lite": "^1.0.30001813", - "electron-to-chromium": "^1.5.439", - "node-releases": "^2.0.57", - "update-browserslist-db": "^1.3.3" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/postcss-colormin/node_modules/caniuse-api": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-4.0.0.tgz", - "integrity": "sha512-B0hQ1OLyJuHTQSOWXvwibWqM6DCoqJdvBA6X1S/53bd4XU7LJ1yurIPlrsouol3mw1jh9pGI4ivubSpmJeIqCA==", - "dev": true, - "license": "MIT", - "dependencies": { - "browserslist": "^4.0.0", - "caniuse-lite": "^1.0.0" - } - }, - "node_modules/postcss-colormin/node_modules/update-browserslist-db": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", - "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/postcss-convert-values": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-9.1.0.tgz", - "integrity": "sha512-dI9//PzLr93HjLBtrsam6sYItqQvwBvt+DWNgIw4yyRJKnAo63jF8Sfy7d03DyuY7UHkEtGHKVrsI4SyxsmGpQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "browserslist": "^4.29.3", - "cssnano-utils": "^9.0.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-convert-values/node_modules/browserslist": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", - "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "baseline-browser-mapping": "^2.11.26", - "caniuse-lite": "^1.0.30001813", - "electron-to-chromium": "^1.5.439", - "node-releases": "^2.0.57", - "update-browserslist-db": "^1.3.3" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/postcss-convert-values/node_modules/update-browserslist-db": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", - "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/postcss-discard-comments": { - "version": "9.0.8", - "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-9.0.8.tgz", - "integrity": "sha512-YaHPbph+EYK2TXx1UieOtLKpBecoQE+wQmrlz6ob+OWaRwabniUJ1ugkTvHxX43inPsd1iEeJ2qxLaHJFte84Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@csstools/css-tokenizer": "^4.0.2", - "cssnano-utils": "^9.0.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-discard-duplicates": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-9.0.7.tgz", - "integrity": "sha512-rbsx1SvhBzCetQDbHVNfQrf0mG83Cyz5SPChQT2kPiXO32hWKPFtd00sy+j1NPPQJOGIVp1VHEgI55tGeqc3Kw==", - "dev": true, - "license": "MIT", - "dependencies": { - "cssnano-utils": "^9.0.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-discard-empty": { - "version": "9.0.8", - "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-9.0.8.tgz", - "integrity": "sha512-hCGjUuCd/IxKRyVl/uaJOLJTeACXo4GkS+0kRTvO8bBs0OxrGJWhxRaRPKXCdftCI+At0aAlosIgS0yjWNubuQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "cssnano-utils": "^9.0.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-discard-overridden": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-9.0.6.tgz", - "integrity": "sha512-9wT4dst0GdTpi3QWh/UP6ft1UiRhqNCfCKvyB4THpYzsHdpF7r2QduDBdeNUlVsgqaQhvzs+r43z3ZVZFequzQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, "node_modules/postcss-import": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-16.2.0.tgz", @@ -25481,426 +25197,35 @@ "dev": true, "license": "MIT" }, - "node_modules/postcss-merge-longhand": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-9.4.0.tgz", - "integrity": "sha512-FZqaPk9Frs6Ecxpeeb303N8DGAeYF3TpLG01mYQ1ws9FVVisQJqqHomoEmXvaEyrNyANZaHCAR5ShA1r/chM1Q==", + "node_modules/postcss-modules-extract-imports": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz", + "integrity": "sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-local-by-default": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.2.0.tgz", + "integrity": "sha512-5kcJm/zk+GJDSfw+V/42fJ5fhjL5YbFDl8nVdXkJPLLW+Vf9mTD5Xe0wqIaDnLuL2U6cDNpTr+UQ+v2HWIBhzw==", "dev": true, "license": "MIT", "dependencies": { - "@csstools/css-tokenizer": "^4.0.2", - "browserslist": "^4.29.3", - "cssnano-utils": "^9.0.0", - "stylehacks": "^9.0.8" + "icss-utils": "^5.0.0", + "postcss-selector-parser": "^7.0.0", + "postcss-value-parser": "^4.1.0" }, "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" + "node": "^10 || ^12 || >= 14" }, "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-merge-longhand/node_modules/browserslist": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", - "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "baseline-browser-mapping": "^2.11.26", - "caniuse-lite": "^1.0.30001813", - "electron-to-chromium": "^1.5.439", - "node-releases": "^2.0.57", - "update-browserslist-db": "^1.3.3" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/postcss-merge-longhand/node_modules/update-browserslist-db": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", - "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/postcss-merge-rules": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-9.1.5.tgz", - "integrity": "sha512-URhX03eaZ1lwYS+A573lNCsioCd6kNUkJUYXSq30uYDmRKSI+3FfR3a4c0lNqmYkgBPFzI8bY94QPdoQh5zNeA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@csstools/css-tokenizer": "^4.0.2", - "browserslist": "^4.29.3", - "caniuse-api": "^4.0.0", - "cssnano-utils": "^9.0.0", - "postcss-minify-selectors": "^9.0.8" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-merge-rules/node_modules/browserslist": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", - "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "baseline-browser-mapping": "^2.11.26", - "caniuse-lite": "^1.0.30001813", - "electron-to-chromium": "^1.5.439", - "node-releases": "^2.0.57", - "update-browserslist-db": "^1.3.3" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/postcss-merge-rules/node_modules/caniuse-api": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-4.0.0.tgz", - "integrity": "sha512-B0hQ1OLyJuHTQSOWXvwibWqM6DCoqJdvBA6X1S/53bd4XU7LJ1yurIPlrsouol3mw1jh9pGI4ivubSpmJeIqCA==", - "dev": true, - "license": "MIT", - "dependencies": { - "browserslist": "^4.0.0", - "caniuse-lite": "^1.0.0" - } - }, - "node_modules/postcss-merge-rules/node_modules/update-browserslist-db": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", - "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/postcss-minify-font-values": { - "version": "9.0.9", - "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-9.0.9.tgz", - "integrity": "sha512-eJkOtHU/zZWJJ7c1MWgalpACGV0sERvtowpWDrgr9Ys0seX5vFBx9pWLOrN8eYO2TIOfMvatMhvgtGKtre1gsg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@csstools/css-tokenizer": "^4.0.2", - "cssnano-utils": "^9.0.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-minify-gradients": { - "version": "9.0.8", - "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-9.0.8.tgz", - "integrity": "sha512-3xGO5lvhSz5m60ElGvU8HJYt0XmYpFkJ+HDK8CYoRvwdmQIjhurClan2z4lDEVkYpeKfrc5dNWIYKie01xhpng==", - "dev": true, - "license": "MIT", - "dependencies": { - "@colordx/core": "^7.3.0", - "@csstools/css-tokenizer": "^4.0.2", - "cssnano-utils": "^9.0.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-minify-params": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-9.1.0.tgz", - "integrity": "sha512-czaf0nUl7mKq1cpMUZ29rQ/2p5zE4TvszK+OkaaaiWuzLhyeaT9qvxxEgO2aNog8eQxCKD1oV6dX6NroAaOAaw==", - "dev": true, - "license": "MIT", - "dependencies": { - "browserslist": "^4.29.3", - "cssnano-utils": "^9.0.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-minify-params/node_modules/browserslist": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", - "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "baseline-browser-mapping": "^2.11.26", - "caniuse-lite": "^1.0.30001813", - "electron-to-chromium": "^1.5.439", - "node-releases": "^2.0.57", - "update-browserslist-db": "^1.3.3" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/postcss-minify-params/node_modules/update-browserslist-db": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", - "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/postcss-minify-selectors": { - "version": "9.0.8", - "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-9.0.8.tgz", - "integrity": "sha512-qMeQvr3ODymnvoDSwml4uTWufma0T2FhRxce4htQ+45otzsm1QyNAg98DXGrawVpGooU2vElaBd8qI+YCwF0UQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "browserslist": "^4.29.3", - "caniuse-api": "^4.0.0", - "cssnano-utils": "^9.0.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-minify-selectors/node_modules/browserslist": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", - "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "baseline-browser-mapping": "^2.11.26", - "caniuse-lite": "^1.0.30001813", - "electron-to-chromium": "^1.5.439", - "node-releases": "^2.0.57", - "update-browserslist-db": "^1.3.3" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/postcss-minify-selectors/node_modules/caniuse-api": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-4.0.0.tgz", - "integrity": "sha512-B0hQ1OLyJuHTQSOWXvwibWqM6DCoqJdvBA6X1S/53bd4XU7LJ1yurIPlrsouol3mw1jh9pGI4ivubSpmJeIqCA==", - "dev": true, - "license": "MIT", - "dependencies": { - "browserslist": "^4.0.0", - "caniuse-lite": "^1.0.0" - } - }, - "node_modules/postcss-minify-selectors/node_modules/update-browserslist-db": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", - "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/postcss-modules-extract-imports": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz", - "integrity": "sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==", - "dev": true, - "license": "ISC", - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-modules-local-by-default": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.2.0.tgz", - "integrity": "sha512-5kcJm/zk+GJDSfw+V/42fJ5fhjL5YbFDl8nVdXkJPLLW+Vf9mTD5Xe0wqIaDnLuL2U6cDNpTr+UQ+v2HWIBhzw==", - "dev": true, - "license": "MIT", - "dependencies": { - "icss-utils": "^5.0.0", - "postcss-selector-parser": "^7.0.0", - "postcss-value-parser": "^4.1.0" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" + "postcss": "^8.1.0" } }, "node_modules/postcss-modules-local-by-default/node_modules/postcss-selector-parser": { @@ -25910,286 +25235,57 @@ "dev": true, "license": "MIT", "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-modules-scope": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.2.1.tgz", - "integrity": "sha512-m9jZstCVaqGjTAuny8MdgE88scJnCiQSlSrOWcTQgM2t32UBe+MUmFSO5t7VMSfAf/FJKImAxBav8ooCHJXCJA==", - "dev": true, - "license": "ISC", - "dependencies": { - "postcss-selector-parser": "^7.0.0" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-modules-scope/node_modules/postcss-selector-parser": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.4.tgz", - "integrity": "sha512-HeP7D2wyhkR+XaK6v4W8oRF62Dsz4flyuczALJp61GckGm42u1saSSJ/0auvcBqxs3jMRFEcPK34At/0JBKdOg==", - "dev": true, - "license": "MIT", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-modules-values": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", - "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "icss-utils": "^5.0.0" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-normalize-charset": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-9.0.6.tgz", - "integrity": "sha512-H336j3ofJ5nM6TLW1nbKHj3zIMtGkycfS0KetU1cmcTtTwQ0f9CvdLVZUmBja6+IO3xuqMogjkYtB91K2slshQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-normalize-display-values": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-9.0.7.tgz", - "integrity": "sha512-M9eGIjAdIjuO6t4HqQJBOjbC+rI+9hF/srxppXa7xAY7EpCwdYVepq8PEAad1pb8EfEWoSCGpK9++nCcw5rl+w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@csstools/css-tokenizer": "^4.0.2", - "cssnano-utils": "^9.0.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-normalize-positions": { - "version": "9.0.8", - "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-9.0.8.tgz", - "integrity": "sha512-LymeX5GrQjS2N6xyBUpKsVMX+DSufYr1OSJYmM3iWVYre0zeBkKiaWNNqLeiJZMcdHgfcRw0HsLnhh7mNhO60A==", - "dev": true, - "license": "MIT", - "dependencies": { - "cssnano-utils": "^9.0.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-normalize-repeat-style": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-9.0.7.tgz", - "integrity": "sha512-13iZyi8hUtMEUO3vSQVOH20ByhT8zzEx/2cmONY/tcfZYnMwgPGxn+p5OvJZTbmxhUDqSFsIWpBVBIEA5fJeYQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "cssnano-utils": "^9.0.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-normalize-string": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-9.0.7.tgz", - "integrity": "sha512-1XZyPwvQpoYewPpveU70LjTA/L17vxECuHnSf4Fg3lRgTzFza9Nxbk1lztTQ41+6PlNKxB2lXX/HGRX5QCbLQg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@csstools/css-tokenizer": "^4.0.2", - "cssnano-utils": "^9.0.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-normalize-timing-functions": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-9.0.7.tgz", - "integrity": "sha512-fWFD289YZXKgIsi28EjT5FuM2NMkEp/5zj1uZZJj/OCXTXun3KFVn2/cbU9iSfgmEbNlJ+uxyFw6GW2aQybKgw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@csstools/css-tokenizer": "^4.0.2", - "cssnano-utils": "^9.0.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-normalize-unicode": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-9.1.1.tgz", - "integrity": "sha512-DRS7ywJHmYDvxWoMc5ran1Yc18tbnvx5g3o8rX6N1JFGrwdlsOcRZ8NyGx35/y+GxgjdpWEBXdnSGmoF7mK4mQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@csstools/css-tokenizer": "^4.0.2", - "browserslist": "^4.29.3", - "cssnano-utils": "^9.0.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-normalize-unicode/node_modules/browserslist": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", - "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "baseline-browser-mapping": "^2.11.26", - "caniuse-lite": "^1.0.30001813", - "electron-to-chromium": "^1.5.439", - "node-releases": "^2.0.57", - "update-browserslist-db": "^1.3.3" - }, - "bin": { - "browserslist": "cli.js" + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" }, "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/postcss-normalize-unicode/node_modules/update-browserslist-db": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", - "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" + "node": ">=4" } }, - "node_modules/postcss-normalize-url": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-10.0.0.tgz", - "integrity": "sha512-AJmPYk7SofTPfeOWvU9AUxKWDWAB0G7vdP9tbn5dXaWBwbqr5x/dmHvbXeWNDF9pqJdq51afuz4cod/a9/ogdw==", + "node_modules/postcss-modules-scope": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.2.1.tgz", + "integrity": "sha512-m9jZstCVaqGjTAuny8MdgE88scJnCiQSlSrOWcTQgM2t32UBe+MUmFSO5t7VMSfAf/FJKImAxBav8ooCHJXCJA==", "dev": true, - "license": "MIT", + "license": "ISC", "dependencies": { - "@csstools/css-tokenizer": "^4.0.2", - "cssnano-utils": "^9.0.0" + "postcss-selector-parser": "^7.0.0" }, "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" + "node": "^10 || ^12 || >= 14" }, "peerDependencies": { - "postcss": "^8.5.29" + "postcss": "^8.1.0" } }, - "node_modules/postcss-normalize-whitespace": { - "version": "9.0.8", - "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-9.0.8.tgz", - "integrity": "sha512-YhqcSyZX6fVIM6sZFf/nd3ZOEEclNZmLSgork6NgetpnQK0QOCyIuT/h3nVja+up5hXCVffl6VcGVqSL8kS4OA==", + "node_modules/postcss-modules-scope/node_modules/postcss-selector-parser": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.4.tgz", + "integrity": "sha512-HeP7D2wyhkR+XaK6v4W8oRF62Dsz4flyuczALJp61GckGm42u1saSSJ/0auvcBqxs3jMRFEcPK34At/0JBKdOg==", "dev": true, "license": "MIT", "dependencies": { - "@csstools/css-tokenizer": "^4.0.2", - "cssnano-utils": "^9.0.0" + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" }, "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" + "node": ">=4" } }, - "node_modules/postcss-ordered-values": { - "version": "9.0.9", - "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-9.0.9.tgz", - "integrity": "sha512-bEeFjrZITn6H81YjFgctaoY5XPXEQeS5NOwMroB47CocSfgnbpc9wH2QzNLXxnhcfEdsGCkTAi8kATYY/EkyTw==", + "node_modules/postcss-modules-values": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", + "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", "dev": true, - "license": "MIT", + "license": "ISC", "dependencies": { - "cssnano-utils": "^9.0.0" + "icss-utils": "^5.0.0" }, "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" + "node": "^10 || ^12 || >= 14" }, "peerDependencies": { - "postcss": "^8.5.29" + "postcss": "^8.1.0" } }, "node_modules/postcss-prefix-selector": { @@ -26202,115 +25298,6 @@ "postcss": ">4 <9" } }, - "node_modules/postcss-reduce-initial": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-9.0.7.tgz", - "integrity": "sha512-5mnNVdVCf7tI1j2uYtiopoLZ6Dm+M7y4Fz32STAtTEZa7LbOf44zYBYduwd952xXshTJkRHpT2Q2UmK+XLo5ew==", - "dev": true, - "license": "MIT", - "dependencies": { - "browserslist": "^4.29.3", - "caniuse-api": "^4.0.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/postcss-reduce-initial/node_modules/browserslist": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", - "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "baseline-browser-mapping": "^2.11.26", - "caniuse-lite": "^1.0.30001813", - "electron-to-chromium": "^1.5.439", - "node-releases": "^2.0.57", - "update-browserslist-db": "^1.3.3" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/postcss-reduce-initial/node_modules/caniuse-api": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-4.0.0.tgz", - "integrity": "sha512-B0hQ1OLyJuHTQSOWXvwibWqM6DCoqJdvBA6X1S/53bd4XU7LJ1yurIPlrsouol3mw1jh9pGI4ivubSpmJeIqCA==", - "dev": true, - "license": "MIT", - "dependencies": { - "browserslist": "^4.0.0", - "caniuse-lite": "^1.0.0" - } - }, - "node_modules/postcss-reduce-initial/node_modules/update-browserslist-db": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", - "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/postcss-reduce-transforms": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-9.0.6.tgz", - "integrity": "sha512-xW/3eNKeL9vVXNMiJdI7ythFkC4CGDq04ziTN0/oJwJXIKeJCenLbM9IXU5ton/iNrwtqzZphERdtad4auQ9wQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "cssnano-utils": "^9.0.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, "node_modules/postcss-resolve-nested-selector": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.6.tgz", @@ -26386,22 +25373,6 @@ "node": ">=4" } }, - "node_modules/postcss-unique-selectors": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-9.0.6.tgz", - "integrity": "sha512-mhXCmLZbqDtzM2JbtjGP36555/aob2fbOXSW8cP0SiNtssVSKB8aG7EbiAhVZKV/toJLqKJm1ayWArvzc5+huA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@csstools/css-tokenizer": "^4.0.2" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, "node_modules/postcss-urlrebase": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/postcss-urlrebase/-/postcss-urlrebase-1.4.0.tgz", @@ -29381,88 +28352,6 @@ "dev": true, "license": "ISC" }, - "node_modules/stylehacks": { - "version": "9.0.8", - "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-9.0.8.tgz", - "integrity": "sha512-PIopN/yo+/Queh2lTvJLQuXJ5yrqxWk6fQTN10daJVjnEaqkM+i+IjQdc8Jzl2fnJ8Ngq1vb57vI0hoLkKs22w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@csstools/css-tokenizer": "^4.0.2", - "browserslist": "^4.29.3" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0" - }, - "peerDependencies": { - "postcss": "^8.5.29" - } - }, - "node_modules/stylehacks/node_modules/browserslist": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", - "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "baseline-browser-mapping": "^2.11.26", - "caniuse-lite": "^1.0.30001813", - "electron-to-chromium": "^1.5.439", - "node-releases": "^2.0.57", - "update-browserslist-db": "^1.3.3" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/stylehacks/node_modules/update-browserslist-db": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", - "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, "node_modules/stylelint": { "version": "17.15.0", "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-17.15.0.tgz", diff --git a/package.json b/package.json index 1d809f29f..13295fda4 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "css-loader": "^7.1.5", "css-minimizer-webpack-plugin": "^8.0.0", "css-unicode-loader": "^1.0.3", - "cssnano": "^9.8.0", + "cssnano": "^9.9.0", "dotenv": "^18.0.8", "eslint": "^10.12.0", "eslint-plugin-jest": "^29.17.0", From cd7f68703abb5ac693a331e8f17cfa0fa7c4af81 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Oct 2026 01:03:47 +0000 Subject: [PATCH 45/80] chore(deps-dev): bump webpack from 5.111.1 to 5.112.0 Bumps [webpack](https://github.com/webpack/webpack) from 5.111.1 to 5.112.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Changelog](https://github.com/webpack/webpack/blob/main/CHANGELOG.md) - [Commits](https://github.com/webpack/webpack/compare/v5.111.1...v5.112.0) --- updated-dependencies: - dependency-name: webpack dependency-version: 5.112.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 59 ++++++++++++++++++++++++++++------------------- package.json | 2 +- 2 files changed, 36 insertions(+), 25 deletions(-) diff --git a/package-lock.json b/package-lock.json index fdc2a526b..986cbb53e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -70,7 +70,7 @@ "rtlcss-webpack-plugin": "^4.0.4", "taffydb": "^2.7.3", "terser-webpack-plugin": "^5.3.14", - "webpack": "^5.111.1", + "webpack": "^5.112.0", "webpack-cli": "^7.2.3", "wp-hookdoc": "^0.2.0" }, @@ -16101,9 +16101,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.25.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.25.1.tgz", - "integrity": "sha512-nGXts5znJzmWPu+mIE9izCOzdg63oJca2mDzGWWTth7sr4aCToKcoyFVBQwN75Ij5Pf6p510EwkTqViTRzDV+w==", + "version": "5.26.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.26.0.tgz", + "integrity": "sha512-9vhedylFonb2YGogzUKX6+Ja72gOJbN1QHAqdrvqLwhdl/QWbKopzoUC9EbQNVsAns/bx/4uyqalrQAoy1IByw==", "dev": true, "license": "MIT", "dependencies": { @@ -22997,15 +22997,15 @@ } }, "node_modules/minimizer-webpack-plugin": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/minimizer-webpack-plugin/-/minimizer-webpack-plugin-5.10.1.tgz", - "integrity": "sha512-+dsZEyTcy1lkq41lxdiOqvb26gXbYGgwY+30w37f9PqUVkuEBejBLDotsHOTjuga9xJyGLW2DqzKDUyJ4W/PMQ==", + "version": "5.13.1", + "resolved": "https://registry.npmjs.org/minimizer-webpack-plugin/-/minimizer-webpack-plugin-5.13.1.tgz", + "integrity": "sha512-1mhAfvachWYYOm8tpmany5NLuvP+F2wxZWBSX8DC0uFS2wJpM9q3rWgN9wBooAH9d5V12wX0BjyJe4fMjHMarQ==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "^0.3.31", "jest-worker": "^27.4.5", - "schema-utils": "^4.3.3", + "schema-utils": "^4.6.0", "terser": "^5.51.0" }, "engines": { @@ -28214,9 +28214,9 @@ } }, "node_modules/schema-utils": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.5.0.tgz", - "integrity": "sha512-zJlMCZ0cAR5p/Y4oVpRoqioDMJcGxaXRrQ/4rP4WyR84vc5z/DolXdbvXeDpTwbtocDFr2rhPqHPErDCUtz2kA==", + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.8.1.tgz", + "integrity": "sha512-x39pYlJPyH7Uge5QO64B9XGP9zLDc9WNmiQZc+CE3IzZPvMu3lHOuAMGpYNoPixEL7MSWlGhYTg5UlLSL8G6iw==", "dev": true, "license": "MIT", "dependencies": { @@ -28225,12 +28225,23 @@ "ajv-formats": "^3.0.1", "ajv-keywords": "^5.1.0" }, + "bin": { + "schema-utils": "bin/schema-utils.js" + }, "engines": { "node": ">= 10.13.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.112.0" + }, + "peerDependenciesMeta": { + "webpack": { + "optional": true + } } }, "node_modules/schema-utils/node_modules/ajv": { @@ -31568,9 +31579,9 @@ } }, "node_modules/watchpack": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.5.2.tgz", - "integrity": "sha512-6i/00NBjP4yGPs+caKSyRfpTF/8Torsu0MOW3mMzIbhgISFder8i7xbqgHlLMwJrdiN8ndBV3UA1/AfzPSr+jg==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.6.3.tgz", + "integrity": "sha512-s3NZy0QpTY9qGqzc0wtz4qI28z3+5qKbbAec4MV4G9N3CfgZ9wgvQRr0cl2jh/tqkWG1NWHkmVMHZpCamev5Wg==", "dev": true, "license": "MIT", "dependencies": { @@ -31632,9 +31643,9 @@ } }, "node_modules/webpack": { - "version": "5.111.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.111.1.tgz", - "integrity": "sha512-cNypaz0RP+S4cvQVi1M/3bRUkvNP0xZpL0TjFx+c6jg64VbxD+2weWDgY9UnjRI6dhZgtaj8DU76GGFcJ79xPQ==", + "version": "5.112.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.112.0.tgz", + "integrity": "sha512-NIBpsRuCll036haDDt/CfcTDfsWNR9Z782nMRMI9D377BsGcYzZDTNU5TyzhCJzPIcihAxMBaMAhq2WSaDrH8Q==", "dev": true, "license": "MIT", "dependencies": { @@ -31645,16 +31656,16 @@ "@webassemblyjs/wasm-parser": "^1.14.1", "browserslist": "^4.28.1", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.25.0", + "enhanced-resolve": "^5.26.0", "es-module-lexer": "^2.1.0", "events": "^3.2.0", "graceful-fs": "^4.2.11", "mime-db": "^1.54.0", - "minimizer-webpack-plugin": "^5.7.0", + "minimizer-webpack-plugin": "^5.13.0", "schema-utils": "^4.5.0", "tapable": "^2.3.0", - "watchpack": "^2.5.2", - "webpack-sources": "^3.5.1" + "watchpack": "^2.6.1", + "webpack-sources": "^3.6.0" }, "bin": { "webpack": "bin/webpack.js" @@ -32104,9 +32115,9 @@ } }, "node_modules/webpack-sources": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.5.1.tgz", - "integrity": "sha512-jyuiGJdtvY434z5bUZrjz67v76/ePNvFZTp9Mdz29IlH4+GPsgyGjiv0fKI+M7BdkU6ADjulUcKAd3tUK3WlEw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.6.0.tgz", + "integrity": "sha512-EIMmPVvNI0CYXyRPp34F2Qk7W37/BZVZIofS6LAUnrNjCVahS+hO4mxwFJDjQjODTGZDtVzLYoN2+1dYkhk9qA==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 1d809f29f..2712220a5 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "rtlcss-webpack-plugin": "^4.0.4", "taffydb": "^2.7.3", "terser-webpack-plugin": "^5.3.14", - "webpack": "^5.111.1", + "webpack": "^5.112.0", "webpack-cli": "^7.2.3", "wp-hookdoc": "^0.2.0" }, From 07037df95f7191433e5f03121a706834aae58202 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Fri, 23 Oct 2026 03:50:55 +0000 Subject: [PATCH 46/80] fix: upgrade @codemirror/state from 6.7.4 to 6.7.6 Snyk has created this PR to upgrade @codemirror/state from 6.7.4 to 6.7.6. See this package in npm: @codemirror/state See this project in Snyk: https://app.snyk.io/org/cloudinaryltd/project/96b8a37d-7953-4bdc-a10b-bd7b659552ac?utm_source=github&utm_medium=referral&page=upgrade-pr From 16143690a3a50eb7108ee0f4c3e29a38144565b2 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Mon, 26 Oct 2026 12:24:19 +0100 Subject: [PATCH 47/80] fix: avoid using null as an array offset in static caches and component parts PHP 8.5 deprecates using null as an array offset. Relationship::get_relationship() and Delivery::get_sized() can be called with a null ID (e.g. when the cloudinary_contextualized_post_id filter returns null), and Component::get_part() is called with a null part by the Opt_Level component. Cast the IDs to int (the Relationship constructor already does so) and skip the build parts lookup for a null part. --- php/class-delivery.php | 2 ++ php/relate/class-relationship.php | 7 ++++--- php/ui/class-component.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/php/class-delivery.php b/php/class-delivery.php index 1d920518f..e4de801aa 100644 --- a/php/class-delivery.php +++ b/php/class-delivery.php @@ -541,6 +541,8 @@ public function unsync_size_relationship( $attachment_id ) { */ public function get_sized( $attachment_id ) { static $sizes = array(), $registered_sizes; + + $attachment_id = (int) $attachment_id; if ( ! $registered_sizes ) { $registered_sizes = wp_get_registered_image_subsizes(); } diff --git a/php/relate/class-relationship.php b/php/relate/class-relationship.php index bedeef302..172e4ac14 100644 --- a/php/relate/class-relationship.php +++ b/php/relate/class-relationship.php @@ -270,11 +270,12 @@ public function delete_cache() { public static function get_relationship( $post_id ) { static $cache = array(); - if ( ! isset( $cache[ $post_id ] ) ) { - $cache[ $post_id ] = new self( $post_id ); + $key = (int) $post_id; + if ( ! isset( $cache[ $key ] ) ) { + $cache[ $key ] = new self( $post_id ); } - return $cache[ $post_id ]; + return $cache[ $key ]; } /** diff --git a/php/ui/class-component.php b/php/ui/class-component.php index 71b0396e1..33815e09b 100644 --- a/php/ui/class-component.php +++ b/php/ui/class-component.php @@ -631,7 +631,7 @@ public function get_part( $part ) { 'content' => null, 'name' => $part, ); - if ( isset( $this->build_parts[ $part ] ) ) { + if ( null !== $part && isset( $this->build_parts[ $part ] ) ) { $struct = wp_parse_args( $this->build_parts[ $part ], $struct ); } if ( $this->setting->has_param( 'attributes' . $this->setting->separator . $part ) ) { From 4556084cfb5fbdb5f4bdf39f8b9bc6af39886ba5 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Mon, 26 Oct 2026 12:24:40 +0100 Subject: [PATCH 48/80] fix: stop the string replace output handler from producing output PHP 8.4 deprecates producing output from within a user output handler ("ob_end_flush(): Producing output from user output handler Cloudinary\String_Replace::replace_strings is deprecated"). The double ob_start() is not the cause on its own: the deprecation fires when an error is displayed while the handler runs (e.g. notices raised by cloudinary_string_replace callbacks, with display_errors on), since that display is output produced inside the handler and is discarded anyway. Route the buffers through a dedicated output_handler() that disables display_errors while replacing strings and restores it afterwards. Errors are still logged. Both buffers are kept to preserve the early-flush workaround. --- php/class-string-replace.php | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/php/class-string-replace.php b/php/class-string-replace.php index 905fa9a27..ec41eb2df 100644 --- a/php/class-string-replace.php +++ b/php/class-string-replace.php @@ -164,8 +164,30 @@ public function init() { * Stop the buffer capture and set the output callback. */ public function start_capture() { - ob_start( array( $this, 'replace_strings' ) ); - ob_start( array( $this, 'replace_strings' ) ); // Second call to catch early buffer flushing. + ob_start( array( $this, 'output_handler' ) ); + ob_start( array( $this, 'output_handler' ) ); // Second call to catch early buffer flushing. + } + + /** + * Output buffer callback to replace strings in the captured buffer. + * + * Output produced within an output handler is discarded, and doing so is deprecated as of PHP 8.4. + * Errors displayed while replacing (e.g. notices raised by hooked callbacks) would count as such output, + * so display is disabled for the duration of the handler. Errors are still logged as usual. + * + * @param string $buffer The captured buffer. + * @param int $phase The output handler phase bitmask. + * + * @return string + */ + public function output_handler( $buffer, $phase ) { + $display_errors = ini_set( 'display_errors', '0' ); // phpcs:ignore WordPress.PHP.IniSet.display_errors_Disallowed + $buffer = $this->replace_strings( $buffer, $phase ); + if ( false !== $display_errors ) { + ini_set( 'display_errors', $display_errors ); // phpcs:ignore WordPress.PHP.IniSet.display_errors_Disallowed + } + + return $buffer; } /** @@ -285,7 +307,7 @@ protected function prime_replacements( $content, $context = 'view' ) { * Replace string in HTML. * * @param string|array $content The HTML. - * @param string $context The context to use. + * @param string|int $context The context to use, or the output handler phase when capturing a buffer. * * @return string */ From fdc4836580ff231882be583d9a4e9329e4efbea5 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Mon, 26 Oct 2026 12:24:58 +0100 Subject: [PATCH 49/80] fix: cache attachment size URL lookups under the intended key Delivery::find_attachment_size_urls() reused $key inside the results loop for each attachment URL, so wp_cache_add() stored the results under the last attachment's URL instead of md5( $sql ). When the last wp_get_attachment_url() call failed, the key was false, triggering "WP_Object_Cache::add was called incorrectly. Cache key must be an integer or a non-empty string, boolean given". Use a separate variable for the attachment URL, and skip attachments without a URL rather than mapping them under a false key. --- php/class-delivery.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/php/class-delivery.php b/php/class-delivery.php index e4de801aa..34801a6b6 100644 --- a/php/class-delivery.php +++ b/php/class-delivery.php @@ -955,8 +955,10 @@ public function find_attachment_size_urls() { $this->sync->add_to_sync( $post_id ); } $size = $this->get_sized( $post_id ); - $key = ! empty( $size['sized_url'] ) ? $size['sized_url'] : wp_get_attachment_url( $post_id ); - $cached[ $key ] = (int) $post_id; + $attachment_url = ! empty( $size['sized_url'] ) ? $size['sized_url'] : wp_get_attachment_url( $post_id ); + if ( $attachment_url ) { + $cached[ $attachment_url ] = (int) $post_id; + } } } wp_cache_add( $key, $cached ); From 216dbf2d62821d1cce7c9b5e9bd7e2b528788482 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Mon, 26 Oct 2026 12:51:55 +0100 Subject: [PATCH 50/80] fix: avoid passing null to preg_replace() when getting a parent asset version Media::get_cloudinary_version() passed the parent attachment's version meta straight to preg_replace(). When the parent has no version meta, get_post_meta() returns its null default, triggering "preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated". Default the meta to an empty string, which still resolves to version 1. --- php/class-media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-media.php b/php/class-media.php index 9948db77b..65f6daf57 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -3180,7 +3180,7 @@ public function get_cloudinary_version( $attachment_id ) { $attachment = get_post( $attachment_id ); if ( ! empty( $attachment ) && Assets::POST_TYPE_SLUG === $attachment->post_type && ! empty( $attachment->post_parent ) ) { - $version = (int) preg_replace( '/\D/', '', $this->get_post_meta( (int) $attachment->post_parent, Sync::META_KEYS['version'], true ) ); + $version = (int) preg_replace( '/\D/', '', $this->get_post_meta( (int) $attachment->post_parent, Sync::META_KEYS['version'], true, '' ) ); } } From 6cffc38db865d5cd97c483d5820c1b1ea1a37643 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Mon, 26 Oct 2026 13:03:37 +0100 Subject: [PATCH 51/80] fix: skip unresolved contextualized attachments when finding size URLs The cloudinary_contextualized_post_id filter can return null, e.g. WPML's wpml_object_id for an attachment without a translation in the current language. Delivery::find_attachment_size_urls() then carried on with a null ID, calling create_delivery( null ), which ends in wp_cache_delete( null ) ("WP_Object_Cache::delete was called incorrectly. Cache key must be an integer or a non-empty string, NULL given"), and add_to_sync( null ). Skip the result when the contextualized ID is empty. --- php/class-delivery.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php/class-delivery.php b/php/class-delivery.php index 34801a6b6..7d5c4ef8b 100644 --- a/php/class-delivery.php +++ b/php/class-delivery.php @@ -944,7 +944,8 @@ public function find_attachment_size_urls() { */ $post_id = apply_filters( 'cloudinary_contextualized_post_id', $result->post_id ); - if ( ! $this->is_deliverable( $post_id ) ) { + // The contextualized post can be missing, e.g. WPML returns null for an attachment without a translation. + if ( empty( $post_id ) || ! $this->is_deliverable( $post_id ) ) { continue; } // If we are here, it means that an attachment in the media library doesn't have a delivery for the url. From fa7d36146df0b0879fcc25e9f0fc52a393596172 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Tue, 27 Oct 2026 00:07:37 +0000 Subject: [PATCH 52/80] fix: upgrade @codemirror/state from 6.7.4 to 6.7.6 Snyk has created this PR to upgrade @codemirror/state from 6.7.4 to 6.7.6. See this package in npm: @codemirror/state See this project in Snyk: https://app.snyk.io/org/cloudinaryltd/project/96b8a37d-7953-4bdc-a10b-bd7b659552ac?utm_source=github&utm_medium=referral&page=upgrade-pr --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index d443c9a92..bf6fe0bf6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "license": "GPL-2.0+", "dependencies": { "@codemirror/lang-json": "^6.0.2", - "@codemirror/state": "^6.7.4", + "@codemirror/state": "^6.7.6", "@codemirror/theme-one-dark": "^6.1.3", "chart.js": "^4.5.1", "classnames": "^2.3.1", @@ -2184,9 +2184,9 @@ } }, "node_modules/@codemirror/state": { - "version": "6.7.4", - "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.7.4.tgz", - "integrity": "sha512-QhQIVRY+xHZDxwOSFrJ1eUMapJBUID3IdeAjf7dHO7zBUzSkyooHiodnalz5MG3iHzwixKMlAAyn7244y537EA==", + "version": "6.7.6", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.7.6.tgz", + "integrity": "sha512-kAz+AncRtKuIknedxT1bq4XwXv4UowhbkHU1myPrtVb/jZtImWuV5BXzv5vK6i3kYACsdiZiQKFQQ5Mq7elW8w==", "license": "MIT", "dependencies": { "@marijn/find-cluster-break": "^1.0.0" diff --git a/package.json b/package.json index 8a9b2fc69..39c3a5c35 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ }, "dependencies": { "@codemirror/lang-json": "^6.0.2", - "@codemirror/state": "^6.7.4", + "@codemirror/state": "^6.7.6", "@codemirror/theme-one-dark": "^6.1.3", "chart.js": "^4.5.1", "classnames": "^2.3.1", From 06bc81de6e9dc309d9e9ceb9c232269fb56d51ac Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Tue, 27 Oct 2026 12:47:43 +0530 Subject: [PATCH 53/80] test(e2e): Add global image transformations spec Check that the global image format and quality settings reach the delivery URL of a newly synced image: - non-default values (webp, 60) give f_webp and q_60 - reverting to the defaults gives f_auto and q_auto - "Not set" removes the f_ and q_ parameters --- .../cloudinary-global-transformations.spec.js | 293 ++++++++++++++++++ 1 file changed, 293 insertions(+) create mode 100644 tests/e2e/cloudinary-global-transformations.spec.js diff --git a/tests/e2e/cloudinary-global-transformations.spec.js b/tests/e2e/cloudinary-global-transformations.spec.js new file mode 100644 index 000000000..880ed0c5f --- /dev/null +++ b/tests/e2e/cloudinary-global-transformations.spec.js @@ -0,0 +1,293 @@ +/** + * External dependencies + */ +const fs = require( 'fs' ); +const path = require( 'path' ); +const { test, expect } = require( './fixtures' ); + +/** + * Internal dependencies + */ +const { ensureCloudinaryConnected } = require( './utils/connection' ); +const { expectCloudinaryUrl } = require( './utils/delivery' ); +const { wpCli, wpEvalFile } = require( './utils/wizard' ); + +const FIXTURE_PATH = path.join( __dirname, 'fixtures', 'test-image.jpg' ); + +/** + * Settings pinned for every test so that the server writes the final + * delivery URL into `src`. With lazy load on, `src` is an SVG placeholder, + * and with breakpoints on, the URL also carries breakpoint sizes. + * + * @type {Record} + */ +const BASE_SETTINGS = { + image_optimization: 'on', + image_freeform: '', + use_lazy_load: 'off', + enable_breakpoints: 'off', +}; + +/** + * Every setting the spec writes, restored in afterAll. + * + * @type {string[]} + */ +const MANAGED_SETTINGS = [ + ...Object.keys( BASE_SETTINGS ), + 'image_format', + 'image_quality', +]; + +let cloudName; + +/** @type {Record|null} */ +let previousSettings = null; + +/** + * Attachments and posts created by the current test, removed in afterEach. + * + * @type {number[]} + */ +let createdIds = []; + +/** + * Save plugin settings through the settings API. + * + * @param {Record} values Setting slug to value. + */ +function saveSettings( values ) { + wpEvalFile( ` + $settings = get_plugin_instance()->settings; + foreach ( json_decode( '${ JSON.stringify( + values + ) }', true ) as $slug => $value ) { + $settings->get_setting( $slug )->save_value( $value ); + } + ` ); +} + +/** + * Read the current value of the managed settings. + * + * @return {Record} Setting slug to value. + */ +function readSettings() { + return JSON.parse( + wpEvalFile( ` + $settings = get_plugin_instance()->settings; + $values = array(); + foreach ( json_decode( '${ JSON.stringify( + MANAGED_SETTINGS + ) }', true ) as $slug ) { + $values[ $slug ] = $settings->get_setting( $slug )->get_value(); + } + echo wp_json_encode( $values ); + ` ) + ); +} + +/** + * Upload the fixture, embed it in a published post and sync it. + * + * Each call gets a fresh attachment, so the image is synced with the + * settings that are active at that time. The timestamp in the filename + * gives a fresh public ID, so no CDN cache from an earlier run applies. + * + * @param {Object} requestUtils RequestUtils fixture. + * @return {Promise<{ attachmentId: number, postLink: string }>} Created objects. + */ +async function uploadSyncedImagePost( requestUtils ) { + const media = await requestUtils.rest( { + method: 'POST', + path: '/wp/v2/media', + headers: { + 'Content-Type': 'image/jpeg', + 'Content-Disposition': `attachment; filename="global-transformations-${ Date.now() }.jpg"`, + }, + data: fs.readFileSync( FIXTURE_PATH ), + } ); + createdIds.push( media.id ); + + const content = + `\n` + + `
\n` + + ``; + + const post = await requestUtils.rest( { + method: 'POST', + path: '/wp/v2/posts', + data: { + status: 'publish', + title: `Cloudinary global transformations e2e ${ Date.now() }`, + content, + }, + } ); + createdIds.push( post.id ); + + // Same reason as the image delivery spec: sync synchronously instead + // of waiting for the auto-sync queue. + wpCli( [ 'cloudinary', 'sync' ] ); + + return { attachmentId: media.id, postLink: post.link }; +} + +/** + * Open the post and return the delivery URL of the inline image. + * + * @param {import('@playwright/test').Page} page + * @param {string} postLink Post permalink. + * @param {number} attachmentId Attachment ID. + * @return {Promise} The `src` of the rendered image. + */ +async function renderedSrc( page, postLink, attachmentId ) { + await page.goto( postLink ); + + const img = page + .locator( `.wp-block-image img.wp-image-${ attachmentId }` ) + .first(); + await expect( img ).toHaveAttribute( + 'src', + /^https:\/\/res\.cloudinary\.com\// + ); + + const src = await img.getAttribute( 'src' ); + expectCloudinaryUrl( src, cloudName ); + return src; +} + +/** + * Collect the transformation parameters from a Cloudinary delivery URL. + * + * Transformations are the path segments between the delivery type and the + * version segment (`v123`). Each segment is a comma separated list, e.g. + * `w_1200,h_900,c_scale/f_auto,q_auto`. + * + * @param {string} url Delivery URL. + * @return {string[]} Parameters such as `f_auto` or `q_60`. + */ +function transformationParams( url ) { + const segments = new URL( url ).pathname.split( '/' ).filter( Boolean ); + // Drop the cloud name and the delivery type (`images` or `image/upload`). + const start = 'image' === segments[ 1 ] ? 3 : 2; + const params = []; + for ( const segment of segments.slice( start ) ) { + if ( /^v\d+$/.test( segment ) ) { + break; + } + params.push( ...segment.split( ',' ) ); + } + return params; +} + +/** + * Filter parameters by their prefix. + * + * @param {string[]} params Transformation parameters. + * @param {string} prefix Parameter prefix such as `f_`. + * @return {string[]} Matching parameters. + */ +function withPrefix( params, prefix ) { + return params.filter( ( param ) => param.startsWith( prefix ) ); +} + +// @serial: needs real credentials in `cloudinary_connect` for `wp cloudinary +// sync`, while every analytics spec overwrites that option with fake ones. +test.describe( + 'Cloudinary global image transformations', + { tag: '@serial' }, + () => { + test.beforeAll( () => { + ( { cloudName } = ensureCloudinaryConnected() ); + previousSettings = readSettings(); + } ); + + test.afterAll( () => { + if ( previousSettings ) { + saveSettings( previousSettings ); + previousSettings = null; + } + } ); + + test.afterEach( () => { + const ids = createdIds; + createdIds = []; + + // WP-CLI rather than REST for the same reason as the image + // delivery spec: `force=true` on a `?rest_route=` URL is fragile. + for ( const id of ids ) { + try { + wpCli( [ 'post', 'delete', String( id ), '--force' ] ); + } catch ( e ) { + console.warn( + `Cleanup of post ${ id } failed:`, + e.message + ); + } + } + } ); + + test( 'non-default format and quality appear as f_ and q_', async ( { + page, + requestUtils, + } ) => { + saveSettings( { + ...BASE_SETTINGS, + image_format: 'webp', + image_quality: '60', + } ); + + const { attachmentId, postLink } = + await uploadSyncedImagePost( requestUtils ); + const params = transformationParams( + await renderedSrc( page, postLink, attachmentId ) + ); + + expect( withPrefix( params, 'f_' ) ).toEqual( [ 'f_webp' ] ); + expect( withPrefix( params, 'q_' ) ).toEqual( [ 'q_60' ] ); + } ); + + test( 'reverting to the defaults replaces the explicit values with auto', async ( { + page, + requestUtils, + } ) => { + // Set the non-default values first, so this test proves the + // revert and does not only read the defaults. + saveSettings( { + ...BASE_SETTINGS, + image_format: 'webp', + image_quality: '60', + } ); + saveSettings( { image_format: 'auto', image_quality: 'auto' } ); + + const { attachmentId, postLink } = + await uploadSyncedImagePost( requestUtils ); + const params = transformationParams( + await renderedSrc( page, postLink, attachmentId ) + ); + + expect( withPrefix( params, 'f_' ) ).toEqual( [ 'f_auto' ] ); + expect( withPrefix( params, 'q_' ) ).toEqual( [ 'q_auto' ] ); + } ); + + test( '"Not set" omits the f_ and q_ parameters', async ( { + page, + requestUtils, + } ) => { + saveSettings( { + ...BASE_SETTINGS, + image_format: 'none', + image_quality: 'none', + } ); + + const { attachmentId, postLink } = + await uploadSyncedImagePost( requestUtils ); + const params = transformationParams( + await renderedSrc( page, postLink, attachmentId ) + ); + + expect( withPrefix( params, 'f_' ) ).toEqual( [] ); + expect( withPrefix( params, 'q_' ) ).toEqual( [] ); + } ); + } +); From edd1ada533807faf37ffb2ed436a2e54623fa1ad Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Tue, 27 Oct 2026 10:45:15 +0100 Subject: [PATCH 54/80] fixup! fix: cache attachment size URL lookups under the intended key --- php/class-delivery.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/php/class-delivery.php b/php/class-delivery.php index 7d5c4ef8b..a4eaa7452 100644 --- a/php/class-delivery.php +++ b/php/class-delivery.php @@ -922,13 +922,17 @@ public function find_attachment_size_urls() { $search ); + // Cache for the current request only. Across requests, failed deliveries or syncs need to be retried, + // and the contextualized post IDs can differ (e.g. per WPML language). + static $cache = array(); + $key = md5( $sql ); - $cached = wp_cache_get( $key ); + $cached = isset( $cache[ $key ] ) ? $cache[ $key ] : false; $auto_sync = $this->sync->is_auto_sync_enabled(); if ( false === $cached ) { $cached = array(); - $results = $wpdb->get_results( $sql ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared + $results = $wpdb->get_results( $sql ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared if ( $results ) { foreach ( $results as $result ) { @@ -962,7 +966,7 @@ public function find_attachment_size_urls() { } } } - wp_cache_add( $key, $cached ); + $cache[ $key ] = $cached; } $this->known = array_merge( $this->known, $cached ); From a544f9bbc2ab341f5527b301d85fc00615dd5b88 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Tue, 27 Oct 2026 10:45:16 +0100 Subject: [PATCH 55/80] fixup! fix: stop the string replace output handler from producing output --- php/class-string-replace.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/class-string-replace.php b/php/class-string-replace.php index ec41eb2df..fe13b160d 100644 --- a/php/class-string-replace.php +++ b/php/class-string-replace.php @@ -174,6 +174,7 @@ public function start_capture() { * Output produced within an output handler is discarded, and doing so is deprecated as of PHP 8.4. * Errors displayed while replacing (e.g. notices raised by hooked callbacks) would count as such output, * so display is disabled for the duration of the handler. Errors are still logged as usual. + * This doesn't cover callbacks that echo output directly, which still trigger the deprecation. * * @param string $buffer The captured buffer. * @param int $phase The output handler phase bitmask. From 94db0c64947d74d52cfe27cccf0da03365781326 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Tue, 27 Oct 2026 10:45:17 +0100 Subject: [PATCH 56/80] fixup! fix: avoid using null as an array offset in static caches and component parts --- php/ui/class-component.php | 4 ++-- php/ui/component/class-opt-level.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/php/ui/class-component.php b/php/ui/class-component.php index 33815e09b..bea5e9dac 100644 --- a/php/ui/class-component.php +++ b/php/ui/class-component.php @@ -618,7 +618,7 @@ public static function build_tag( $element, $attributes = array(), $state = 'ope /** * Get a build part to construct. * - * @param string|null $part The part name. + * @param string $part The part name. * * @return array */ @@ -631,7 +631,7 @@ public function get_part( $part ) { 'content' => null, 'name' => $part, ); - if ( null !== $part && isset( $this->build_parts[ $part ] ) ) { + if ( isset( $this->build_parts[ $part ] ) ) { $struct = wp_parse_args( $this->build_parts[ $part ], $struct ); } if ( $this->setting->has_param( 'attributes' . $this->setting->separator . $part ) ) { diff --git a/php/ui/component/class-opt-level.php b/php/ui/component/class-opt-level.php index 5ff1eb178..8d32e5c0d 100644 --- a/php/ui/component/class-opt-level.php +++ b/php/ui/component/class-opt-level.php @@ -119,7 +119,7 @@ protected function get_setting_line( $slug ) { protected function get_badge( $status = 'active' ) { $badge = $this->get_part( 'span' ); $badge['attributes']['class'][] = "cld-optimisation-item-{$status}"; - $text = $this->get_part( null ); + $text = $this->get_part( '' ); if ( 'active' === $status ) { $text['content'] = __( 'Activated', 'cloudinary' ); $icon = $this->dashicon( $this->get_part( 'span' ) ); From fc44b87efc8ae6d29c3fa061af37592402800981 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Wed, 28 Oct 2026 14:54:47 +0100 Subject: [PATCH 57/80] Update i18n --- languages/cloudinary.pot | 116 ++++++++++++++++++++++----------------- 1 file changed, 67 insertions(+), 49 deletions(-) diff --git a/languages/cloudinary.pot b/languages/cloudinary.pot index dfdbe7b7e..f817bc842 100644 --- a/languages/cloudinary.pot +++ b/languages/cloudinary.pot @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Cloudinary STABLETAG\n" "Report-Msgid-Bugs-To: https://github.com/cloudinary/cloudinary_wordpress\n" -"POT-Creation-Date: 2026-09-10 09:07:21+00:00\n" +"POT-Creation-Date: 2026-10-28 13:54:10+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -513,7 +513,7 @@ msgid "" "WordPress." msgstr "" -#: php/class-media.php:2094 +#: php/class-media.php:2207 msgid "Import" msgstr "" @@ -521,49 +521,49 @@ msgstr "" msgid "Cloudinary" msgstr "" -#: php/class-media.php:2449 +#: php/class-media.php:2562 msgid "The delivery for this asset is disabled." msgstr "" -#: php/class-media.php:2453 +#: php/class-media.php:2566 msgid "Not syncable. This is an external media." msgstr "" -#: php/class-media.php:2457 +#: php/class-media.php:2570 msgid "This media is Fetch type." msgstr "" -#: php/class-media.php:2461 +#: php/class-media.php:2574 msgid "This media is Sprite type." msgstr "" -#: php/class-media.php:2471 +#: php/class-media.php:2584 msgid "Not Synced" msgstr "" -#: php/class-media.php:2476 +#: php/class-media.php:2589 msgid "Synced" msgstr "" -#: php/class-media.php:3135 +#: php/class-media.php:3320 msgid "No Cloudinary filters" msgstr "" -#: php/class-media.php:3235 +#: php/class-media.php:3427 msgid "Media Settings" msgstr "" -#: php/class-media.php:3238 +#: php/class-media.php:3430 msgid "Media Display" msgstr "" -#: php/class-media.php:3242 php/ui/component/class-plan-details.php:129 +#: php/class-media.php:3434 php/ui/component/class-plan-details.php:129 #: php/ui/component/class-plan-status.php:128 #: ui-definitions/settings-pages.php:568 ui-definitions/settings-sidebar.php:47 msgid "Transformations" msgstr "" -#: php/class-media.php:3243 +#: php/class-media.php:3435 msgid "" "Cloudinary allows you to easily transform your images on-the-fly to any " "required format, style and dimension, and also optimizes images for minimal " @@ -572,7 +572,7 @@ msgid "" "transformation and delivery URLs." msgstr "" -#: php/class-media.php:3248 ui-definitions/settings-image.php:175 +#: php/class-media.php:3440 ui-definitions/settings-image.php:175 #: ui-definitions/settings-pages.php:594 ui-definitions/settings-video.php:260 msgid "See examples" msgstr "" @@ -656,56 +656,65 @@ msgid "" "purchase?

Thank you!" msgstr "" -#: php/class-sync.php:504 +#: php/class-sync.php:505 msgid "Synchronizing asset with Cloudinary" msgstr "" -#: php/class-sync.php:524 +#: php/class-sync.php:525 msgid "Upgrading from previous version" msgstr "" -#: php/class-sync.php:535 +#: php/class-sync.php:536 msgid "Downloading from Cloudinary" msgstr "" -#: php/class-sync.php:550 php/class-sync.php:567 +#: php/class-sync.php:551 php/class-sync.php:568 msgid "Uploading to Cloudinary" msgstr "" #: php/class-sync.php:580 +msgid "Regenerating thumbnail sizes" +msgstr "" + +#: php/class-sync.php:593 #. translators: %s folder name msgid "Copying to folder %s." msgstr "" -#: php/class-sync.php:595 php/class-sync.php:622 +#: php/class-sync.php:608 php/class-sync.php:635 msgid "Updating metadata" msgstr "" -#: php/class-sync.php:608 +#: php/class-sync.php:621 msgid "Updating breakpoints" msgstr "" -#: php/class-sync.php:649 +#: php/class-sync.php:662 msgid "Uploading to new cloud name." msgstr "" -#: php/class-sync.php:1130 +#: php/class-sync.php:955 +#. translators: %s is the sync type that would not advance. +msgid "Sync loop detected: the \"%s\" sync state could not be saved." +msgstr "" + +#: php/class-sync.php:1191 msgid "Sync errors cleaned up" msgstr "" -#: php/class-sync.php:1220 +#: php/class-sync.php:1281 msgid "Is Cloudinary synced." msgstr "" -#: php/class-sync.php:1277 +#: php/class-sync.php:1338 msgid "Media Library Sync Settings" msgstr "" -#: php/class-sync.php:1282 +#: php/class-sync.php:1343 msgid "Sync method" msgstr "" -#: php/class-sync.php:1285 +#: php/class-sync.php:1346 #. translators: The HTML break line, the link to Cloudinary documentation and #. closing tag. msgid "" @@ -714,35 +723,35 @@ msgid "" "Media Library.%3$s%4$sLearn more%5$s" msgstr "" -#: php/class-sync.php:1296 +#: php/class-sync.php:1357 msgid "Auto sync" msgstr "" -#: php/class-sync.php:1297 +#: php/class-sync.php:1358 msgid "Manual sync" msgstr "" -#: php/class-sync.php:1303 +#: php/class-sync.php:1364 msgid "Cloudinary folder path" msgstr "" -#: php/class-sync.php:1307 +#: php/class-sync.php:1368 msgid "e.g.: wordpress_assets/" msgstr "" -#: php/class-sync.php:1310 +#: php/class-sync.php:1371 msgid "" "The folder in your Cloudinary account that WordPress assets are uploaded " "to. Leave blank to use the root of your Cloudinary library." msgstr "" -#: php/class-sync.php:1319 php/ui/component/class-plan-details.php:128 +#: php/class-sync.php:1380 php/ui/component/class-plan-details.php:128 #: php/ui/component/class-plan-status.php:94 #: ui-definitions/settings-sidebar.php:41 msgid "Storage" msgstr "" -#: php/class-sync.php:1322 +#: php/class-sync.php:1383 #. translators: the HTML for opening and closing list and its items. msgid "" "Choose where your assets are stored.%1$sCloudinary and WordPress: Stores " @@ -755,19 +764,19 @@ msgid "" "compatibility.%4$s%5$sLearn more%6$s" msgstr "" -#: php/class-sync.php:1335 +#: php/class-sync.php:1396 msgid "Cloudinary and WordPress" msgstr "" -#: php/class-sync.php:1336 +#: php/class-sync.php:1397 msgid "Cloudinary and WordPress (low resolution)" msgstr "" -#: php/class-sync.php:1337 +#: php/class-sync.php:1398 msgid "Cloudinary only" msgstr "" -#: php/class-sync.php:1343 php/delivery/class-lazy-load.php:544 +#: php/class-sync.php:1404 php/delivery/class-lazy-load.php:544 #: php/media/class-gallery.php:454 ui-definitions/components/header.php:19 #: ui-definitions/settings-image.php:263 ui-definitions/settings-pages.php:207 #: ui-definitions/settings-pages.php:223 ui-definitions/settings-pages.php:224 @@ -775,7 +784,7 @@ msgstr "" msgid "Need help?" msgstr "" -#: php/class-sync.php:1346 +#: php/class-sync.php:1407 #. Translators: The HTML for opening and closing link tags. msgid "" "Watch free lessons on how to use the Media Library Sync Settings in the " @@ -793,30 +802,30 @@ msgid "" "System Report" msgstr "" -#: php/class-utils.php:868 +#: php/class-utils.php:872 msgid "Debug log is empty" msgstr "" -#: php/class-utils.php:922 +#: php/class-utils.php:926 msgid "Missing SRC attribute." msgstr "" -#: php/class-utils.php:960 +#: php/class-utils.php:964 #. translators: The attachment ID. msgid "Clean up sync metadata for %d" msgstr "" -#: php/class-utils.php:1385 +#: php/class-utils.php:1389 msgid "Cloudinary global transformations" msgstr "" -#: php/class-utils.php:1392 +#: php/class-utils.php:1396 #. translators: %1$s is the taxonomy label and the %2$s is the context of the #. use. msgid "%1$s %2$s transformations" msgstr "" -#: php/class-utils.php:1402 +#: php/class-utils.php:1406 #. translators: %s is the term name. msgid "%s transformations" msgstr "" @@ -1041,25 +1050,30 @@ msgstr "" msgid "Could not download the Cloudinary asset." msgstr "" -#: php/sync/class-push-sync.php:278 +#: php/sync/class-push-sync.php:279 #. translators: variable is sync type. msgid "Sync type: %s" msgstr "" -#: php/sync/class-push-sync.php:303 +#: php/sync/class-push-sync.php:314 +#. translators: %s is the sync type that would not advance. +msgid "Sync loop detected: the \"%s\" sync state is not advancing." +msgstr "" + +#: php/sync/class-push-sync.php:354 msgid "Starting new thread." msgstr "" -#: php/sync/class-push-sync.php:329 +#: php/sync/class-push-sync.php:380 msgid "Asset in sync loop." msgstr "" -#: php/sync/class-push-sync.php:335 +#: php/sync/class-push-sync.php:386 #. translators: variable is thread name and asset ID. msgid "%1$s - cycle %3$s: Syncing asset %2$d" msgstr "" -#: php/sync/class-push-sync.php:345 +#: php/sync/class-push-sync.php:396 #. translators: variable is thread name. msgid "Ending thread %s" msgstr "" @@ -1223,6 +1237,10 @@ msgstr "" msgid "Fix Cloudinary Sync Error" msgstr "" +#: php/sync/class-upload-sync.php:296 php/sync/class-upload-sync.php:353 +msgid "Could not regenerate attachment sizes." +msgstr "" + #: php/templates/connection-string.php:13 msgid "Where to find my Connection string?" msgstr "" From f5d38a0a710daf9109005afaeb6acd1fa29d34c0 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Thu, 29 Oct 2026 09:13:17 +0100 Subject: [PATCH 58/80] fix(delivery): track Cloudinary src URLs back to their attachment Since WPP-1183, image_downsize() and wp_get_attachment_image_src() return Cloudinary URLs on the front end, so tags built by theme code (e.g. wp_get_attachment_image() in a template or shortcode) reach Delivery with a Cloudinary src. parse_element() tracks such a src back through the public ID, but then looked the item up by the relation's sized_url, which is relative to the content dir, while the keys of $this->known are full URLs. The lookup never matched, so these tags lost lazy loading, responsive breakpoints and the SEO attributes they had in 3.3.8. Extracts the URL set_usability() builds for the known keys into get_searchable_url(), and uses it for the track-back. --- php/class-delivery.php | 51 ++++--- .../tests/test-delivery-parse-element.php | 142 ++++++++++++++++++ 2 files changed, 173 insertions(+), 20 deletions(-) create mode 100644 tests/phpunit/tests/test-delivery-parse-element.php diff --git a/php/class-delivery.php b/php/class-delivery.php index a4eaa7452..b4374c255 100644 --- a/php/class-delivery.php +++ b/php/class-delivery.php @@ -1584,8 +1584,8 @@ public function parse_element( $element, $content = '' ) { if ( $this->media->is_cloudinary_url( $raw_url ) ) { $public_id = $this->media->get_public_id_from_url( $raw_url ); if ( isset( $this->known[ $public_id ] ) ) { - - $url = $this->known[ $public_id ]['sized_url']; + // The relation's sized_url is relative to the content dir, while the URL keys of $this->known are full URLs. + $url = $this->get_searchable_url( $this->known[ $public_id ] ); $attributes['src'] = $url; } } @@ -1837,25 +1837,13 @@ public function validate_url( $url ) { } /** - * Set url usability. + * Get the URL an item is known by, as used for the keys of $this->known. * - * @param array $item The item result. - * @param null|bool $auto_sync If auto_sync is on. + * @param array $item The item result. + * + * @return string */ - protected function set_usability( $item, $auto_sync = null ) { - - /** - * Filter the found item to allow usability to be altered. - * - * @hook cloudinary_set_usable_asset - * @since 3.0.2 - * - * @param array $item The found asset. - * - * @return array - */ - $item = apply_filters( 'cloudinary_set_usable_asset', $item ); - + protected function get_searchable_url( $item ) { /** * The URL to be searched for and prepared to be delivered by Cloudinary. * @@ -1887,7 +1875,30 @@ protected function set_usability( $item, $auto_sync = null ) { * * @return string */ - $url = apply_filters( 'cloudinary_delivery_searchable_url', $url, $item, $content_url ); + return apply_filters( 'cloudinary_delivery_searchable_url', $url, $item, $content_url ); + } + + /** + * Set url usability. + * + * @param array $item The item result. + * @param null|bool $auto_sync If auto_sync is on. + */ + protected function set_usability( $item, $auto_sync = null ) { + + /** + * Filter the found item to allow usability to be altered. + * + * @hook cloudinary_set_usable_asset + * @since 3.0.2 + * + * @param array $item The found asset. + * + * @return array + */ + $item = apply_filters( 'cloudinary_set_usable_asset', $item ); + + $url = $this->get_searchable_url( $item ); $found = array(); diff --git a/tests/phpunit/tests/test-delivery-parse-element.php b/tests/phpunit/tests/test-delivery-parse-element.php new file mode 100644 index 000000000..0c37cb4a2 --- /dev/null +++ b/tests/phpunit/tests/test-delivery-parse-element.php @@ -0,0 +1,142 @@ +attachment->create_upload_object( DIR_TESTDATA . '/images/canola.jpg' ); + } + + /** + * Build a Delivery instance using a media component pointed at the test Cloudinary domain. + * + * @return Test_Delivery_Parse_Element_Delivery + */ + protected function get_delivery() { + $plugin = \Cloudinary\get_plugin_instance(); + $media = new \Cloudinary\Media( $plugin ); + $media->base_url = self::BASE_URL; + $media->filter = new \Cloudinary\Media\Filter( $media ); + + $delivery = new Test_Delivery_Parse_Element_Delivery( $plugin ); + $delivery->set_media( $media ); + + return $delivery; + } + + /** + * Seed the known items the same way Delivery::set_usability() keys them: by public ID, and + * by the full URL built from the content URL and the relation's content-relative sized_url. + * + * @param Test_Delivery_Parse_Element_Delivery $delivery The delivery instance. + * + * @return string The full URL the item is known by. + */ + protected function seed_known( $delivery ) { + $file = get_post_meta( self::$attachment_id, '_wp_attached_file', true ); + $item = array( + 'post_id' => self::$attachment_id, + 'public_id' => 'canola', + 'sized_url' => '/uploads/' . $file, + 'sync_type' => 'media', + 'format' => 'jpg', + 'width' => 640, + 'height' => 480, + 'post_state' => 'enable', + ); + $url = \Cloudinary\Utils::clean_url( content_url() ) . $item['sized_url']; + + $delivery->known['canola'] = $item; + $delivery->known[ $url ] = $item; + + return $url; + } + + /** + * An img tag with a Cloudinary src for a known public ID is tracked back to its attachment. + * + * @return void + */ + public function test_cloudinary_src_is_tracked_back_to_its_attachment() { + $delivery = $this->get_delivery(); + $url = $this->seed_known( $delivery ); + + $element = $delivery->parse_element( '' ); + + $this->assertSame( self::$attachment_id, $element['id'] ); + $this->assertSame( $url, $element['atts']['src'] ); + $this->assertSame( 'canola.jpg', $element['atts']['data-public-id'] ); + } + + /** + * A Cloudinary src for a public ID Delivery doesn't know is left alone. + * + * @return void + */ + public function test_unknown_cloudinary_src_is_not_tracked_back() { + $delivery = $this->get_delivery(); + $this->seed_known( $delivery ); + + $src = self::BASE_URL . '/images/w_300,h_225,c_scale/v1/other/other.jpg'; + $element = $delivery->parse_element( '' ); + + $this->assertSame( 0, $element['id'] ); + $this->assertSame( $src, $element['atts']['src'] ); + } +} + +/** + * Delivery with a settable media component, since init() only wires the real one once connected. + */ +class Test_Delivery_Parse_Element_Delivery extends \Cloudinary\Delivery { + + /** + * Set the media component. + * + * @param \Cloudinary\Media $media The media component. + * + * @return void + */ + public function set_media( $media ) { + $this->media = $media; + } +} From c0d6f79ee131682e4e0e42a57774af88485dce56 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Thu, 29 Oct 2026 13:34:15 +0100 Subject: [PATCH 59/80] fix(delivery): leave Cloudinary URLs with their own transformations as is The track-back also matched Cloudinary URLs typed into content by hand, and rebuilding them from the attachment dropped any transformations in their path (e.g. an effect or a manual crop). Before the track-back worked, these tags were left as they were. Only track a URL back when its transformations are ones the plugin applies to the attachment itself: its size, and the attachment's own and global transformations. --- php/class-delivery.php | 44 +++++++++- .../tests/test-delivery-parse-element.php | 86 ++++++++++++++++++- 2 files changed, 125 insertions(+), 5 deletions(-) diff --git a/php/class-delivery.php b/php/class-delivery.php index b4374c255..f2ec5d184 100644 --- a/php/class-delivery.php +++ b/php/class-delivery.php @@ -1583,7 +1583,8 @@ public function parse_element( $element, $content = '' ) { // Track back the found URL. if ( $this->media->is_cloudinary_url( $raw_url ) ) { $public_id = $this->media->get_public_id_from_url( $raw_url ); - if ( isset( $this->known[ $public_id ] ) ) { + // A URL with transformations of its own (e.g. typed into content by hand) is left as is, since rebuilding it would drop them. + if ( isset( $this->known[ $public_id ] ) && ! $this->has_custom_transformations( $raw_url, $this->known[ $public_id ]['post_id'] ) ) { // The relation's sized_url is relative to the content dir, while the URL keys of $this->known are full URLs. $url = $this->get_searchable_url( $this->known[ $public_id ] ); $attributes['src'] = $url; @@ -1836,6 +1837,47 @@ public function validate_url( $url ) { return $parts['host'] === $home['host'] ? $this->is_content_dir( $url ) : $this->media->can_upload_from_host( $parts['host'] ); } + /** + * Check if a Cloudinary URL has transformations other than the ones the plugin applies to the attachment itself: + * its size, and the attachment's own and global transformations. + * + * @param string $url The Cloudinary URL. + * @param int $attachment_id The attachment ID. + * + * @return bool + */ + protected function has_custom_transformations( $url, $attachment_id ) { + $type = $this->media->get_resource_type( $attachment_id ); + $expected = $this->media->get_transformations_from_string( (string) $this->media->cloudinary_url( $attachment_id ), $type ); + + foreach ( $this->media->get_transformations_from_string( $url, $type ) as $transformation ) { + // Loose comparison, so the order of the parameters doesn't matter. + if ( ! $this->is_size_transformation( $transformation ) && ! in_array( $transformation, $expected ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict + return true; + } + } + + return false; + } + + /** + * Check if a transformation is one the plugin uses to size an image, e.g. `w_300,h_200,c_scale` or `w_150,h_150,c_thumb,g_auto`. + * + * @param array $transformation The transformation, as parsed by Media::get_transformations_from_string(). + * + * @return bool + */ + protected function is_size_transformation( $transformation ) { + if ( array_diff_key( $transformation, array_flip( array( 'width', 'height', 'crop', 'gravity' ) ) ) ) { + return false; + } + if ( isset( $transformation['crop'] ) && ! in_array( $transformation['crop'], array( 'scale', 'fill', 'thumb' ), true ) ) { + return false; + } + + return ! isset( $transformation['gravity'] ) || 'auto' === $transformation['gravity']; + } + /** * Get the URL an item is known by, as used for the keys of $this->known. * diff --git a/tests/phpunit/tests/test-delivery-parse-element.php b/tests/phpunit/tests/test-delivery-parse-element.php index 0c37cb4a2..492f6e2a1 100644 --- a/tests/phpunit/tests/test-delivery-parse-element.php +++ b/tests/phpunit/tests/test-delivery-parse-element.php @@ -8,7 +8,8 @@ * tracks such a src back to its attachment through the public ID; this covers that the track-back * resolves to the same full URL the known items are keyed by, rather than the relation's * content-relative sized_url, which never matched and left the tag unprocessed (no lazy loading, - * responsive breakpoints or SEO attributes). + * responsive breakpoints or SEO attributes). A src with transformations of its own (e.g. typed + * into content by hand) is left alone, as rebuilding it from the attachment would drop them. * * The known items are seeded directly rather than driven through prepare_delivery() and the * relationship table, so no Cloudinary account is needed. @@ -53,9 +54,10 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { */ protected function get_delivery() { $plugin = \Cloudinary\get_plugin_instance(); - $media = new \Cloudinary\Media( $plugin ); - $media->base_url = self::BASE_URL; - $media->filter = new \Cloudinary\Media\Filter( $media ); + $media = new Test_Delivery_Parse_Element_Media( $plugin ); + $media->base_url = self::BASE_URL; + $media->filter = new \Cloudinary\Media\Filter( $media ); + $media->stub_cloudinary_url = self::BASE_URL . '/images/f_auto,q_auto/v1/canola/canola.jpg'; $delivery = new Test_Delivery_Parse_Element_Delivery( $plugin ); $delivery->set_media( $media ); @@ -107,6 +109,54 @@ public function test_cloudinary_src_is_tracked_back_to_its_attachment() { $this->assertSame( 'canola.jpg', $element['atts']['data-public-id'] ); } + /** + * A Cloudinary src with the plugin's own thumbnail crop is still tracked back. + * + * @return void + */ + public function test_cloudinary_src_with_thumbnail_crop_is_tracked_back() { + $delivery = $this->get_delivery(); + $this->seed_known( $delivery ); + + $element = $delivery->parse_element( '' ); + + $this->assertSame( self::$attachment_id, $element['id'] ); + } + + /** + * A Cloudinary src with transformations of its own, e.g. typed into content by hand, is left + * alone, since rebuilding it from the attachment would drop them. + * + * @dataProvider data_custom_transformations + * + * @param string $transformations The transformations in the src. + * + * @return void + */ + public function test_cloudinary_src_with_custom_transformations_is_not_tracked_back( $transformations ) { + $delivery = $this->get_delivery(); + $this->seed_known( $delivery ); + + $src = self::BASE_URL . '/images/' . $transformations . '/v1/canola/canola.jpg'; + $element = $delivery->parse_element( '' ); + + $this->assertSame( 0, $element['id'] ); + $this->assertSame( $src, $element['atts']['src'] ); + } + + /** + * Transformations the plugin doesn't apply itself. + * + * @return array + */ + public function data_custom_transformations() { + return array( + 'effect' => array( 'w_300,h_225,c_scale/e_sepia/f_auto,q_auto' ), + 'manual crop' => array( 'c_crop,w_400,h_400,x_100,y_100/e_grayscale' ), + 'gravity' => array( 'w_300,h_300,c_fill,g_face' ), + ); + } + /** * A Cloudinary src for a public ID Delivery doesn't know is left alone. * @@ -124,6 +174,34 @@ public function test_unknown_cloudinary_src_is_not_tracked_back() { } } +/** + * Media with cloudinary_url() stubbed, to avoid the real sync/signature pipeline. + */ +class Test_Delivery_Parse_Element_Media extends \Cloudinary\Media { + + /** + * Canned cloudinary_url() return value. + * + * @var string|false + */ + public $stub_cloudinary_url = false; + + /** + * Stubbed to avoid the real sync/signature pipeline. + * + * @param int $attachment_id The attachment ID. + * @param array|string $size The requested size. + * @param array $transformations Transformations to apply. + * @param string|null $cloudinary_id A forced Cloudinary ID. + * @param bool $overwrite_transformations Whether to overwrite transformations. + * + * @return string|false + */ + public function cloudinary_url( $attachment_id, $size = array(), $transformations = array(), $cloudinary_id = null, $overwrite_transformations = false ) { + return $this->stub_cloudinary_url; + } +} + /** * Delivery with a settable media component, since init() only wires the real one once connected. */ From ac7bdda7e3938f95bd4585ffa2ca506b20a69bf4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 01:02:47 +0000 Subject: [PATCH 60/80] chore(deps-dev): bump dotenv from 18.0.8 to 18.0.9 Bumps [dotenv](https://github.com/motdotla/dotenv) from 18.0.8 to 18.0.9. - [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md) - [Commits](https://github.com/motdotla/dotenv/compare/v18.0.8...v18.0.9) --- updated-dependencies: - dependency-name: dotenv dependency-version: 18.0.9 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 175d308fc..244387645 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "css-minimizer-webpack-plugin": "^8.0.0", "css-unicode-loader": "^1.0.3", "cssnano": "^9.9.0", - "dotenv": "^18.0.8", + "dotenv": "^18.0.9", "eslint": "^10.13.0", "eslint-plugin-jest": "^29.17.0", "eslint-plugin-react-hooks": "^7.0.1", @@ -15089,9 +15089,9 @@ } }, "node_modules/dotenv": { - "version": "18.0.8", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-18.0.8.tgz", - "integrity": "sha512-2KDeoFoK/zRtcnbunCDlLG5VWVMcyqeQc6iK65o231nfNAcuGrKoqUQfJFUtBI+QlShk5HKIHxwebBtUl3rEfA==", + "version": "18.0.9", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-18.0.9.tgz", + "integrity": "sha512-3fVOW4cB02R066PUSwn8O4TJyz9NckQl7F81blIbaq9jKBm2tSmOKky7ZHIXzGvkVPXCSn6jkpziBPZdGFs8Tw==", "dev": true, "license": "BSD-2-Clause", "bin": { diff --git a/package.json b/package.json index 771644bf4..ba78ec957 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "css-minimizer-webpack-plugin": "^8.0.0", "css-unicode-loader": "^1.0.3", "cssnano": "^9.9.0", - "dotenv": "^18.0.8", + "dotenv": "^18.0.9", "eslint": "^10.13.0", "eslint-plugin-jest": "^29.17.0", "eslint-plugin-react-hooks": "^7.0.1", From f0677178354a8ef8f5eb3e059fe8e6913a5dfae5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 01:03:00 +0000 Subject: [PATCH 61/80] chore(deps): bump chart.js from 4.5.1 to 4.6.1 Bumps [chart.js](https://github.com/chartjs/Chart.js) from 4.5.1 to 4.6.1. - [Release notes](https://github.com/chartjs/Chart.js/releases) - [Commits](https://github.com/chartjs/Chart.js/compare/v4.5.1...v4.6.1) --- updated-dependencies: - dependency-name: chart.js dependency-version: 4.6.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 175d308fc..0889bf1f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@codemirror/lang-json": "^6.0.2", "@codemirror/state": "^6.7.6", "@codemirror/theme-one-dark": "^6.1.3", - "chart.js": "^4.5.1", + "chart.js": "^4.6.1", "classnames": "^2.3.1", "codemirror": "^6.0.2", "dot-object": "^2.1.4", @@ -12760,9 +12760,9 @@ "license": "MIT" }, "node_modules/chart.js": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.5.1.tgz", - "integrity": "sha512-GIjfiT9dbmHRiYi6Nl2yFCq7kkwdkp1W/lp2J99rX0yo9tgJGn3lKQATztIjb5tVtevcBtIdICNWqlq5+E8/Pw==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.6.1.tgz", + "integrity": "sha512-hJyniucsFmq//EvXYvJ6c6mahPoI3kaxdjVH8awTaJ/fDNWeSqqqArixMJWkWNN6fcYvPU3HneSANFNYtRi61g==", "license": "MIT", "dependencies": { "@kurkle/color": "^0.3.0" diff --git a/package.json b/package.json index 771644bf4..d82274fb0 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "@codemirror/lang-json": "^6.0.2", "@codemirror/state": "^6.7.6", "@codemirror/theme-one-dark": "^6.1.3", - "chart.js": "^4.5.1", + "chart.js": "^4.6.1", "classnames": "^2.3.1", "codemirror": "^6.0.2", "dot-object": "^2.1.4", From 88a47d18e3d827f6a5c2831705c94cc283cb85c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 01:03:18 +0000 Subject: [PATCH 62/80] chore(deps-dev): bump webpack from 5.112.0 to 5.112.2 Bumps [webpack](https://github.com/webpack/webpack) from 5.112.0 to 5.112.2. - [Release notes](https://github.com/webpack/webpack/releases) - [Changelog](https://github.com/webpack/webpack/blob/main/CHANGELOG.md) - [Commits](https://github.com/webpack/webpack/compare/v5.112.0...v5.112.2) --- updated-dependencies: - dependency-name: webpack dependency-version: 5.112.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 175d308fc..f2e930c25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -70,7 +70,7 @@ "rtlcss-webpack-plugin": "^4.0.4", "taffydb": "^2.7.3", "terser-webpack-plugin": "^5.3.14", - "webpack": "^5.112.0", + "webpack": "^5.112.2", "webpack-cli": "^7.2.3", "wp-hookdoc": "^0.2.0" }, @@ -29203,9 +29203,9 @@ "license": "Apache-2.0" }, "node_modules/webpack": { - "version": "5.112.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.112.0.tgz", - "integrity": "sha512-NIBpsRuCll036haDDt/CfcTDfsWNR9Z782nMRMI9D377BsGcYzZDTNU5TyzhCJzPIcihAxMBaMAhq2WSaDrH8Q==", + "version": "5.112.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.112.2.tgz", + "integrity": "sha512-B2tp1LI9D8GVpPDqprdt12ukTkXXahj9MzqSWJq4faSPgOUM7CdZaGAB6HrL/8E6UwbBpdj4vzWDbKoFnVoU6g==", "dev": true, "license": "MIT", "dependencies": { @@ -29222,9 +29222,9 @@ "graceful-fs": "^4.2.11", "mime-db": "^1.54.0", "minimizer-webpack-plugin": "^5.13.0", - "schema-utils": "^4.5.0", + "schema-utils": "^4.8.1", "tapable": "^2.3.0", - "watchpack": "^2.6.1", + "watchpack": "^2.6.3", "webpack-sources": "^3.6.0" }, "bin": { diff --git a/package.json b/package.json index 771644bf4..065baa2d6 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "rtlcss-webpack-plugin": "^4.0.4", "taffydb": "^2.7.3", "terser-webpack-plugin": "^5.3.14", - "webpack": "^5.112.0", + "webpack": "^5.112.2", "webpack-cli": "^7.2.3", "wp-hookdoc": "^0.2.0" }, From 48498c8651582220bb8ead5f5943915c491f8549 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 01:03:29 +0000 Subject: [PATCH 63/80] chore(deps-dev): bump npm-run-all2 from 9.0.3 to 9.0.4 Bumps [npm-run-all2](https://github.com/bcomnes/npm-run-all2) from 9.0.3 to 9.0.4. - [Release notes](https://github.com/bcomnes/npm-run-all2/releases) - [Changelog](https://github.com/bcomnes/npm-run-all2/blob/master/CHANGELOG.md) - [Commits](https://github.com/bcomnes/npm-run-all2/compare/v9.0.3...v9.0.4) --- updated-dependencies: - dependency-name: npm-run-all2 dependency-version: 9.0.4 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 10 +++++----- package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 175d308fc..6592900a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -63,7 +63,7 @@ "lint-staged": "^17.6.0", "load-grunt-tasks": "^5.1.0", "mini-css-extract-plugin": "^2.9.4", - "npm-run-all2": "^9.0.3", + "npm-run-all2": "^9.0.4", "patch-package": "^8.0.1", "postcss-loader": "^8.2.0", "prettier": "npm:wp-prettier@^3.0.0", @@ -22725,9 +22725,9 @@ } }, "node_modules/npm-run-all2": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/npm-run-all2/-/npm-run-all2-9.0.3.tgz", - "integrity": "sha512-BQAEdU1PtYc48qYRdghW2BVTQT3VqWCoFQmO87NlM1h1PYwMCKQpUWaNyB20V26caNzFsXQDfyOdznLlHCih6g==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/npm-run-all2/-/npm-run-all2-9.0.4.tgz", + "integrity": "sha512-GuGRF8MddEKavyUzjy0k2z2pA76/N+eT8lHlypx0/AhShLKD2FOerQxHhpFhcqnQmAqCkunUCYlf6Z9RKh/4zg==", "dev": true, "license": "MIT", "dependencies": { @@ -22737,7 +22737,7 @@ "picomatch": "^4.0.2", "pidtree": "^1.0.0", "read-package-json-fast": "^6.0.0", - "shell-quote": "^1.8.4", + "shell-quote": "^1.12.0", "which": "^7.0.0" }, "bin": { diff --git a/package.json b/package.json index 771644bf4..e986d49c0 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "lint-staged": "^17.6.0", "load-grunt-tasks": "^5.1.0", "mini-css-extract-plugin": "^2.9.4", - "npm-run-all2": "^9.0.3", + "npm-run-all2": "^9.0.4", "patch-package": "^8.0.1", "postcss-loader": "^8.2.0", "prettier": "npm:wp-prettier@^3.0.0", From a95783efac1f95519a75b953195800d62730ebd1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 01:06:08 +0000 Subject: [PATCH 64/80] chore(deps-dev): bump phpstan/phpstan from 2.3.1 to 2.3.2 Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan-phar-composer-source) from 2.3.1 to 2.3.2. - [Commits](https://github.com/phpstan/phpstan-phar-composer-source/commits) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-version: 2.3.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 25b01ceaf..cbf065734 100644 --- a/composer.lock +++ b/composer.lock @@ -992,11 +992,11 @@ }, { "name": "phpstan/phpstan", - "version": "2.3.1", + "version": "2.3.2", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/6155239b488e95d26d1ebd95c6b4bb294d7f09db", - "reference": "6155239b488e95d26d1ebd95c6b4bb294d7f09db", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/18bc23a0682f08591529377d271b5c4dfe9ed1dd", + "reference": "18bc23a0682f08591529377d271b5c4dfe9ed1dd", "shasum": "" }, "require": { @@ -1052,7 +1052,7 @@ "type": "github" } ], - "time": "2026-10-08T21:09:11+00:00" + "time": "2026-10-24T11:36:00+00:00" }, { "name": "phpunit/php-code-coverage", From a1235e091f68262d305e68d0ebe59cfd7f7374b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 01:09:45 +0000 Subject: [PATCH 65/80] chore(deps-dev): bump the wordpress group across 1 directory with 13 updates Bumps the wordpress group with 13 updates in the / directory: | Package | From | To | | --- | --- | --- | | [@wordpress/api-fetch](https://github.com/WordPress/gutenberg/tree/HEAD/packages/api-fetch) | `7.55.0` | `8.0.0` | | [@wordpress/block-editor](https://github.com/WordPress/gutenberg/tree/HEAD/packages/block-editor) | `17.1.0` | `19.0.0` | | [@wordpress/blocks](https://github.com/WordPress/gutenberg/tree/HEAD/packages/blocks) | `16.0.0` | `17.0.0` | | [@wordpress/browserslist-config](https://github.com/WordPress/gutenberg/tree/HEAD/packages/browserslist-config) | `6.56.0` | `7.0.0` | | [@wordpress/components](https://github.com/WordPress/gutenberg/tree/HEAD/packages/components) | `40.1.0` | `43.0.0` | | [@wordpress/data](https://github.com/WordPress/gutenberg/tree/HEAD/packages/data) | `10.55.0` | `11.0.0` | | [@wordpress/e2e-test-utils-playwright](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils-playwright) | `2.1.0` | `3.1.0` | | [@wordpress/element](https://github.com/WordPress/gutenberg/tree/HEAD/packages/element) | `8.8.0` | `10.0.0` | | [@wordpress/env](https://github.com/WordPress/gutenberg/tree/HEAD/packages/env) | `11.15.0` | `12.0.0` | | [@wordpress/eslint-plugin](https://github.com/WordPress/gutenberg/tree/HEAD/packages/eslint-plugin) | `26.0.0` | `28.0.0` | | [@wordpress/hooks](https://github.com/WordPress/gutenberg/tree/HEAD/packages/hooks) | `4.56.0` | `5.0.0` | | [@wordpress/i18n](https://github.com/WordPress/gutenberg/tree/HEAD/packages/i18n) | `6.29.0` | `7.0.0` | | [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) | `36.0.0` | `37.0.0` | Updates `@wordpress/api-fetch` from 7.55.0 to 8.0.0 - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/api-fetch/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/api-fetch@8.0.0/packages/api-fetch) Updates `@wordpress/block-editor` from 17.1.0 to 19.0.0 - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/block-editor/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/block-editor@19.0.0/packages/block-editor) Updates `@wordpress/blocks` from 16.0.0 to 17.0.0 - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/blocks/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/blocks@17.0.0/packages/blocks) Updates `@wordpress/browserslist-config` from 6.56.0 to 7.0.0 - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/browserslist-config/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/browserslist-config@7.0.0/packages/browserslist-config) Updates `@wordpress/components` from 40.1.0 to 43.0.0 - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/components/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/components@43.0.0/packages/components) Updates `@wordpress/data` from 10.55.0 to 11.0.0 - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/data/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/data@11.0.0/packages/data) Updates `@wordpress/e2e-test-utils-playwright` from 2.1.0 to 3.1.0 - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils-playwright/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils-playwright@3.1.0/packages/e2e-test-utils-playwright) Updates `@wordpress/element` from 8.8.0 to 10.0.0 - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/element/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/element@10.0.0/packages/element) Updates `@wordpress/env` from 11.15.0 to 12.0.0 - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/env/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/env@12.0.0/packages/env) Updates `@wordpress/eslint-plugin` from 26.0.0 to 28.0.0 - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/eslint-plugin@28.0.0/packages/eslint-plugin) Updates `@wordpress/hooks` from 4.56.0 to 5.0.0 - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/hooks/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/hooks@5.0.0/packages/hooks) Updates `@wordpress/i18n` from 6.29.0 to 7.0.0 - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/i18n/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/i18n@7.0.0/packages/i18n) Updates `@wordpress/scripts` from 36.0.0 to 37.0.0 - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@37.0.0/packages/scripts) --- updated-dependencies: - dependency-name: "@wordpress/api-fetch" dependency-version: 7.56.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: wordpress - dependency-name: "@wordpress/block-editor" dependency-version: 18.0.0 dependency-type: direct:development update-type: version-update:semver-major dependency-group: wordpress - dependency-name: "@wordpress/blocks" dependency-version: 16.1.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: wordpress - dependency-name: "@wordpress/browserslist-config" dependency-version: 6.56.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: wordpress - dependency-name: "@wordpress/components" dependency-version: 41.0.0 dependency-type: direct:development update-type: version-update:semver-major dependency-group: wordpress - dependency-name: "@wordpress/data" dependency-version: 10.56.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: wordpress - dependency-name: "@wordpress/e2e-test-utils-playwright" dependency-version: 2.1.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: wordpress - dependency-name: "@wordpress/element" dependency-version: 8.8.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: wordpress - dependency-name: "@wordpress/env" dependency-version: 11.16.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: wordpress - dependency-name: "@wordpress/eslint-plugin" dependency-version: 27.0.0 dependency-type: direct:development update-type: version-update:semver-major dependency-group: wordpress - dependency-name: "@wordpress/hooks" dependency-version: 4.56.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: wordpress - dependency-name: "@wordpress/i18n" dependency-version: 6.29.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: wordpress - dependency-name: "@wordpress/scripts" dependency-version: 36.0.0 dependency-type: direct:development update-type: version-update:semver-major dependency-group: wordpress ... Signed-off-by: dependabot[bot] --- package-lock.json | 3361 +++++++++++++++++---------------------------- package.json | 26 +- 2 files changed, 1265 insertions(+), 2122 deletions(-) diff --git a/package-lock.json b/package-lock.json index 175d308fc..4e5ee2320 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,19 +26,19 @@ }, "devDependencies": { "@playwright/test": "^1.64.1", - "@wordpress/api-fetch": "^7.55.0", - "@wordpress/block-editor": "^17.1.0", - "@wordpress/blocks": "^16.0.0", - "@wordpress/browserslist-config": "^6.55.0", - "@wordpress/components": "^40.0.0", - "@wordpress/data": "^10.34.0", - "@wordpress/e2e-test-utils-playwright": "^2.0.0", - "@wordpress/element": "^8.5.0", - "@wordpress/env": "^11.15.0", - "@wordpress/eslint-plugin": "^26.0.0", - "@wordpress/hooks": "^4.52.0", - "@wordpress/i18n": "^6.7.0", - "@wordpress/scripts": "^36.0.0", + "@wordpress/api-fetch": "^8.0.0", + "@wordpress/block-editor": "^19.0.0", + "@wordpress/blocks": "^17.0.0", + "@wordpress/browserslist-config": "^7.0.0", + "@wordpress/components": "^43.0.0", + "@wordpress/data": "^11.0.0", + "@wordpress/e2e-test-utils-playwright": "^3.1.0", + "@wordpress/element": "^10.0.0", + "@wordpress/env": "^12.0.0", + "@wordpress/eslint-plugin": "^28.0.0", + "@wordpress/hooks": "^5.0.0", + "@wordpress/i18n": "^7.0.0", + "@wordpress/scripts": "^37.0.0", "copy-webpack-plugin": "^14.0.0", "css-loader": "^7.1.5", "css-minimizer-webpack-plugin": "^8.0.0", @@ -80,24 +80,24 @@ } }, "node_modules/@ariakit/components": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@ariakit/components/-/components-0.1.11.tgz", - "integrity": "sha512-hFmfWKkK8jpATf39kNZSMDlG3o+tftfQwyooRhbPl/YCpFur+IGz5ZPA+PGIIfFjfdkAURLNDJPSeWtXO3xssQ==", + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/@ariakit/components/-/components-0.1.15.tgz", + "integrity": "sha512-Rq8cU/DXURIHbvRPZHXmUd7RHkTG0cXDjkjSWSeQEOQHp8w1bNenYUygoe0MzM0gwWakHrctA78XWGFgHmzUWg==", "dev": true, "license": "MIT", "dependencies": { - "@ariakit/store": "0.1.9", - "@ariakit/utils": "0.2.0" + "@ariakit/store": "0.1.11", + "@ariakit/utils": "0.2.2" } }, "node_modules/@ariakit/react": { - "version": "0.4.38", - "resolved": "https://registry.npmjs.org/@ariakit/react/-/react-0.4.38.tgz", - "integrity": "sha512-VubItCXqly9GNFxulOYDkFP94jh1M5iHeuo0BDTTiN1ndrGNeZCvsRUWd06BC9yjg+/LKEAnFLeolE1pG1IQBg==", + "version": "0.4.42", + "resolved": "https://registry.npmjs.org/@ariakit/react/-/react-0.4.42.tgz", + "integrity": "sha512-D+nElmWhT2w0TV0BKUh84ox21AaflvMv1dTt6Fn9TEOQIdZmOAqF1B6VAv69L5R1oyLzNV7neLD8cMTku+vbEg==", "dev": true, "license": "MIT", "dependencies": { - "@ariakit/react-components": "0.5.0" + "@ariakit/react-components": "0.7.1" }, "funding": { "type": "opencollective", @@ -109,17 +109,17 @@ } }, "node_modules/@ariakit/react-components": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@ariakit/react-components/-/react-components-0.5.0.tgz", - "integrity": "sha512-NEpptkB3sJZrwTIIzFydyGjLGVLpfDt0X3naLh9x2Z0WyIkJuz6ZbzyWAxMrc9m4oNJgnex4cy5MZYndrJTtKQ==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@ariakit/react-components/-/react-components-0.7.1.tgz", + "integrity": "sha512-HOqqJqwtXYCrdwYRZeIg/hvXCPceGO+Ts+UIu9FIIIeaVqAxgyFYUb8Umbh40Wscek3PrYDdx/r5B5lpByUX8w==", "dev": true, "license": "MIT", "dependencies": { - "@ariakit/components": "0.1.11", - "@ariakit/react-store": "0.1.10", - "@ariakit/react-utils": "0.2.5", - "@ariakit/store": "0.1.9", - "@ariakit/utils": "0.2.0", + "@ariakit/components": "0.1.15", + "@ariakit/react-store": "0.1.13", + "@ariakit/react-utils": "0.2.8", + "@ariakit/store": "0.1.11", + "@ariakit/utils": "0.2.2", "@floating-ui/dom": "^1.0.0" }, "peerDependencies": { @@ -128,15 +128,15 @@ } }, "node_modules/@ariakit/react-store": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/@ariakit/react-store/-/react-store-0.1.10.tgz", - "integrity": "sha512-DTpWLkfZDWDJqqH9aIcu/AYft1o3BGk/apkJyzSdSZtdFgOqcvDH+9m8zuuF6wMoZghpiS1pysRMk1X7gXVjfw==", + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/@ariakit/react-store/-/react-store-0.1.13.tgz", + "integrity": "sha512-/4R0HVcx14RlYCNqffytY9v3E+HLn+kL/Iaef3iOGSSvzr+Po75ZFJzMrNv3jVZsuhXXTilI16XmRT8nSiSUsA==", "dev": true, "license": "MIT", "dependencies": { - "@ariakit/react-utils": "0.2.5", - "@ariakit/store": "0.1.9", - "@ariakit/utils": "0.2.0", + "@ariakit/react-utils": "0.2.8", + "@ariakit/store": "0.1.11", + "@ariakit/utils": "0.2.2", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { @@ -144,33 +144,33 @@ } }, "node_modules/@ariakit/react-utils": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/@ariakit/react-utils/-/react-utils-0.2.5.tgz", - "integrity": "sha512-VfE0o5SH3TxEoivA8KgKd6Z+h1zDIYdRPEKxTCEOuBFwMlayGZbOxmmZGBZdmkg1M3GTf4iNfUfpFqAh0mUYqw==", + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/@ariakit/react-utils/-/react-utils-0.2.8.tgz", + "integrity": "sha512-F8bQ4tbPxK9oniw/XS2HB0bCvZA0djpkFlFsqx4rGH1RPrhwg17OCf6rOMCo1nMfAqrUT6rpdRkxlocmgaznvg==", "dev": true, "license": "MIT", "dependencies": { - "@ariakit/store": "0.1.9", - "@ariakit/utils": "0.2.0" + "@ariakit/store": "0.1.11", + "@ariakit/utils": "0.2.2" }, "peerDependencies": { "react": "^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/@ariakit/store": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/@ariakit/store/-/store-0.1.9.tgz", - "integrity": "sha512-VXT8GQxmbKR4KKWiZuuVL8Bkvsz7IT5sLYppPnFsmszl1KeKR6dcbo08VKVk6yGL6Gu1AvqmrMwV02DMAv5ZAQ==", + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/@ariakit/store/-/store-0.1.11.tgz", + "integrity": "sha512-rffsPgyf6MTVK3pZSS86oKIj8370F9229c/7QqCwvbEIl0zM0bfEEdE6K+djnsabwajhWlJ/2syURdD4x30rXg==", "dev": true, "license": "MIT", "dependencies": { - "@ariakit/utils": "0.2.0" + "@ariakit/utils": "0.2.2" } }, "node_modules/@ariakit/utils": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@ariakit/utils/-/utils-0.2.0.tgz", - "integrity": "sha512-y8GtynpLOsjz4H1juJEVRXtrL2+TEt+wIVoz09cnAnWVMfXggN2akH+vF6dP4jPJd0/F2yniwe08cLpkua+HWw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@ariakit/utils/-/utils-0.2.2.tgz", + "integrity": "sha512-OjdYlnJ8dW6XkBHirX0jx8bzLm577IL9Fe8T9dPrNKgCVvvJJiUL18iA5Oqqq9+FQ5ahhx5t4WgdE+2AaqG3IA==", "dev": true, "license": "MIT" }, @@ -1990,17 +1990,17 @@ } }, "node_modules/@base-ui/react": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@base-ui/react/-/react-1.8.0.tgz", - "integrity": "sha512-P0/1sxo6SBVZOklKMIedvTWqw2s2IQzi9x5bIVsXu980cuSOD4NeuRSs+/L7LZQfDkZP/uRZyGPyfFl/B1oH+Q==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@base-ui/react/-/react-1.9.0.tgz", + "integrity": "sha512-S8CSYosASBKtpL8SWUfS78rFElfLijiCgA7oHOK22jCJ95FULsYyKwBNFOgudt0RA+/7yNc7F81bOvQnRgbBiQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/runtime": "^7.29.7", - "@base-ui/utils": "0.4.0", + "@babel/runtime": "^7.29.7 || ^8.0.0", + "@base-ui/utils": "0.5.0", "@floating-ui/react-dom": "^2.1.9", "@floating-ui/utils": "^0.2.12", - "use-sync-external-store": "^1.6.0" + "use-sync-external-store": "^1.7.0" }, "engines": { "node": ">=14.0.0" @@ -2029,16 +2029,16 @@ } }, "node_modules/@base-ui/utils": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@base-ui/utils/-/utils-0.4.0.tgz", - "integrity": "sha512-bO9fz25kKtPf+aZVyfQrC0PDmJdmVni31W2hCS5/Owb+inwdIL3XU26pCPRPlt4LSxZrBgLwubXQXQlKaFEZzw==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@base-ui/utils/-/utils-0.5.0.tgz", + "integrity": "sha512-dYGGcEttjkYiMoa5nHm8vLaJ2UcuTWxo3BFAwOYXeRg/q7UVVvA6cacEIXEs3FgBfK1CGtW1ptElqs7wsx+t9A==", "dev": true, "license": "MIT", "dependencies": { - "@babel/runtime": "^7.29.7", + "@babel/runtime": "^7.29.7 || ^8.0.0", "@floating-ui/utils": "^0.2.12", - "reselect": "^5.2.0", - "use-sync-external-store": "^1.6.0" + "reselect": "^5.3.0", + "use-sync-external-store": "^1.7.0" }, "peerDependencies": { "@types/react": "^17 || ^18 || ^19", @@ -2223,9 +2223,9 @@ "license": "MIT" }, "node_modules/@csstools/css-calc": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-3.4.0.tgz", - "integrity": "sha512-XQKj5B7QiZcHiegCOCAzcAOJdhGgWOHbbu62h5e5mkHnn8lWcfiJhllkqWmxu5zWR9jucPHuo1iTB56P033hcg==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-3.4.3.tgz", + "integrity": "sha512-iex20d8CHVkyvg6B7UKV7uHnI2Bqo9g+EFfT9E0y+GvTvhZ/DwONJ+9aKb1dlqm0ZiGsL5RXjp0fCoJYnkeDjA==", "dev": true, "funding": [ { @@ -2242,14 +2242,14 @@ "node": ">=20.19.0" }, "peerDependencies": { - "@csstools/css-parser-algorithms": "^4.0.0", - "@csstools/css-tokenizer": "^4.0.0" + "@csstools/css-parser-algorithms": "^4.0.2", + "@csstools/css-tokenizer": "^4.0.2" } }, "node_modules/@csstools/css-parser-algorithms": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-4.0.0.tgz", - "integrity": "sha512-+B87qS7fIG3L5h3qwJ/IFbjoVoOe/bpOdh9hAjXbvx0o8ImEmUsGXN0inFOnk2ChCFgqkkGFQ+TpM5rbhkKe4w==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-4.0.2.tgz", + "integrity": "sha512-40cSKyMvK+tq4qz6Awrlye2WGuOKt3FwPgtGg6KTfbHOWNw+Rk1rzbAtZnZ6IBhsY491HLRnDXwoyBAijmmILA==", "dev": true, "funding": [ { @@ -2266,13 +2266,13 @@ "node": ">=20.19.0" }, "peerDependencies": { - "@csstools/css-tokenizer": "^4.0.0" + "@csstools/css-tokenizer": "^4.0.2" } }, "node_modules/@csstools/css-syntax-patches-for-csstree": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.1.13.tgz", - "integrity": "sha512-i9ZylF5QNhmNfPA9l0vHAWK4kPrbIp6g9lKgaiIFsIBz2F/WNB7OLrzlNNcCOm+h42bkaSD2v1PG+IBPHhc3ZA==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.1.15.tgz", + "integrity": "sha512-J0u7HkVl2nzSlhsiTOp4AmwcUQ3D+mGEEKfBy/7To5/y7F2OHwyLrXfrhR0SMgr4p5Lo+eaMVSeai24zUcBIxA==", "dev": true, "funding": [ { @@ -2422,203 +2422,6 @@ "tslib": "^2.4.0" } }, - "node_modules/@emotion/babel-plugin": { - "version": "11.13.5", - "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.13.5.tgz", - "integrity": "sha512-pxHCpT2ex+0q+HH91/zsdHkw/lXd468DIN2zvfvLtPKLLMo6gQj7oLObq8PhkrxOZb/gGCq03S3Z7PDhS8pduQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-module-imports": "^7.16.7", - "@babel/runtime": "^7.18.3", - "@emotion/hash": "^0.9.2", - "@emotion/memoize": "^0.9.0", - "@emotion/serialize": "^1.3.3", - "babel-plugin-macros": "^3.1.0", - "convert-source-map": "^1.5.0", - "escape-string-regexp": "^4.0.0", - "find-root": "^1.1.0", - "source-map": "^0.5.7", - "stylis": "4.2.0" - } - }, - "node_modules/@emotion/babel-plugin/node_modules/convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true, - "license": "MIT" - }, - "node_modules/@emotion/cache": { - "version": "11.14.0", - "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.14.0.tgz", - "integrity": "sha512-L/B1lc/TViYk4DcpGxtAVbx0ZyiKM5ktoIyafGkH6zg/tj+mA+NE//aPYKG0k8kCHSHVJrpLpcAlOBEXQ3SavA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@emotion/memoize": "^0.9.0", - "@emotion/sheet": "^1.4.0", - "@emotion/utils": "^1.4.2", - "@emotion/weak-memoize": "^0.4.0", - "stylis": "4.2.0" - } - }, - "node_modules/@emotion/css": { - "version": "11.13.5", - "resolved": "https://registry.npmjs.org/@emotion/css/-/css-11.13.5.tgz", - "integrity": "sha512-wQdD0Xhkn3Qy2VNcIzbLP9MR8TafI0MJb7BEAXKp+w4+XqErksWR4OXomuDzPsN4InLdGhVe6EYcn2ZIUCpB8w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@emotion/babel-plugin": "^11.13.5", - "@emotion/cache": "^11.13.5", - "@emotion/serialize": "^1.3.3", - "@emotion/sheet": "^1.4.0", - "@emotion/utils": "^1.4.2" - } - }, - "node_modules/@emotion/hash": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.2.tgz", - "integrity": "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==", - "dev": true, - "license": "MIT" - }, - "node_modules/@emotion/is-prop-valid": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.4.0.tgz", - "integrity": "sha512-QgD4fyscGcbbKwJmqNvUMSE02OsHUa+lAWKdEUIJKgqe5IwRSKd7+KhibEWdaKwgjLj0DRSHA9biAIqGBk05lw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@emotion/memoize": "^0.9.0" - } - }, - "node_modules/@emotion/memoize": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", - "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@emotion/react": { - "version": "11.14.0", - "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.14.0.tgz", - "integrity": "sha512-O000MLDBDdk/EohJPFUqvnp4qnHeYkVP5B0xEG0D/L7cOKP9kefu2DXn8dj74cQfsEzUqh+sr1RzFqiL1o+PpA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.18.3", - "@emotion/babel-plugin": "^11.13.5", - "@emotion/cache": "^11.14.0", - "@emotion/serialize": "^1.3.3", - "@emotion/use-insertion-effect-with-fallbacks": "^1.2.0", - "@emotion/utils": "^1.4.2", - "@emotion/weak-memoize": "^0.4.0", - "hoist-non-react-statics": "^3.3.1" - }, - "peerDependencies": { - "react": ">=16.8.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@emotion/serialize": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.3.3.tgz", - "integrity": "sha512-EISGqt7sSNWHGI76hC7x1CksiXPahbxEOrC5RjmFRJTqLyEK9/9hZvBbiYn70dw4wuwMKiEMCUlR6ZXTSWQqxA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@emotion/hash": "^0.9.2", - "@emotion/memoize": "^0.9.0", - "@emotion/unitless": "^0.10.0", - "@emotion/utils": "^1.4.2", - "csstype": "^3.0.2" - } - }, - "node_modules/@emotion/sheet": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.4.0.tgz", - "integrity": "sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@emotion/styled": { - "version": "11.14.1", - "resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-11.14.1.tgz", - "integrity": "sha512-qEEJt42DuToa3gurlH4Qqc1kVpNq8wO8cJtDzU46TjlzWjDlsVyevtYCRijVq3SrHsROS+gVQ8Fnea108GnKzw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.18.3", - "@emotion/babel-plugin": "^11.13.5", - "@emotion/is-prop-valid": "^1.3.0", - "@emotion/serialize": "^1.3.3", - "@emotion/use-insertion-effect-with-fallbacks": "^1.2.0", - "@emotion/utils": "^1.4.2" - }, - "peerDependencies": { - "@emotion/react": "^11.0.0-rc.0", - "react": ">=16.8.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@emotion/unitless": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.10.0.tgz", - "integrity": "sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@emotion/use-insertion-effect-with-fallbacks": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.2.0.tgz", - "integrity": "sha512-yJMtVdH59sxi/aVJBpk9FQq+OR8ll5GT8oWd57UpeaKEVGab41JWaCFA7FRLoMLloOZF/c/wsPoe+bfGmRKgDg==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "react": ">=16.8.0" - } - }, - "node_modules/@emotion/utils": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.4.2.tgz", - "integrity": "sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@emotion/weak-memoize": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.4.0.tgz", - "integrity": "sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@es-joy/jsdoccomment": { - "version": "0.50.2", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.50.2.tgz", - "integrity": "sha512-YAdE/IJSpwbOTiaURNCKECdAwqrJuFiZhylmesBcIRawtYKnBR2wxPhoIewMg+Yu+QuYvHfJNReWpoxGBKOChA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.6", - "@typescript-eslint/types": "^8.11.0", - "comment-parser": "1.4.1", - "esquery": "^1.6.0", - "jsdoc-type-pratt-parser": "~4.1.0" - }, - "engines": { - "node": ">=18" - } - }, "node_modules/@es-joy/resolve.exports": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@es-joy/resolve.exports/-/resolve.exports-1.2.0.tgz", @@ -2629,26 +2432,6 @@ "node": ">=10" } }, - "node_modules/@eslint-community/eslint-plugin-eslint-comments": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-4.7.2.tgz", - "integrity": "sha512-LF03qURSwEWm2dz5wtdDCzNk+7Opl0X7q6I3undsaIuNsEiNvRV3BCtqu14Q/6Pzg1tBj44LcxpW2EpSLZStZw==", - "dev": true, - "license": "MIT", - "dependencies": { - "escape-string-regexp": "^4.0.0", - "ignore": "^7.0.5" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0" - } - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.9.1", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", @@ -3950,9 +3733,9 @@ } }, "node_modules/@nodable/entities": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@nodable/entities/-/entities-3.0.0.tgz", - "integrity": "sha512-8L9xFeTYKhm49xfIypoe2W5wV1m/3Z58kT+7kR9A8OyFxcPduI4VmxaUMQyKYrRjUoLLSXv6EKKID5Tvj9cUVw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@nodable/entities/-/entities-3.1.0.tgz", + "integrity": "sha512-LsS/DjHr+uDM647Gru/cA8+J3a3HfhttwCKLyuoyN7yXTFCxKBtSgMQBvrW9yNPa2/zDRUNuGPaH5QUFoa4arQ==", "dev": true, "funding": [ { @@ -4578,6 +4361,7 @@ "version": "7.6.1", "resolved": "https://registry.npmjs.org/@octokit/webhooks-types/-/webhooks-types-7.6.1.tgz", "integrity": "sha512-S8u2cJzklBC0FgTwWVLaM8tMrDuDMVE4xiTK4EYXM9GntyvrdbSoxqDQa+Fh57CCNApyIpyeqPhhFEmHPfrXgw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", "dev": true, "license": "MIT" }, @@ -5185,231 +4969,233 @@ } }, "node_modules/@php-wasm/cli-util": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/cli-util/-/cli-util-3.1.41.tgz", - "integrity": "sha512-Tya6tusfES8csh+3oAOY80I3PQaEd3tFKPryIi6tuwSOUQTqN87qIXVBzjxBk1Gmb53ZwYg8q8+Cu6hUGieBpA==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/cli-util/-/cli-util-3.1.61.tgz", + "integrity": "sha512-J5B/BL9aB2Fc1Go3B7Me5SSzNX7V34PIlwiG5hhd91s2/y/dOqwcmhajMwxZU/zUnQizM7K3d6H4tCtkvdUzJQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/util": "3.1.41", + "@php-wasm/util": "3.1.61", "fast-xml-parser": "^5.8.0", "jsonc-parser": "3.3.1" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@php-wasm/logger": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/logger/-/logger-3.1.41.tgz", - "integrity": "sha512-bIX1A/6AeN8mCMHYGAUX9Gf2S3wuDVcM3fsG51OqFiwZCKfKOVJNyPm7YAykofeEUEYsrVHjyWNBv6jHMDF3BA==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/logger/-/logger-3.1.61.tgz", + "integrity": "sha512-4KAlMVNLgk/HnoNvjnrcP3NByTqTbvJsehRLdFJwAO3k74yy3IQL1Ohb57Qdtz9+1ezn5fdBMH/bS3XJjBiPzw==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@php-wasm/node": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/node/-/node-3.1.41.tgz", - "integrity": "sha512-GDNOkAQuWq+bZmQNHPhOMXklNLQpIyeLmw0m1K0IrL+Z3XAxCBPlnn0om5+bhqO7JjqVlbCb+5T/s2gw1IWBEg==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/node/-/node-3.1.61.tgz", + "integrity": "sha512-Arf2M0Fe/ZMzAF5FtKGu1oyGIy4wtKpQViLSy3mIagGuJtaElK4RIJFX/dQE+ZhMN1FRQHlb+oktqMyZGIoNRA==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/cli-util": "3.1.41", - "@php-wasm/logger": "3.1.41", - "@php-wasm/node-5-2": "3.1.41", - "@php-wasm/node-7-4": "3.1.41", - "@php-wasm/node-8-0": "3.1.41", - "@php-wasm/node-8-1": "3.1.41", - "@php-wasm/node-8-2": "3.1.41", - "@php-wasm/node-8-3": "3.1.41", - "@php-wasm/node-8-4": "3.1.41", - "@php-wasm/node-8-5": "3.1.41", - "@php-wasm/universal": "3.1.41", - "@php-wasm/util": "3.1.41", - "fs-ext-extra-prebuilt": "2.2.7", + "@php-wasm/cli-util": "3.1.61", + "@php-wasm/logger": "3.1.61", + "@php-wasm/node-5-2": "3.1.61", + "@php-wasm/node-7-4": "3.1.61", + "@php-wasm/node-8-0": "3.1.61", + "@php-wasm/node-8-1": "3.1.61", + "@php-wasm/node-8-2": "3.1.61", + "@php-wasm/node-8-3": "3.1.61", + "@php-wasm/node-8-4": "3.1.61", + "@php-wasm/node-8-5": "3.1.61", + "@php-wasm/universal": "3.1.61", + "@php-wasm/util": "3.1.61", "wasm-feature-detect": "1.8.0", "ws": "8.21.0" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" + }, + "optionalDependencies": { + "fs-ext-extra-prebuilt": "~2.2.15" } }, "node_modules/@php-wasm/node-5-2": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/node-5-2/-/node-5-2-3.1.41.tgz", - "integrity": "sha512-GbtDcymMvPJcrhMbubf7r1xfjNNBYxAXnMzPJb3vrcXiDDDdt8NYan8ekvj3meWJzlqj0spj8SXqO2OleQad4w==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/node-5-2/-/node-5-2-3.1.61.tgz", + "integrity": "sha512-fe6Tv36jEt5la329y3apCvdanMonZSRnXBChv43Z82wJxUA59ZLa4xl2B8lPMl2bsUplVMbVh0n0oVuRBRWTCg==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/universal": "3.1.41", + "@php-wasm/universal": "3.1.61", "wasm-feature-detect": "1.8.0" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@php-wasm/node-7-4": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/node-7-4/-/node-7-4-3.1.41.tgz", - "integrity": "sha512-hG4RjCsrXFPKVWTbfyoEXqqOJkAwnHdZcbpTgxn253SnQXOUea94lJXrN3ki6Nk0WauM7MH7PFZbN+0NNjPypQ==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/node-7-4/-/node-7-4-3.1.61.tgz", + "integrity": "sha512-Ci0N87OtceX3ur0Mm3I7JKIrR3htNS3+0fFl4emiF1pifFfyBY9tANnx/ql+W7VG0h6I9pA+5Ng1+ABXGxdq1Q==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/universal": "3.1.41", + "@php-wasm/universal": "3.1.61", "wasm-feature-detect": "1.8.0" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@php-wasm/node-8-0": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/node-8-0/-/node-8-0-3.1.41.tgz", - "integrity": "sha512-ivN/otcmGtoZWjt1K2IE+810u2rxAQuspay/rRJdXsY9mxiCoo0vTlxcl5v1DJIx2HvsHHfaAjoWcmckb7djAw==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/node-8-0/-/node-8-0-3.1.61.tgz", + "integrity": "sha512-GszL/X56cPv9VMpq8k7qmh7uPbseWMyTH+lxq6VhEkOHpQuJVfHLrLMm7LrUzaAoXxD2OhcgaeFWZuGiiEsx3w==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/universal": "3.1.41", + "@php-wasm/universal": "3.1.61", "wasm-feature-detect": "1.8.0" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@php-wasm/node-8-1": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/node-8-1/-/node-8-1-3.1.41.tgz", - "integrity": "sha512-H5LhYZMI2qY2j+h6GERPUBnv0+K0oMpaYyVd01BOfvJiJN1KVDAp+tNBnVUq6lPl6lpFjOHl5/9jfvJDXdpt+w==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/node-8-1/-/node-8-1-3.1.61.tgz", + "integrity": "sha512-cCOYCUTcqWI/X7FesOPc+FqpaSNhu3GnIaJs2GJaNpIPdVTZiBz0L1MP/c3sPJDMFM38/Ra4q0TyZMfsWcx6BA==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/universal": "3.1.41", + "@php-wasm/universal": "3.1.61", "wasm-feature-detect": "1.8.0" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@php-wasm/node-8-2": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/node-8-2/-/node-8-2-3.1.41.tgz", - "integrity": "sha512-RgPyrCS3yS8ELsthqkjFTqBL98gpxX2B1ZH+en/9TD97h4PvRnAKU3909EwtsXoySTPl6ITcOgB4HuXVjr04pA==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/node-8-2/-/node-8-2-3.1.61.tgz", + "integrity": "sha512-HH6A/vxAMT7oLbSWBGApE1fC3+6E2Tspw/mKqhsFDUIcaGkGyaDPYBwDt/ZX4U7MBfjxng+WGh8r2zXwuEKUEw==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/universal": "3.1.41", + "@php-wasm/universal": "3.1.61", "wasm-feature-detect": "1.8.0" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@php-wasm/node-8-3": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/node-8-3/-/node-8-3-3.1.41.tgz", - "integrity": "sha512-CkYlFrBQrjMTvig5noRKX9vYfEbL38AH6ufZ2SpfSlq4Z4n+iIRNJHj/865kTaMagY/J3/4A5QgCH5FCMA3xoQ==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/node-8-3/-/node-8-3-3.1.61.tgz", + "integrity": "sha512-ba6bgfPTZq1BUnpfQyppM9jEmtaPWW6kGFU+uiwNFz8AdsVDOKXAPVlp47SCToxRjOK2D6CwbEdHCW29yTp84w==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/universal": "3.1.41", + "@php-wasm/universal": "3.1.61", "wasm-feature-detect": "1.8.0" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@php-wasm/node-8-4": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/node-8-4/-/node-8-4-3.1.41.tgz", - "integrity": "sha512-t+c2fu1RiElIZk72arZ3GfjeCCwajtiQAf3YyTJnrGF20PYpnluX0HuwoQNWY3EsP+1X1KhUqYrGXVrC+w8Tiw==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/node-8-4/-/node-8-4-3.1.61.tgz", + "integrity": "sha512-pen4AgjGtrRyOMW+Hob1/1T6y4B7XYLqwlfyHtplU6asNCVIT6lvGtubGRKCuvVejAPEA0wHtI9OEUW3CsV2Ow==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/universal": "3.1.41", + "@php-wasm/universal": "3.1.61", "wasm-feature-detect": "1.8.0" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@php-wasm/node-8-5": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/node-8-5/-/node-8-5-3.1.41.tgz", - "integrity": "sha512-+cO8/+yqYIkIL01Twwp9yZC+3fxQTF1vrF5ZtMtS4iKjDHip9mKfZNCIx0RNRfXFf2+IOxhWpIvK1fkoOQTaFA==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/node-8-5/-/node-8-5-3.1.61.tgz", + "integrity": "sha512-qlu3xS0kcdgSEeqv/Ow0/E+2H3TlHw5APcZh5vJf6PAK9oMqRB+0mU44swDv81+bTmO0rApafO/HkomDGbKN5w==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/universal": "3.1.41", + "@php-wasm/universal": "3.1.61", "wasm-feature-detect": "1.8.0" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@php-wasm/progress": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/progress/-/progress-3.1.41.tgz", - "integrity": "sha512-nwXh9cmXY2j61vI/aBYO78jnAbD2C46HILuDarwKi0FXxkMIQ86z5vCWz7iLbBw42kCtkelC8Lbbd2dY8eDR9w==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/progress/-/progress-3.1.61.tgz", + "integrity": "sha512-kZKq/jBnRW3BNH6UcYMnOJdOXrQMPo+PfoZPFzMOsHZEfco4i7QK/+sZXMAE3/qFCyG5iNVkmhLMd5uKDm1bzA==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/logger": "3.1.41" + "@php-wasm/logger": "3.1.61" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@php-wasm/scopes": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/scopes/-/scopes-3.1.41.tgz", - "integrity": "sha512-ux7RzRsI6JmBnmx3ZH2XUMXV1AVvOoeSoQz2+cSML4Y+lMRvYZLLr1FW9NE69tyij+XkoXbQ4ed+ktDt31O8qg==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/scopes/-/scopes-3.1.61.tgz", + "integrity": "sha512-SFEy1I3wggp2oEt2X+ntF2gB7HeJUJagen405PGFAvC4MPPO6Es7/olro+JOIz5iDINRU5FpHMp/854+8Mkemw==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@php-wasm/stream-compression": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/stream-compression/-/stream-compression-3.1.41.tgz", - "integrity": "sha512-g6u6LhSVXRtC7TdaA+77iYOi58IjTBGL7YoN1bwVwMETz6TJEiXu6u+PPHOGbVDoriz8+Z6JtxOayM3HykT3WQ==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/stream-compression/-/stream-compression-3.1.61.tgz", + "integrity": "sha512-KkpVyvNYRZ9H3HY2SEZVkF+cJBFwpAjijznpNmi546jMfDYkyelOq4faUvk4FWpJuSEXJSDXNyMC3jOW6yE7vQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/util": "3.1.41" + "@php-wasm/util": "3.1.61" } }, "node_modules/@php-wasm/universal": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/universal/-/universal-3.1.41.tgz", - "integrity": "sha512-T2vTpE0tdDi+2XOng/ZOHj5D2qEepnhSg2f4y64d7y6/Z+QUpzm9uyvxlsUVoiFhwklWC++Bq5dX3eXEI2lVUQ==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/universal/-/universal-3.1.61.tgz", + "integrity": "sha512-ZNlT6WueUP+ZOWF++0LnCdYhxiW5cbZc/UGWcRZ1+n1N8DYU2wuQNvqGWUJw+NHtf4WGbytVWnjkbub/WToGGQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/logger": "3.1.41", - "@php-wasm/progress": "3.1.41", - "@php-wasm/stream-compression": "3.1.41", - "@php-wasm/util": "3.1.41", + "@php-wasm/logger": "3.1.61", + "@php-wasm/progress": "3.1.61", + "@php-wasm/stream-compression": "3.1.61", + "@php-wasm/util": "3.1.61", "ini": "4.1.2" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@php-wasm/universal/node_modules/ini": { @@ -5423,39 +5209,39 @@ } }, "node_modules/@php-wasm/util": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/util/-/util-3.1.41.tgz", - "integrity": "sha512-+t2nsvnYlfzY9LRpTXXrGa71LtTeujEpASfIAUhpidSc7CJTla9Oab0dQ+2slq6o4PU9Oc5NRMrz768iDp08eA==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/util/-/util-3.1.61.tgz", + "integrity": "sha512-FfIa4dp7EptOr5S7KyvVvhW7k/MUBb3MAHumWq0nq+QD5JkszcEp7OOT56kuXtCxxnbsHwCyUL2FS8F2gkbRFA==", "dev": true, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@php-wasm/web-service-worker": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/web-service-worker/-/web-service-worker-3.1.41.tgz", - "integrity": "sha512-Ubx370HnZs/qu0q5GyuzEbjn/V50Gu+r8yObls/s6tnXiw0wVDhV94upLfsgjOmosGacxFNDVesmgwJTuKyEjg==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/web-service-worker/-/web-service-worker-3.1.61.tgz", + "integrity": "sha512-t91QXVpotYGFtluTt252H0SR8DutPfbylsFbACrw9C8c2TfLBbMfCiJjq1s4j9BucJCFpE075Il+6rr8aM5Rtg==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/scopes": "3.1.41", - "@php-wasm/universal": "3.1.41" + "@php-wasm/scopes": "3.1.61", + "@php-wasm/universal": "3.1.61" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@php-wasm/xdebug-bridge": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@php-wasm/xdebug-bridge/-/xdebug-bridge-3.1.41.tgz", - "integrity": "sha512-HfAILIRbzXkw0kMuenExtU3UCEoM5wcyxgwZlL5+DyaDLqjjUU71lgfmq/BNctk+9I+5U64SN50c2OXfikkcoQ==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@php-wasm/xdebug-bridge/-/xdebug-bridge-3.1.61.tgz", + "integrity": "sha512-rnWP0dK9yF11scOHCv91X2MDq57p608pJ7cEGDNbHuyq/MXKIrvA+DiTo5+rH6mY0Fz9BC0C1edW7WGl5xO+AQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/logger": "3.1.41", - "@php-wasm/universal": "3.1.41", + "@php-wasm/logger": "3.1.61", + "@php-wasm/universal": "3.1.61", "ws": "8.21.0", "xml2js": "0.6.2", "yargs": "17.7.2" @@ -5464,8 +5250,8 @@ "xdebug-bridge": "xdebug-bridge.js" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@php-wasm/xdebug-bridge/node_modules/emoji-regex": { @@ -5475,16 +5261,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@php-wasm/xdebug-bridge/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/@php-wasm/xdebug-bridge/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -5560,32 +5336,31 @@ } }, "node_modules/@pmmmwh/react-refresh-webpack-plugin": { - "version": "0.5.17", - "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.17.tgz", - "integrity": "sha512-tXDyE1/jzFsHXjhRZQ3hMl0IVhYe5qula43LDWIhVfjp9G/nT5OQY5AORVOrkEGAUltBJOfOWeETbmhm6kHhuQ==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.6.3.tgz", + "integrity": "sha512-k1EEmFS9K7685tqJM55DCA3sYlTNZb7aFj1M3HNFwMqH+fGgMEvemIQ5kurIzKc9wYRSmfKpSZN3WUyY/GHlvg==", "dev": true, "license": "MIT", "dependencies": { - "ansi-html": "^0.0.9", + "anser": "^2.1.1", "core-js-pure": "^3.23.3", "error-stack-parser": "^2.0.6", "html-entities": "^2.1.0", - "loader-utils": "^2.0.4", "schema-utils": "^4.2.0", "source-map": "^0.7.3" }, "engines": { - "node": ">= 10.13" + "node": ">=18.12" }, "peerDependencies": { - "@types/webpack": "4.x || 5.x", + "@types/webpack": "5.x", "react-refresh": ">=0.10.0 <1.0.0", "sockjs-client": "^1.4.0", - "type-fest": ">=0.17.0 <5.0.0", - "webpack": ">=4.43.0 <6.0.0", - "webpack-dev-server": "3.x || 4.x || 5.x", + "type-fest": ">=0.17.0 <6.0.0", + "webpack": "^5.0.0", + "webpack-dev-server": "^4.8.0 || 5.x || 6.x", "webpack-hot-middleware": "2.x", - "webpack-plugin-serve": "0.x || 1.x" + "webpack-plugin-serve": "1.x" }, "peerDependenciesMeta": { "@types/webpack": { @@ -5608,16 +5383,6 @@ } } }, - "node_modules/@pmmmwh/react-refresh-webpack-plugin/node_modules/source-map": { - "version": "0.7.6", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", - "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">= 12" - } - }, "node_modules/@polka/url": { "version": "1.0.0-next.29", "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", @@ -5856,9 +5621,9 @@ } }, "node_modules/@radix-ui/primitive": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.7.tgz", - "integrity": "sha512-rqWnm76nYT8HoNNqEjpgJ7Pw/DrBj5iBTrmEPo6HTX5+VJyBNOqTdv4g89G63HuR5g0AaENoAcH7Is5fF2kZ8Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.2.0.tgz", + "integrity": "sha512-KABY+VMIRPJL+Vyzv/335FEhXXD/xDv8BMb1kl48/aXJZMH0LtHCTx5ga5RnxaEP3nZHtmTLf1P9vanmFX46bw==", "dev": true, "license": "MIT" }, @@ -5879,9 +5644,9 @@ } }, "node_modules/@radix-ui/react-context": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.2.2.tgz", - "integrity": "sha512-RHCUGwKHDr0hDGg4X7ma4JG4/+12qxw8rkh5QKdDldlCvtja6nUx1Ef/8HVrJze81lEsgLQlqjzjGNHantgnQA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.3.0.tgz", + "integrity": "sha512-v5AYEocMISkbJ+1fTXzZpiFv7NRr3D2WiYbLIKf+FkmJ8VkP6d503eV2n34MFussHXY1pcoq3yfJiQH77dc4Mg==", "dev": true, "license": "MIT", "peerDependencies": { @@ -5895,24 +5660,24 @@ } }, "node_modules/@radix-ui/react-dialog": { - "version": "1.1.23", - "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.1.23.tgz", - "integrity": "sha512-Ksw4WeROkO4rC9k/onilX/Ao2Cr1ku1unMNH+XSCcP4jSXYu7HDsg9n4ojMjVb22XpYjAQ9qfrFlVbru1vXDUA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.3.1.tgz", + "integrity": "sha512-+0E4qvVTwjAWra9sEhJ+9BTsvHE00zkUuNw1VGh7S+Gc13dfYk+S1PVQdchWDj+XYHhAai7Z7IpzXVDCGsDplg==", "dev": true, "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-dismissable-layer": "1.1.19", - "@radix-ui/react-focus-guards": "1.1.6", - "@radix-ui/react-focus-scope": "1.1.16", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-dismissable-layer": "1.2.1", + "@radix-ui/react-focus-guards": "1.2.0", + "@radix-ui/react-focus-scope": "1.3.1", "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-portal": "1.1.17", - "@radix-ui/react-presence": "1.1.10", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-slot": "1.3.3", - "@radix-ui/react-use-controllable-state": "1.2.6", + "@radix-ui/react-portal": "1.2.0", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-use-controllable-state": "1.3.0", "@radix-ui/react-use-layout-effect": "1.1.4", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.7.2" @@ -5933,16 +5698,16 @@ } }, "node_modules/@radix-ui/react-dismissable-layer": { - "version": "1.1.19", - "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.19.tgz", - "integrity": "sha512-8g4pfOL9HoKKLWGiypT+dphVqjFfmcXO5GBnhsG6zI+lxAx/8feQpr+1LSN8Re3hiZ+XkLNS4O9ztK11/LzQ6w==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.2.1.tgz", + "integrity": "sha512-KIfDcAsx+oVylFZ4xryVKusJUrLLhTQmfnJW4kwk4Km5myvhHCrj04hnWWUC166+xD4DHdH8tQGylwYX1h6+Pg==", "dev": true, "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-callback-ref": "1.1.4", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-callback-ref": "1.1.5", "@radix-ui/react-use-effect-event": "0.0.5" }, "peerDependencies": { @@ -5961,9 +5726,9 @@ } }, "node_modules/@radix-ui/react-focus-guards": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.6.tgz", - "integrity": "sha512-RNOJjfZMTyBM6xYmV3IVGXkPjIhcBAuv48POevAXwrGJhkWZ9p1rFoIS1JFooPuT193AZmRsCPhpoVJxx6OPoQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.2.0.tgz", + "integrity": "sha512-MPm5R0iRGUDrDnPNxmLBkv+X7pN4XKzt+MbWJEuJQsH3NFH4omrbpXpucyYCCKTSt+na/ZxGhEWQrWTZ0285cA==", "dev": true, "license": "MIT", "peerDependencies": { @@ -5977,15 +5742,15 @@ } }, "node_modules/@radix-ui/react-focus-scope": { - "version": "1.1.16", - "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.16.tgz", - "integrity": "sha512-wmRZ2WWLvmt6KHy2rNPOdPUjwq5xOHY02+m+udwJTn0aNIox/rkskAvJTyTLGhPK6KgrUjlJUJpgmx/+wFiFIQ==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.3.1.tgz", + "integrity": "sha512-ugeMhbXt4y5S2T1GnIqbWDKEN962PDwnX1fN0eKOOgf5f63Dh2mn8F1FUySlgW0iF6GiVsRF32DzuDIWTUyQJg==", "dev": true, "license": "MIT", "dependencies": { "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-callback-ref": "1.1.4" + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-callback-ref": "1.1.5" }, "peerDependencies": { "@types/react": "*", @@ -6022,13 +5787,13 @@ } }, "node_modules/@radix-ui/react-portal": { - "version": "1.1.17", - "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.1.17.tgz", - "integrity": "sha512-vKQLcWypUnwZVvfV7UkGahH2g6ySe8M8R+zYBwPrv5byZ9QAW6cQVvNKo7GgmD+p8aYb6D9JBuvy8/WhOno2wQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.2.0.tgz", + "integrity": "sha512-StX7xXnaRU41VvFtMm9zlhVGz8XF6GmWWTXftkQaY+tqVkbs/R9UmAp5mLzHHapk5hM9RMZQvO/3usyIP/g42g==", "dev": true, "license": "MIT", "dependencies": { - "@radix-ui/react-primitive": "2.1.10", + "@radix-ui/react-primitive": "2.2.0", "@radix-ui/react-use-layout-effect": "1.1.4" }, "peerDependencies": { @@ -6047,9 +5812,9 @@ } }, "node_modules/@radix-ui/react-presence": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.10.tgz", - "integrity": "sha512-3wyzCQ6+ubRA+D4uv9m95JYLXxmOHp05qjrkjeA7uKHHtjpPggQzc6DAb0URl7j67oR0K2foO4ip27TiX037Bw==", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.11.tgz", + "integrity": "sha512-Z7/atlkab36Z8hm+V8zYc79r0W+tiOB1o0tun1By94JyadkekLQmtEAnBSP9XKXBNQsStoStS4+gX10JpS5akA==", "dev": true, "license": "MIT", "dependencies": { @@ -6071,13 +5836,13 @@ } }, "node_modules/@radix-ui/react-primitive": { - "version": "2.1.10", - "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz", - "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.2.0.tgz", + "integrity": "sha512-HCTSPMNqv55Qk0IX4geJbpyXazmqulcimwuyjxTkKi29v+QZbG2Zho9BnbBq4YS2PF+KlNb2CXoLz66uUmblkg==", "dev": true, "license": "MIT", "dependencies": { - "@radix-ui/react-slot": "1.3.3" + "@radix-ui/react-slot": "1.5.0" }, "peerDependencies": { "@types/react": "*", @@ -6095,9 +5860,9 @@ } }, "node_modules/@radix-ui/react-slot": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz", - "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.5.0.tgz", + "integrity": "sha512-tyYd9ddPXAysAbdbD9eYxgwpCSv6f3PncqVSNKQFSR5lcJVLz3cb/pANDoYrLiHBpXv7skortyUgGUWsYuPPFQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6114,11 +5879,14 @@ } }, "node_modules/@radix-ui/react-use-callback-ref": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.4.tgz", - "integrity": "sha512-R6OUY2e2fA6Yn6s+VSx5KBV6Nx8LQEhu+cz7LCej18rQ1HLyg9PSC9jP/ZNx0o6FAIK9c0F1kHylzSxKsdlkrQ==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.5.tgz", + "integrity": "sha512-Y5GBf4NKeADoXI1geiMlMuMoURT3k9MizzzKhGb/m55H94aGigZ01PIpkvsO6lML13BA6XYAXSJ6gza7vTn5nw==", "dev": true, "license": "MIT", + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.4" + }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" @@ -6130,13 +5898,13 @@ } }, "node_modules/@radix-ui/react-use-controllable-state": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.6.tgz", - "integrity": "sha512-uEQJGT97ZA/TgP/Hydw47lHu+/vQj6z/0jA+WeTbK1o9Rx45GImjpD0tc3W5ad3D6XTSR6e1yEO0FvGq6WQfVQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.3.0.tgz", + "integrity": "sha512-TAcBI7bw2ljYCbv4+zuTSd6zICu8pRt6SDN2vJ/Z06K2MXh6I9WYFe/A9ovlFDtR5HVHGm5iDxDoABm/++dbKg==", "dev": true, "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-use-effect-event": "0.0.5", "@radix-ui/react-use-layout-effect": "1.1.4" }, @@ -6186,81 +5954,82 @@ } }, "node_modules/@react-spring/animated": { - "version": "9.7.5", - "resolved": "https://registry.npmjs.org/@react-spring/animated/-/animated-9.7.5.tgz", - "integrity": "sha512-Tqrwz7pIlsSDITzxoLS3n/v/YCUHQdOIKtOJf4yL6kYVSDTSmVK1LI1Q3M/uu2Sx4X3pIWF3xLUhlsA6SPNTNg==", + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/@react-spring/animated/-/animated-10.1.2.tgz", + "integrity": "sha512-yAsQ/bbp6+vko7WNCI1M00c6KLE9XKTGCrgRhQqS4JcK3oF5qBV4rHYrQEprvEvYXxt+1H5FsLS2eVValEPfFw==", "dev": true, "license": "MIT", "dependencies": { - "@react-spring/shared": "~9.7.5", - "@react-spring/types": "~9.7.5" + "@react-spring/shared": "~10.1.2", + "@react-spring/types": "~10.1.2" }, "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/@react-spring/core": { - "version": "9.7.5", - "resolved": "https://registry.npmjs.org/@react-spring/core/-/core-9.7.5.tgz", - "integrity": "sha512-rmEqcxRcu7dWh7MnCcMXLvrf6/SDlSokLaLTxiPlAYi11nN3B5oiCUAblO72o+9z/87j2uzxa2Inm8UbLjXA+w==", + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/@react-spring/core/-/core-10.1.2.tgz", + "integrity": "sha512-lPGOAg0V+PV3ucopOajD+YCxoe8twALqAeG4c/+sqVjBsyUNNdx8qfz/DcNSPKA8PV3+AyQELlCxlDfap9cmBQ==", "dev": true, "license": "MIT", "dependencies": { - "@react-spring/animated": "~9.7.5", - "@react-spring/shared": "~9.7.5", - "@react-spring/types": "~9.7.5" + "@react-spring/animated": "~10.1.2", + "@react-spring/shared": "~10.1.2", + "@react-spring/types": "~10.1.2" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/react-spring/donate" }, "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/@react-spring/rafz": { - "version": "9.7.5", - "resolved": "https://registry.npmjs.org/@react-spring/rafz/-/rafz-9.7.5.tgz", - "integrity": "sha512-5ZenDQMC48wjUzPAm1EtwQ5Ot3bLIAwwqP2w2owG5KoNdNHpEJV263nGhCeKKmuA3vG2zLLOdu3or6kuDjA6Aw==", + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/@react-spring/rafz/-/rafz-10.1.2.tgz", + "integrity": "sha512-KC6vSFZyPnRJ2rXqipV9QqR4SaYbYXjvKfdYKWipNK2mWuV79gr20WmpVUOsTiEHGRY3WSOdWCHN+P9Pdaqb7Q==", "dev": true, "license": "MIT" }, "node_modules/@react-spring/shared": { - "version": "9.7.5", - "resolved": "https://registry.npmjs.org/@react-spring/shared/-/shared-9.7.5.tgz", - "integrity": "sha512-wdtoJrhUeeyD/PP/zo+np2s1Z820Ohr/BbuVYv+3dVLW7WctoiN7std8rISoYoHpUXtbkpesSKuPIw/6U1w1Pw==", + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/@react-spring/shared/-/shared-10.1.2.tgz", + "integrity": "sha512-47/8bNQ/o0uEmxEnPBuERlC29VSqiTn5P9ln9tUMSVkYKYxBtouYE686F5kAGj+eHRPoNCw7drxWE9nv2d1LMw==", "dev": true, "license": "MIT", "dependencies": { - "@react-spring/rafz": "~9.7.5", - "@react-spring/types": "~9.7.5" + "@react-spring/rafz": "~10.1.2", + "@react-spring/types": "~10.1.2" }, "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/@react-spring/types": { - "version": "9.7.5", - "resolved": "https://registry.npmjs.org/@react-spring/types/-/types-9.7.5.tgz", - "integrity": "sha512-HVj7LrZ4ReHWBimBvu2SKND3cDVUPWKLqRTmWe/fNY6o1owGOX0cAHbdPDTMelgBlVbrTKrre6lFkhqGZErK/g==", + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/@react-spring/types/-/types-10.1.2.tgz", + "integrity": "sha512-G4CWowmVPz+rDG1y9QRVq/prZNxiNwQaHC0kgT/MgY6jAGgdRgTV4VThpvJDwWvUitk3xZB4soP4d36fjeQ09g==", "dev": true, "license": "MIT" }, "node_modules/@react-spring/web": { - "version": "9.7.5", - "resolved": "https://registry.npmjs.org/@react-spring/web/-/web-9.7.5.tgz", - "integrity": "sha512-lmvqGwpe+CSttsWNZVr+Dg62adtKhauGwLyGE/RRyZ8AAMLgb9x3NDMA5RMElXo+IMyTkPp7nxTB8ZQlmhb6JQ==", + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/@react-spring/web/-/web-10.1.2.tgz", + "integrity": "sha512-KxDB3zaDqy9qFsu7fdxjyraAxweHH4k5TW5WGT/OuMK6hKaxSDfhrQfRBzfFaSVvMBf+NghbJFanllV4ia6i7A==", "dev": true, "license": "MIT", "dependencies": { - "@react-spring/animated": "~9.7.5", - "@react-spring/core": "~9.7.5", - "@react-spring/shared": "~9.7.5", - "@react-spring/types": "~9.7.5" + "@react-spring/animated": "~10.1.2", + "@react-spring/core": "~10.1.2", + "@react-spring/shared": "~10.1.2", + "@react-spring/types": "~10.1.2", + "csstype": "^3.2.3" }, "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/@rtsao/scc": { @@ -6388,20 +6157,20 @@ } }, "node_modules/@simple-git/args-pathspec": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@simple-git/args-pathspec/-/args-pathspec-1.0.3.tgz", - "integrity": "sha512-ngJMaHlsWDTfjyq9F3VIQ8b7NXbBLq5j9i5bJ6XLYtD6qlDXT7fdKY2KscWWUF8t18xx052Y/PUO1K1TRc9yKA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@simple-git/args-pathspec/-/args-pathspec-1.0.4.tgz", + "integrity": "sha512-EtMX6XjRWSastG2SdkmSQByPtJ9dx/NIjnHbpQPCYt62j4RmSx5rgLTGpw0YCjF5h191gZOmBfheOT23cRSFdw==", "dev": true, "license": "MIT" }, "node_modules/@simple-git/argv-parser": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@simple-git/argv-parser/-/argv-parser-1.1.1.tgz", - "integrity": "sha512-Q9lBcfQ+VQCpQqGJFHe5yooOS5hGdLFFbJ5R+R5aDsnkPCahtn1hSkMcORX65J2Z5lxSkD0lQorMsncuBQxYUw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@simple-git/argv-parser/-/argv-parser-2.0.1.tgz", + "integrity": "sha512-M++IaVWrN+vYalilOHfwvT2IL3wYZtVEBQpmX6DLSOJLtxbZ+SUeIDE3IiPogzhPACLajwtxfa5rp+ZX1FczzQ==", "dev": true, "license": "MIT", "dependencies": { - "@simple-git/args-pathspec": "^1.0.3" + "@simple-git/args-pathspec": "^1.0.4" } }, "node_modules/@sinclair/typebox": { @@ -6470,9 +6239,9 @@ } }, "node_modules/@stylistic/stylelint-plugin/node_modules/postcss-selector-parser": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.6.tgz", - "integrity": "sha512-7qASPzhKF2l2KLboRZux8CCTRMdGiV08vWmyKzPz22qZ7ZjQBOeY7rNzNoCLSUiftJ7HUq0GERHmxw/t0dCdMw==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.7.tgz", + "integrity": "sha512-wWBro/7hJ40ye6TPiXkUQoXKCw23xSsjriUvqd7Uls9Sso3oLiON1flc18cCdnjgCRXw4fBVqUJJeOdDTh3P3g==", "dev": true, "license": "MIT", "dependencies": { @@ -6875,9 +6644,9 @@ } }, "node_modules/@types/aws-lambda": { - "version": "8.10.162", - "resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.162.tgz", - "integrity": "sha512-Fn658grtLOci1oxi1391vvDWJRKNGWRSqfxRkmN/Iy3c0tQH1USMKEXcPYHLvope+ZgTFocx9FRQJx1muBL6qw==", + "version": "8.10.164", + "resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.164.tgz", + "integrity": "sha512-XOnrazWcOd6yWPnR7DxqCBPPYciDjHq+NN8LPwwqBCJNXLyPJgKo47fZpJ113+oyAn9Zti0Cf6H4k6yPcE3WFg==", "dev": true, "license": "MIT" }, @@ -7023,13 +6792,6 @@ "@types/send": "*" } }, - "node_modules/@types/gradient-parser": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@types/gradient-parser/-/gradient-parser-1.1.0.tgz", - "integrity": "sha512-SaEcbgQscHtGJ1QL+ajgDTmmqU2f6T+00jZRcFlVHUW2Asivc84LNUev/UQFyu117AsdyrtI+qpwLvgjJXJxmw==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/highlight-words-core": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@types/highlight-words-core/-/highlight-words-core-1.2.1.tgz", @@ -7333,17 +7095,17 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.65.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.65.0.tgz", - "integrity": "sha512-IEgob78X12rHpUmtcwFsXhZdVGJtwTVP8FiCLZkR6GlYVrl2PcuB+KhCE5BlVC/eQpQnu8WXRtkHZuPar+gCRA==", + "version": "8.72.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.72.1.tgz", + "integrity": "sha512-5CokTWXpmbylfFabsbvHC0CAw3XLaGnoa+nFJX5FR592h/LoZsENUE6p/rg5xvkKrFEXz6pYmgI29AgXc2N3BQ==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.65.0", - "@typescript-eslint/type-utils": "8.65.0", - "@typescript-eslint/utils": "8.65.0", - "@typescript-eslint/visitor-keys": "8.65.0", + "@typescript-eslint/scope-manager": "8.72.1", + "@typescript-eslint/type-utils": "8.72.1", + "@typescript-eslint/utils": "8.72.1", + "@typescript-eslint/visitor-keys": "8.72.1", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.5.0" @@ -7356,22 +7118,22 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.65.0", + "@typescript-eslint/parser": "^8.72.1", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "8.65.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.65.0.tgz", - "integrity": "sha512-CZ4nMxWwgu1HEEFNkeaCptra9QCtkmKdgf3sWh1rl1trIhmxLilgTV4cwcbQ4wemnT4sWQN8CaKOmdYx+g2gMA==", + "version": "8.72.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.72.1.tgz", + "integrity": "sha512-ZGwZP4OCfyA0AQTpEAMWz+rtX01DRhQWW5hB0ucKDEIX5U7jdmPSaMx94rQfaPAQzIYz2BimOgKOJtjfpRFQ9g==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.65.0", - "@typescript-eslint/types": "8.65.0", - "@typescript-eslint/typescript-estree": "8.65.0", - "@typescript-eslint/visitor-keys": "8.65.0", + "@typescript-eslint/scope-manager": "8.72.1", + "@typescript-eslint/types": "8.72.1", + "@typescript-eslint/typescript-estree": "8.72.1", + "@typescript-eslint/visitor-keys": "8.72.1", "debug": "^4.4.3" }, "engines": { @@ -7387,14 +7149,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.65.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.65.0.tgz", - "integrity": "sha512-SxnPhbTsGahizDgbu7oqFH/xVtzIqMd/s+WtnSxNxJZJpLbdT5IPdzg8EZxO3+PoKahXmwJLeNQOpKJb3/bi7Q==", + "version": "8.72.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.72.1.tgz", + "integrity": "sha512-fAuVMkwdO/huI8nyo/WKnNKf6Gag93S56Rh3Ts5mGcavwSdaN8tRg1gCeIGX8PF+nzp1BjGfO4gHhGzW1J6jTg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.65.0", - "@typescript-eslint/types": "^8.65.0", + "@typescript-eslint/tsconfig-utils": "^8.72.1", + "@typescript-eslint/types": "^8.72.1", "debug": "^4.4.3" }, "engines": { @@ -7409,14 +7171,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.65.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.65.0.tgz", - "integrity": "sha512-Esbl8OSYiVxBokYgWPf7VVWg/BE798wXhimnn9ML9Pt5qoDf8bfQlgjlKXR/k98+AcNzlLKYrpCcrcuZ9DZLgg==", + "version": "8.72.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.72.1.tgz", + "integrity": "sha512-lC/t6eMCZZQAAKZEYGL6RDVSuFehpdmMT6h+nJIjIa6oylN/PwDgDVtEIbB7O9xFfZYtZAYLoLlDNWKJhtF+uQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.65.0", - "@typescript-eslint/visitor-keys": "8.65.0" + "@typescript-eslint/types": "8.72.1", + "@typescript-eslint/visitor-keys": "8.72.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -7427,9 +7189,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.65.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.65.0.tgz", - "integrity": "sha512-j6GzGqCiRdA7Qhur2VVmKZAkBLfnHFQfx4TaJGL9RMveZqCo48jSHHO0DTgizEnGhtWnqmbtCUSrqSkdiY/0Hg==", + "version": "8.72.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.1.tgz", + "integrity": "sha512-e4D5R5vpeAEPBxT2BAzsFQL3sbwyeeeo5+aczgNSRK1V734jE7pTqaGFU+fXapWEQwnZbpFaTn32+Z8DwS6OTg==", "dev": true, "license": "MIT", "engines": { @@ -7444,15 +7206,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.65.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.65.0.tgz", - "integrity": "sha512-YjaZ7PRI5qY7ax2L3PbvX0rRyGtipAReCWs0mhhDBHjH/vl0g0BonaGXrKdKpMbIIsMIwDgbk/xzkBTyAltS5g==", + "version": "8.72.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.72.1.tgz", + "integrity": "sha512-iY2wlmyrXJmx4yxUGP3aYCFF3cA/6ShddOKmLU2dx7LnEykbAM8WThlxZEfd1NddqceF6eJmZUayxx9oKIYNlg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.65.0", - "@typescript-eslint/typescript-estree": "8.65.0", - "@typescript-eslint/utils": "8.65.0", + "@typescript-eslint/types": "8.72.1", + "@typescript-eslint/typescript-estree": "8.72.1", + "@typescript-eslint/utils": "8.72.1", "debug": "^4.4.3", "ts-api-utils": "^2.5.0" }, @@ -7469,9 +7231,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.65.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.65.0.tgz", - "integrity": "sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg==", + "version": "8.72.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.72.1.tgz", + "integrity": "sha512-LmE5IhQet1BWOWEXqBrVtBPsMAOQ6Nzk35d+WLh3mk4EUF33sqlfxjio1MdYeSvKSG5skactKKuixBIKXhL4Rw==", "dev": true, "license": "MIT", "engines": { @@ -7483,16 +7245,16 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.65.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.65.0.tgz", - "integrity": "sha512-JboAE2swaYt4tb1fHhHTABE2K+OLy09XfcTbhnk4Pw96f9dd2e9iYsJ28gBggHlo5z5x1rkyWvcPoTuNTd4oGg==", + "version": "8.72.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.72.1.tgz", + "integrity": "sha512-DAlUoUV93hIvrtIQLwCbmZQYVZwOMhiHJrOVUUIWicFZaIYjTRqlY3I/NZevfkLmSqkNHRu2qYDcq9lrn16oOQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.65.0", - "@typescript-eslint/tsconfig-utils": "8.65.0", - "@typescript-eslint/types": "8.65.0", - "@typescript-eslint/visitor-keys": "8.65.0", + "@typescript-eslint/project-service": "8.72.1", + "@typescript-eslint/tsconfig-utils": "8.72.1", + "@typescript-eslint/types": "8.72.1", + "@typescript-eslint/visitor-keys": "8.72.1", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", @@ -7511,16 +7273,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.65.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.65.0.tgz", - "integrity": "sha512-gXiwIHsYreboxeJucHKPvgwl7dXt50mF8s1/c00cP/WoVTyWKFdtfhRWwZiXYFU5H2O8vVoSLNrexFZjYS/SGA==", + "version": "8.72.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.72.1.tgz", + "integrity": "sha512-5v5liypurJBFHCBNqh/RjsymAD+VWcE0djuGY/BUqp5fC3Qn+luWDEksjuTtWjPn6i5zQlUtkZCRG/CYG0yCkA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.65.0", - "@typescript-eslint/types": "8.65.0", - "@typescript-eslint/typescript-estree": "8.65.0" + "@typescript-eslint/scope-manager": "8.72.1", + "@typescript-eslint/types": "8.72.1", + "@typescript-eslint/typescript-estree": "8.72.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -7535,13 +7297,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.65.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.65.0.tgz", - "integrity": "sha512-8C71BQkGjiMmXtop7pHVJu1l2NNShFdkCyD6a2ezzs5vU/L3LRtb69EtcteFwz0mYMPzIgOw0n6OV4VBUWZd7A==", + "version": "8.72.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.72.1.tgz", + "integrity": "sha512-SB8xqipSzZHUePCCLNeYxqnxq83X61/qzNhjQGbTfjxGZIeOEP7tBgWYX05Tcd6CgE02WdTJnh5b8kMZJ/+bnQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.65.0", + "@typescript-eslint/types": "8.72.1", "eslint-visitor-keys": "^5.0.0" }, "engines": { @@ -8098,51 +7860,48 @@ } }, "node_modules/@wordpress/a11y": { - "version": "4.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/a11y/-/a11y-4.55.0.tgz", - "integrity": "sha512-vhAsPgOgfOZ09IMNDBUf2KgERY1ZhzOADnpIr2JeH27EL2HtPOTLZGPB8pi30JdTHfff2ttZ8EWf1XU2iF17Tg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/a11y/-/a11y-5.0.0.tgz", + "integrity": "sha512-ocYyNn7Z85gDzvto3ppOPeuaj4VoDk03ymsO3ubuAoEDdxXgsTiJIZIBTYrwxvQZ3KznBe5i/HzPKrpvdpJQ+Q==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/dom-ready": "^4.55.0", - "@wordpress/i18n": "^6.28.0" + "@wordpress/dom-ready": "^5.0.0", + "@wordpress/i18n": "^7.0.0" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" } }, "node_modules/@wordpress/api-fetch": { - "version": "7.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-7.55.0.tgz", - "integrity": "sha512-xT80VXmnvFdK71FJQwZ+9sWaWYvBavm9TCaySzbXYAT24sHzONSa9lCvAOcfvPKVFQcBFExT6EalB4U3A0JKPg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-8.0.0.tgz", + "integrity": "sha512-3+GnPoqIIxehutRZNJcutDjMFqnDiatBFD88Ecw8FksbPfFIeK4ONG9ORCQKsfLiCpu5DHWVrPJrvtzGw4ZffQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/i18n": "^6.28.0", - "@wordpress/private-apis": "^1.55.0", - "@wordpress/url": "^4.55.0" + "@wordpress/i18n": "^7.0.0", + "@wordpress/private-apis": "^3.0.0", + "@wordpress/url": "^5.0.0" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" } }, "node_modules/@wordpress/autop": { - "version": "4.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/autop/-/autop-4.55.0.tgz", - "integrity": "sha512-j7XVZ4ypUBZSTcZkJ8OI+4KA4EU2J+zL4kyLnraec/sVZ/1YlGsPL9oSF6fA+jyOWmi4OBszPEIG0XvkntHB/g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/autop/-/autop-5.0.0.tgz", + "integrity": "sha512-aHfC5Z7TmwvuRT0iV9e6l/N17C3VVcXcOlzouEC0x2/SNEc0dR71b3WPc0Qx4P44TAvpp7YQPJcaaM/Fz7Bfbg==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" } }, "node_modules/@wordpress/babel-preset-default": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@wordpress/babel-preset-default/-/babel-preset-default-8.56.0.tgz", - "integrity": "sha512-e6M3B67Ooub7jQaBLW1KiY6Ghq9wXAdBBe08nZ6xeSX3znBdXlWCg6YpSRw54//t/p7ajHSKVaq8dvf2x46P+A==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/babel-preset-default/-/babel-preset-default-10.0.0.tgz", + "integrity": "sha512-mXxwcIfEuj10SnofavV13/0NshtkrI+d1S/vSWrtgU5ibj+ejcvAXBiqIPBsb3RZDZwipTbRJV+VbyBjaf4IrQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { @@ -8152,98 +7911,105 @@ "@babel/plugin-transform-runtime": "^7.25.7", "@babel/preset-env": "^7.25.7", "@babel/preset-typescript": "^7.25.7", - "@wordpress/browserslist-config": "^6.56.0", - "@wordpress/warning": "^3.56.0", + "@wordpress/browserslist-config": "^7.0.0", + "@wordpress/warning": "^4.0.0", "browserslist": "^4.28.7", "core-js": "^3.31.0", - "react": "^18.3.1" + "react": "^19.3.0" }, "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" + } + }, + "node_modules/@wordpress/babel-preset-default/node_modules/react": { + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-19.3.1.tgz", + "integrity": "sha512-QNhWdt7nrgVWWQG58QuGsAR3jv3Hbe4mb4vz7w2csnHavciZJgda1CPNaldF6eVxv90ud3jUXpKlHL69gO38yw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" } }, "node_modules/@wordpress/base-styles": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/base-styles/-/base-styles-13.1.0.tgz", - "integrity": "sha512-6bdgpXZi0ajrB139xYd9okoMWYRNe3engXh5GLDhG5lIyL8wvM976Ref1I0+5LafnQQUk9Ug4IPruHx3tJcZgA==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/base-styles/-/base-styles-14.0.0.tgz", + "integrity": "sha512-BkxwZfnaazn6qziF1yBcYPyGziFArrcsyKgm09fDd0SdegRsh2ZmlENwAcvfuQ23ENS/m3vuFMMmBUbqg+Efmg==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" } }, "node_modules/@wordpress/blob": { - "version": "4.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/blob/-/blob-4.55.0.tgz", - "integrity": "sha512-EUP9pxKkWW8qwJ0ddFPRpiOXOlsfqkrjSN/MNOESebXsyV6ZPKDdKkVZn1mnpvLjKPY7ebkKtn4exHIQmu9wpg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/blob/-/blob-5.0.0.tgz", + "integrity": "sha512-BB2FpHEOq1my0Qe6BD/K5SAWt5I40vDZaFxH5PeeUyZ1KCEszaidkwYsY02sXxRK8rK/WOHGii2fOcpIqrmajA==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" } }, "node_modules/@wordpress/block-editor": { - "version": "17.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/block-editor/-/block-editor-17.1.0.tgz", - "integrity": "sha512-p+4YgopJOP/gXif9QEjE3LpQY8fGMtGCVkRZ37Ia6fl9rH8QPD6MDhgCjsg1LDazMTc18MwbMyRKLFfFrwqeUw==", + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/block-editor/-/block-editor-19.0.0.tgz", + "integrity": "sha512-HZqOQC10gR7NOU1cUWRrIKx/6XuZBrlbezw8fLgbMpZD91E0oglSqrkvejhE+Ezw8zpDHvD9L/SacfZv8BP/Hw==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@react-spring/web": "^9.4.5", - "@wordpress/a11y": "^4.55.0", - "@wordpress/base-styles": "^13.1.0", - "@wordpress/blob": "^4.55.0", - "@wordpress/block-serialization-default-parser": "^5.55.0", - "@wordpress/blocks": "^16.0.0", - "@wordpress/commands": "^1.55.0", - "@wordpress/components": "^40.1.0", - "@wordpress/compose": "^8.8.0", - "@wordpress/data": "^10.55.0", - "@wordpress/dataviews": "^19.0.0", - "@wordpress/date": "^5.55.0", - "@wordpress/deprecated": "^4.55.0", - "@wordpress/dom": "^4.55.0", - "@wordpress/element": "^8.7.0", - "@wordpress/global-styles-engine": "^1.22.0", - "@wordpress/hooks": "^4.55.0", - "@wordpress/html-entities": "^4.55.0", - "@wordpress/i18n": "^6.28.0", - "@wordpress/icons": "^16.0.0", - "@wordpress/image-cropper": "^1.19.0", - "@wordpress/interactivity": "^6.55.0", - "@wordpress/is-shallow-equal": "^5.55.0", - "@wordpress/kebab-case": "^1.2.0", - "@wordpress/keyboard-shortcuts": "^5.55.0", - "@wordpress/keycodes": "^4.55.0", - "@wordpress/notices": "^5.55.0", - "@wordpress/preferences": "^4.55.0", - "@wordpress/priority-queue": "^3.55.0", - "@wordpress/private-apis": "^1.55.0", - "@wordpress/rich-text": "^7.55.0", - "@wordpress/style-engine": "^2.55.0", - "@wordpress/token-list": "^3.55.0", - "@wordpress/ui": "^0.22.0", - "@wordpress/upload-media": "^0.40.0", - "@wordpress/url": "^4.55.0", - "@wordpress/warning": "^3.55.0", + "@react-spring/web": "^10.1.2", + "@wordpress/a11y": "^5.0.0", + "@wordpress/base-styles": "^14.0.0", + "@wordpress/blob": "^5.0.0", + "@wordpress/block-serialization-default-parser": "^6.0.0", + "@wordpress/blocks": "^17.0.0", + "@wordpress/commands": "^2.0.0", + "@wordpress/components": "^43.0.0", + "@wordpress/compose": "^9.0.0", + "@wordpress/data": "^11.0.0", + "@wordpress/dataviews": "^21.0.0", + "@wordpress/date": "^6.0.0", + "@wordpress/deprecated": "^5.0.0", + "@wordpress/dom": "^5.0.0", + "@wordpress/element": "^10.0.0", + "@wordpress/global-styles-engine": "^2.0.0", + "@wordpress/hooks": "^5.0.0", + "@wordpress/html-entities": "^5.0.0", + "@wordpress/i18n": "^7.0.0", + "@wordpress/icons": "^19.0.0", + "@wordpress/image-cropper": "^2.0.0", + "@wordpress/interactivity": "^8.0.0", + "@wordpress/is-shallow-equal": "^6.0.0", + "@wordpress/kebab-case": "^2.0.0", + "@wordpress/keyboard-shortcuts": "^6.0.0", + "@wordpress/keycodes": "^5.0.0", + "@wordpress/notices": "^6.0.0", + "@wordpress/preferences": "^5.0.0", + "@wordpress/priority-queue": "^4.0.0", + "@wordpress/private-apis": "^3.0.0", + "@wordpress/react-inert-value": "^2.0.0", + "@wordpress/rich-text": "^8.0.0", + "@wordpress/style-engine": "^3.0.0", + "@wordpress/token-list": "^4.0.0", + "@wordpress/ui": "^0.25.0", + "@wordpress/upload-media": "^0.43.0", + "@wordpress/url": "^5.0.0", + "@wordpress/warning": "^4.0.0", "change-case": "^4.1.2", "clsx": "^2.1.1", - "colord": "^2.9.3", + "colord": "^2.9.4", "diff": "^8.0.3", "fast-deep-equal": "^3.1.3", "parsel-js": "^1.1.2", "postcss": "^8.4.38", "postcss-prefix-selector": "^1.16.0", "postcss-urlrebase": "^1.4.0", - "react-autosize-textarea": "^7.1.0", "react-easy-crop": "^5.4.2", "remove-accents": "^0.5.0" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19", @@ -8256,63 +8022,79 @@ } } }, + "node_modules/@wordpress/block-editor/node_modules/@wordpress/kebab-case": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/kebab-case/-/kebab-case-2.0.0.tgz", + "integrity": "sha512-JjPgCJ5SRbbiKboK1U+k37NY8Hb42hHzMphczPtYPGGRNiasMV7T4RkbKlvUo+Qcm0hE6G8ct9VnEsfSsEbjoQ==", + "dev": true, + "license": "GPL-2.0-or-later", + "dependencies": { + "change-case": "^4.1.2" + }, + "engines": { + "node": ">=22.13.0" + } + }, "node_modules/@wordpress/block-serialization-default-parser": { - "version": "5.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/block-serialization-default-parser/-/block-serialization-default-parser-5.55.0.tgz", - "integrity": "sha512-1VxsFa72StKmVKFnmxBYg9adcWUdTqIgbPubtelOgeYi0LXVRrJNXKG89JP3GXnE2Hk1iK3TbtZJj956E+ANRA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/block-serialization-default-parser/-/block-serialization-default-parser-6.0.0.tgz", + "integrity": "sha512-C9HgZeToeeNouMGjTnz5WV8z4vNZ+NBrX4af4Npy6F/VrikOpMAYYJ5hi1K07g/o9hzalZMYN+fHXvuQcYK9MQ==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" } }, "node_modules/@wordpress/blocks": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/@wordpress/blocks/-/blocks-16.0.0.tgz", - "integrity": "sha512-wDL8R5VuJK0vvavZbvSUjWagPB5Vt9bmNQo1G8OAoAjl/JUCICjU9BvZWM8XK/BXSS95qcb5l3H3UIca5onuwQ==", + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/blocks/-/blocks-17.0.0.tgz", + "integrity": "sha512-6lZpvRhaFvg/GxYa6RXauU67g7ocjR2UloY1i53wFrCPoNgZAIIfn2q94IX5KeE35nSr0u8XdzDjyRwFz0QGYw==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/autop": "^4.55.0", - "@wordpress/blob": "^4.55.0", - "@wordpress/block-serialization-default-parser": "^5.55.0", - "@wordpress/data": "^10.55.0", - "@wordpress/deprecated": "^4.55.0", - "@wordpress/dom": "^4.55.0", - "@wordpress/element": "^8.7.0", - "@wordpress/hooks": "^4.55.0", - "@wordpress/html-entities": "^4.55.0", - "@wordpress/i18n": "^6.28.0", - "@wordpress/is-shallow-equal": "^5.55.0", - "@wordpress/keycodes": "^4.55.0", - "@wordpress/private-apis": "^1.55.0", - "@wordpress/rich-text": "^7.55.0", - "@wordpress/shortcode": "^4.55.0", - "@wordpress/warning": "^3.55.0", + "@wordpress/autop": "^5.0.0", + "@wordpress/blob": "^5.0.0", + "@wordpress/block-serialization-default-parser": "^6.0.0", + "@wordpress/data": "^11.0.0", + "@wordpress/deprecated": "^5.0.0", + "@wordpress/dom": "^5.0.0", + "@wordpress/element": "^10.0.0", + "@wordpress/hooks": "^5.0.0", + "@wordpress/html-entities": "^5.0.0", + "@wordpress/i18n": "^7.0.0", + "@wordpress/is-shallow-equal": "^6.0.0", + "@wordpress/keycodes": "^5.0.0", + "@wordpress/private-apis": "^3.0.0", + "@wordpress/rich-text": "^8.0.0", + "@wordpress/shortcode": "^5.0.0", + "@wordpress/warning": "^4.0.0", "change-case": "^4.1.2", - "colord": "^2.9.3", + "colord": "^2.9.4", "fast-deep-equal": "^3.1.3", "hpq": "^1.4.0", "is-plain-object": "^5.1.0", "marked": "^18.0.3", "memize": "^2.1.1", - "react-is": "^18.3.0", + "react-is": "^19.3.0", "remove-accents": "^0.5.0", "simple-html-tokenizer": "^0.5.7", "uuid": "^14.0.0" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19", - "react": "^18 || ^19" + "@types/react-dom": "^18 || ^19", + "react": "^18 || ^19", + "react-dom": "^18 || ^19" }, "peerDependenciesMeta": { "@types/react": { "optional": true + }, + "@types/react-dom": { + "optional": true } } }, @@ -8330,105 +8112,101 @@ } }, "node_modules/@wordpress/browserslist-config": { - "version": "6.56.0", - "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-6.56.0.tgz", - "integrity": "sha512-/gdTZapH6cV2iu+glSvM6IjYjS6kLtRlmjlNENqn03Isc8V1cSyWZWZ4vlq2i41uwqGoDObu4DdlmTBWS+g4Cg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-7.0.0.tgz", + "integrity": "sha512-eZ2yaOBprRNppFNN/qubJ7C2nOX6llR+IeQ5jQC1665sFcOkZes+hLwpbKsZNcmL26ge+77vdQ0f/Ur67rgkgw==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" } }, "node_modules/@wordpress/commands": { - "version": "1.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-1.55.0.tgz", - "integrity": "sha512-AM/r2cTB8Ijql9O9f5yuNS4Zb55h718E8Dsa30agsf0zQIunJ+tSHWjzJBiqOtNqDxDtU5jdjhWApsauEEFZpA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-2.0.0.tgz", + "integrity": "sha512-pfkGCvuEOJ6v67++VKdn387pM3AFbAQKVLZJ2lq9Ei75xvd7pkmsnz3iqLA326E88IiXmSY49KSXuU/4bGsCYA==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/base-styles": "^13.1.0", - "@wordpress/components": "^40.1.0", - "@wordpress/data": "^10.55.0", - "@wordpress/element": "^8.7.0", - "@wordpress/i18n": "^6.28.0", - "@wordpress/icons": "^16.0.0", - "@wordpress/keyboard-shortcuts": "^5.55.0", - "@wordpress/keycodes": "^4.55.0", - "@wordpress/preferences": "^4.55.0", - "@wordpress/private-apis": "^1.55.0", + "@wordpress/base-styles": "^14.0.0", + "@wordpress/components": "^43.0.0", + "@wordpress/data": "^11.0.0", + "@wordpress/element": "^10.0.0", + "@wordpress/i18n": "^7.0.0", + "@wordpress/icons": "^19.0.0", + "@wordpress/keyboard-shortcuts": "^6.0.0", + "@wordpress/keycodes": "^5.0.0", + "@wordpress/preferences": "^5.0.0", + "@wordpress/private-apis": "^3.0.0", "clsx": "^2.1.1", "cmdk": "^1.0.0" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" }, "peerDependencies": { + "@types/react": "^18 || ^19", "react": "^18 || ^19", "react-dom": "^18 || ^19" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } } }, "node_modules/@wordpress/components": { - "version": "40.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-40.1.0.tgz", - "integrity": "sha512-kSMoGcAwf752S18Y2RCEy6EM94NpemrMKWOM6+GSFE3wLYDArO8g9rXXOVBSd1R09Vc+s6Rk//Z+d3pN+DOx6A==", + "version": "43.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-43.0.0.tgz", + "integrity": "sha512-8IfVyT0QXTlhcw9id9aSygYISKR+xjyyVWuJuwMGgb/SqHGBFLnBBKBRq/ypamF/eB0vE8Gb+AmdjP6G8P1LBw==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@ariakit/react": "^0.4.37", + "@ariakit/react": "^0.4.42", "@date-fns/utc": "^2.1.1", - "@emotion/cache": "^11.14.0", - "@emotion/css": "^11.13.5", - "@emotion/react": "^11.14.0", - "@emotion/serialize": "^1.3.3", - "@emotion/styled": "^11.14.1", - "@emotion/utils": "^1.4.2", "@floating-ui/react-dom": "^2.1.9", - "@types/gradient-parser": "^1.1.0", "@types/highlight-words-core": "^1.2.1", "@use-gesture/react": "^10.3.1", - "@wordpress/a11y": "^4.55.0", - "@wordpress/base-styles": "^13.1.0", - "@wordpress/compose": "^8.8.0", - "@wordpress/date": "^5.55.0", - "@wordpress/deprecated": "^4.55.0", - "@wordpress/dom": "^4.55.0", - "@wordpress/element": "^8.7.0", - "@wordpress/escape-html": "^3.55.0", - "@wordpress/hooks": "^4.55.0", - "@wordpress/html-entities": "^4.55.0", - "@wordpress/i18n": "^6.28.0", - "@wordpress/icons": "^16.0.0", - "@wordpress/is-shallow-equal": "^5.55.0", - "@wordpress/kebab-case": "^1.2.0", - "@wordpress/keycodes": "^4.55.0", - "@wordpress/primitives": "^4.55.0", - "@wordpress/private-apis": "^1.55.0", - "@wordpress/rich-text": "^7.55.0", - "@wordpress/style-runtime": "^0.11.0", - "@wordpress/ui": "^0.22.0", - "@wordpress/warning": "^3.55.0", - "change-case": "^4.1.2", + "@wordpress/a11y": "^5.0.0", + "@wordpress/base-styles": "^14.0.0", + "@wordpress/compose": "^9.0.0", + "@wordpress/date": "^6.0.0", + "@wordpress/deprecated": "^5.0.0", + "@wordpress/dom": "^5.0.0", + "@wordpress/element": "^10.0.0", + "@wordpress/escape-html": "^4.0.0", + "@wordpress/hooks": "^5.0.0", + "@wordpress/html-entities": "^5.0.0", + "@wordpress/i18n": "^7.0.0", + "@wordpress/icons": "^19.0.0", + "@wordpress/is-shallow-equal": "^6.0.0", + "@wordpress/keycodes": "^5.0.0", + "@wordpress/primitives": "^5.0.0", + "@wordpress/private-apis": "^3.0.0", + "@wordpress/react-inert-value": "^2.0.0", + "@wordpress/rich-text": "^8.0.0", + "@wordpress/style-runtime": "^0.14.0", + "@wordpress/ui": "^0.25.0", + "@wordpress/warning": "^4.0.0", "clsx": "^2.1.1", - "colord": "^2.9.3", + "colord": "^2.9.4", "csstype": "^3.2.3", "date-fns": "^4.4.0", "deepmerge": "^4.3.1", "fast-deep-equal": "^3.1.3", "framer-motion": "^11.15.0", - "gradient-parser": "^1.1.1", + "gradient-parser": "^1.2.0", "highlight-words-core": "^1.2.2", "is-plain-object": "^5.1.0", "memize": "^2.1.1", "path-to-regexp": "^6.2.1", - "re-resizable": "^6.4.0", + "re-resizable": "^6.11.2", "react-colorful": "^5.6.1", "remove-accents": "^0.5.0", "uuid": "^14.0.0" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19", @@ -8442,52 +8220,56 @@ } }, "node_modules/@wordpress/compose": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-8.9.0.tgz", - "integrity": "sha512-P5LIb2c+r77CVxhxRZW1RU+jZVn5QtkwsKrxea3oSRmbJn5Z3layII2Ilzw1+0qOUpgBgQbUnko0LsDLMTC/5g==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-9.0.0.tgz", + "integrity": "sha512-xP7EDOTyJrc5fC48Zh/u9Hvu+eHvKlU+qn5OyDQi1ahmg5GqNq3UAaODnsgeLyggGgWtmJhbzgN0qIJvhn52Sw==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { "@types/mousetrap": "^1.6.8", - "@wordpress/deprecated": "^4.56.0", - "@wordpress/dom": "^4.56.0", - "@wordpress/element": "^8.8.0", - "@wordpress/is-shallow-equal": "^5.56.0", - "@wordpress/keycodes": "^4.56.0", - "@wordpress/priority-queue": "^3.56.0", - "@wordpress/private-apis": "^1.56.0", - "@wordpress/undo-manager": "^1.56.0", + "@wordpress/deprecated": "^5.0.0", + "@wordpress/dom": "^5.0.0", + "@wordpress/element": "^10.0.0", + "@wordpress/is-shallow-equal": "^6.0.0", + "@wordpress/keycodes": "^5.0.0", + "@wordpress/priority-queue": "^4.0.0", + "@wordpress/private-apis": "^3.0.0", + "@wordpress/undo-manager": "^2.0.0", "change-case": "^4.1.2", - "mousetrap": "^1.6.5", - "use-memo-one": "^1.1.1" + "mousetrap": "^1.6.5" }, "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19", - "react": "^18 || ^19" + "@types/react-dom": "^18 || ^19", + "react": "^18 || ^19", + "react-dom": "^18 || ^19" }, "peerDependenciesMeta": { "@types/react": { "optional": true + }, + "@types/react-dom": { + "optional": true } } }, "node_modules/@wordpress/data": { - "version": "10.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-10.55.0.tgz", - "integrity": "sha512-eBnMTN2+L9KFfdcfm2s98Fg18xCehHhWwuIoZcuO1RTsy0aL4XsEKy+jrAMKg08HrDi5AfXaytr4Shh86ny7gA==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-11.0.0.tgz", + "integrity": "sha512-z74Y4/cfyw+Kel5uhVYsoZTytFtUw2xRrfFpa7uWIdfrdQxSVgxajd74pRjxGQ6W+g0VWzV6ZBptHDxYf58Nmg==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/compose": "^8.8.0", - "@wordpress/deprecated": "^4.55.0", - "@wordpress/element": "^8.7.0", - "@wordpress/is-shallow-equal": "^5.55.0", - "@wordpress/priority-queue": "^3.55.0", - "@wordpress/private-apis": "^1.55.0", - "@wordpress/redux-routine": "^5.55.0", + "@wordpress/compose": "^9.0.0", + "@wordpress/deprecated": "^5.0.0", + "@wordpress/element": "^10.0.0", + "@wordpress/is-shallow-equal": "^6.0.0", + "@wordpress/priority-queue": "^4.0.0", + "@wordpress/private-apis": "^3.0.0", + "@wordpress/redux-routine": "^6.0.0", "deepmerge": "^4.3.1", "equivalent-key-map": "^0.2.2", "is-plain-object": "^5.1.0", @@ -8496,55 +8278,55 @@ "rememo": "^4.0.2" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19", - "react": "^18 || ^19" + "@types/react-dom": "^18 || ^19", + "react": "^18 || ^19", + "react-dom": "^18 || ^19" }, "peerDependenciesMeta": { "@types/react": { "optional": true + }, + "@types/react-dom": { + "optional": true } } }, "node_modules/@wordpress/dataviews": { - "version": "19.0.0", - "resolved": "https://registry.npmjs.org/@wordpress/dataviews/-/dataviews-19.0.0.tgz", - "integrity": "sha512-jvY4snbIm8tSPD0gZwPNBEykMpuzktiX+jq/7R08MKPKYXVFKtjRFN5S5pjNF2EWRdQhuRMBDDqWFM7K2zD3VQ==", + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/dataviews/-/dataviews-21.0.0.tgz", + "integrity": "sha512-/aojI+0aZEpMYkteZ404V2Bhyxu0Kr5zcf7WhEgmIyHEcfBmuoKIxiPjnVQgAC990gmwW522LYBLnepOymdIOg==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@ariakit/react": "^0.4.37", - "@base-ui/react": "^1.7.0", + "@ariakit/react": "^0.4.42", + "@base-ui/react": "^1.9.0", "@date-fns/tz": "^1.5.0", "@daypicker/react": "^10.0.1", - "@emotion/cache": "^11.14.0", - "@emotion/css": "^11.13.5", - "@emotion/react": "^11.14.0", - "@emotion/styled": "^11.14.1", - "@emotion/utils": "^1.4.2", "@floating-ui/react-dom": "^2.1.9", "@use-gesture/react": "^10.3.1", - "@wordpress/a11y": "^4.55.0", - "@wordpress/base-styles": "^13.1.0", - "@wordpress/components": "^40.1.0", - "@wordpress/compose": "^8.8.0", - "@wordpress/data": "^10.55.0", - "@wordpress/date": "^5.55.0", - "@wordpress/deprecated": "^4.55.0", - "@wordpress/element": "^8.7.0", - "@wordpress/hooks": "^4.55.0", - "@wordpress/i18n": "^6.28.0", - "@wordpress/icons": "^16.0.0", - "@wordpress/kebab-case": "^1.2.0", - "@wordpress/keycodes": "^4.55.0", - "@wordpress/ui": "^0.22.0", - "@wordpress/warning": "^3.55.0", + "@wordpress/a11y": "^5.0.0", + "@wordpress/base-styles": "^14.0.0", + "@wordpress/components": "^43.0.0", + "@wordpress/compose": "^9.0.0", + "@wordpress/data": "^11.0.0", + "@wordpress/date": "^6.0.0", + "@wordpress/deprecated": "^5.0.0", + "@wordpress/element": "^10.0.0", + "@wordpress/hooks": "^5.0.0", + "@wordpress/i18n": "^7.0.0", + "@wordpress/icons": "^19.0.0", + "@wordpress/kebab-case": "^2.0.0", + "@wordpress/keycodes": "^5.0.0", + "@wordpress/react-inert-value": "^2.0.0", + "@wordpress/ui": "^0.25.0", + "@wordpress/warning": "^4.0.0", "change-case": "^4.1.2", "clsx": "^2.1.1", - "colord": "^2.9.3", + "colord": "^2.9.4", "colorjs.io": "^0.7.1", "date-fns": "^4.4.0", "deepmerge": "^4.3.1", @@ -8555,12 +8337,10 @@ "memize": "^2.1.1", "react-colorful": "^5.6.1", "remove-accents": "^0.5.0", - "use-memo-one": "^1.1.1", "uuid": "^14.0.0" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19", @@ -8573,79 +8353,90 @@ } } }, - "node_modules/@wordpress/date": { - "version": "5.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/date/-/date-5.55.0.tgz", - "integrity": "sha512-Z7Y7vj0MSXO75Inf9m7KXoTgocjmO4HsSSCiqSpBuYjIkQHEuloYZfL9y/PCxMfxhQb/qa4ueRH+XT7csXE68Q==", + "node_modules/@wordpress/dataviews/node_modules/@wordpress/kebab-case": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/kebab-case/-/kebab-case-2.0.0.tgz", + "integrity": "sha512-JjPgCJ5SRbbiKboK1U+k37NY8Hb42hHzMphczPtYPGGRNiasMV7T4RkbKlvUo+Qcm0hE6G8ct9VnEsfSsEbjoQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/deprecated": "^4.55.0", - "moment": "^2.29.4", - "moment-timezone": "^0.5.40" + "change-case": "^4.1.2" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" } }, - "node_modules/@wordpress/dependency-extraction-webpack-plugin": { - "version": "6.56.0", - "resolved": "https://registry.npmjs.org/@wordpress/dependency-extraction-webpack-plugin/-/dependency-extraction-webpack-plugin-6.56.0.tgz", - "integrity": "sha512-WXbnRMxSLtVcDWfz7oQJFBIsh0Afewoenj0WPKuasFta2MHLBIRAzHQOv5QMjCK/5MF0N0ljQzcnxYbuIvgj7w==", + "node_modules/@wordpress/date": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/date/-/date-6.0.0.tgz", + "integrity": "sha512-knjw0jMLk2RzLq8wUzLuS0lvNI1UqwpbqxYVuSyXrUb+8GKXaT/uq0ql82Dha0RiagNCfrneowZFo3mJc7EyTw==", + "dev": true, + "license": "GPL-2.0-or-later", + "dependencies": { + "@wordpress/deprecated": "^5.0.0", + "moment": "^2.31.0", + "moment-timezone": "^0.5.40" + }, + "engines": { + "node": ">=22.13.0" + } + }, + "node_modules/@wordpress/dependency-extraction-webpack-plugin": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/dependency-extraction-webpack-plugin/-/dependency-extraction-webpack-plugin-7.0.0.tgz", + "integrity": "sha512-SYzb/CWt8VfGGMwGb7UVjBV8qGBkY6PqybUWFtn581lx/KMJANwswLPTWA/QOhog0NSDynscpQuOPibQ5ULceQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { "json2php": "^0.0.9" }, "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" }, "peerDependencies": { "webpack": "^5.0.0" } }, "node_modules/@wordpress/deprecated": { - "version": "4.56.0", - "resolved": "https://registry.npmjs.org/@wordpress/deprecated/-/deprecated-4.56.0.tgz", - "integrity": "sha512-to+VUihf/FGYPf74KXr6Yag+hTkaw8i8ZAa4x6Z3ZP3zMBu6pnxnc4QT0eZlWraeKdE2ZLbtT5tF7mkZSWzoFQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/deprecated/-/deprecated-5.0.0.tgz", + "integrity": "sha512-PZjrzeX15ZNIDvcBzOXnXF/FpKNwZgz23hQ+xpcmRBjZKCyT6YoxC45O3jFIGyZZtBwxoxCYQPBkCjRuKbVcpg==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/hooks": "^4.56.0" + "@wordpress/hooks": "^5.0.0" }, "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" } }, "node_modules/@wordpress/dom": { - "version": "4.56.0", - "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-4.56.0.tgz", - "integrity": "sha512-gn+A1WqWv7dcQ4VA2PUo0JgFKegwlya8pCAyydgPpUBxEeSzUZnJl//SEIy4Og30GcNUAuOQbHDEL6rzcJfUfw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-5.0.0.tgz", + "integrity": "sha512-jKRFuQgNuAbFhiIU/b1xQl00rEphMdBQal6pmiN/pDVfIR1idZFaaI8K+eH/Gqn+yb/q20YIqPLM1+SXR4xy8w==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/deprecated": "^4.56.0" + "@wordpress/deprecated": "^5.0.0" }, "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" } }, "node_modules/@wordpress/dom-ready": { - "version": "4.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/dom-ready/-/dom-ready-4.55.0.tgz", - "integrity": "sha512-tQ53SGYvknpYIusqI7OHddZqlC9t4tXmhRC/aEicm8YFLyBsccg4Lprp78AsaFkOIhbaNTOw41vzN3rVpGT5zg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom-ready/-/dom-ready-5.0.0.tgz", + "integrity": "sha512-a2Y+loEwENAM+kyTnXU7LTe8GgriXWfoxbco4486e2FuNpfELPLjDLAeJVbaFuw8pbtkk6xARlLh32y7yGG7Rg==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" } }, "node_modules/@wordpress/e2e-test-utils-playwright": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils-playwright/-/e2e-test-utils-playwright-2.1.0.tgz", - "integrity": "sha512-yfMzXmaVTAKJfaXz7H8HIdr6J2wUELNeBTAp7SPW6YK3h36Tx7YUayCfAiFOBgi8p5CBK9c6VbfthXkWRLAenw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils-playwright/-/e2e-test-utils-playwright-3.1.0.tgz", + "integrity": "sha512-ybc60l3g1syfpVJ7L/zOculIYBsfVfwsWOAn/bm4vN4+irRT6jJ/11bbPhclb9yjDyGatn+aHw89OhhHLjz8mQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { @@ -8661,21 +8452,26 @@ "peerDependencies": { "@playwright/test": ">=1", "@types/node": ">=20" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, "node_modules/@wordpress/element": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-8.8.0.tgz", - "integrity": "sha512-cMQ32/FbQVwwa10+R1QUjJwXM+FSnNtL0t1ZOmY/rdtjm8sZh1A6idpQEC0JFCoBGx61ZXYA2EUyjqJoLyU9QQ==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-10.0.0.tgz", + "integrity": "sha512-gv3cZ3O2j4y7qUUBo/h1Ni9OxG6ak78+D0YhggMsGyIPavT4CpJtRyMbarhENJ7K1MM9JzpuecdlMID8Cfd51Q==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/escape-html": "^3.56.0", + "@wordpress/escape-html": "^4.0.0", "change-case": "^4.1.2", "is-plain-object": "^5.1.0" }, "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19", @@ -8693,38 +8489,37 @@ } }, "node_modules/@wordpress/env": { - "version": "11.15.0", - "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-11.15.0.tgz", - "integrity": "sha512-FZq3eMDXBlZVZU8jVSX/4XoexgiBM4ZBqk69Mh23pz+1MMeQ13l7g5v7zKAAnyA3F9eHd+1sWsUpQnuS1f1T6Q==", + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-12.0.0.tgz", + "integrity": "sha512-RoUQV3sl1qF4h/kg+vrec9PCfr2bwXSOmWoLd9NmV8rD/sCBMt7tSBfeTWZEbClMhWHce8tu4hJ+pQeHXNnu2A==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { "@inquirer/prompts": "^7.2.0", - "@wp-playground/cli": "^3.0.48", - "adm-zip": "^0.6.0", + "@wp-playground/cli": "^3.1.56", + "adm-zip": "^0.6.1", "chalk": "^4.1.1", "copy-dir": "^1.3.0", "cross-spawn": "^7.0.6", "docker-compose": "^0.24.3", "got": "^11.8.5", - "js-yaml": "^3.15.0", + "js-yaml": "^3.15.2", "ora": "^4.0.2", "rimraf": "^5.0.10", - "simple-git": "^3.32.3", + "simple-git": "^4.0.2", "yargs": "^17.3.0" }, "bin": { "wp-env": "bin/wp-env" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" } }, "node_modules/@wordpress/env/node_modules/adm-zip": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.6.0.tgz", - "integrity": "sha512-XleryMhbuksdKtofnWZ9Sk+4CUTbms4Mb/EU32SZwToAyZ5RgVos/ki8n+yr0LWHOGKuakbXTuuYNHLQjhddgg==", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.6.1.tgz", + "integrity": "sha512-Xwrja8nx9e5o2N1my4DsKCeKpdrnACyr1wtbPxBDgGzKzKyE9kRtBFA8mWldI+RVlD7CBZNWY/wQ2+ydwOR6kQ==", "dev": true, "license": "MIT", "engines": { @@ -8742,9 +8537,9 @@ } }, "node_modules/@wordpress/env/node_modules/js-yaml": { - "version": "3.15.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.1.tgz", - "integrity": "sha512-S99WuO3HlhO3XN41EtYUNl9zzXjoJx7QvmipxsJVxtCBT0YHEFy+iOJhjSvrmV12nYhWpZaM8lPHkJm0yUMbag==", + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.2.tgz", + "integrity": "sha512-6EuL879VkRA+1Cz578mKMiKvjPNEuk6+r1JaFzoSWejZmtf7xWbIyw1e3KkxlkzTIt9Taw6JBhEppG7utc1P+w==", "dev": true, "license": "MIT", "dependencies": { @@ -8763,32 +8558,32 @@ "license": "BSD-3-Clause" }, "node_modules/@wordpress/escape-html": { - "version": "3.56.0", - "resolved": "https://registry.npmjs.org/@wordpress/escape-html/-/escape-html-3.56.0.tgz", - "integrity": "sha512-5k+7+XuXgeczkg2QuiN2zROHzj9/dU9qyv78H6I291+QOXLLlfOBzB2ds/MLvIyjv1mP1jLkvzzOB0PxHgfr+Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/escape-html/-/escape-html-4.0.0.tgz", + "integrity": "sha512-fWEvTJvNyPUSAXz3pMETrt1DHKaQ9CJVirhuBqb1xuZmIdRY4AlsjLgayd+lUSTkTU+0gRIPu1TDdU5/6Ue2Nw==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" } }, "node_modules/@wordpress/eslint-plugin": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/@wordpress/eslint-plugin/-/eslint-plugin-26.0.0.tgz", - "integrity": "sha512-bkTUJPIBeYD/pEAqxzkp2vjHL96o1rPTFwarDTu0bO4aG5DWhgc5mALbFz6keGJZwIcS6rN6PNpmZb5erkzxOg==", + "version": "28.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/eslint-plugin/-/eslint-plugin-28.0.0.tgz", + "integrity": "sha512-VRFrez67J9HWGR4s149A3ZG1ynY9uEczmuR7SFXzlcUn3itlo5ood42pv1dgTZK3eqJo3l5tdK3hD94W+ZEq8w==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@eslint-community/eslint-plugin-eslint-comments": "^4.7.0", "@eslint/compat": "^2.0.0", - "@wordpress/prettier-config": "^4.55.0", - "@wordpress/theme": "^2.1.0", + "@vitest/eslint-plugin": "^1.6.27", + "@wordpress/prettier-config": "^5.0.0", + "@wordpress/theme": "^3.0.0", "cosmiconfig": "^7.0.0", "eslint-config-prettier": "^10.0.0", "eslint-import-resolver-typescript": "^4.4.4", "eslint-plugin-import": "^2.32.0", "eslint-plugin-jest": "^29.16.5", - "eslint-plugin-jsdoc": "^50.0.0", + "eslint-plugin-jsdoc": "^64.0.0", "eslint-plugin-jsx-a11y": "^6.10.0", "eslint-plugin-playwright": "^2.1.0", "eslint-plugin-prettier": "^5.5.5", @@ -8796,11 +8591,10 @@ "eslint-plugin-react-hooks": "^7.1.1", "globals": "^16.0.0", "requireindex": "^1.2.0", - "typescript-eslint": "^8.57.1" + "typescript-eslint": "^8.70.1" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" }, "peerDependencies": { "eslint": "^9.0.0 || ^10.0.0", @@ -8922,31 +8716,6 @@ "semver": "bin/semver.js" } }, - "node_modules/@wordpress/eslint-plugin/node_modules/eslint-plugin-jsdoc": { - "version": "50.8.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.8.0.tgz", - "integrity": "sha512-UyGb5755LMFWPrZTEqqvTJ3urLz1iqj+bYOHFNag+sw3NvaMWP9K2z+uIn37XfNALmQLQyrBlJ5mkiVPL7ADEg==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@es-joy/jsdoccomment": "~0.50.2", - "are-docs-informative": "^0.0.2", - "comment-parser": "1.4.1", - "debug": "^4.4.1", - "escape-string-regexp": "^4.0.0", - "espree": "^10.3.0", - "esquery": "^1.6.0", - "parse-imports-exports": "^0.2.4", - "semver": "^7.7.2", - "spdx-expression-parse": "^4.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" - } - }, "node_modules/@wordpress/eslint-plugin/node_modules/eslint-plugin-jsx-a11y": { "version": "6.10.2", "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.2.tgz", @@ -9020,37 +8789,6 @@ "semver": "bin/semver.js" } }, - "node_modules/@wordpress/eslint-plugin/node_modules/espree": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", - "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.15.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.2.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@wordpress/eslint-plugin/node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/@wordpress/eslint-plugin/node_modules/globals": { "version": "16.5.0", "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz", @@ -9102,58 +8840,70 @@ } }, "node_modules/@wordpress/global-styles-engine": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/@wordpress/global-styles-engine/-/global-styles-engine-1.22.0.tgz", - "integrity": "sha512-TBqF5uTErL15mpzjd8ncCJLi/NDmIWceS1aMKWSjbyT0qg4JJHIResqiVPqVOx562Tj86Jwq05ENdMSxALf/Qg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/global-styles-engine/-/global-styles-engine-2.0.0.tgz", + "integrity": "sha512-lhMen98kG/nLv3QPD8HWXPdhuXDbOje7/gYpljv4zKBjAf3tfbRQ11MblKW8OvYUux3Iu9vaZE+DB2LOgNee5g==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/blocks": "^16.0.0", - "@wordpress/data": "^10.55.0", - "@wordpress/i18n": "^6.28.0", - "@wordpress/private-apis": "^1.55.0", - "@wordpress/style-engine": "^2.55.0", - "colord": "^2.9.3", + "@wordpress/blocks": "^17.0.0", + "@wordpress/data": "^11.0.0", + "@wordpress/i18n": "^7.0.0", + "@wordpress/private-apis": "^3.0.0", + "@wordpress/style-engine": "^3.0.0", + "colord": "^2.9.4", "deepmerge": "^4.3.1", "fast-deep-equal": "^3.1.3", "is-plain-object": "^5.1.0", "memize": "^2.1.1" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" + }, + "peerDependencies": { + "@types/react": "^18 || ^19", + "@types/react-dom": "^18 || ^19", + "react": "^18 || ^19", + "react-dom": "^18 || ^19" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } } }, "node_modules/@wordpress/hooks": { - "version": "4.56.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-4.56.0.tgz", - "integrity": "sha512-3+90yFqbMyzhqOEu88MjwlpznzVFl3am0YYIt7kc/8mfJ79IyHkYyiDdid3/fkJDMbZHH4tGy0J/JFp84/5Q2w==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-5.0.0.tgz", + "integrity": "sha512-jA2hDMNr2Ky/D14s8K+TQ/ZI125icjZfTPZYcsgEHM6mTtSJY2dhcmp9+tfSrcnY+M17svzplIxXma+bpBzcFg==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" } }, "node_modules/@wordpress/html-entities": { - "version": "4.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/html-entities/-/html-entities-4.55.0.tgz", - "integrity": "sha512-RQhGSbG0Lnnr+WLFJav3917a9L56/jI1K+cPcFidR87f1w8QJDCvmO3Jr9rzuGdCtgIfGKjaOHGFxjxYE/Milg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/html-entities/-/html-entities-5.0.0.tgz", + "integrity": "sha512-rj95Op3y+4+QsdOzlguOT8lpAHegJwdMsDx9Eq/9/fL/CGskgugUm4aqqeFQDNd7B+gOzXM7NZMX2ohaYYXYdA==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" } }, "node_modules/@wordpress/i18n": { - "version": "6.29.0", - "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-6.29.0.tgz", - "integrity": "sha512-ErLuyzvVbkylJhfvyi3tuj4CPn2EyT6f1TVCJ4EXHsNqgQ0ZlfYs3MBsJB2wcMNvYWIYtnOSeo8M5ucMVbMu3Q==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-7.0.0.tgz", + "integrity": "sha512-xk7qKLDB08c3LDUtThfmuumq//354bXLGRrPWfC1gmwPMNJPRC7ggwtSFxzH+ImdssxIKk8NaG4H3yF5WJoS5w==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { "@tannin/sprintf": "^1.3.2", - "@wordpress/hooks": "^4.56.0", + "@wordpress/hooks": "^5.0.0", "gettext-parser": "^1.3.1", "tannin": "^1.2.0" }, @@ -9161,50 +8911,53 @@ "pot-to-php": "tools/pot-to-php.js" }, "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" } }, "node_modules/@wordpress/icons": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/@wordpress/icons/-/icons-16.0.0.tgz", - "integrity": "sha512-dWoe+vgVd/hCvGK33LJH5mRvHxNp4iQlDs5e/vyVANRqnyUdxqnGHVvlqGygJF2b4dQXDN6/pwyyNkcw2VBBug==", + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/icons/-/icons-19.0.0.tgz", + "integrity": "sha512-LPx0Tppj5Y/54fuqIRMUqzplP0ZQL1nNvWthUv+ctpylDbGe4qdlWJpLCLZq1BpI1IXS2s3g5NaN2dXFi5H45w==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/element": "^8.7.0", - "@wordpress/primitives": "^4.55.0", + "@wordpress/element": "^10.0.0", + "@wordpress/primitives": "^5.0.0", "change-case": "^4.1.2" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19", - "react": "^18 || ^19" + "@types/react-dom": "^18 || ^19", + "react": "^18 || ^19", + "react-dom": "^18 || ^19" }, "peerDependenciesMeta": { "@types/react": { "optional": true + }, + "@types/react-dom": { + "optional": true } } }, "node_modules/@wordpress/image-cropper": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/@wordpress/image-cropper/-/image-cropper-1.19.0.tgz", - "integrity": "sha512-7wm+iPooVcLetdKZbTjhlXWKaY5zNe4M6CmfytR014Av4AuTu5dv/0Ou4lkogwRVAEcPWW7PX2F3jh5gNuYwQg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/image-cropper/-/image-cropper-2.0.0.tgz", + "integrity": "sha512-Ach0WfHZbwM8oomQtgHsTMgG0+wuhlZYD7ZHsygREkPVD9f0Kd+513rtRFfMdQ2NJzdjqJXSD2nEK0hT/gGjOQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/components": "^40.1.0", - "@wordpress/element": "^8.7.0", - "@wordpress/i18n": "^6.28.0", + "@wordpress/components": "^43.0.0", + "@wordpress/element": "^10.0.0", + "@wordpress/i18n": "^7.0.0", "dequal": "^2.0.3", "react-easy-crop": "^5.4.2" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19", @@ -9218,9 +8971,9 @@ } }, "node_modules/@wordpress/interactivity": { - "version": "6.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/interactivity/-/interactivity-6.55.0.tgz", - "integrity": "sha512-5OWCPNOUXO8sDnt6HlMVtBGAO4Lbw8TD77JgKc7tSRKjNXfEJpdFiLGG6L68yuf8VjvWNsk0VvLZV17g6+TQRQ==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/interactivity/-/interactivity-8.0.0.tgz", + "integrity": "sha512-VI60fYRVsSErIs/K9xnUNoAXUycgQwMGP7cq7YHvWdKROPE285+lnv9GarRGFR7W5/9i5fk3a8ifV+2o6sMCOg==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { @@ -9229,70 +8982,59 @@ "preact": "^10.29.1" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" } }, "node_modules/@wordpress/is-shallow-equal": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-5.56.0.tgz", - "integrity": "sha512-KpyMI+SJV8xqoaGF5VV+FEHfj137jUEam3A98cKBFW8rGxC0ip7i3LCww0jXPwBciKiOw+XBzgTjJBwk89kfYQ==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-6.0.0.tgz", + "integrity": "sha512-KMEZTCaXWp5udPNdPc8lEky3AEhKnUej0aKfjV38Ggox2e87SDXALt3DdMhydO//2xlXZXfGtYtBJ0qk9LpnLQ==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=18.12.0" - } - }, - "node_modules/@wordpress/kebab-case": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/kebab-case/-/kebab-case-1.2.0.tgz", - "integrity": "sha512-7NJKsIHbWYqXjG6ku6t9GhXPz2vBXlH25lAH9SUYKV8EvyupeeboIiI/+tr9fAjCxwunW9smZB0nq+X44zIVpw==", - "dev": true, - "license": "GPL-2.0-or-later", - "dependencies": { - "change-case": "^4.1.2" - }, - "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=22.13.0" } }, "node_modules/@wordpress/keyboard-shortcuts": { - "version": "5.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/keyboard-shortcuts/-/keyboard-shortcuts-5.55.0.tgz", - "integrity": "sha512-puQs8nFf2ltCDRXXUBmjSRN9J8n5tTKSwDlwi1RPEARRYZ8EPz6kCTNqsUvSIx8+aeRTXQUmzpded9u5uR5v7g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/keyboard-shortcuts/-/keyboard-shortcuts-6.0.0.tgz", + "integrity": "sha512-6OkdL+ZFJ+0llQtiDkP5OifzKvX7NMJpwsbBssm9vfNa93okyLOWY3j8HzUyKQLnuSrO8z+SwBzSJjImUHorTg==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/data": "^10.55.0", - "@wordpress/element": "^8.7.0", - "@wordpress/keycodes": "^4.55.0" + "@wordpress/data": "^11.0.0", + "@wordpress/element": "^10.0.0", + "@wordpress/keycodes": "^5.0.0" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19", - "react": "^18 || ^19" + "@types/react-dom": "^18 || ^19", + "react": "^18 || ^19", + "react-dom": "^18 || ^19" }, "peerDependenciesMeta": { "@types/react": { "optional": true + }, + "@types/react-dom": { + "optional": true } } }, "node_modules/@wordpress/keycodes": { - "version": "4.56.0", - "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-4.56.0.tgz", - "integrity": "sha512-zNF8WANxCBRXu25RB1QI2ZFoWydzWxz9F4dSKQ0nhEtvc6sY6gU/+WY+7xLdLMXU3lLZNFbEJOK369Fgygm/1w==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-5.0.0.tgz", + "integrity": "sha512-15T931kJjj90KlDcsXKaGucK+iyqY9CftR7tXO60m8T8gDC2GVuUWMIX3Sq9+4fsahABuqoUd+QTiW4xSDlpCg==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/i18n": "^6.29.0" + "@wordpress/i18n": "^7.0.0" }, "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19" @@ -9304,83 +9046,92 @@ } }, "node_modules/@wordpress/notices": { - "version": "5.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/notices/-/notices-5.55.0.tgz", - "integrity": "sha512-D/kosXrqc+vlTmzdcV0aH1FflOtwqTTx4lSL0KJ2MR8x0qOHAiiZBjaI327Rt9nZzHXefKWNYYWtxF9sauogXw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/notices/-/notices-6.0.0.tgz", + "integrity": "sha512-IDiPfOgUvswr1aXVm3SwOziTtZY+R8t0CfO0jHzK1M50ddzRRTReZPM1bPftU23PAW5k1UqxPc/aYRwLK4Xopg==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/a11y": "^4.55.0", - "@wordpress/components": "^40.1.0", - "@wordpress/data": "^10.55.0", + "@wordpress/a11y": "^5.0.0", + "@wordpress/components": "^43.0.0", + "@wordpress/compose": "^9.0.0", + "@wordpress/data": "^11.0.0", + "@wordpress/deprecated": "^5.0.0", + "@wordpress/element": "^10.0.0", + "@wordpress/i18n": "^7.0.0", + "@wordpress/private-apis": "^3.0.0", + "@wordpress/ui": "^0.25.0", "clsx": "^2.1.1" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19", - "react": "^18 || ^19" + "@types/react-dom": "^18 || ^19", + "react": "^18 || ^19", + "react-dom": "^18 || ^19" }, "peerDependenciesMeta": { "@types/react": { "optional": true + }, + "@types/react-dom": { + "optional": true } } }, "node_modules/@wordpress/npm-package-json-lint-config": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@wordpress/npm-package-json-lint-config/-/npm-package-json-lint-config-5.56.0.tgz", - "integrity": "sha512-mjRHIk9IWn8UU2h+SsY2+FRwDWMlhYA0aO3Q4kMEIqD2UR768DQXQHyWW3ZZKwY+NptCFFchtf7aGnndMaeDJA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/npm-package-json-lint-config/-/npm-package-json-lint-config-6.0.0.tgz", + "integrity": "sha512-h0VN1RW3OqsreiFrJ13FD/jFX9b+VHerfWNED/OUUSi17pmVgik47niTfth1/xpotL+kz2RuBopb9oV+HpKcQQ==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" }, "peerDependencies": { "npm-package-json-lint": ">=6.0.0" } }, "node_modules/@wordpress/postcss-plugins-preset": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@wordpress/postcss-plugins-preset/-/postcss-plugins-preset-5.56.0.tgz", - "integrity": "sha512-v87zGeZhNchruNDFgjdX8MMZw5NLmLsKoNDCUTLgsSv+be3EY2MX5vlsJJc0IApZWCphMwU45ExIEbCTmusLMA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/postcss-plugins-preset/-/postcss-plugins-preset-6.0.0.tgz", + "integrity": "sha512-Z8PLYiY32e0k7xQz0Fc7K30PcOIFvaoc9JduPMQMCfmukJKFMaRYxqyJZNdva7fPu18vUl9dFpB6ZP/+C5aZYQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/browserslist-config": "^6.56.0", + "@wordpress/browserslist-config": "^7.0.0", "autoprefixer": "^10.4.21", "postcss-import": "^16.1.1" }, "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" }, "peerDependencies": { "postcss": "^8.0.0" } }, "node_modules/@wordpress/preferences": { - "version": "4.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/preferences/-/preferences-4.55.0.tgz", - "integrity": "sha512-cS9AfTAtzduOfJd+RYuDKJAgu6dKQT0z/IFt3h6/RTzAmXG/nUYt3taVDtVfJQjRJoGJ9HBsYVsAxtA69tXG/g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/preferences/-/preferences-5.0.0.tgz", + "integrity": "sha512-rQaSz2di9k3tzm9BkO26ikydgevBDf+QU9ET97rFjlSaoDqQ1YqOLcFH61o8vtthr3NjQFBq/XAz38VMCVVsXw==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/a11y": "^4.55.0", - "@wordpress/base-styles": "^13.1.0", - "@wordpress/components": "^40.1.0", - "@wordpress/compose": "^8.8.0", - "@wordpress/data": "^10.55.0", - "@wordpress/deprecated": "^4.55.0", - "@wordpress/element": "^8.7.0", - "@wordpress/i18n": "^6.28.0", - "@wordpress/icons": "^16.0.0", - "@wordpress/private-apis": "^1.55.0" + "@wordpress/a11y": "^5.0.0", + "@wordpress/base-styles": "^14.0.0", + "@wordpress/components": "^43.0.0", + "@wordpress/compose": "^9.0.0", + "@wordpress/data": "^11.0.0", + "@wordpress/deprecated": "^5.0.0", + "@wordpress/element": "^10.0.0", + "@wordpress/i18n": "^7.0.0", + "@wordpress/icons": "^19.0.0", + "@wordpress/private-apis": "^3.0.0" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19", @@ -9394,69 +9145,92 @@ } }, "node_modules/@wordpress/prettier-config": { - "version": "4.56.0", - "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-4.56.0.tgz", - "integrity": "sha512-FTiY8VRrKVcB2FNxFsALoe8TC0ilpIzYdiRT+VaS87HlEF99L5UfZoGT7gL2VhdEhkNCS9FPtk9k2xGPok/WJg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-5.0.0.tgz", + "integrity": "sha512-uQ3rtrqt8yvUHFN9Xcxuw7EfSw4ArMkwFxtz2RHZM2Sis9jzB7xk0FcK/iWE55q0WWSjmFGWoNVpOEQoSE7ocQ==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" }, "peerDependencies": { "prettier": ">=3" } }, "node_modules/@wordpress/primitives": { - "version": "4.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/primitives/-/primitives-4.55.0.tgz", - "integrity": "sha512-xvxKWRo1ikIqHcLQjXCQqoyw9jYuVNx6Ue1DEwgokoJ4bRxucz+u83HpQW9Z3Lxicmw1w6x9ZiQa74PFBDmXrQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/primitives/-/primitives-5.0.0.tgz", + "integrity": "sha512-XrRJIbNXai/jlL9FLEANUzaAigTdN8XgWzAHTfAjDskvy3X6CjUbMyjXLWE5OhyCKhq+JAd3mWb9zq4sgl+V2w==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/element": "^8.7.0", + "@wordpress/element": "^10.0.0", "clsx": "^2.1.1" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19", - "react": "^18 || ^19" + "@types/react-dom": "^18 || ^19", + "react": "^18 || ^19", + "react-dom": "^18 || ^19" }, "peerDependenciesMeta": { "@types/react": { "optional": true + }, + "@types/react-dom": { + "optional": true } } }, "node_modules/@wordpress/priority-queue": { - "version": "3.56.0", - "resolved": "https://registry.npmjs.org/@wordpress/priority-queue/-/priority-queue-3.56.0.tgz", - "integrity": "sha512-PwCtvndDcizxs7DpfQ33uDsu/we3fFG/sejK4KspwotC99LtGvO5QgvtiO6g7SIoXKAMdaNW82B9w4Y/VNCNNQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/priority-queue/-/priority-queue-4.0.0.tgz", + "integrity": "sha512-YXEwn7xtr4bUts2IOPREjlWYa3n/ba7ndLCqFN3ofeRvvr2ZVCI1WP20v7a+CQZi+n9FS7fy+lYqx3wnTYtGzg==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { "requestidlecallback": "^0.3.0" }, "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" } }, "node_modules/@wordpress/private-apis": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-1.56.0.tgz", - "integrity": "sha512-LwtJallQ1xT1ABbulaW9lYswuMS20s/sQCX71Rf9s37M9qQBZ0Pw7hkkeCU6ik6jPkorHsLhbGCeThcAcHYr2w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-3.0.0.tgz", + "integrity": "sha512-IDXGi2VWfjUFwBTDtWj7/FMY240JpqraxFEIaXIeD3KFumX8lQuAYvE9gU8GcNBt/NlXZCDEmNioxCbAZN+jiA==", + "dev": true, + "license": "GPL-2.0-or-later", + "engines": { + "node": ">=22.13.0" + } + }, + "node_modules/@wordpress/react-inert-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/react-inert-value/-/react-inert-value-2.0.0.tgz", + "integrity": "sha512-inwoViBZ2K3ubTvfjkvpzwpXovZVF05CMWZ08scQt+ttYHD1Sf3pL3gn11iAxcR1Wf/0TzZoPeLc+PhnAUzuSg==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" + }, + "peerDependencies": { + "@types/react": "^18 || ^19", + "react": "^18 || ^19" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } } }, "node_modules/@wordpress/redux-routine": { - "version": "5.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/redux-routine/-/redux-routine-5.55.0.tgz", - "integrity": "sha512-ui7VqyNSD4JEKmXUbPdxQ18lAGN/ive8bwMZ9eLpBjyEUhUFw/hEZaT/rvCVX3EGlGu1o7FxnFxM2QJfIouKVA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/redux-routine/-/redux-routine-6.0.0.tgz", + "integrity": "sha512-mJm9DeHXFIPeaCA6E+VYupWXBW7g1QuKqEgBclm3HCDN+Th6OO+HMLfa2eS+dAPyoTu2NhSF0QlY1ArijOzuiw==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { @@ -9465,65 +9239,68 @@ "rungen": "^0.3.2" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" }, "peerDependencies": { "redux": ">=4" } }, "node_modules/@wordpress/rich-text": { - "version": "7.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/rich-text/-/rich-text-7.55.0.tgz", - "integrity": "sha512-x21ZIJBvc4DZpbXGVpK/EjVFfKJjvdM5Z67PKdhNYLz4BZqQAoZIS17oX8l7KzvbWsA+U37pRbaX1PqHi2VNTw==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/rich-text/-/rich-text-8.0.0.tgz", + "integrity": "sha512-2Jg50SJwE82+qO8tnQbIhSqCIb9I+rW6bi0hRVcTMOtRxC8wBisw5n0zngLfGRSHtAA9irnEzrOfPk2m6LtyuQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/a11y": "^4.55.0", - "@wordpress/compose": "^8.8.0", - "@wordpress/data": "^10.55.0", - "@wordpress/deprecated": "^4.55.0", - "@wordpress/dom": "^4.55.0", - "@wordpress/element": "^8.7.0", - "@wordpress/escape-html": "^3.55.0", - "@wordpress/i18n": "^6.28.0", - "@wordpress/keycodes": "^4.55.0", - "@wordpress/private-apis": "^1.55.0", - "colord": "^2.9.3" + "@wordpress/a11y": "^5.0.0", + "@wordpress/compose": "^9.0.0", + "@wordpress/data": "^11.0.0", + "@wordpress/deprecated": "^5.0.0", + "@wordpress/dom": "^5.0.0", + "@wordpress/element": "^10.0.0", + "@wordpress/escape-html": "^4.0.0", + "@wordpress/i18n": "^7.0.0", + "@wordpress/keycodes": "^5.0.0", + "@wordpress/private-apis": "^3.0.0", + "colord": "^2.9.4" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19", - "react": "^18 || ^19" + "@types/react-dom": "^18 || ^19", + "react": "^18 || ^19", + "react-dom": "^18 || ^19" }, "peerDependenciesMeta": { "@types/react": { "optional": true + }, + "@types/react-dom": { + "optional": true } } }, "node_modules/@wordpress/scripts": { - "version": "36.0.0", - "resolved": "https://registry.npmjs.org/@wordpress/scripts/-/scripts-36.0.0.tgz", - "integrity": "sha512-VOg524BUofA67xn00Z7oznUa/65AM5pxftxtfdsjGQ0J9zvTuOvyuUUuG6PkWb+IsVOYNwLlnIAeOaw84oHXnQ==", + "version": "37.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/scripts/-/scripts-37.0.0.tgz", + "integrity": "sha512-/a01kTH8lqAPzO6AhZRBiFpWcDorZs32U07YdkNhV7UOQAhWrBAWBOXPsLBcCh7NRt603C/hYOea8YcIqPpbZA==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { "@babel/core": "^7.25.7", - "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11", + "@pmmmwh/react-refresh-webpack-plugin": "^0.6.3", "@svgr/webpack": "^8.0.1", - "@wordpress/babel-preset-default": "^8.56.0", - "@wordpress/browserslist-config": "^6.56.0", - "@wordpress/dependency-extraction-webpack-plugin": "^6.56.0", - "@wordpress/e2e-test-utils-playwright": "^2.1.0", - "@wordpress/eslint-plugin": "^27.0.0", - "@wordpress/npm-package-json-lint-config": "^5.56.0", - "@wordpress/postcss-plugins-preset": "^5.56.0", - "@wordpress/prettier-config": "^4.56.0", - "@wordpress/stylelint-config": "^26.0.0", + "@wordpress/babel-preset-default": "^10.0.0", + "@wordpress/browserslist-config": "^7.0.0", + "@wordpress/dependency-extraction-webpack-plugin": "^7.0.0", + "@wordpress/e2e-test-utils-playwright": "^3.1.0", + "@wordpress/eslint-plugin": "^28.0.0", + "@wordpress/npm-package-json-lint-config": "^6.0.0", + "@wordpress/postcss-plugins-preset": "^6.0.0", + "@wordpress/prettier-config": "^5.0.0", + "@wordpress/stylelint-config": "^27.0.0", "adm-zip": "^0.6.1", "babel-loader": "^9.2.1", "browserslist": "^4.28.7", @@ -9554,12 +9331,13 @@ "schema-utils": "^4.2.0", "source-map-loader": "^3.0.0", "stylelint": "^17.14.1", + "stylelint-scss": "^7.2.0", "terser-webpack-plugin": "^5.3.10", "url-loader": "^4.1.1", "webpack": "^5.111.0", "webpack-bundle-analyzer": "^4.9.1", "webpack-cli": "^5.1.4", - "webpack-dev-server": "^5.2.1" + "webpack-dev-server": "^6.0.0" }, "bin": { "wp-scripts": "bin/wp-scripts.js" @@ -9641,226 +9419,6 @@ } } }, - "node_modules/@wordpress/scripts/node_modules/@wordpress/eslint-plugin": { - "version": "27.0.0", - "resolved": "https://registry.npmjs.org/@wordpress/eslint-plugin/-/eslint-plugin-27.0.0.tgz", - "integrity": "sha512-0KMR7l7517fl/ZgADGrPG/cReBBCN93LSmu/bsQ7jzdst9+RmCI8y+q3V2XGWfKio9TK+ZM10zUvi9wTnd0T3Q==", - "dev": true, - "license": "GPL-2.0-or-later", - "dependencies": { - "@eslint-community/eslint-plugin-eslint-comments": "^4.7.0", - "@eslint/compat": "^2.0.0", - "@vitest/eslint-plugin": "^1.6.27", - "@wordpress/prettier-config": "^4.56.0", - "@wordpress/theme": "^2.2.0", - "cosmiconfig": "^7.0.0", - "eslint-config-prettier": "^10.0.0", - "eslint-import-resolver-typescript": "^4.4.4", - "eslint-plugin-import": "^2.32.0", - "eslint-plugin-jest": "^29.16.5", - "eslint-plugin-jsdoc": "^64.0.0", - "eslint-plugin-jsx-a11y": "^6.10.0", - "eslint-plugin-playwright": "^2.1.0", - "eslint-plugin-prettier": "^5.5.5", - "eslint-plugin-react": "^7.37.0", - "eslint-plugin-react-hooks": "^7.1.1", - "globals": "^16.0.0", - "requireindex": "^1.2.0", - "typescript-eslint": "^8.57.1" - }, - "engines": { - "node": ">=18.12.0" - }, - "peerDependencies": { - "eslint": "^9.0.0 || ^10.0.0", - "prettier": ">=3", - "typescript": ">=5" - }, - "peerDependenciesMeta": { - "prettier": { - "optional": true - }, - "typescript": { - "optional": true - } - } - }, - "node_modules/@wordpress/scripts/node_modules/@wordpress/eslint-plugin/node_modules/eslint-import-resolver-typescript": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.10.1.tgz", - "integrity": "sha512-A1rHYb06zjMGAxdLSkN2fXPBwuSaQ0iO5M/hdyS0Ajj1VBaRp0sPD3dn1FhME3c/JluGFbwSxyCfqdSbtQLAHQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "@nolyfill/is-core-module": "1.0.39", - "debug": "^4.4.0", - "get-tsconfig": "^4.10.0", - "is-bun-module": "^2.0.0", - "stable-hash": "^0.0.5", - "tinyglobby": "^0.2.13", - "unrs-resolver": "^1.6.2" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint-import-resolver-typescript" - }, - "peerDependencies": { - "eslint": "*", - "eslint-plugin-import": "*", - "eslint-plugin-import-x": "*" - }, - "peerDependenciesMeta": { - "eslint-plugin-import": { - "optional": true - }, - "eslint-plugin-import-x": { - "optional": true - } - } - }, - "node_modules/@wordpress/scripts/node_modules/@wordpress/eslint-plugin/node_modules/eslint-plugin-import": { - "version": "2.32.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz", - "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rtsao/scc": "^1.1.0", - "array-includes": "^3.1.9", - "array.prototype.findlastindex": "^1.2.6", - "array.prototype.flat": "^1.3.3", - "array.prototype.flatmap": "^1.3.3", - "debug": "^3.2.7", - "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.9", - "eslint-module-utils": "^2.12.1", - "hasown": "^2.0.2", - "is-core-module": "^2.16.1", - "is-glob": "^4.0.3", - "minimatch": "^3.1.2", - "object.fromentries": "^2.0.8", - "object.groupby": "^1.0.3", - "object.values": "^1.2.1", - "semver": "^6.3.1", - "string.prototype.trimend": "^1.0.9", - "tsconfig-paths": "^3.15.0" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" - } - }, - "node_modules/@wordpress/scripts/node_modules/@wordpress/eslint-plugin/node_modules/eslint-plugin-import/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/@wordpress/scripts/node_modules/@wordpress/eslint-plugin/node_modules/eslint-plugin-jsx-a11y": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.2.tgz", - "integrity": "sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "aria-query": "^5.3.2", - "array-includes": "^3.1.8", - "array.prototype.flatmap": "^1.3.2", - "ast-types-flow": "^0.0.8", - "axe-core": "^4.10.0", - "axobject-query": "^4.1.0", - "damerau-levenshtein": "^1.0.8", - "emoji-regex": "^9.2.2", - "hasown": "^2.0.2", - "jsx-ast-utils": "^3.3.5", - "language-tags": "^1.0.9", - "minimatch": "^3.1.2", - "object.fromentries": "^2.0.8", - "safe-regex-test": "^1.0.3", - "string.prototype.includes": "^2.0.1" - }, - "engines": { - "node": ">=4.0" - }, - "peerDependencies": { - "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9" - } - }, - "node_modules/@wordpress/scripts/node_modules/@wordpress/eslint-plugin/node_modules/eslint-plugin-react": { - "version": "7.37.5", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz", - "integrity": "sha512-Qteup0SqU15kdocexFNAJMvCJEfa2xUKNV4CC1xsVMrIIqEy3SQ/rqyxCWNzfrd3/ldy6HMlD2e0JDVpDg2qIA==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-includes": "^3.1.8", - "array.prototype.findlast": "^1.2.5", - "array.prototype.flatmap": "^1.3.3", - "array.prototype.tosorted": "^1.1.4", - "doctrine": "^2.1.0", - "es-iterator-helpers": "^1.2.1", - "estraverse": "^5.3.0", - "hasown": "^2.0.2", - "jsx-ast-utils": "^2.4.1 || ^3.0.0", - "minimatch": "^3.1.2", - "object.entries": "^1.1.9", - "object.fromentries": "^2.0.8", - "object.values": "^1.2.1", - "prop-types": "^15.8.1", - "resolve": "^2.0.0-next.5", - "semver": "^6.3.1", - "string.prototype.matchall": "^4.0.12", - "string.prototype.repeat": "^1.0.0" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" - } - }, - "node_modules/@wordpress/scripts/node_modules/@wordpress/eslint-plugin/node_modules/resolve": { - "version": "2.0.0-next.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.7.tgz", - "integrity": "sha512-tqt+NBWwyaMgw3zDsnygx4CByWjQEJHOPMdslYhppaQSJUtL/D4JO9CcBBlhPoI8lz9oJIDXkwXfhF4aWqP8xQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "is-core-module": "^2.16.2", - "node-exports-info": "^1.6.0", - "object-keys": "^1.1.1", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/@wordpress/scripts/node_modules/@wordpress/eslint-plugin/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/@wordpress/scripts/node_modules/adm-zip": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.6.1.tgz", @@ -9869,36 +9427,19 @@ "license": "MIT", "engines": { "node": ">=14.0" - } - }, - "node_modules/@wordpress/scripts/node_modules/array-union": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-3.0.1.tgz", - "integrity": "sha512-1OvF9IbWwaeiM9VhzYXVQacMibxpXOMYVNIvMtKRyX9SImBXpKcFr8XvFDeEslCyuH/t6KRt7HEO94AlP8Iatw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@wordpress/scripts/node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@wordpress/scripts/node_modules/brace-expansion": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.7.tgz", - "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==", + } + }, + "node_modules/@wordpress/scripts/node_modules/array-union": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-3.0.1.tgz", + "integrity": "sha512-1OvF9IbWwaeiM9VhzYXVQacMibxpXOMYVNIvMtKRyX9SImBXpKcFr8XvFDeEslCyuH/t6KRt7HEO94AlP8Iatw==", "dev": true, "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@wordpress/scripts/node_modules/clone-deep": { @@ -10087,19 +9628,6 @@ "postcss": "^8.4.31" } }, - "node_modules/@wordpress/scripts/node_modules/globals": { - "version": "16.5.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz", - "integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@wordpress/scripts/node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -10133,22 +9661,6 @@ "node": ">=0.10.0" } }, - "node_modules/@wordpress/scripts/node_modules/minimatch": { - "version": "9.0.9", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", - "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.2" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/@wordpress/scripts/node_modules/postcss-calc": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-9.0.1.tgz", @@ -10724,31 +10236,29 @@ } }, "node_modules/@wordpress/shortcode": { - "version": "4.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/shortcode/-/shortcode-4.55.0.tgz", - "integrity": "sha512-8RTQ/deDMfbtKBmKr+Dcgg8/xSvOJwwvkWL23e2soGnwoh2+Rzt6Tp/RWUt6e+MFBMe4fk8fquOwsYTdUHMhoQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/shortcode/-/shortcode-5.0.0.tgz", + "integrity": "sha512-anwstb/SfweKgw8BNEouvzwCII9AAY7I/asPZJf084rEtG/5V2II9ls0PdfamYuDedNvFdToCV3uiK9NFD06jw==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { "memize": "^2.1.1" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" } }, "node_modules/@wordpress/style-engine": { - "version": "2.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/style-engine/-/style-engine-2.55.0.tgz", - "integrity": "sha512-mcXbq65cy3TuYpuTfO72RvQjEaJ6LuNdcekMSBWVq4jxyHCLAqjzwiJ4EwO2SYDw4CqN27h7h7BABs1KShr38A==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/style-engine/-/style-engine-3.0.0.tgz", + "integrity": "sha512-obU8yuXphfCZVdcv7bVf/dn6AlzBqYfglyyc/ymqEyjmh4cTY0pF/Do1sraT/XP5n+NZrFGV5D9wcJILTNC3Lg==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { "change-case": "^4.1.2" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19" @@ -10760,30 +10270,29 @@ } }, "node_modules/@wordpress/style-runtime": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@wordpress/style-runtime/-/style-runtime-0.11.0.tgz", - "integrity": "sha512-bVtgHLe7dfN3o4OzgYD9owOxuiwVu2SzfKjtndFI7kkYFVNZ48goiHQ8X1bJT+iXz8ay8/A4chVjrRbhSlPjiw==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@wordpress/style-runtime/-/style-runtime-0.14.0.tgz", + "integrity": "sha512-cWk3G7Pe6Wo9uMpaPAbrhsPJAmkShPn3LLc8vkte1ZQ7ls1M+e6m78KQxd0HYy4ty2nbGGlhnHE7ISxQzGhrsQ==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=22.13.0" } }, "node_modules/@wordpress/stylelint-config": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/@wordpress/stylelint-config/-/stylelint-config-26.0.0.tgz", - "integrity": "sha512-It8AXpTaeTcxUwLznqKtBbizfNADEN07BgnIwol8qdQqTHo5eElU1lahQIZxHPJ/5PkW5VejRF1h50vhARJ6uw==", + "version": "27.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/stylelint-config/-/stylelint-config-27.0.0.tgz", + "integrity": "sha512-NvLTijt+fZR2/0T3EwH5cswLdpuo/On1B+BQlkkuQ3HsNrwWLTEvwboaOqzJUwFs/owB9+AO11Ocaayexesalw==", "dev": true, "license": "MIT", "dependencies": { "@stylistic/stylelint-plugin": "^5.2.1", - "@wordpress/theme": "^2.2.0", + "@wordpress/theme": "^3.0.0", "stylelint-config-recommended": "^18.0.0", "stylelint-config-recommended-scss": "^17.0.1" }, "engines": { - "node": "^20.19.0 || >=22.13.0" + "node": ">=22.13.0" }, "peerDependencies": { "stylelint": "^17.14.1", @@ -10791,22 +10300,27 @@ } }, "node_modules/@wordpress/theme": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/theme/-/theme-2.2.0.tgz", - "integrity": "sha512-HlmT0DvWG3cp++HNFxHVCtzZvpoa4dkxLZPFU6AEfmKOYd7OMBFQFs14+H+UAKKsvJk7KdzY1L8RstrM5yUXAw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/theme/-/theme-3.0.0.tgz", + "integrity": "sha512-m25ORtLD77WL40vG3Vt/0WKzg/liuiM2PGMNaDv4SDO1hZ7H0t+Lp8rfTlsYnBdI+iO8+juICyK4OiVRde1I0Q==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/compose": "^8.9.0", - "@wordpress/deprecated": "^4.56.0", - "@wordpress/element": "^8.8.0", - "@wordpress/private-apis": "^1.56.0", - "@wordpress/style-runtime": "^0.12.0", + "@babel/parser": "^7.28.6", + "@babel/types": "^7.29.7", + "@jridgewell/remapping": "^2.3.5", + "@jridgewell/trace-mapping": "^0.3.31", + "@wordpress/compose": "^9.0.0", + "@wordpress/deprecated": "^5.0.0", + "@wordpress/element": "^10.0.0", + "@wordpress/private-apis": "^3.0.0", + "@wordpress/style-runtime": "^0.14.0", "colorjs.io": "^0.7.1", + "magic-string": "^0.30.21", "memize": "^2.1.1" }, "engines": { - "node": "^20.19.0 || >=22.13.0" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19", @@ -10831,6 +10345,12 @@ "postcss": { "optional": true }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + }, "stylelint": { "optional": true }, @@ -10839,54 +10359,43 @@ } } }, - "node_modules/@wordpress/theme/node_modules/@wordpress/style-runtime": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/style-runtime/-/style-runtime-0.12.0.tgz", - "integrity": "sha512-qCEKNYAGyJ3II+EQS4HNDbwPwddPUf1Pf3C7dSqqEuM9x0zbQm4/uZlf9i8CyV2k7ul9MzHeVjzIYlI+IuXEvA==", - "dev": true, - "license": "GPL-2.0-or-later", - "engines": { - "node": ">=20.10.0" - } - }, "node_modules/@wordpress/token-list": { - "version": "3.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/token-list/-/token-list-3.55.0.tgz", - "integrity": "sha512-CLz1GMkRP2FsG8gWxDTGAfcsXVnPQlHrb27+UhtSN8Vbygaj1w7vvOaaQGQTBbLxLzxvwByPKKsBv7TJqx/Osg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/token-list/-/token-list-4.0.0.tgz", + "integrity": "sha512-W8WY1B4POIXLQcWM/N3Zz9TGMMqtfJvS2VcIql889eEFKk1trx0ynsbzVFO/UblGiSjAdxpANES9yHNKa43VWw==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" } }, "node_modules/@wordpress/ui": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/@wordpress/ui/-/ui-0.22.0.tgz", - "integrity": "sha512-4mljrQzSG7c5v1LxgOLMisewPVoZIHHX2f3ixixl++D5jNDUGJlRilxi8Mo5eGjN8McoBvyunIu+PkeZ5I2y6Q==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@wordpress/ui/-/ui-0.25.0.tgz", + "integrity": "sha512-G/aUYgQpL18q3DfyV/1ebB8tEjXBubWPPXitcs4IvXYbAAFNBLsoUUGv5K3sfqJuxhi51lbyKT0Eap6Wj0kkCQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@base-ui/react": "^1.7.0", + "@base-ui/react": "^1.9.0", "@daypicker/react": "^10.0.1", - "@wordpress/a11y": "^4.55.0", - "@wordpress/compose": "^8.8.0", - "@wordpress/element": "^8.7.0", - "@wordpress/i18n": "^6.28.0", - "@wordpress/icons": "^16.0.0", - "@wordpress/keycodes": "^4.55.0", - "@wordpress/primitives": "^4.55.0", - "@wordpress/private-apis": "^1.55.0", - "@wordpress/style-runtime": "^0.11.0", - "@wordpress/theme": "^2.1.0", - "@wordpress/warning": "^3.55.0", + "@wordpress/a11y": "^5.0.0", + "@wordpress/compose": "^9.0.0", + "@wordpress/element": "^10.0.0", + "@wordpress/i18n": "^7.0.0", + "@wordpress/icons": "^19.0.0", + "@wordpress/keycodes": "^5.0.0", + "@wordpress/primitives": "^5.0.0", + "@wordpress/private-apis": "^3.0.0", + "@wordpress/react-inert-value": "^2.0.0", + "@wordpress/style-runtime": "^0.14.0", + "@wordpress/theme": "^3.0.0", + "@wordpress/warning": "^4.0.0", "clsx": "^2.1.1", "date-fns": "^4.4.0", "tabbable": "^6.4.0" }, "engines": { - "node": "^20.19.0 || >=22.13.0", - "npm": ">=10.2.3" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19", @@ -10900,39 +10409,37 @@ } }, "node_modules/@wordpress/undo-manager": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-1.56.0.tgz", - "integrity": "sha512-1jHpsam603sVmgmrV8ndAlaOpwK4CVhAeB9myz5CgRvPN7qukja8T672W+LkVxyAW8oPC1A/msSo9RXSRaoOFQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-2.0.0.tgz", + "integrity": "sha512-OQfGPUBz79/NKkkBvF5L/k1DmxuCQGYvczA/BOef+ECCCnjpIXF6HS1txpULozI5owejQDDjhZp25bq25jF5Vg==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/is-shallow-equal": "^5.56.0" + "@wordpress/is-shallow-equal": "^6.0.0" }, "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" } }, "node_modules/@wordpress/upload-media": { - "version": "0.40.0", - "resolved": "https://registry.npmjs.org/@wordpress/upload-media/-/upload-media-0.40.0.tgz", - "integrity": "sha512-LCADF7BRGhQiw5HGqvLpvIIyJbXukFvAZfNBgzLQazc0g6/cMd/v0mMQKU6VI+KLa5QcOcKt7UGpkPXwOAsJwQ==", + "version": "0.43.0", + "resolved": "https://registry.npmjs.org/@wordpress/upload-media/-/upload-media-0.43.0.tgz", + "integrity": "sha512-Cgi0XNoWurFFbCJPljPaii2cy7hHwMml3Dbf9zhlUsyihT3H9LfkSR/Oox+NHFPOqAPv1q2YPWCGuZe3mXDZEQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/blob": "^4.55.0", - "@wordpress/compose": "^8.8.0", - "@wordpress/data": "^10.55.0", - "@wordpress/element": "^8.7.0", - "@wordpress/i18n": "^6.28.0", - "@wordpress/private-apis": "^1.55.0", - "@wordpress/url": "^4.55.0", - "@wordpress/video-conversion": "^0.6.0", - "@wordpress/vips": "^4.1.0", + "@wordpress/blob": "^5.0.0", + "@wordpress/compose": "^9.0.0", + "@wordpress/data": "^11.0.0", + "@wordpress/element": "^10.0.0", + "@wordpress/i18n": "^7.0.0", + "@wordpress/private-apis": "^3.0.0", + "@wordpress/video-conversion": "^0.9.0", + "@wordpress/vips": "^5.0.0", "uuid": "^14.0.0" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" }, "peerDependencies": { "@types/react": "^18 || ^19", @@ -10946,114 +10453,107 @@ } }, "node_modules/@wordpress/url": { - "version": "4.55.0", - "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-4.55.0.tgz", - "integrity": "sha512-BOT83/0a5N8NVjGXbu3aOeowpDL9xw6jPegxNViSjWYwmR6ceN49hw94+YTcUkMqBZOXEk1KH0XFKuklArMo4Q==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-5.0.0.tgz", + "integrity": "sha512-oPDn3vjO7unimaiFSnwoP8Ys6TVGp3UXwF0CwRDMoYLqRIjDuPpZLoUbkPAnWnLOrNP+GjIzCm7qQNCrze/UAA==", "dev": true, "license": "GPL-2.0-or-later", - "dependencies": { - "remove-accents": "^0.5.0" - }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" } }, "node_modules/@wordpress/video-conversion": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@wordpress/video-conversion/-/video-conversion-0.6.0.tgz", - "integrity": "sha512-4/68n731fbXGyQCq1ReV64iRMjASo6yw+CsZbLZYbGhPbNdX34BAQy++9iOI0nK4ukl7jFz1WqiLB/eAsklyPg==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@wordpress/video-conversion/-/video-conversion-0.9.0.tgz", + "integrity": "sha512-fxU5BDB809r/AbxM70LUst3CjWpn85ugT6QebwugOlX+s7aUQ7/HZ5ON0XZE4V2nPtOeUsT1HyVDcikcbaMZbQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/worker-threads": "^1.15.0", + "@wordpress/worker-threads": "^2.0.0", "mediabunny": "^1.45.2" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" } }, "node_modules/@wordpress/vips": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/vips/-/vips-4.1.0.tgz", - "integrity": "sha512-b0M04JxpZchNjbJFxdSdlBce+UYYb1sxdGXatqp8b8cs3AdUSDMqWdBs64SvxfNT/a/T/iHVPLE56t8yQPdmgw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/vips/-/vips-5.0.0.tgz", + "integrity": "sha512-7he8zRvtoaI+uGCoQ6Tf5+PbuhB0OowB0h8H4HLB7yv8hl4YOxnGG1tB1ldB6gypNyukcawk+aK/CcJ2+cnI2A==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/worker-threads": "^1.15.0", + "@wordpress/worker-threads": "^2.0.0", "wasm-vips": "^0.0.18" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" } }, "node_modules/@wordpress/warning": { - "version": "3.56.0", - "resolved": "https://registry.npmjs.org/@wordpress/warning/-/warning-3.56.0.tgz", - "integrity": "sha512-6dUEn4UYE0wKGRTrGlLRr8829vq0jY/m3xQmiiqSGvcdPdza5fR+R/ol4azQcge4V3CHsEzKZ8R9h5Qwi+Zv5g==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/warning/-/warning-4.0.0.tgz", + "integrity": "sha512-qhAwfjMUYT1TfyMlrkO4i1IbcqfjfjLBFepXSRvMUhNbL8CRRu3cgjdZNCf82FkvUwmuCEuMsrmGisxu4CGr1A==", "dev": true, "license": "GPL-2.0-or-later", "engines": { - "node": ">=18.12.0" + "node": ">=22.13.0" } }, "node_modules/@wordpress/worker-threads": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/@wordpress/worker-threads/-/worker-threads-1.15.0.tgz", - "integrity": "sha512-DOd88jdCUAPtk9w3FTmgISltTXRUOOSAVBkh2IaPyBs7dcqH07i6KNU38fSGT3TPgPA2AlvkHdSyqDLvoxxToA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/worker-threads/-/worker-threads-2.0.0.tgz", + "integrity": "sha512-ytIahXlVLdMMDfdDvOl1X4GrzVRcxc4JB+41zWJFdkNnzxDe6xbuyKujNe6kwrWFvr2YfC41wXfPViHEzB96pw==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { "comctx": "^1.4.3" }, "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" + "node": ">=22.13.0" } }, "node_modules/@wp-playground/blueprints": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@wp-playground/blueprints/-/blueprints-3.1.41.tgz", - "integrity": "sha512-UhveYQs/W+IXxmOP7jBLN8kE/xqI/vTj1OhLrwPMaL9mcmQiow6v7O4ysFiNehDuLQGTAecNmr1nOdKUAQx03g==", - "dev": true, - "dependencies": { - "@php-wasm/logger": "3.1.41", - "@php-wasm/progress": "3.1.41", - "@php-wasm/stream-compression": "3.1.41", - "@php-wasm/universal": "3.1.41", - "@php-wasm/util": "3.1.41", - "@php-wasm/web-service-worker": "3.1.41", - "@wp-playground/common": "3.1.41", - "@wp-playground/storage": "3.1.41", - "@wp-playground/wordpress": "3.1.41", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@wp-playground/blueprints/-/blueprints-3.1.61.tgz", + "integrity": "sha512-JHO9nVo6lWSr28mVPdUj1/ZPrIGcWcmM/yg6mmVXVVaEuMQRsiUGY9ok6j8s6Z7ZW1MjOMfdsq1Out8HnmXB+g==", + "dev": true, + "dependencies": { + "@php-wasm/logger": "3.1.61", + "@php-wasm/progress": "3.1.61", + "@php-wasm/stream-compression": "3.1.61", + "@php-wasm/universal": "3.1.61", + "@php-wasm/util": "3.1.61", + "@php-wasm/web-service-worker": "3.1.61", + "@wp-playground/common": "3.1.61", + "@wp-playground/storage": "3.1.61", + "@wp-playground/wordpress": "3.1.61", "ajv": "8.18.0" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@wp-playground/cli": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@wp-playground/cli/-/cli-3.1.41.tgz", - "integrity": "sha512-7ceotUA94ZtRE8mA9k86QOKAU3KTQk3I8YPZgbn3x85FD1e9fRtr4LAK9eeX9NkvytEUm/xIqBaQ3IvdRYYFDw==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@wp-playground/cli/-/cli-3.1.61.tgz", + "integrity": "sha512-Vss8SNGokydNmbr1EFhe632GywmMsHjFEk9JIy/jEjFECVxusPmMLK+RNTV6ivG+cdmTPhw0T3sYmmVgPP93Yg==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/cli-util": "3.1.41", - "@php-wasm/logger": "3.1.41", - "@php-wasm/node": "3.1.41", - "@php-wasm/progress": "3.1.41", - "@php-wasm/universal": "3.1.41", - "@php-wasm/util": "3.1.41", - "@php-wasm/xdebug-bridge": "3.1.41", - "@wp-playground/blueprints": "3.1.41", - "@wp-playground/common": "3.1.41", - "@wp-playground/storage": "3.1.41", - "@wp-playground/tools": "3.1.41", - "@wp-playground/wordpress": "3.1.41", + "@php-wasm/cli-util": "3.1.61", + "@php-wasm/logger": "3.1.61", + "@php-wasm/node": "3.1.61", + "@php-wasm/progress": "3.1.61", + "@php-wasm/universal": "3.1.61", + "@php-wasm/util": "3.1.61", + "@php-wasm/xdebug-bridge": "3.1.61", + "@wp-playground/blueprints": "3.1.61", + "@wp-playground/common": "3.1.61", + "@wp-playground/storage": "3.1.61", + "@wp-playground/tools": "3.1.61", + "@wp-playground/wordpress": "3.1.61", "express": "4.22.2", "fs-extra": "11.1.1", "tmp-promise": "3.0.3", @@ -11071,16 +10571,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@wp-playground/cli/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/@wp-playground/cli/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -11116,65 +10606,72 @@ } }, "node_modules/@wp-playground/common": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@wp-playground/common/-/common-3.1.41.tgz", - "integrity": "sha512-BhsyR7feAFCiUoNgZEA3mHAPjecK+l/S/bnNl6VhhT+NXLg/sWxzmIG/EvxCHHBVF66xnUlI25NjsLw0pokC/Q==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@wp-playground/common/-/common-3.1.61.tgz", + "integrity": "sha512-SCWxf3y3ncTaq6hRfMYWl78Dk4pcLjGN+m9r6NNwrGwtOQ8+VWEb7OqnzP3myVWEL7rvh9Nsvpk5A8spYTEiyw==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/universal": "3.1.41", - "@php-wasm/util": "3.1.41" + "@php-wasm/universal": "3.1.61", + "@php-wasm/util": "3.1.61" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@wp-playground/storage": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@wp-playground/storage/-/storage-3.1.41.tgz", - "integrity": "sha512-oBoElqKZj+6ZSGzyfn6kJzD5B9SwNhKgAoZO5gmO+gC9oEZg6KZ41dJ1qD6duuTL9Q/qGuh3aBT3A6P5AtKDqQ==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@wp-playground/storage/-/storage-3.1.61.tgz", + "integrity": "sha512-cVj7SNBnkwvbFEwsjcYVfzdXHKdqzD9l+VZnn4f7VMPYv0JcpsEPeYxzORg0tivtWh25JZz5IV/Jqk+piskZCg==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/stream-compression": "3.1.41", - "@php-wasm/universal": "3.1.41", - "@php-wasm/util": "3.1.41", + "@php-wasm/stream-compression": "3.1.61", + "@php-wasm/universal": "3.1.61", + "@php-wasm/util": "3.1.61", "@zip.js/zip.js": "2.7.57", "isomorphic-git": "1.37.6", "octokit": "3.1.2", - "pako": "^1.0.10" + "pako": "^1.0.10", + "sha.js": "2.4.12" } }, "node_modules/@wp-playground/tools": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@wp-playground/tools/-/tools-3.1.41.tgz", - "integrity": "sha512-xptMuuQF+t+EPc6uxg9yw/+jI+tKSroYrfJ4Cb5UGCT+EAXqaselvDRIYO/w3N67yAyadthES8uyHscS6ZpzyQ==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@wp-playground/tools/-/tools-3.1.61.tgz", + "integrity": "sha512-ZTKOSt5xwMmLLW5TMR4/FYG8uJuMf/JxrMhhYA9at4rOOmG5ErN7IQRiOp9W7fBVgQthaYCDFKi+v10u9lyF7Q==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wp-playground/blueprints": "3.1.41" + "@php-wasm/node": "3.1.61", + "@php-wasm/universal": "3.1.61", + "@php-wasm/util": "3.1.61", + "@wp-playground/blueprints": "3.1.61", + "@wp-playground/common": "3.1.61", + "@wp-playground/wordpress": "3.1.61" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@wp-playground/wordpress": { - "version": "3.1.41", - "resolved": "https://registry.npmjs.org/@wp-playground/wordpress/-/wordpress-3.1.41.tgz", - "integrity": "sha512-bKK318um+vxuMLbQqeIc8KiOeV3PRgEm3i8YTr/BCOpRhbDkRZV5yT/0i+ccimrRd2JJ6KyURyw6N6r81wOEXQ==", + "version": "3.1.61", + "resolved": "https://registry.npmjs.org/@wp-playground/wordpress/-/wordpress-3.1.61.tgz", + "integrity": "sha512-VlncPYr63Xj9t+m50IT/YBvqVXmg9QwDL11DDJnLckYLp0t+jNz7GtD7rMGk/pJADKIubnn9en+jLttYkkZBaQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@php-wasm/logger": "3.1.41", - "@php-wasm/universal": "3.1.41", - "@php-wasm/util": "3.1.41", - "@wp-playground/common": "3.1.41" + "@php-wasm/logger": "3.1.61", + "@php-wasm/universal": "3.1.61", + "@php-wasm/util": "3.1.61", + "@wp-playground/common": "3.1.61", + "zstddec": "^0.2.0" }, "engines": { - "node": ">=20.10.0", - "npm": ">=10.2.3" + "node": ">=24.18.0", + "npm": ">=11.16.0" } }, "node_modules/@xtuc/ieee754": { @@ -11370,6 +10867,13 @@ "ajv": "^8.8.2" } }, + "node_modules/anser": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/anser/-/anser-2.3.5.tgz", + "integrity": "sha512-vcZjxvvVoxTeR5XBNJB38oTu/7eDCZlwdz32N1eNgpyPF7j/Z7Idf+CUwQOkKKpJ7RJyjxgLHCM7vdIK0iCNMQ==", + "dev": true, + "license": "MIT" + }, "node_modules/ansi-colors": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", @@ -11390,19 +10894,6 @@ "node": ">=4" } }, - "node_modules/ansi-html": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.9.tgz", - "integrity": "sha512-ozbS3LuenHVxNRh/wdnN16QapUHzauqSomAl1jwwJRRsGwFwtj644lIhxfWu0Fy0acCij2+AEgHvjscq3dlVXg==", - "dev": true, - "engines": [ - "node >= 0.8.0" - ], - "license": "Apache-2.0", - "bin": { - "ansi-html": "bin/ansi-html" - } - }, "node_modules/ansi-html-community": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz", @@ -11525,16 +11016,6 @@ "node": ">= 6" } }, - "node_modules/are-docs-informative": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", - "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14" - } - }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -11850,9 +11331,9 @@ } }, "node_modules/autoprefixer": { - "version": "10.6.1", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.6.1.tgz", - "integrity": "sha512-cL1Qz6ADZhcEbny/8HPfe99J6HhNoYtpX2LFLIbhgGE7Q1hlQVkYFdetDN7Id3KiQxhDrHwzlHr/YQCnZ8+xSA==", + "version": "10.6.2", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.6.2.tgz", + "integrity": "sha512-VOw9/yGTGwPPgzFcODtcv6zhEPIeIWkRSe10L2ri2f5vZ7ID7lCt6jZzRF5/ubgOZ+szYydmEF5AYsA5jxX1tA==", "dev": true, "funding": [ { @@ -11887,9 +11368,9 @@ } }, "node_modules/autoprefixer/node_modules/browserslist": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", - "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", + "version": "4.29.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.5.tgz", + "integrity": "sha512-khTmKu5NGYTotqcYo8Bew2k4RAE9PuXRSFRXG2lQBrCEQHyeQ/vX6gKMxfokwywBsLiXZMnHsmWMG1pnO8J7uQ==", "dev": true, "funding": [ { @@ -11907,11 +11388,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.11.26", - "caniuse-lite": "^1.0.30001813", - "electron-to-chromium": "^1.5.439", - "node-releases": "^2.0.57", - "update-browserslist-db": "^1.3.3" + "baseline-browser-mapping": "^2.11.33", + "caniuse-lite": "^1.0.30001819", + "electron-to-chromium": "^1.5.464", + "node-releases": "^2.0.60", + "update-browserslist-db": "^1.3.4" }, "bin": { "browserslist": "cli.js" @@ -11921,9 +11402,9 @@ } }, "node_modules/autoprefixer/node_modules/update-browserslist-db": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", - "integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", "dev": true, "funding": [ { @@ -11951,13 +11432,6 @@ "browserslist": ">= 4.21.0" } }, - "node_modules/autosize": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/autosize/-/autosize-4.0.4.tgz", - "integrity": "sha512-5yxLQ22O0fCRGoxGfeLSNt3J8LB1v+umtpMnPW6XjkTWXKoN0AmXAIhelJcDtFT/Y/wYWmfE+oqU10Q0b8FhaQ==", - "dev": true, - "license": "MIT" - }, "node_modules/available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", @@ -12012,22 +11486,6 @@ "webpack": ">=5" } }, - "node_modules/babel-plugin-macros": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", - "integrity": "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.12.5", - "cosmiconfig": "^7.0.0", - "resolve": "^1.19.0" - }, - "engines": { - "node": ">=10", - "npm": ">=6" - } - }, "node_modules/babel-plugin-polyfill-corejs2": { "version": "0.4.17", "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.17.tgz", @@ -12132,9 +11590,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.11.30", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.30.tgz", - "integrity": "sha512-YJs6Pz17RMNv8HoyKREtCY38E3BV1nPkWVmIb+XN1uHC1Vqt3KZCH/uJH9ZKRoiKb/icZ6tvehyee6RZNbFfRA==", + "version": "2.11.33", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.33.tgz", + "integrity": "sha512-yiVKDX+qCMRKBE084lXvq9EcwFUhKZ2nU8TK1EQQuOgPNR/lmbGxXOeDdlGUqC2Zz11Cs9rk1d/8NfgBmlkt0w==", "dev": true, "license": "Apache-2.0", "bin": { @@ -12636,9 +12094,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001816", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001816.tgz", - "integrity": "sha512-+8Yx7BXCoqk6IF8yTicjfUR6D/ldJzdlsodlEOiOSPmhK844WIgk67/zIQaGAOxNkZyyvBlrRFnLvqKIoqbAFw==", + "version": "1.0.30001819", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001819.tgz", + "integrity": "sha512-LFUqIIAwpzsIuevnKnsR9qnStBcgzPShTX61lBwN9uFkkf8o8zLiebEjbW8AYtZiF+1YKDWfdt/pWDtMuG8Xwg==", "dev": true, "funding": [ { @@ -12992,16 +12450,6 @@ "dev": true, "license": "MIT" }, - "node_modules/cliui/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/cliui/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -13156,9 +12604,9 @@ } }, "node_modules/comctx": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/comctx/-/comctx-1.7.5.tgz", - "integrity": "sha512-0fsxsxr1Hg2T99wOIteUbsJOX6jMmnhAJepcVRqNRMWpcbxRhbm2+0R8qEuQEaE4gWjfdXaKeAGYAn0yeElylQ==", + "version": "1.7.6", + "resolved": "https://registry.npmjs.org/comctx/-/comctx-1.7.6.tgz", + "integrity": "sha512-rDhDqh6qfmivZfVOGi4qs8RB3PnVtIAB5zLsWu4JqCoQ1p4IEJSB5pW2JvOhFwCMmCLiei9qpaIMxmVVQRhzyw==", "dev": true, "license": "MIT" }, @@ -13171,16 +12619,6 @@ "node": ">= 6" } }, - "node_modules/comment-parser": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", - "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 12.0.0" - } - }, "node_modules/common-path-prefix": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", @@ -13283,12 +12721,6 @@ "node": ">= 0.6" } }, - "node_modules/computed-style": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/computed-style/-/computed-style-0.1.4.tgz", - "integrity": "sha512-WpAmaKbMNmS3OProfHIdJiNleNJdgUrJfbKArXua28QF7+0CoZjlLn0lp6vlc+dl5r2/X9GQiQRQQU4BzSa69w==", - "dev": true - }, "node_modules/configstore": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/configstore/-/configstore-7.1.0.tgz", @@ -13409,9 +12841,9 @@ } }, "node_modules/core-js": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.50.0.tgz", - "integrity": "sha512-BRWgOLKkFeCgRudR6zrs8p9XJZcE14grzKMMssoYrk6krtuEZ7MTKPIY5RzOnqsEKIR9kst7wNzphttraT+Yqw==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.51.0.tgz", + "integrity": "sha512-7bDKx/5jm5MxzsXxc93g6Z2+4ZsuT/MddrfRmTDJNAkWsYWHU8EVNEsBiIEWnMAMCHMmRfUEjkuo3jeNBOIHRw==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -13438,12 +12870,15 @@ } }, "node_modules/core-js-pure": { - "version": "3.49.0", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.49.0.tgz", - "integrity": "sha512-XM4RFka59xATyJv/cS3O3Kml72hQXUeGRuuTmMYFxwzc9/7C8OYTaIR/Ji+Yt8DXzsFLNhat15cE/JP15HrCgw==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.51.0.tgz", + "integrity": "sha512-NE4SFDJ+qzQeqHG2vVSNwopzS6zZNPYJ5kinIqs+OofTqGzOmICgT89E/yvS9XY7rwb3eU1utWXTJ9nVFqv74A==", "dev": true, "hasInstallScript": true, "license": "MIT", + "engines": { + "node": "*" + }, "funding": { "type": "opencollective", "url": "https://opencollective.com/core-js" @@ -15151,9 +14586,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.459", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.459.tgz", - "integrity": "sha512-4SC9HHSFjO/liAhifpdOL5hG9b4BP7/5G3y3UPZVO8trlAXr1CaUEEJL0gWK3kOcYcZrOA5rkwG45Gra/lTIgg==", + "version": "1.5.465", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.465.tgz", + "integrity": "sha512-zg4iUpbeGw7YNZsswc2xKr2uiBex2d8dELAXo92Icw3but1ULbrvK8USe6wVLaWjgJnKBARv0pchx9Owktx6wQ==", "dev": true, "license": "ISC" }, @@ -15733,197 +15168,56 @@ "@es-joy/resolve.exports": "1.2.0", "@typescript-eslint/utils": "^8.70.0", "are-docs-informative": "^0.1.1", - "comment-parser": "1.4.9", - "debug": "^4.4.3", - "escape-string-regexp": "^5.0.0", - "espree": "^11.2.0", - "esquery": "^1.7.0", - "html-entities": "^2.6.0", - "object-deep-merge": "^2.0.1", - "parse-imports-exports": "^0.2.4", - "semver": "^7.8.5", - "spdx-expression-parse": "^5.0.0", - "to-valid-identifier": "^1.0.0" - }, - "engines": { - "node": "^22.22.2 || >=24.15.0" - }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0", - "typescript": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/eslint-plugin-jsdoc/node_modules/@es-joy/jsdoccomment": { - "version": "0.98.0", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.98.0.tgz", - "integrity": "sha512-QS+b7I2aaSM+gZfDz1b9E4B367JJ2qTjFXRKF289iKkh9sYdZ21Q5MiF/Duzouy3J0C4VhM3I/8f2F4+zT8gYQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.9", - "@typescript-eslint/types": "^8.70.0", - "comment-parser": "1.4.9", - "esquery": "^1.7.0", - "jsdoc-type-pratt-parser": "~9.2.2" - }, - "engines": { - "node": "^22.22.2 || >=24.15.0" - } - }, - "node_modules/eslint-plugin-jsdoc/node_modules/@types/node": { - "version": "26.6.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.4.tgz", - "integrity": "sha512-ldVPDCzj7fsaGZrLB0NuHuTvJcsNasysBAqMolr/cgxrLd1xbqxIr3XJiPnHHJUCxj5sNF1vnRj9aWnrVh5Jcg==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~8.9.0" - } - }, - "node_modules/eslint-plugin-jsdoc/node_modules/@typescript-eslint/project-service": { - "version": "8.71.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.71.0.tgz", - "integrity": "sha512-aABjw5rjBacYONVPaPiWOCjJu0vEF4a25iQuodlmQYL1trtLZ0X/y+2Vzl3BKI1odM4LnwLE1oUDXYp1wzx1TQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.71.0", - "@typescript-eslint/types": "^8.71.0", - "debug": "^4.4.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/eslint-plugin-jsdoc/node_modules/@typescript-eslint/scope-manager": { - "version": "8.71.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.71.0.tgz", - "integrity": "sha512-gWF0BhUcnjZxSpLE8ngS/59n2SB0J3YqRxvX1+2aoRJk9hNtHSLOV+TcarFiOr5ipXm3yc1QrI4c9YZc8zyCxw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.71.0", - "@typescript-eslint/visitor-keys": "8.71.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/eslint-plugin-jsdoc/node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.71.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.71.0.tgz", - "integrity": "sha512-Z1UlWHADEK2Mlb9NpWfDeSjqoZ5EyrOv4R3eQpbkzqn/EwaIdOpXXupEA1+0ZIOSJSZZDBHG0BrQyN8zUG6Pwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/eslint-plugin-jsdoc/node_modules/@typescript-eslint/types": { - "version": "8.71.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.71.0.tgz", - "integrity": "sha512-cJ4OoxPGWvFnBTnSZyaU+qJzGTqPTGJY+gDchj6cRyLRdmIdt4rcsE4twj+zPfrNiWuVi38wijHzShL++Z9atQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/eslint-plugin-jsdoc/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.71.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.71.0.tgz", - "integrity": "sha512-PEEF4G5sLLWAS5BpPrUvms4ySZkiBQQZM4z+3ReI46axK5Vqr/vXBQatJQIZZOYdGyPUAKTtsrWzpqKuU+3DEw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/project-service": "8.71.0", - "@typescript-eslint/tsconfig-utils": "8.71.0", - "@typescript-eslint/types": "8.71.0", - "@typescript-eslint/visitor-keys": "8.71.0", - "debug": "^4.4.3", - "minimatch": "^10.2.2", - "semver": "^7.7.3", - "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.5.0" + "comment-parser": "1.4.9", + "debug": "^4.4.3", + "escape-string-regexp": "^5.0.0", + "espree": "^11.2.0", + "esquery": "^1.7.0", + "html-entities": "^2.6.0", + "object-deep-merge": "^2.0.1", + "parse-imports-exports": "^0.2.4", + "semver": "^7.8.5", + "spdx-expression-parse": "^5.0.0", + "to-valid-identifier": "^1.0.0" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "node": "^22.22.2 || >=24.15.0" }, "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0", + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/eslint-plugin-jsdoc/node_modules/@typescript-eslint/utils": { - "version": "8.71.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.71.0.tgz", - "integrity": "sha512-pKR/tEMVrXZG23UFKUn5BQf3zfmfk7KQceI2cGzywZ5nxM5Eu3hEJU1utjWzydtzBbcJAQhHN8iPCxobHpPcZQ==", + "node_modules/eslint-plugin-jsdoc/node_modules/@es-joy/jsdoccomment": { + "version": "0.98.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.98.0.tgz", + "integrity": "sha512-QS+b7I2aaSM+gZfDz1b9E4B367JJ2qTjFXRKF289iKkh9sYdZ21Q5MiF/Duzouy3J0C4VhM3I/8f2F4+zT8gYQ==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.71.0", - "@typescript-eslint/types": "8.71.0", - "@typescript-eslint/typescript-estree": "8.71.0" + "@types/estree": "^1.0.9", + "@typescript-eslint/types": "^8.70.0", + "comment-parser": "1.4.9", + "esquery": "^1.7.0", + "jsdoc-type-pratt-parser": "~9.2.2" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" + "node": "^22.22.2 || >=24.15.0" } }, - "node_modules/eslint-plugin-jsdoc/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.71.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.71.0.tgz", - "integrity": "sha512-8eQ9R218XORK+KLosnf4bu/QsUXvUyVwTbArg7/0NMB1Pu87OJKvj4nhFblkYE8gQV73mW1dx1ptlPCkwRGa7A==", + "node_modules/eslint-plugin-jsdoc/node_modules/@types/node": { + "version": "26.6.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.4.tgz", + "integrity": "sha512-ldVPDCzj7fsaGZrLB0NuHuTvJcsNasysBAqMolr/cgxrLd1xbqxIr3XJiPnHHJUCxj5sNF1vnRj9aWnrVh5Jcg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.71.0", - "eslint-visitor-keys": "^5.0.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "undici-types": "~8.9.0" } }, "node_modules/eslint-plugin-jsdoc/node_modules/are-docs-informative": { @@ -15959,19 +15253,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-plugin-jsdoc/node_modules/eslint-visitor-keys": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", - "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/eslint-plugin-jsdoc/node_modules/jsdoc-type-pratt-parser": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-9.2.2.tgz", @@ -16548,9 +15829,9 @@ "license": "BSD-3-Clause" }, "node_modules/fast-xml-builder": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.2.0.tgz", - "integrity": "sha512-00aAWieqff+ZJhsXA4g1g7M8k+7AYoMUUHF+/zFb5U6Uv/P0Vl4QZo84/IcufzYalLuEj9928bXN9PbbFzMF0Q==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.3.1.tgz", + "integrity": "sha512-pIM/1n3ntFXKYrUZwW7QCK0gAW7XY+wzj1YMIV3tLDvPj/V+zTGJK5e3/4WJfwj0qWw2ElNXiTixda/R+3YSug==", "dev": true, "funding": [ { @@ -16560,14 +15841,14 @@ ], "license": "MIT", "dependencies": { - "path-expression-matcher": "^1.5.0", - "xml-naming": "^0.1.0" + "path-expression-matcher": "^1.6.2", + "xml-naming": "^0.3.0" } }, "node_modules/fast-xml-parser": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.10.1.tgz", - "integrity": "sha512-IEMIf7298kXuZSRFoGfMYrl7is8LpavODgbNz1cwIudv7KwVFnuU+UsMporfq6PD6aXSlawZlARiA3UywCTfMw==", + "version": "5.11.2", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.11.2.tgz", + "integrity": "sha512-R9iDuNrQYeQut46cn2r2wHKn4HYzVDvDm5J1wW+koZewykv0yuO2HChTYeZtrULyHIDM9cj9TUXloCsueCQUog==", "dev": true, "funding": [ { @@ -16577,33 +15858,17 @@ ], "license": "MIT", "dependencies": { - "@nodable/entities": "^3.0.0", + "@nodable/entities": "^3.0.1", "fast-xml-builder": "^1.2.0", "is-unsafe": "^2.0.0", "path-expression-matcher": "^1.6.2", - "strnum": "^2.4.1", + "strnum": "^2.4.2", "xml-naming": "^0.3.0" }, "bin": { "fxparser": "src/cli/cli.js" } }, - "node_modules/fast-xml-parser/node_modules/xml-naming": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/xml-naming/-/xml-naming-0.3.0.tgz", - "integrity": "sha512-ghig2TBE/H11aOVgmahA3MhimvkBr6JIYknH/Dhdk10nXwdbIqBJsbfMxpvFPG8bAw77gN29aQWvKpmVoPlvPQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" - } - ], - "license": "MIT", - "engines": { - "node": ">=16.0.0" - } - }, "node_modules/fastest-levenshtein": { "version": "1.0.16", "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", @@ -16830,13 +16095,6 @@ "dev": true, "license": "MIT" }, - "node_modules/find-root": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", - "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", - "dev": true, - "license": "MIT" - }, "node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -17146,14 +16404,15 @@ "license": "MIT" }, "node_modules/fs-ext-extra-prebuilt": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/fs-ext-extra-prebuilt/-/fs-ext-extra-prebuilt-2.2.7.tgz", - "integrity": "sha512-Q7rayYRBDIvDF01HWOwSSjoaP+05N1g+o3BXL1Zf8Frw2JkjSmi4EtvCBITuW30l6hB2m2TW1pehdh8wyU/+gw==", + "version": "2.2.16", + "resolved": "https://registry.npmjs.org/fs-ext-extra-prebuilt/-/fs-ext-extra-prebuilt-2.2.16.tgz", + "integrity": "sha512-mVKH62x8olJe64hwGt0sl7DAsnGZajnjwaNRzkzMdwfWxafUGU7/AqYgSEj1D+yHkwhTuys8r8BYyhYT1c2nuw==", "dev": true, "hasInstallScript": true, "license": "MIT", + "optional": true, "dependencies": { - "nan": "^2.24.0" + "nan": "^2.27.0" }, "engines": { "node": ">= 8.0.0" @@ -17603,9 +16862,9 @@ "license": "ISC" }, "node_modules/gradient-parser": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/gradient-parser/-/gradient-parser-1.1.1.tgz", - "integrity": "sha512-Hu0YfNU+38EsTmnUfLXUKFMXq9yz7htGYpF4x+dlbBhUCvIvzLt0yVLT/gJRmvLKFJdqNFrz4eKkIUjIXSr7Tw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gradient-parser/-/gradient-parser-1.2.0.tgz", + "integrity": "sha512-6ABGa9CR7WR/0pAJicBy5SJkiikbFM6kf/JjykwX7x+t+s8ORWVnlbi6FkHeFFb36yWsjUpHqSYrygd7ofEUqA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -18218,23 +17477,6 @@ "dev": true, "license": "MIT" }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/hoist-non-react-statics/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true, - "license": "MIT" - }, "node_modules/homedir-polyfill": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", @@ -19229,6 +18471,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/is-generator-function": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", @@ -19566,9 +18818,9 @@ } }, "node_modules/is-unsafe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-unsafe/-/is-unsafe-2.0.0.tgz", - "integrity": "sha512-2LdV822R+wmI86unXA93WCFpL6g+av8ynWk0nrHyJqGop5VoocYsSLFgN8jrfalT6iGeLNM4KXuVSsULP53kEA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-unsafe/-/is-unsafe-2.0.2.tgz", + "integrity": "sha512-HgbIHPBH0KHHCcjLfGsCvhtPTVxjaAZlXjwdz7/GQC40SjSe4sfQsar8J5VFo8JOSbarkpV0OLG95bbaNd9aAQ==", "dev": true, "funding": [ { @@ -19733,9 +18985,9 @@ } }, "node_modules/isomorphic-git/node_modules/readable-stream": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", - "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.8.0.tgz", + "integrity": "sha512-2jhTTU3Eilp/2DMT71gbcoqC35eQHasMJH0RHkYxwlxIv3+FR6Y5xAFZIwEGLxKkjZYEFlsiMNIdwUqjK2lLHQ==", "dev": true, "license": "MIT", "dependencies": { @@ -19980,16 +19232,6 @@ "node": ">=12.0.0" } }, - "node_modules/jsdoc-type-pratt-parser": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.1.0.tgz", - "integrity": "sha512-Hicd6JK5Njt2QB6XYFS7ok9e37O8AYk3jTcppG4YVQnYjOemymvTcmc7OWsmq/Qqj5TdRFO5/x/tIPmBeRtGHg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/jsdoc/node_modules/escape-string-regexp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", @@ -20556,19 +19798,6 @@ "url": "https://github.com/sponsors/antonk52" } }, - "node_modules/line-height": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/line-height/-/line-height-0.3.1.tgz", - "integrity": "sha512-YExecgqPwnp5gplD2+Y8e8A5+jKpr25+DzMbFdI1/1UAr0FJrTFv4VkHLf8/6B590i1wUPJWMKKldkd/bdQ//w==", - "dev": true, - "license": "MIT", - "dependencies": { - "computed-style": "~0.1.3" - }, - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -20894,6 +20123,16 @@ "yallist": "^3.0.2" } }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, "node_modules/make-iterator": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", @@ -21172,9 +20411,9 @@ } }, "node_modules/mediabunny": { - "version": "1.56.2", - "resolved": "https://registry.npmjs.org/mediabunny/-/mediabunny-1.56.2.tgz", - "integrity": "sha512-KrrL2Hr47q+IXS19BVWJyYMw1Wb8gz8FkeKP/+ui7q8tPt0lfaio2d9CaGkEWFghaD02wNae/HgYBZTcg5RyZg==", + "version": "1.62.1", + "resolved": "https://registry.npmjs.org/mediabunny/-/mediabunny-1.62.1.tgz", + "integrity": "sha512-lYzeerDwo9QLhBCipqQDXOSV7InvaIFplllZQviPO5rPwH+IUr8M1uvumk1olIUgMRGkPiInRriv25WFErUgMw==", "dev": true, "license": "MPL-2.0", "workspaces": [ @@ -22312,11 +21551,12 @@ } }, "node_modules/nan": { - "version": "2.27.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.27.0.tgz", - "integrity": "sha512-hC+0LidcL3XE4rp1C4H54KujgXKzbfyTngZTwBByQxsOxCEKZT0MPQ4hOKUH2jU1OYstqdDH4onyHPDzcV0XdQ==", + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.30.0.tgz", + "integrity": "sha512-P5mokDkSvCGBz6mZDD/2l+w9QoICRXdCyZ9ONGmTePr40oihJg3Kpn0YU3twKd6PJnwSlLBWNQeOT6yWEV2c4A==", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true }, "node_modules/nanoid": { "version": "3.3.20", @@ -22426,9 +21666,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.59", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.59.tgz", - "integrity": "sha512-5qr2okC4ItAI0hG5SaV0HoYMpnM/Y6+Oqr7AmPYy/2uEoGvS+GbSKLeRxSS1uAdu59yz0ouzcuXievSgg///WA==", + "version": "2.0.60", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.60.tgz", + "integrity": "sha512-OmO8+GM1JUZqXET720VrJCwkjUCXmCMQm0Z3UDDRbfNLHS4NEAvY60j5jiFv0tkKw2PNNlqOLhahVmwJIOLDIQ==", "dev": true, "license": "MIT", "engines": { @@ -24363,9 +23603,9 @@ } }, "node_modules/postcss-resolve-nested-selector": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.6.tgz", - "integrity": "sha512-0sglIs9Wmkzbr8lQwEyIzlDOOC9bGmfVKcJTaxv3vMmd3uo4o4DerC3En0bnmgceeql9BfC8hRkp7cg0fjdVqw==", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.7.tgz", + "integrity": "sha512-lFcugRCQXWManq7nyZ0dDtir52wc7gKYJfWpSuz4GxvnGc7dtlpXcZYX4A0asatzTuqpQ3ngDdyD+QG/szeXWw==", "dev": true, "license": "MIT" }, @@ -24817,6 +24057,7 @@ "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -24824,22 +24065,6 @@ "node": ">=0.10.0" } }, - "node_modules/react-autosize-textarea": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/react-autosize-textarea/-/react-autosize-textarea-7.1.0.tgz", - "integrity": "sha512-BHpjCDkuOlllZn3nLazY2F8oYO1tS2jHnWhcjTWQdcKiiMU6gHLNt/fzmqMSyerR0eTdKtfSIqtSeTtghNwS+g==", - "dev": true, - "license": "MIT", - "dependencies": { - "autosize": "^4.0.2", - "line-height": "^0.3.1", - "prop-types": "^15.5.6" - }, - "peerDependencies": { - "react": "^0.14.0 || ^15.0.0 || ^16.0.0", - "react-dom": "^0.14.0 || ^15.0.0 || ^16.0.0" - } - }, "node_modules/react-colorful": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/react-colorful/-/react-colorful-5.7.0.tgz", @@ -24909,9 +24134,9 @@ } }, "node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.3.1.tgz", + "integrity": "sha512-RRieF6IyxQBkcK6pP8xOHprLTPW6QjRkbGdImtqNme+/hYVwCZkLQLdlZGOhUqXwkS9IEynaGvPJtv6XB/cz0Q==", "dev": true, "license": "MIT" }, @@ -26700,16 +25925,16 @@ } }, "node_modules/simple-git": { - "version": "3.36.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.36.0.tgz", - "integrity": "sha512-cGQjLjK8bxJw4QuYT7gxHw3/IouVESbhahSsHrX97MzCL1gu2u7oy38W6L2ZIGECEfIBG4BabsWDPjBxJENv9Q==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-4.0.2.tgz", + "integrity": "sha512-l0sIsv9VrPwovKELFDBOj/lhmIcbMvxBk2B+hRhsMM4/VL3gKtuZvYnBNixVo+N/0HnqQx2cBdLvxnAbygHpqA==", "dev": true, "license": "MIT", "dependencies": { "@kwsites/file-exists": "^1.1.1", "@kwsites/promise-deferred": "^1.1.1", - "@simple-git/args-pathspec": "^1.0.3", - "@simple-git/argv-parser": "^1.1.0", + "@simple-git/args-pathspec": "1.0.4", + "@simple-git/argv-parser": "2.0.1", "debug": "^4.4.0" }, "funding": { @@ -26786,13 +26011,13 @@ } }, "node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", + "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", "dev": true, "license": "BSD-3-Clause", "engines": { - "node": ">=0.10.0" + "node": ">= 12" } }, "node_modules/source-map-js": { @@ -26851,17 +26076,6 @@ "spdx-license-ids": "^3.0.0" } }, - "node_modules/spdx-correct/node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, "node_modules/spdx-exceptions": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", @@ -26870,9 +26084,9 @@ "license": "CC-BY-3.0" }, "node_modules/spdx-expression-parse": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", - "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, "license": "MIT", "dependencies": { @@ -27068,16 +26282,6 @@ "dev": true, "license": "MIT" }, - "node_modules/string-width-cjs/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/string-width/node_modules/ansi-regex": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", @@ -27279,9 +26483,9 @@ } }, "node_modules/strnum": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.4.1.tgz", - "integrity": "sha512-M9eUSMT2dCB2cTNPG7UYj6KuK7RJR2SN2+yCV/fTW3xzTCS6EaGZ5pSMgDIjB7r8zSfTGk+dvvn9rTjpVS9Mwg==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.5.1.tgz", + "integrity": "sha512-UM4nTLWzQiDBseVxUGxN0wJzIk0UU89Qi7pKXz9qISo+lhviJikTuikBsK/oFRlpvYHvSdz0TVoLyQ+sEpYwxA==", "dev": true, "funding": [ { @@ -27432,21 +26636,21 @@ } }, "node_modules/stylelint-scss": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-7.3.0.tgz", - "integrity": "sha512-FBz075AUFoEJ1WQKsgsRr6EJKcjy7jxQjV8xsAqbPcnhNiXnJ7C489vqUyDZccBy1GorewlshERkaMuCyOKXaw==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-7.4.0.tgz", + "integrity": "sha512-OvN+AestcvtB/IFvde1kpFLq2mpIsPaeB8E+Cjlxu7qjf0ja7NCoTrDW97tuNeXFlYGUdwqGq5cXaByLpNwuxA==", "dev": true, "license": "MIT", "dependencies": { - "@csstools/css-calc": "^3.3.0", + "@csstools/css-calc": "^3.4.3", "@csstools/css-parser-algorithms": "^4.0.0", - "@csstools/css-syntax-patches-for-csstree": "^1.1.8", + "@csstools/css-syntax-patches-for-csstree": "^1.1.15", "@csstools/css-tokenizer": "^4.0.0", "css-tree": "^3.2.1", "is-plain-object": "^5.1.0", "known-css-properties": "^0.37.0", "postcss-media-query-parser": "^0.2.3", - "postcss-resolve-nested-selector": "^0.1.6", + "postcss-resolve-nested-selector": "^0.1.7", "postcss-selector-parser": "^7.1.6", "postcss-value-parser": "^4.2.0" }, @@ -27458,9 +26662,9 @@ } }, "node_modules/stylelint-scss/node_modules/postcss-selector-parser": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.6.tgz", - "integrity": "sha512-7qASPzhKF2l2KLboRZux8CCTRMdGiV08vWmyKzPz22qZ7ZjQBOeY7rNzNoCLSUiftJ7HUq0GERHmxw/t0dCdMw==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.7.tgz", + "integrity": "sha512-wWBro/7hJ40ye6TPiXkUQoXKCw23xSsjriUvqd7Uls9Sso3oLiON1flc18cCdnjgCRXw4fBVqUJJeOdDTh3P3g==", "dev": true, "license": "MIT", "dependencies": { @@ -27713,13 +26917,6 @@ "node": "^20.17.0 || >=22.9.0" } }, - "node_modules/stylis": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", - "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==", - "dev": true, - "license": "MIT" - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -27906,16 +27103,6 @@ "dev": true, "license": "MIT" }, - "node_modules/table/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/table/node_modules/slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", @@ -28615,16 +27802,16 @@ } }, "node_modules/typescript-eslint": { - "version": "8.65.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.65.0.tgz", - "integrity": "sha512-/ggrHAwyjENDusvyxbuqxAC2dTnZg/Z8F+fgQtYIz+L6n/9HfSlEZcFGV/NsMNa6CkGk0xUjUAFwC0vHOflvIA==", + "version": "8.72.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.72.1.tgz", + "integrity": "sha512-3Li9FfPmQp45nxEtFD1ZCrYFI3cYK5kpyNtmm1H7lMagm8u9sy6PTjy3ytwQZs7KNukOyKFHAZ6z6GjYFeaeXw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.65.0", - "@typescript-eslint/parser": "8.65.0", - "@typescript-eslint/typescript-estree": "8.65.0", - "@typescript-eslint/utils": "8.65.0" + "@typescript-eslint/eslint-plugin": "8.72.1", + "@typescript-eslint/parser": "8.72.1", + "@typescript-eslint/typescript-estree": "8.72.1", + "@typescript-eslint/utils": "8.72.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -28999,16 +28186,6 @@ } } }, - "node_modules/use-memo-one": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/use-memo-one/-/use-memo-one-1.1.3.tgz", - "integrity": "sha512-g66/K7ZQGYrI6dy8GLpVcMsBp4s17xNkYJVSMvTEevGy3nDxHOfE6z8BVE22+5G5x7t3+bhzrlTDB7ObrEE0cQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/use-sidecar": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.3.tgz", @@ -29033,9 +28210,9 @@ } }, "node_modules/use-sync-external-store": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz", - "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.7.0.tgz", + "integrity": "sha512-6L+EeigHMQhdaIPNIFUKwfWJSwWFQ8gJbJ2DLOs5sDIegTwR9fRxvnM3uciHKjIZhFz+KAv2emhWMRvDmMcY8A==", "dev": true, "license": "MIT", "peerDependencies": { @@ -29094,17 +28271,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "node_modules/validate-npm-package-license/node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, "node_modules/validate-npm-package-name": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.1.tgz", @@ -29896,16 +29062,6 @@ "dev": true, "license": "MIT" }, - "node_modules/wrap-ansi-cjs/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/wrap-ansi-cjs/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -29928,16 +29084,6 @@ "dev": true, "license": "MIT" }, - "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/wrap-ansi/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -30027,9 +29173,9 @@ } }, "node_modules/xml-naming": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/xml-naming/-/xml-naming-0.1.0.tgz", - "integrity": "sha512-k8KO9hrMyNk6tUWqUfkTEZbezRRpONVOzUTnc97VnCvyj6Tf9lyUR9EDAIeiVLv56jsMcoXEwjW8Kv5yPY52lw==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/xml-naming/-/xml-naming-0.3.0.tgz", + "integrity": "sha512-ghig2TBE/H11aOVgmahA3MhimvkBr6JIYknH/Dhdk10nXwdbIqBJsbfMxpvFPG8bAw77gN29aQWvKpmVoPlvPQ==", "dev": true, "funding": [ { @@ -30136,16 +29282,6 @@ "dev": true, "license": "MIT" }, - "node_modules/yargs/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/yargs/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -30261,6 +29397,13 @@ "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" } + }, + "node_modules/zstddec": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/zstddec/-/zstddec-0.2.0.tgz", + "integrity": "sha512-oyPnDa1X5c13+Y7mA/FDMNJrn4S8UNBe0KCqtDmor40Re7ALrPN6npFwyYVRRh+PqozZQdeg23QtbcamZnG5rA==", + "dev": true, + "license": "MIT AND BSD-3-Clause" } } } diff --git a/package.json b/package.json index 771644bf4..06a1ccf9b 100644 --- a/package.json +++ b/package.json @@ -74,19 +74,19 @@ }, "devDependencies": { "@playwright/test": "^1.64.1", - "@wordpress/api-fetch": "^7.55.0", - "@wordpress/block-editor": "^17.1.0", - "@wordpress/blocks": "^16.0.0", - "@wordpress/browserslist-config": "^6.55.0", - "@wordpress/components": "^40.0.0", - "@wordpress/data": "^10.34.0", - "@wordpress/e2e-test-utils-playwright": "^2.0.0", - "@wordpress/element": "^8.5.0", - "@wordpress/env": "^11.15.0", - "@wordpress/eslint-plugin": "^26.0.0", - "@wordpress/hooks": "^4.52.0", - "@wordpress/i18n": "^6.7.0", - "@wordpress/scripts": "^36.0.0", + "@wordpress/api-fetch": "^8.0.0", + "@wordpress/block-editor": "^19.0.0", + "@wordpress/blocks": "^17.0.0", + "@wordpress/browserslist-config": "^7.0.0", + "@wordpress/components": "^43.0.0", + "@wordpress/data": "^11.0.0", + "@wordpress/e2e-test-utils-playwright": "^3.1.0", + "@wordpress/element": "^10.0.0", + "@wordpress/env": "^12.0.0", + "@wordpress/eslint-plugin": "^28.0.0", + "@wordpress/hooks": "^5.0.0", + "@wordpress/i18n": "^7.0.0", + "@wordpress/scripts": "^37.0.0", "copy-webpack-plugin": "^14.0.0", "css-loader": "^7.1.5", "css-minimizer-webpack-plugin": "^8.0.0", From cfa58f0ade881125981f5d6e3c4ad6294be7dccc Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Sat, 31 Oct 2026 23:51:27 +0000 Subject: [PATCH 66/80] fix: upgrade human-format from 1.2.1 to 1.4.0 Snyk has created this PR to upgrade human-format from 1.2.1 to 1.4.0. See this package in npm: human-format See this project in Snyk: https://app.snyk.io/org/cloudinaryltd/project/96b8a37d-7953-4bdc-a10b-bd7b659552ac?utm_source=github&utm_medium=referral&page=upgrade-pr --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index d443c9a92..02f530114 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "codemirror": "^6.0.2", "dot-object": "^2.1.4", "file-size": "^1.0.0", - "human-format": "^1.2.1", + "human-format": "^1.4.0", "loading-attribute-polyfill": "^2.1.1", "lodash": "^4.17.21", "progressbar.js": "^1.1.1", @@ -18508,9 +18508,9 @@ } }, "node_modules/human-format": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/human-format/-/human-format-1.2.1.tgz", - "integrity": "sha512-o5Ldz62VWR5lYUZ8aVQaLKiN37NsHnmk3xjMoUjza3mGkk8MvMofgZT0T6HKSCKSJIir+AWk9Dx8KhxvZAUgCg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/human-format/-/human-format-1.4.0.tgz", + "integrity": "sha512-c7nc9W5j1NsYwJJG5SUEwsZb5yvZNeHEdQspQTx3Q8uLvGYjS+7Oyoh/giaGd0aZN4kBIzGhlqmAvl4MEypJig==", "license": "ISC", "engines": { "node": ">=4" diff --git a/package.json b/package.json index 8a9b2fc69..9f392fb15 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "codemirror": "^6.0.2", "dot-object": "^2.1.4", "file-size": "^1.0.0", - "human-format": "^1.2.1", + "human-format": "^1.4.0", "loading-attribute-polyfill": "^2.1.1", "lodash": "^4.17.21", "progressbar.js": "^1.1.1", From 09a8641dc4dbb93a962d2a361a6cb76b56a8c66e Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Mon, 2 Nov 2026 09:05:15 +0100 Subject: [PATCH 67/80] fix(delivery): keep transformations and overlays when recreating a delivery relation An asset inserted from the DAM with a crop or effects stages those transformations in post meta until it gets a delivery relation. create_size_relation() moves them into the new row and deletes the post meta, but create_delivery() then restored the transformations it had captured before the row existed (none). The restore goes through a relationship save deferred to shutdown, so it overwrote the migrated value with null and the transformations were lost for good. The capture also came from Relate::get_transformations(), which is memoized per request, so recreating the relation again in the same request kept capturing the stale value. Recreating an existing relation also baked its overlays into the transformations column, as the capture merged them in, and dropped the overlay columns. Capture the transformations and overlays from the relationship data instead, each in its own column, and write them with the new relation itself rather than restoring them afterwards. Transformations staged in post meta still take precedence. --- php/class-delivery.php | 33 ++- .../tests/test-delivery-create-delivery.php | 205 ++++++++++++++++++ 2 files changed, 228 insertions(+), 10 deletions(-) create mode 100644 tests/phpunit/tests/test-delivery-create-delivery.php diff --git a/php/class-delivery.php b/php/class-delivery.php index f2ec5d184..3e1a7f0f9 100644 --- a/php/class-delivery.php +++ b/php/class-delivery.php @@ -104,6 +104,13 @@ class Delivery implements Setup { */ const META_CACHE_KEY = '_cld_replacements'; + /** + * The relationship columns carried over when a delivery relation is recreated. + * + * @var array + */ + const PRESERVED_RELATION_KEYS = array( 'transformations', 'text_overlay', 'image_overlay' ); + /** * Holds the captured post contexts * @@ -425,14 +432,12 @@ public function is_deliverable( $attachment_id ) { * @param int $attachment_id The attachment ID. */ public function create_delivery( $attachment_id ) { - $relationship = Relationship::get_relationship( $attachment_id ); - $transformations = null; - // Preserve pre-existing transformations. + $relationship = Relationship::get_relationship( $attachment_id ); + $preserve = array(); + // Preserve pre-existing transformations and overlays, each in its own column. + // Read the relationship data rather than Relate::get_transformations(), which is memoized per request and merges in the overlays. if ( $relationship instanceof Relationship ) { - $transformations = Relate::get_transformations( $attachment_id, true ); - if ( empty( $transformations ) ) { - $transformations = null; - } + $preserve = array_intersect_key( (array) $relationship->get_data(), array_flip( self::PRESERVED_RELATION_KEYS ) ); } $this->delete_size_relationship( $attachment_id ); $size = $this->get_sized( $attachment_id ); @@ -449,11 +454,11 @@ public function create_delivery( $attachment_id ) { if ( empty( $sized_url ) ) { $sized_url = Utils::get_path_from_url( wp_get_attachment_url( $attachment_id ), true ); } - self::create_size_relation( $attachment_id, $sized_url, $wh, $base ); + // Write the preserved values with the new relation itself. Restoring them afterwards would go through a deferred save that runs on shutdown, overwriting transformations the relation has just migrated out of post meta. + self::create_size_relation( $attachment_id, $sized_url, $wh, $base, $preserve ); // Update public ID and type. self::update_size_relations_public_id( $attachment_id, $public_id ); self::update_size_relations_state( $attachment_id, 'inherit' ); - self::update_size_relations_transformations( $attachment_id, $transformations ); $this->sync->set_signature_item( $attachment_id, 'delivery' ); } @@ -638,10 +643,11 @@ public static function delete_bulk_size_relations( $ids ) { * @param string $sized_url The sized url. * @param string $size The size in (width)x(height) format. * @param string $parent_path The path of the parent if external. + * @param array $preserve Transformations and overlays to carry over from a previous relation. * * @return false|int */ - public static function create_size_relation( $attachment_id, $sized_url, $size = '0x0', $parent_path = '' ) { // phpcs:ignore PHPCompatibility.Numbers.RemovedHexadecimalNumericStrings.Found, PHPCompatibility.Miscellaneous.ValidIntegers.HexNumericStringFound + public static function create_size_relation( $attachment_id, $sized_url, $size = '0x0', $parent_path = '', $preserve = array() ) { // phpcs:ignore PHPCompatibility.Numbers.RemovedHexadecimalNumericStrings.Found, PHPCompatibility.Miscellaneous.ValidIntegers.HexNumericStringFound global $wpdb; static $media; if ( ! $media ) { @@ -671,6 +677,13 @@ public static function create_size_relation( $attachment_id, $sized_url, $size = 'parent_hash' => md5( $parent_path ), ); + // Carry over preserved values, unless transformations staged in post meta replace them. + foreach ( array_intersect_key( (array) $preserve, array_flip( self::PRESERVED_RELATION_KEYS ) ) as $key => $value ) { + if ( ! empty( $value ) && empty( $data[ $key ] ) ) { + $data[ $key ] = $value; + } + } + $insert_id = false; $created = $wpdb->replace( Utils::get_relationship_table(), $data ); // phpcs:ignore WordPress.DB if ( 0 < $created ) { diff --git a/tests/phpunit/tests/test-delivery-create-delivery.php b/tests/phpunit/tests/test-delivery-create-delivery.php new file mode 100644 index 000000000..fc35ffd5b --- /dev/null +++ b/tests/phpunit/tests/test-delivery-create-delivery.php @@ -0,0 +1,205 @@ +query( str_replace( 'CREATE TABLE', 'CREATE TABLE IF NOT EXISTS', Utils::get_table_sql() ) ); // phpcs:ignore WordPress.DB + + $this->attachment_id = self::factory()->attachment->create_upload_object( DIR_TESTDATA . '/images/canola.jpg' ); + $this->get_media()->update_post_meta( $this->attachment_id, Sync::META_KEYS['public_id'], 'canola' ); + } + + /** + * Get the Media component. + * + * @return \Cloudinary\Media + */ + protected function get_media() { + return \Cloudinary\get_plugin_instance()->get_component( 'media' ); + } + + /** + * Build a Delivery instance wired to the plugin's Media component and a stubbed Sync. + * + * @return Test_Delivery_Create_Delivery_Delivery + */ + protected function get_delivery() { + $plugin = \Cloudinary\get_plugin_instance(); + $delivery = new Test_Delivery_Create_Delivery_Delivery( $plugin ); + $delivery->set_components( $this->get_media(), new Test_Delivery_Create_Delivery_Sync() ); + + return $delivery; + } + + /** + * Run the relationship save that is deferred to shutdown. + * + * @return void + */ + protected function run_shutdown_save() { + Relationship::get_relationship( $this->attachment_id )->do_save(); + } + + /** + * Read the attachment's relation row straight from the table. + * + * @return array|null + */ + protected function get_row() { + global $wpdb; + $table = Utils::get_relationship_table(); + + return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$table} WHERE post_id = %d", $this->attachment_id ), ARRAY_A ); // phpcs:ignore WordPress.DB + } + + /** + * Transformations staged in post meta by a DAM import end up in the new relation. + * + * @return void + */ + public function test_keeps_staged_transformations_of_a_new_relation() { + $this->get_media()->update_post_meta( $this->attachment_id, Sync::META_KEYS['transformation'], array( array( 'effect' => 'sepia' ) ) ); + + $this->get_delivery()->create_delivery( $this->attachment_id ); + $this->run_shutdown_save(); + + $row = $this->get_row(); + $this->assertSame( 'e_sepia', $row['transformations'] ); + $this->assertEmpty( $this->get_media()->get_post_meta( $this->attachment_id, Sync::META_KEYS['transformation'], true ) ); + } + + /** + * The relation is recreated several times in one request when the attachment is used more than + * once on the page; the staged transformations, consumed by the first call, must survive the rest. + * + * @return void + */ + public function test_keeps_staged_transformations_when_recreated_in_the_same_request() { + $this->get_media()->update_post_meta( $this->attachment_id, Sync::META_KEYS['transformation'], array( array( 'effect' => 'sepia' ) ) ); + + $delivery = $this->get_delivery(); + $delivery->create_delivery( $this->attachment_id ); + $delivery->create_delivery( $this->attachment_id ); + $delivery->create_delivery( $this->attachment_id ); + $this->run_shutdown_save(); + + $this->assertSame( 'e_sepia', $this->get_row()['transformations'] ); + } + + /** + * Recreating an existing relation keeps its transformations and overlays in their own columns. + * + * @return void + */ + public function test_keeps_transformations_and_overlays_of_an_existing_relation() { + $text_overlay = wp_json_encode( array( 'transformation' => 'l_text:Arial_20:Hello/fl_layer_apply' ) ); + $image_overlay = wp_json_encode( array( 'transformation' => 'l_logo/fl_layer_apply' ) ); + + $delivery = $this->get_delivery(); + $delivery->create_delivery( $this->attachment_id ); + $relationship = Relationship::get_relationship( $this->attachment_id ); + $relationship->transformations = 'e_sepia'; + $relationship->text_overlay = $text_overlay; + $relationship->image_overlay = $image_overlay; + $this->run_shutdown_save(); + + $delivery->create_delivery( $this->attachment_id ); + $this->run_shutdown_save(); + + $row = $this->get_row(); + $this->assertSame( 'e_sepia', $row['transformations'] ); + $this->assertSame( $text_overlay, $row['text_overlay'] ); + $this->assertSame( $image_overlay, $row['image_overlay'] ); + } + + /** + * Transformations newly staged in post meta replace those of the existing relation. + * + * @return void + */ + public function test_staged_transformations_replace_those_of_an_existing_relation() { + $delivery = $this->get_delivery(); + $delivery->create_delivery( $this->attachment_id ); + Relationship::get_relationship( $this->attachment_id )->transformations = 'e_sepia'; + $this->run_shutdown_save(); + + $this->get_media()->update_post_meta( $this->attachment_id, Sync::META_KEYS['transformation'], array( array( 'effect' => 'grayscale' ) ) ); + $delivery->create_delivery( $this->attachment_id ); + $this->run_shutdown_save(); + + $this->assertSame( 'e_grayscale', $this->get_row()['transformations'] ); + } +} + +/** + * Delivery with its components settable, as setup() only runs on a connected plugin. + */ +class Test_Delivery_Create_Delivery_Delivery extends \Cloudinary\Delivery { + + /** + * Set the Media and Sync components. + * + * @param \Cloudinary\Media $media The media component. + * @param object $sync The sync component. + * + * @return void + */ + public function set_components( $media, $sync ) { + $this->media = $media; + $this->sync = $sync; + } +} + +/** + * Sync stub, as signatures need the sync types a connected plugin registers. + */ +class Test_Delivery_Create_Delivery_Sync { + + /** + * Stubbed to a no-op. + * + * @param int $attachment_id The attachment ID. + * @param string $type The sync type. + * + * @return void + */ + public function set_signature_item( $attachment_id, $type ) {} +} From ac5d5a5b86a4aa83a3e12c6780232f4dca69d3c3 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Mon, 2 Nov 2026 09:05:20 +0100 Subject: [PATCH 68/80] test: drop internal ticket references from test docblocks --- tests/phpunit/tests/test-attachment-image-src.php | 2 +- tests/phpunit/tests/test-delivery-parse-element.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/tests/test-attachment-image-src.php b/tests/phpunit/tests/test-attachment-image-src.php index b5ab3efbf..dd2e1f8a8 100644 --- a/tests/phpunit/tests/test-attachment-image-src.php +++ b/tests/phpunit/tests/test-attachment-image-src.php @@ -3,7 +3,7 @@ * Tests for Cloudinary\Media::filter_attachment_image_src(). * * This covers the wp_get_attachment_image_src filter Cloudinary hooks so it keeps the last - * word on that specific, commonly-targeted core hook (see WPP-1183): it must bow out cheaply + * word on that specific, commonly-targeted core hook: it must bow out cheaply * when a URL is already a Cloudinary URL or there is no image at all, only correct an attachment * that actually has a real image representation (an image, or a preview-capable format like PDF/ * PSD -- anything else showing here with icon=true is a generic mime icon, not something to diff --git a/tests/phpunit/tests/test-delivery-parse-element.php b/tests/phpunit/tests/test-delivery-parse-element.php index 492f6e2a1..38795a46b 100644 --- a/tests/phpunit/tests/test-delivery-parse-element.php +++ b/tests/phpunit/tests/test-delivery-parse-element.php @@ -2,8 +2,7 @@ /** * Tests for Cloudinary\Delivery::parse_element(). * - * Since WPP-1183, image_downsize() and wp_get_attachment_image_src() return Cloudinary URLs on - * the front end too, so tags built by theme code (wp_get_attachment_image() in a template, a + * image_downsize() and wp_get_attachment_image_src() return Cloudinary URLs on the front end too, so tags built by theme code (wp_get_attachment_image() in a template, a * shortcode, a widget) reach Delivery with a Cloudinary src instead of a local one. Delivery * tracks such a src back to its attachment through the public ID; this covers that the track-back * resolves to the same full URL the known items are keyed by, rather than the relation's From 2a331a656c747f3a56aa8806c07e4ac6620dd42f Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Mon, 2 Nov 2026 17:30:00 +0530 Subject: [PATCH 69/80] test(e2e): Prove revert and share one synced image The revert test saved webp/60 and then auto/auto before any render, so it passed even if the plugin ignored the settings. Render and check webp/60 first, then revert and check f_auto/q_auto on the same image. f_ and q_ are added at render time, not at sync time, so upload and sync one image in beforeAll instead of one per test. Record each ID as soon as it exists so a partial setup is still cleaned up. --- .../cloudinary-global-transformations.spec.js | 113 ++++++++---------- 1 file changed, 53 insertions(+), 60 deletions(-) diff --git a/tests/e2e/cloudinary-global-transformations.spec.js b/tests/e2e/cloudinary-global-transformations.spec.js index 880ed0c5f..705a14e9a 100644 --- a/tests/e2e/cloudinary-global-transformations.spec.js +++ b/tests/e2e/cloudinary-global-transformations.spec.js @@ -45,7 +45,15 @@ let cloudName; let previousSettings = null; /** - * Attachments and posts created by the current test, removed in afterEach. + * The image post shared by all tests, set in beforeAll. + * + * @type {{ attachmentId: number, postLink: string }|null} + */ +let created = null; + +/** + * IDs of the attachment and post, removed in afterAll. Each ID is recorded + * as soon as it exists, so a setup that fails part way is still cleaned up. * * @type {number[]} */ @@ -90,9 +98,8 @@ function readSettings() { /** * Upload the fixture, embed it in a published post and sync it. * - * Each call gets a fresh attachment, so the image is synced with the - * settings that are active at that time. The timestamp in the filename - * gives a fresh public ID, so no CDN cache from an earlier run applies. + * The timestamp in the filename gives a fresh public ID, so no CDN cache + * from an earlier run applies. * * @param {Object} requestUtils RequestUtils fixture. * @return {Promise<{ attachmentId: number, postLink: string }>} Created objects. @@ -133,18 +140,21 @@ async function uploadSyncedImagePost( requestUtils ) { } /** - * Open the post and return the delivery URL of the inline image. + * Open the post and return the f_ and q_ parameters of the inline image's + * delivery URL. + * + * The plugin adds the global format and quality when it renders the page, + * not when it syncs the image, so a settings change shows on the next + * render of the same image. * * @param {import('@playwright/test').Page} page - * @param {string} postLink Post permalink. - * @param {number} attachmentId Attachment ID. - * @return {Promise} The `src` of the rendered image. + * @return {Promise<{ format: string[], quality: string[] }>} Parameters by prefix. */ -async function renderedSrc( page, postLink, attachmentId ) { - await page.goto( postLink ); +async function renderedParams( page ) { + await page.goto( created.postLink ); const img = page - .locator( `.wp-block-image img.wp-image-${ attachmentId }` ) + .locator( `.wp-block-image img.wp-image-${ created.attachmentId }` ) .first(); await expect( img ).toHaveAttribute( 'src', @@ -153,7 +163,12 @@ async function renderedSrc( page, postLink, attachmentId ) { const src = await img.getAttribute( 'src' ); expectCloudinaryUrl( src, cloudName ); - return src; + + const params = transformationParams( src ); + return { + format: withPrefix( params, 'f_' ), + quality: withPrefix( params, 'q_' ), + }; } /** @@ -197,9 +212,11 @@ test.describe( 'Cloudinary global image transformations', { tag: '@serial' }, () => { - test.beforeAll( () => { + test.beforeAll( async ( { requestUtils } ) => { ( { cloudName } = ensureCloudinaryConnected() ); previousSettings = readSettings(); + saveSettings( BASE_SETTINGS ); + created = await uploadSyncedImagePost( requestUtils ); } ); test.afterAll( () => { @@ -207,9 +224,7 @@ test.describe( saveSettings( previousSettings ); previousSettings = null; } - } ); - - test.afterEach( () => { + created = null; const ids = createdIds; createdIds = []; @@ -229,65 +244,43 @@ test.describe( test( 'non-default format and quality appear as f_ and q_', async ( { page, - requestUtils, } ) => { - saveSettings( { - ...BASE_SETTINGS, - image_format: 'webp', - image_quality: '60', - } ); + saveSettings( { image_format: 'webp', image_quality: '60' } ); - const { attachmentId, postLink } = - await uploadSyncedImagePost( requestUtils ); - const params = transformationParams( - await renderedSrc( page, postLink, attachmentId ) - ); - - expect( withPrefix( params, 'f_' ) ).toEqual( [ 'f_webp' ] ); - expect( withPrefix( params, 'q_' ) ).toEqual( [ 'q_60' ] ); + expect( await renderedParams( page ) ).toEqual( { + format: [ 'f_webp' ], + quality: [ 'q_60' ], + } ); } ); test( 'reverting to the defaults replaces the explicit values with auto', async ( { page, - requestUtils, } ) => { - // Set the non-default values first, so this test proves the - // revert and does not only read the defaults. - saveSettings( { - ...BASE_SETTINGS, - image_format: 'webp', - image_quality: '60', + // Render with the non-default values first. Without this + // step the test would pass even if the plugin ignored the + // settings and always printed the defaults. + saveSettings( { image_format: 'webp', image_quality: '60' } ); + expect( await renderedParams( page ) ).toEqual( { + format: [ 'f_webp' ], + quality: [ 'q_60' ], } ); - saveSettings( { image_format: 'auto', image_quality: 'auto' } ); - const { attachmentId, postLink } = - await uploadSyncedImagePost( requestUtils ); - const params = transformationParams( - await renderedSrc( page, postLink, attachmentId ) - ); - - expect( withPrefix( params, 'f_' ) ).toEqual( [ 'f_auto' ] ); - expect( withPrefix( params, 'q_' ) ).toEqual( [ 'q_auto' ] ); + saveSettings( { image_format: 'auto', image_quality: 'auto' } ); + expect( await renderedParams( page ) ).toEqual( { + format: [ 'f_auto' ], + quality: [ 'q_auto' ], + } ); } ); test( '"Not set" omits the f_ and q_ parameters', async ( { page, - requestUtils, } ) => { - saveSettings( { - ...BASE_SETTINGS, - image_format: 'none', - image_quality: 'none', - } ); + saveSettings( { image_format: 'none', image_quality: 'none' } ); - const { attachmentId, postLink } = - await uploadSyncedImagePost( requestUtils ); - const params = transformationParams( - await renderedSrc( page, postLink, attachmentId ) - ); - - expect( withPrefix( params, 'f_' ) ).toEqual( [] ); - expect( withPrefix( params, 'q_' ) ).toEqual( [] ); + expect( await renderedParams( page ) ).toEqual( { + format: [], + quality: [], + } ); } ); } ); From 739195cc1972014d29ef47742d3490af7846722b Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Mon, 2 Nov 2026 14:19:26 +0100 Subject: [PATCH 70/80] Build assets --- js/block-editor.asset.php | 13 ++++++++++++- js/cloudinary.js | 2 +- js/deactivate.asset.php | 7 ++++++- js/gallery-block.asset.php | 14 +++++++++++++- js/gallery-block.js | 2 +- js/gallery-init.asset.php | 7 ++++++- js/gallery.asset.php | 12 +++++++++++- js/gallery.js | 2 +- js/inline-loader.asset.php | 7 ++++++- js/lazy-load.asset.php | 7 ++++++- js/media-modal.asset.php | 7 ++++++- js/syntax-highlight.js | 2 +- js/terms-order.asset.php | 7 ++++++- js/video-init.asset.php | 7 ++++++- 14 files changed, 82 insertions(+), 14 deletions(-) diff --git a/js/block-editor.asset.php b/js/block-editor.asset.php index 3730d17f1..e91b58b93 100644 --- a/js/block-editor.asset.php +++ b/js/block-editor.asset.php @@ -1 +1,12 @@ - array('wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'a9b2df98cf4781d2997f'); + array( + 'wp-api-fetch', + 'wp-block-editor', + 'wp-components', + 'wp-data', + 'wp-element', + 'wp-hooks', + 'wp-i18n' + ), + 'version' => 'a9b2df98cf4781d2997f' +); diff --git a/js/cloudinary.js b/js/cloudinary.js index 047d4e16d..aaaccd21b 100644 --- a/js/cloudinary.js +++ b/js/cloudinary.js @@ -1,2 +1,2 @@ -(()=>{var t={951(t,e){var i,n,s,o;o=function(){var t="BKMGTPEZY".split("");function e(t,e){return t&&t.toLowerCase()===e.toLowerCase()}return function(i,n){return i="number"==typeof i?i:0,(n=n||{}).fixed="number"==typeof n.fixed?n.fixed:2,n.spacer="string"==typeof n.spacer?n.spacer:" ",n.calculate=function(t){var s=e(t,"si")?["k","B"]:["K","iB"],o=e(t,"si")?1e3:1024,r=Math.log(i)/Math.log(o)|0,a=i/Math.pow(o,r),l=a.toFixed(n.fixed);return r-1<3&&!e(t,"si")&&e(t,"jedec")&&(s[1]="B"),{suffix:r?(s[0]+"MGTPEZY")[r-1]+s[1]:1==(0|l)?"Byte":"Bytes",magnitude:r,result:a,fixed:l,bits:{result:a/8,fixed:(a/8).toFixed(n.fixed)}}},n.to=function(n,s){var o=e(s,"si")?1e3:1024,r=t.indexOf("string"==typeof n?n[0].toUpperCase():"B"),a=i;if(-1===r||0===r)return a.toFixed(2);for(;r>0;r--)a/=o;return a.toFixed(2)},n.human=function(t){var e=n.calculate(t);return e.fixed+n.spacer+e.suffix},n}},t.exports?t.exports=o():(n=[],void 0===(s="function"==typeof(i=o)?i.apply(e,n):i)||(t.exports=s))},998(t,e){var i,n,s;n=[],i=function(){"use strict";function t(t,e){var i,n,s;for(i=1,n=arguments.length;i>1].factor>t?s=e-1:n=e;return i[n]},c.prototype.parse=function(t,e){var i=t.match(this._regexp);if(null!==i){var n,s=i[3];if(a(this._prefixes,s))n=this._prefixes[s];else{if(e||(s=s.toLowerCase(),!a(this._lcPrefixes,s)))return;s=this._lcPrefixes[s],n=this._prefixes[s]}var o=+i[2];return void 0!==i[1]&&(o=-o),{factor:n,prefix:s,unit:i[4],value:o}}};var h={binary:c.create(",Ki,Mi,Gi,Ti,Pi,Ei,Zi,Yi".split(","),1024),SI:c.create("y,z,a,f,p,n,µ,m,,k,M,G,T,P,E,Z,Y".split(","),1e3,-8)},d={maxDecimals:2,separator:" ",unit:""},u={scale:"SI",strict:!1};function f(e,i){var n=(i=t({},d,i)).decimals;void 0!==n&&delete i.maxDecimals;var s=v(e,i);e=void 0!==n?s.value.toFixed(n):String(s.value);var o=s.prefix+i.unit;return""===o?e:e+i.separator+o}var p={scale:"binary",unit:"B"};function g(e,i){return f(e,void 0===i?p:t({},p,i))}function m(t,e){var i=b(t,e);return i.value*i.factor}function b(e,i){if("string"!=typeof e)throw new TypeError("str must be a string");i=t({},u,i);var n=l(h,i.scale);if(void 0===n)throw new Error("missing scale");var s=n.parse(e,i.strict);if(void 0===s)throw new Error("cannot parse str");return s}function v(e,i){if(0===e)return{value:0,prefix:""};if(e<0){var n=v(-e,i);return n.value=-n.value,n}if("number"!=typeof e||Number.isNaN(e))throw new TypeError("value must be a number");i=t({},u,i);var s,o=l(h,i.scale);if(void 0===o)throw new Error("missing scale");var r=i.maxDecimals,c="auto"===r;c?s=10:void 0!==r&&(s=Math.pow(10,r));var d,f=i.prefix;if(void 0!==f){if(!a(o._prefixes,f))throw new Error("invalid prefix");d=o._prefixes[f]}else{var p=o.findPrefix(e);if(void 0!==s)do{var g=(d=p.factor)/s;e=Math.round(e/g)*g}while((p=o.findPrefix(e)).factor!==d);else d=p.factor;f=p.prefix}return e=void 0===s?e/d:Math.round(e*s/d)/s,c&&Math.abs(e)>=10&&(e=Math.round(e)),{prefix:f,value:e}}return f.bytes=g,f.parse=m,m.raw=b,f.raw=v,f.Scale=c,f},void 0===(s="function"==typeof i?i.apply(e,n):i)||(t.exports=s)},336(t){var e,i="loading"in HTMLImageElement.prototype,n="loading"in HTMLIFrameElement.prototype,s="onscroll"in window;function o(t){var e,i,n=[];"picture"===t.parentNode.tagName.toLowerCase()&&((i=(e=t.parentNode).querySelector("source[data-lazy-remove]"))&&e.removeChild(i),n=Array.prototype.slice.call(t.parentNode.querySelectorAll("source"))),n.push(t),n.forEach(function(t){t.hasAttribute("data-lazy-srcset")&&(t.setAttribute("srcset",t.getAttribute("data-lazy-srcset")),t.removeAttribute("data-lazy-srcset"))}),t.setAttribute("src",t.getAttribute("data-lazy-src")),t.removeAttribute("data-lazy-src")}function r(t){var o=document.createElement("div");for(o.innerHTML=function(t){var o=t.textContent||t.innerHTML,r="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 "+((o.match(/width=['"](\d+)['"]/)||!1)[1]||1)+" "+((o.match(/height=['"](\d+)['"]/)||!1)[1]||1)+"%27%3E%3C/svg%3E";return(/\n-1}function zt(t,e){var i=this.__data__,n=te(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this}function Bt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e1?i[s-1]:void 0,r=s>2?i[2]:void 0;for(o=t.length>3&&"function"==typeof o?(s--,o):void 0,r&&ke(i[0],i[1],r)&&(o=s<3?void 0:o,s=1),e=Object(e);++n-1&&t%1==0&&t0){if(++e>=o)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function De(t){if(null!=t){try{return ot.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ie(t,e){return t===e||t!=t&&e!=e}var Re=se(function(){return arguments}())?se:function(t){return He(t)&&rt.call(t,"callee")&&!bt.call(t,"callee")},je=Array.isArray;function Fe(t){return null!=t&&We(t.length)&&!Ne(t)}function ze(t){return He(t)&&Fe(t)}var Be=_t||Ke;function Ne(t){if(!Ve(t))return!1;var e=ne(t);return e==p||e==g||e==h||e==x}function We(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Ve(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function He(t){return null!=t&&"object"==typeof t}function $e(t){if(!He(t)||ne(t)!=y)return!1;var e=gt(t);if(null===e)return!0;var i=rt.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&ot.call(i)==ct}var Ue=X?K(X):re;function qe(t){return ge(t,Ye(t))}function Ye(t){return Fe(t)?Kt(t,!0):ae(t)}var Xe=me(function(t,e,i){le(t,e,i)});function Je(t){return function(){return t}}function Ge(t){return t}function Ke(){return!1}e.exports=Xe}).call(this)}).call(this,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,i,n){var s,o;s=self,o=function(){return function(){"use strict";var t={720:function(t,e,i){i.r(e),i.d(e,{Scene:function(){return ae},Tweenable:function(){return Mt},interpolate:function(){return ee},processTweens:function(){return bt},setBezierFunction:function(){return H},shouldScheduleUpdate:function(){return xt},tween:function(){return Ot},unsetBezierFunction:function(){return $}});var n={};i.r(n),i.d(n,{bounce:function(){return R},bouncePast:function(){return j},easeFrom:function(){return z},easeFromTo:function(){return F},easeInBack:function(){return A},easeInCirc:function(){return S},easeInCubic:function(){return c},easeInExpo:function(){return _},easeInOutBack:function(){return C},easeInOutCirc:function(){return O},easeInOutCubic:function(){return d},easeInOutExpo:function(){return k},easeInOutQuad:function(){return l},easeInOutQuart:function(){return p},easeInOutQuint:function(){return b},easeInOutSine:function(){return x},easeInQuad:function(){return r},easeInQuart:function(){return u},easeInQuint:function(){return g},easeInSine:function(){return v},easeOutBack:function(){return T},easeOutBounce:function(){return E},easeOutCirc:function(){return M},easeOutCubic:function(){return h},easeOutExpo:function(){return w},easeOutQuad:function(){return a},easeOutQuart:function(){return f},easeOutQuint:function(){return m},easeOutSine:function(){return y},easeTo:function(){return B},elastic:function(){return P},linear:function(){return o},swingFrom:function(){return D},swingFromTo:function(){return L},swingTo:function(){return I}});var s={};i.r(s),i.d(s,{afterTween:function(){return Jt},beforeTween:function(){return Xt},doesApply:function(){return qt},tweenCreated:function(){return Yt}});var o=function(t){return t},r=function(t){return Math.pow(t,2)},a=function(t){return-(Math.pow(t-1,2)-1)},l=function(t){return(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2)},c=function(t){return Math.pow(t,3)},h=function(t){return Math.pow(t-1,3)+1},d=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)},u=function(t){return Math.pow(t,4)},f=function(t){return-(Math.pow(t-1,4)-1)},p=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},g=function(t){return Math.pow(t,5)},m=function(t){return Math.pow(t-1,5)+1},b=function(t){return(t/=.5)<1?.5*Math.pow(t,5):.5*(Math.pow(t-2,5)+2)},v=function(t){return 1-Math.cos(t*(Math.PI/2))},y=function(t){return Math.sin(t*(Math.PI/2))},x=function(t){return-.5*(Math.cos(Math.PI*t)-1)},_=function(t){return 0===t?0:Math.pow(2,10*(t-1))},w=function(t){return 1===t?1:1-Math.pow(2,-10*t)},k=function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},S=function(t){return-(Math.sqrt(1-t*t)-1)},M=function(t){return Math.sqrt(1-Math.pow(t-1,2))},O=function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},E=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},A=function(t){var e=1.70158;return t*t*((e+1)*t-e)},T=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},C=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},P=function(t){return-1*Math.pow(4,-8*t)*Math.sin((6*t-1)*(2*Math.PI)/2)+1},L=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},D=function(t){var e=1.70158;return t*t*((e+1)*t-e)},I=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},R=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},j=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?2-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?2-(7.5625*(t-=2.25/2.75)*t+.9375):2-(7.5625*(t-=2.625/2.75)*t+.984375)},F=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},z=function(t){return Math.pow(t,4)},B=function(t){return Math.pow(t,.25)};function N(t,e,i,n,s,o){var r,a,l,c,h,d=0,u=0,f=0,p=function(t){return((d*t+u)*t+f)*t},g=function(t){return(3*d*t+2*u)*t+f},m=function(t){return t>=0?t:0-t};return d=1-(f=3*e)-(u=3*(n-e)-f),l=1-(h=3*i)-(c=3*(s-i)-h),r=t,a=function(t){return 1/(200*t)}(o),function(t){return((l*t+c)*t+h)*t}(function(t,e){var i,n,s,o,r,a;for(s=t,a=0;a<8;a++){if(o=p(s)-t,m(o)(n=1))return n;for(;io?i=s:n=s,s=.5*(n-i)+i}return s}(r,a))}var W,V=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.25,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.25,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.75,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.75;return function(s){return N(s,t,e,i,n,1)}},H=function(t,e,i,n,s){var o=V(e,i,n,s);return o.displayName=t,o.x1=e,o.y1=i,o.x2=n,o.y2=s,Mt.formulas[t]=o},$=function(t){return delete Mt.formulas[t]};function U(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function q(t,e){for(var i=0;it.length)&&(e=t.length);for(var i=0,n=new Array(e);ia?a:e;t._hasEnded=l>=a;var c=o-(a-l),h=t._filters.length>0;if(t._hasEnded)return t._render(r,t._data,c),t.stop(!0);h&&t._applyFilter(rt),l1&&void 0!==arguments[1]?arguments[1]:it,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Array.isArray(e))return V.apply(void 0,X(e));var n=Y(e);if(pt[e])return pt[e];if(n===ct||n===lt)for(var s in t)i[s]=e;else for(var o in t)i[o]=e[o]||it;return i},kt=function(t){t===ut?(ut=t._next)?ut._previous=null:ft=null:t===ft?(ft=t._previous)?ft._next=null:ut=null:(tt=t._previous,et=t._next,tt._next=et,et._previous=tt),t._previous=t._next=null},St="function"==typeof Promise?Promise:null;W=Symbol.toStringTag;var Mt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;U(this,t),Q(this,W,"Promise"),this._config={},this._data={},this._delay=0,this._filters=[],this._next=null,this._previous=null,this._timestamp=null,this._hasEnded=!1,this._resolve=null,this._reject=null,this._currentState=e||{},this._originalState={},this._targetState={},this._start=dt,this._render=dt,this._promiseCtor=St,i&&this.setConfig(i)}var e;return e=[{key:"_applyFilter",value:function(t){for(var e=this._filters.length;e>0;e--){var i=this._filters[e-e][t];i&&i(this)}}},{key:"tween",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return this._isPlaying&&this.stop(),!e&&this._config||this.setConfig(e),this._pausedAtTime=null,this._timestamp=t.now(),this._start(this.get(),this._data),this._delay&&this._render(this._currentState,this._data,0),this._resume(this._timestamp)}},{key:"setConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this._config;for(var n in e)i[n]=e[n];var s=i.promise,o=void 0===s?this._promiseCtor:s,r=i.start,a=void 0===r?dt:r,l=i.finish,c=i.render,h=void 0===c?this._config.step||dt:c,d=i.step,u=void 0===d?dt:d;this._data=i.data||i.attachment||this._data,this._isPlaying=!1,this._pausedAtTime=null,this._scheduleId=null,this._delay=e.delay||0,this._start=a,this._render=h||u,this._duration=i.duration||500,this._promiseCtor=o,l&&(this._resolve=l);var f=e.from,p=e.to,g=void 0===p?{}:p,m=this._currentState,b=this._originalState,v=this._targetState;for(var y in f)m[y]=f[y];var x=!1;for(var _ in m){var w=m[_];x||Y(w)!==ct||(x=!0),b[_]=w,v[_]=g.hasOwnProperty(_)?g[_]:w}if(this._easing=wt(this._currentState,i.easing,this._easing),this._filters.length=0,x){for(var k in t.filters)t.filters[k].doesApply(this)&&this._filters.push(t.filters[k]);this._applyFilter(at)}return this}},{key:"then",value:function(t,e){var i=this;return this._promise=new this._promiseCtor(function(t,e){i._resolve=t,i._reject=e}),this._promise.then(t,e)}},{key:"catch",value:function(t){return this.then().catch(t)}},{key:"finally",value:function(t){return this.then().finally(t)}},{key:"get",value:function(){return K({},this._currentState)}},{key:"set",value:function(t){this._currentState=t}},{key:"pause",value:function(){if(this._isPlaying)return this._pausedAtTime=t.now(),this._isPlaying=!1,kt(this),this}},{key:"resume",value:function(){return this._resume()}},{key:"_resume",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.now();return null===this._timestamp?this.tween():this._isPlaying?this._promise:(this._pausedAtTime&&(this._timestamp+=e-this._pausedAtTime,this._pausedAtTime=null),this._isPlaying=!0,null===ut?(ut=this,ft=this):(this._previous=ft,ft._next=this,ft=this),this)}},{key:"seek",value:function(e){e=Math.max(e,0);var i=t.now();return this._timestamp+e===0||(this._timestamp=i-e,mt(this,i)),this}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._isPlaying)return this;this._isPlaying=!1,kt(this);var e=this._filters.length>0;return t&&(e&&this._applyFilter(rt),gt(1,this._currentState,this._originalState,this._targetState,1,0,this._easing),e&&(this._applyFilter(st),this._applyFilter(ot))),this._resolve&&this._resolve({data:this._data,state:this._currentState,tweenable:this}),this._resolve=null,this._reject=null,this}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._currentState,i=this._data;return this._isPlaying?(this._reject&&this._reject({data:i,state:e,tweenable:this}),this._resolve=null,this._reject=null,this.stop(t)):this}},{key:"isPlaying",value:function(){return this._isPlaying}},{key:"hasEnded",value:function(){return this._hasEnded}},{key:"setScheduleFunction",value:function(e){t.setScheduleFunction(e)}},{key:"data",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t&&(this._data=K({},t)),this._data}},{key:"dispose",value:function(){for(var t in this)delete this[t]}}],e&&q(t.prototype,e),t}();function Ot(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new Mt;return e.tween(t),e.tweenable=e,e}Q(Mt,"now",function(){return Z}),Q(Mt,"setScheduleFunction",function(t){return ht=t}),Q(Mt,"filters",{}),Q(Mt,"formulas",pt),xt(!0);var Et,At,Tt=/(\d|-|\.)/,Ct=/([^\-0-9.]+)/g,Pt=/[0-9.-]+/g,Lt=(Et=Pt.source,At=/,\s*/.source,new RegExp("rgba?\\(".concat(Et).concat(At).concat(Et).concat(At).concat(Et,"(").concat(At).concat(Et,")?\\)"),"g")),Dt=/^.*\(/,It=/#([0-9]|[a-f]){3,6}/gi,Rt="VAL",jt=function(t,e){return t.map(function(t,i){return"_".concat(e,"_").concat(i)})};function Ft(t){return parseInt(t,16)}var zt=function(t){return"rgb(".concat((e=t,3===(e=e.replace(/#/,"")).length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[Ft(e.substr(0,2)),Ft(e.substr(2,2)),Ft(e.substr(4,2))]).join(","),")");var e},Bt=function(t,e,i){var n=e.match(t),s=e.replace(t,Rt);return n&&n.forEach(function(t){return s=s.replace(Rt,i(t))}),s},Nt=function(t){for(var e in t){var i=t[e];"string"==typeof i&&i.match(It)&&(t[e]=Bt(It,i,zt))}},Wt=function(t){var e=t.match(Pt),i=e.slice(0,3).map(Math.floor),n=t.match(Dt)[0];if(3===e.length)return"".concat(n).concat(i.join(","),")");if(4===e.length)return"".concat(n).concat(i.join(","),",").concat(e[3],")");throw new Error("Invalid rgbChunk: ".concat(t))},Vt=function(t){return t.match(Pt)},Ht=function(t,e){var i={};return e.forEach(function(e){i[e]=t[e],delete t[e]}),i},$t=function(t,e){return e.map(function(e){return t[e]})},Ut=function(t,e){return e.forEach(function(e){return t=t.replace(Rt,+e.toFixed(4))}),t},qt=function(t){for(var e in t._currentState)if("string"==typeof t._currentState[e])return!0;return!1};function Yt(t){var e=t._currentState;[e,t._originalState,t._targetState].forEach(Nt),t._tokenData=function(t){var e,i,n={};for(var s in t){var o=t[s];"string"==typeof o&&(n[s]={formatString:(e=o,i=void 0,i=e.match(Ct),i?(1===i.length||e.charAt(0).match(Tt))&&i.unshift(""):i=["",""],i.join(Rt)),chunkNames:jt(Vt(o),s)})}return n}(e)}function Xt(t){var e=t._currentState,i=t._originalState,n=t._targetState,s=t._easing,o=t._tokenData;!function(t,e){var i=function(i){var n=e[i].chunkNames,s=t[i];if("string"==typeof s){var o=s.split(" "),r=o[o.length-1];n.forEach(function(e,i){return t[e]=o[i]||r})}else n.forEach(function(e){return t[e]=s});delete t[i]};for(var n in e)i(n)}(s,o),[e,i,n].forEach(function(t){return function(t,e){var i=function(i){Vt(t[i]).forEach(function(n,s){return t[e[i].chunkNames[s]]=+n}),delete t[i]};for(var n in e)i(n)}(t,o)})}function Jt(t){var e=t._currentState,i=t._originalState,n=t._targetState,s=t._easing,o=t._tokenData;[e,i,n].forEach(function(t){return function(t,e){for(var i in e){var n=e[i],s=n.chunkNames,o=n.formatString,r=Ut(o,$t(Ht(t,s),s));t[i]=Bt(Lt,r,Wt)}}(t,o)}),function(t,e){for(var i in e){var n=e[i].chunkNames,s=t[n[0]];t[i]="string"==typeof s?n.map(function(e){var i=t[e];return delete t[e],i}).join(" "):s}}(s,o)}function Gt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function Kt(t){for(var e=1;e4&&void 0!==arguments[4]?arguments[4]:0,o=Kt({},t),r=wt(t,n);for(var a in Zt._filters.length=0,Zt.set({}),Zt._currentState=o,Zt._originalState=t,Zt._targetState=e,Zt._easing=r,te)te[a].doesApply(Zt)&&Zt._filters.push(te[a]);Zt._applyFilter("tweenCreated"),Zt._applyFilter("beforeTween");var l=gt(i,o,t,e,1,s,r);return Zt._applyFilter("afterTween"),l};function ie(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);it.strokeWidth&&(e=t.trailWidth);var i=50-e/2;return s.render(this._pathTemplate,{radius:i,"2radius":2*i})},o.prototype._trailString=function(t){return this._pathString(t)},e.exports=o},{"./shape":8,"./utils":10}],4:[function(t,e,i){var n=t("./shape"),s=t("./utils"),o=function(t,e){this._pathTemplate=e.vertical?"M {center},100 L {center},0":"M 0,{center} L 100,{center}",n.apply(this,arguments)};o.prototype=new n,o.prototype.constructor=o,o.prototype._initializeSvg=function(t,e){var i=e.vertical?"0 0 "+e.strokeWidth+" 100":"0 0 100 "+e.strokeWidth;t.setAttribute("viewBox",i),t.setAttribute("preserveAspectRatio","none")},o.prototype._pathString=function(t){return s.render(this._pathTemplate,{center:t.strokeWidth/2})},o.prototype._trailString=function(t){return this._pathString(t)},e.exports=o},{"./shape":8,"./utils":10}],5:[function(t,e,i){e.exports={Line:t("./line"),Circle:t("./circle"),SemiCircle:t("./semicircle"),Square:t("./square"),Path:t("./path"),Shape:t("./shape"),utils:t("./utils")}},{"./circle":3,"./line":4,"./path":6,"./semicircle":7,"./shape":8,"./square":9,"./utils":10}],6:[function(t,e,i){var n=t("shifty"),s=t("./utils"),o=n.Tweenable,r={easeIn:"easeInCubic",easeOut:"easeOutCubic",easeInOut:"easeInOutCubic"},a=function t(e,i){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");var n;i=s.extend({delay:0,duration:800,easing:"linear",from:{},to:{},step:function(){}},i),n=s.isString(e)?document.querySelector(e):e,this.path=n,this._opts=i,this._tweenable=null;var o=this.path.getTotalLength();this.path.style.strokeDasharray=o+" "+o,this.set(0)};a.prototype.value=function(){var t=this._getComputedDashOffset(),e=this.path.getTotalLength();return parseFloat((1-t/e).toFixed(6),10)},a.prototype.set=function(t){this.stop(),this.path.style.strokeDashoffset=this._progressToOffset(t);var e=this._opts.step;if(s.isFunction(e)){var i=this._easing(this._opts.easing);e(this._calculateTo(t,i),this._opts.shape||this,this._opts.attachment)}},a.prototype.stop=function(){this._stopTween(),this.path.style.strokeDashoffset=this._getComputedDashOffset()},a.prototype.animate=function(t,e,i){e=e||{},s.isFunction(e)&&(i=e,e={});var n=s.extend({},e),r=s.extend({},this._opts);e=s.extend(r,e);var a=this._easing(e.easing),l=this._resolveFromAndTo(t,a,n);this.stop(),this.path.getBoundingClientRect();var c=this._getComputedDashOffset(),h=this._progressToOffset(t),d=this;this._tweenable=new o,this._tweenable.tween({from:s.extend({offset:c},l.from),to:s.extend({offset:h},l.to),duration:e.duration,delay:e.delay,easing:a,step:function(t){d.path.style.strokeDashoffset=t.offset;var i=e.shape||d;e.step(t,i,e.attachment)}}).then(function(t){s.isFunction(i)&&i()}).catch(function(t){throw console.error("Error in tweening:",t),t})},a.prototype._getComputedDashOffset=function(){var t=window.getComputedStyle(this.path,null);return parseFloat(t.getPropertyValue("stroke-dashoffset"),10)},a.prototype._progressToOffset=function(t){var e=this.path.getTotalLength();return e-t*e},a.prototype._resolveFromAndTo=function(t,e,i){return i.from&&i.to?{from:i.from,to:i.to}:{from:this._calculateFrom(e),to:this._calculateTo(t,e)}},a.prototype._calculateFrom=function(t){return n.interpolate(this._opts.from,this._opts.to,this.value(),t)},a.prototype._calculateTo=function(t,e){return n.interpolate(this._opts.from,this._opts.to,t,e)},a.prototype._stopTween=function(){null!==this._tweenable&&(this._tweenable.stop(!0),this._tweenable=null)},a.prototype._easing=function(t){return r.hasOwnProperty(t)?r[t]:t},e.exports=a},{"./utils":10,shifty:2}],7:[function(t,e,i){var n=t("./shape"),s=t("./circle"),o=t("./utils"),r=function(t,e){this._pathTemplate="M 50,50 m -{radius},0 a {radius},{radius} 0 1 1 {2radius},0",this.containerAspectRatio=2,n.apply(this,arguments)};r.prototype=new n,r.prototype.constructor=r,r.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 50")},r.prototype._initializeTextContainer=function(t,e,i){t.text.style&&(i.style.top="auto",i.style.bottom="0",t.text.alignToBottom?o.setStyle(i,"transform","translate(-50%, 0)"):o.setStyle(i,"transform","translate(-50%, 50%)"))},r.prototype._pathString=s.prototype._pathString,r.prototype._trailString=s.prototype._trailString,e.exports=r},{"./circle":3,"./shape":8,"./utils":10}],8:[function(t,e,i){var n=t("./path"),s=t("./utils"),o="Object is destroyed",r=function t(e,i){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");if(0!==arguments.length){this._opts=s.extend({color:"#555",strokeWidth:1,trailColor:null,trailWidth:null,fill:null,text:{style:{color:null,position:"absolute",left:"50%",top:"50%",padding:0,margin:0,transform:{prefix:!0,value:"translate(-50%, -50%)"}},autoStyleContainer:!0,alignToBottom:!0,value:null,className:"progressbar-text"},svgStyle:{display:"block",width:"100%"},warnings:!1},i,!0),s.isObject(i)&&void 0!==i.svgStyle&&(this._opts.svgStyle=i.svgStyle),s.isObject(i)&&s.isObject(i.text)&&void 0!==i.text.style&&(this._opts.text.style=i.text.style);var o,r=this._createSvgView(this._opts);if(!(o=s.isString(e)?document.querySelector(e):e))throw new Error("Container does not exist: "+e);this._container=o,this._container.appendChild(r.svg),this._opts.warnings&&this._warnContainerAspectRatio(this._container),this._opts.svgStyle&&s.setStyles(r.svg,this._opts.svgStyle),this.svg=r.svg,this.path=r.path,this.trail=r.trail,this.text=null;var a=s.extend({attachment:void 0,shape:this},this._opts);this._progressPath=new n(r.path,a),s.isObject(this._opts.text)&&null!==this._opts.text.value&&this.setText(this._opts.text.value)}};r.prototype.animate=function(t,e,i){if(null===this._progressPath)throw new Error(o);this._progressPath.animate(t,e,i)},r.prototype.stop=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath.stop()},r.prototype.pause=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.pause()},r.prototype.resume=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.resume()},r.prototype.destroy=function(){if(null===this._progressPath)throw new Error(o);this.stop(),this.svg.parentNode.removeChild(this.svg),this.svg=null,this.path=null,this.trail=null,this._progressPath=null,null!==this.text&&(this.text.parentNode.removeChild(this.text),this.text=null)},r.prototype.set=function(t){if(null===this._progressPath)throw new Error(o);this._progressPath.set(t)},r.prototype.value=function(){if(null===this._progressPath)throw new Error(o);return void 0===this._progressPath?0:this._progressPath.value()},r.prototype.setText=function(t){if(null===this._progressPath)throw new Error(o);null===this.text&&(this.text=this._createTextContainer(this._opts,this._container),this._container.appendChild(this.text)),s.isObject(t)?(s.removeChildren(this.text),this.text.appendChild(t)):this.text.innerHTML=t},r.prototype._createSvgView=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");this._initializeSvg(e,t);var i=null;(t.trailColor||t.trailWidth)&&(i=this._createTrail(t),e.appendChild(i));var n=this._createPath(t);return e.appendChild(n),{svg:e,path:n,trail:i}},r.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 100")},r.prototype._createPath=function(t){var e=this._pathString(t);return this._createPathElement(e,t)},r.prototype._createTrail=function(t){var e=this._trailString(t),i=s.extend({},t);return i.trailColor||(i.trailColor="#eee"),i.trailWidth||(i.trailWidth=i.strokeWidth),i.color=i.trailColor,i.strokeWidth=i.trailWidth,i.fill=null,this._createPathElement(e,i)},r.prototype._createPathElement=function(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",t),i.setAttribute("stroke",e.color),i.setAttribute("stroke-width",e.strokeWidth),e.fill?i.setAttribute("fill",e.fill):i.setAttribute("fill-opacity","0"),i},r.prototype._createTextContainer=function(t,e){var i=document.createElement("div");i.className=t.text.className;var n=t.text.style;return n&&(t.text.autoStyleContainer&&(e.style.position="relative"),s.setStyles(i,n),n.color||(i.style.color=t.color)),this._initializeTextContainer(t,e,i),i},r.prototype._initializeTextContainer=function(t,e,i){},r.prototype._pathString=function(t){throw new Error("Override this function for each progress bar")},r.prototype._trailString=function(t){throw new Error("Override this function for each progress bar")},r.prototype._warnContainerAspectRatio=function(t){if(this.containerAspectRatio){var e=window.getComputedStyle(t,null),i=parseFloat(e.getPropertyValue("width"),10),n=parseFloat(e.getPropertyValue("height"),10);s.floatEquals(this.containerAspectRatio,i/n)||(console.warn("Incorrect aspect ratio of container","#"+t.id,"detected:",e.getPropertyValue("width")+"(width)","/",e.getPropertyValue("height")+"(height)","=",i/n),console.warn("Aspect ratio of should be",this.containerAspectRatio))}},e.exports=r},{"./path":6,"./utils":10}],9:[function(t,e,i){var n=t("./shape"),s=t("./utils"),o=function(t,e){this._pathTemplate="M 0,{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{strokeWidth}",this._trailTemplate="M {startMargin},{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{halfOfStrokeWidth}",n.apply(this,arguments)};o.prototype=new n,o.prototype.constructor=o,o.prototype._pathString=function(t){var e=100-t.strokeWidth/2;return s.render(this._pathTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2})},o.prototype._trailString=function(t){var e=100-t.strokeWidth/2;return s.render(this._trailTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2,startMargin:t.strokeWidth/2-t.trailWidth/2})},e.exports=o},{"./shape":8,"./utils":10}],10:[function(t,e,i){var n=t("lodash.merge"),s="Webkit Moz O ms".split(" "),o=.001;function r(t,e){var i=t;for(var n in e)if(e.hasOwnProperty(n)){var s=e[n],o=new RegExp("\\{"+n+"\\}","g");i=i.replace(o,s)}return i}function a(t,e,i){for(var n=t.style,o=0;oo[0];break;case"lt":i=this.value{const e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.hasOwn(t,e),(()=>{let t;globalThis.importScripts&&(t=globalThis.location+"");const e=globalThis.document;if(!t&&e&&("SCRIPT"===e.currentScript?.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){const i=e.getElementsByTagName("script");if(i.length){let e=i.length-1;for(;e>-1&&(!t||!/^https?:/.test(t));)t=i[e--].src}}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),i.p=t})(),(()=>{"use strict";i(336),i(712),i(544);const t={sample:{image:document.getElementById("transformation-sample-image"),video:document.getElementById("transformation-sample-video")},preview:{image:document.getElementById("sample-image"),video:document.getElementById("sample-video")},fields:document.getElementsByClassName("cld-ui-input"),button:{image:document.getElementById("refresh-image-preview"),video:document.getElementById("refresh-video-preview")},spinner:{image:document.getElementById("image-loader"),video:document.getElementById("video-loader")},optimization:{image:document.getElementById("image_settings.image_optimization"),video:document.getElementById("video_settings.video_optimization")},error_container:document.getElementById("cld-preview-error"),activeItem:null,elements:{image:[],video:[]},_placeItem(t){null!==t&&(t.style.display="block",t.style.visibility="visible",t.style.position="absolute",t.style.top=t.parentElement.clientHeight/2-t.clientHeight/2+"px",t.style.left=t.parentElement.clientWidth/2-t.clientWidth/2+"px")},_setLoading(t){this.sample[t]&&(this.button[t].style.display="block",this._placeItem(this.button[t]),this.preview[t].style.opacity="0.1")},_build(t){if(!this.sample[t])return;this.sample[t].innerHTML="",this.elements[t]=[];for(const e of this.fields){if(t!==e.dataset.context||e.dataset.disabled&&"true"===e.dataset.disabled)continue;let i=e.value.trim();if(i.length){if("select-one"===e.type){if("none"===i||!1===this.optimization[t].checked)continue;i=e.dataset.meta+"_"+i}else t=e.dataset.context,e.dataset.meta&&(i=e.dataset.meta+"_"+i),e.dataset.suffix&&(i+=e.dataset.suffix),i=this._transformations(i,t,!0);i&&this.elements[t].push(i)}}let e="";this.elements[t].length&&(e="/"+this._getGlobalTransformationElements(t).replace(/ /g,"%20")),this.sample[t].textContent=e,this.sample[t].parentElement.href="https://res.cloudinary.com/demo/"+this.sample[t].parentElement.innerText.trim().replace("../","").replace(/ /g,"%20")},_clearLoading(t){this.spinner[t].style.visibility="hidden",this.activeItem=null,this.preview[t].style.opacity=1},_refresh(t,e){if(t&&t.preventDefault(),!this.sample[e])return;const i=this,n=CLD_GLOBAL_TRANSFORMATIONS[e].preview_url+this._getGlobalTransformationElements(e)+CLD_GLOBAL_TRANSFORMATIONS[e].file;if(this.button[e].style.display="none",this._placeItem(this.spinner[e]),"image"===e){const t=new Image;t.onload=function(){i.preview[e].src=this.src,i._clearLoading(e),i.error_container&&(i.error_container.style.display="none"),t.remove()},t.onerror=function(){const t=i.elements[e].includes("f_mp4");i.error_container&&(i.error_container.style.display="block",t?(i.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[e].warning.replace("%s","f_mp4"),i.error_container.classList.replace("settings-alert-error","settings-alert-warning")):(i.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[e].error,i.error_container.classList.replace("settings-alert-warning","settings-alert-error"))),i._clearLoading(e)},t.src=n}else{const t=i._transformations(i._getGlobalTransformationElements(e),e);samplePlayer.source({publicId:"sailing_boat",transformation:t}),i._clearLoading(e)}},_getGlobalTransformationElements(t){let e=[];return e.push(this.elements[t].slice(0,2).join(",")),e.push(this.elements[t].slice(2).join(",")),e=e.filter(t=>t).join("/"),e},_transformations(t,e,i=!1){const n=CLD_GLOBAL_TRANSFORMATIONS[e].valid_types;let s=null;const o=t.split("/"),r=[];for(let t=0;t":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},n=["(","?"],s={")":["("],":":["?","?:"]},o=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var r={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,i){if(t)throw e;return i}};function a(t){var i=function(t){for(var i,r,a,l,c=[],h=[];i=t.match(o);){for(r=i[0],(a=t.substr(0,i.index).trim())&&c.push(a);l=h.pop();){if(s[r]){if(s[r][0]===l){r=s[r][1]||r;break}}else if(n.indexOf(l)>=0||e[l]1===t?0:1},d=/^i18n\.(n?gettext|has_translation)(_|$)/;var u=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var f=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var p=function(t,e){return function(i,n,s,o=10){const r=t[e];if(!f(i))return;if(!u(n))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof o)return void console.error("If specified, the hook priority must be a number.");const a={callback:s,priority:o,namespace:n};if(r[i]){const t=r[i].handlers;let e;for(e=t.length;e>0&&!(o>=t[e-1].priority);e--);e===t.length?t[e]=a:t.splice(e,0,a),r.__current.forEach(t=>{t.name===i&&t.currentIndex>=e&&t.currentIndex++})}else r[i]={handlers:[a],runs:0};"hookAdded"!==i&&t.doAction("hookAdded",i,n,s,o)}};var g=function(t,e,i=!1){return function(n,s){const o=t[e];if(!f(n))return;if(!i&&!u(s))return;if(!o[n])return 0;let r=0;if(i)r=o[n].handlers.length,o[n]={runs:o[n].runs,handlers:[]};else{const t=o[n].handlers;for(let e=t.length-1;e>=0;e--)t[e].namespace===s&&(t.splice(e,1),r++,o.__current.forEach(t=>{t.name===n&&t.currentIndex>=e&&t.currentIndex--}))}return"hookRemoved"!==n&&t.doAction("hookRemoved",n,s),r}};var m=function(t,e){return function(i,n){const s=t[e];return void 0!==n?i in s&&s[i].handlers.some(t=>t.namespace===n):i in s}};var b=function(t,e,i,n){return function(s,...o){const r=t[e];r[s]||(r[s]={handlers:[],runs:0}),r[s].runs++;const a=r[s].handlers;if(!a||!a.length)return i?o[0]:void 0;const l={name:s,currentIndex:0};return(n?async function(){try{r.__current.add(l);let t=i?o[0]:void 0;for(;l.currentIndex0:Array.from(n.__current).some(t=>t.name===i)}};var x=function(t,e){return function(i){const n=t[e];if(f(i))return n[i]&&n[i].runs?n[i].runs:0}},_=class{actions;filters;addAction;addFilter;removeAction;removeFilter;hasAction;hasFilter;removeAllActions;removeAllFilters;doAction;doActionAsync;applyFilters;applyFiltersAsync;currentAction;currentFilter;doingAction;doingFilter;didAction;didFilter;constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=p(this,"actions"),this.addFilter=p(this,"filters"),this.removeAction=g(this,"actions"),this.removeFilter=g(this,"filters"),this.hasAction=m(this,"actions"),this.hasFilter=m(this,"filters"),this.removeAllActions=g(this,"actions",!0),this.removeAllFilters=g(this,"filters",!0),this.doAction=b(this,"actions",!1,!1),this.doActionAsync=b(this,"actions",!1,!0),this.applyFilters=b(this,"filters",!0,!1),this.applyFiltersAsync=b(this,"filters",!0,!0),this.currentAction=v(this,"actions"),this.currentFilter=v(this,"filters"),this.doingAction=y(this,"actions"),this.doingFilter=y(this,"filters"),this.didAction=x(this,"actions"),this.didFilter=x(this,"filters")}};var w=function(){return new _}(),{addAction:k,addFilter:S,removeAction:M,removeFilter:O,hasAction:E,hasFilter:A,removeAllActions:T,removeAllFilters:C,doAction:P,doActionAsync:L,applyFilters:D,applyFiltersAsync:I,currentAction:R,currentFilter:j,doingAction:F,doingFilter:z,didAction:B,didFilter:N,actions:W,filters:V}=w,H=((t,e,i)=>{const n=new c({}),s=new Set,o=()=>{s.forEach(t=>t())},r=(t,e="default")=>{n.data[e]={...n.data[e],...t},n.data[e][""]={...h,...n.data[e]?.[""]},delete n.pluralForms[e]},a=(t,e)=>{r(t,e),o()},l=(t="default",e,i,s,o)=>(n.data[t]||r(void 0,t),n.dcnpgettext(t,e,i,s,o)),u=t=>t||"default",f=(t,e,n)=>{let s=l(n,e,t);return i?(s=i.applyFilters("i18n.gettext_with_context",s,t,e,n),i.applyFilters("i18n.gettext_with_context_"+u(n),s,t,e,n)):s};if(t&&a(t,e),i){const t=t=>{d.test(t)&&o()};i.addAction("hookAdded","core/i18n",t),i.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:(t="default")=>n.data[t],setLocaleData:a,addLocaleData:(t,e="default")=>{n.data[e]={...n.data[e],...t,"":{...h,...n.data[e]?.[""],...t?.[""]}},delete n.pluralForms[e],o()},resetLocaleData:(t,e)=>{n.data={},n.pluralForms={},a(t,e)},subscribe:t=>(s.add(t),()=>s.delete(t)),__:(t,e)=>{let n=l(e,void 0,t);return i?(n=i.applyFilters("i18n.gettext",n,t,e),i.applyFilters("i18n.gettext_"+u(e),n,t,e)):n},_x:f,_n:(t,e,n,s)=>{let o=l(s,void 0,t,e,n);return i?(o=i.applyFilters("i18n.ngettext",o,t,e,n,s),i.applyFilters("i18n.ngettext_"+u(s),o,t,e,n,s)):o},_nx:(t,e,n,s,o)=>{let r=l(o,s,t,e,n);return i?(r=i.applyFilters("i18n.ngettext_with_context",r,t,e,n,s,o),i.applyFilters("i18n.ngettext_with_context_"+u(o),r,t,e,n,s,o)):r},isRTL:()=>"rtl"===f("ltr","text direction"),hasTranslation:(t,e,s)=>{const o=e?e+""+t:t;let r=!!n.data?.[s??"default"]?.[o];return i&&(r=i.applyFilters("i18n.has_translation",r,t,e,s),r=i.applyFilters("i18n.has_translation_"+u(s),r,t,e,s)),r}}})(void 0,void 0,w),$=(H.getLocaleData.bind(H),H.setLocaleData.bind(H),H.resetLocaleData.bind(H),H.subscribe.bind(H),H.__.bind(H)),U=(H._x.bind(H),H._n.bind(H),H._nx.bind(H),H.isRTL.bind(H),H.hasTranslation.bind(H),["@wordpress/admin-ui","@wordpress/api-fetch","@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/boot","@wordpress/commands","@wordpress/compose","@wordpress/connectors","@wordpress/workflows","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/font-list-route","@wordpress/format-library","@wordpress/patterns","@wordpress/preferences","@wordpress/rich-text","@wordpress/route","@wordpress/router","@wordpress/routes","@wordpress/storybook","@wordpress/sync","@wordpress/theme","@wordpress/dataviews","@wordpress/fields","@wordpress/lazy-editor","@wordpress/media-editor","@wordpress/media-utils","@wordpress/upload-media","@wordpress/global-styles-engine","@wordpress/global-styles-ui","@wordpress/ui","@wordpress/views","@wordpress/widget-dashboard"]);function q(t,e){if(!t)throw new Error("Cannot lock an undefined object.");const i=t;J in i||(i[J]={}),X.set(i[J],e)}function Y(t){if(!t)throw new Error("Cannot unlock an undefined object.");const e=t;if(!(J in e))throw new Error("Cannot unlock an object that was not locked before. ");return X.get(e[J])}var X=new WeakMap,J=Symbol("Private API ID");var{lock:G,unlock:K}=((t,e)=>{if(!U.includes(e))throw new Error(`You tried to opt-in to unstable APIs as module "${e}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress."!==t)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return{lock:q,unlock:Y}})("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/api-fetch");var Q=function(t){const e=(t,i)=>{const{headers:n={}}=t;for(const s in n)if("x-wp-nonce"===s.toLowerCase()&&n[s]===e.nonce)return i(t);return i({...t,headers:{...n,"X-WP-Nonce":e.nonce}})};return e.nonce=t,e},Z=(t,e)=>{let i,n,s=t.path;return"string"==typeof t.namespace&&"string"==typeof t.endpoint&&(i=t.namespace.replace(/^\/|\/$/g,""),n=t.endpoint.replace(/^\//,""),s=n?i+"/"+n:i),delete t.namespace,delete t.endpoint,e({...t,path:s})},tt=t=>(e,i)=>Z(e,e=>{let n,s=e.url,o=e.path;return"string"==typeof o&&(n=t,-1!==t.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(o=o.replace("?","&")),s=n+o),i({...e,url:s})});function et(t){try{return decodeURIComponent(t)}catch{return t}}function it(t){const e=t.indexOf("?");if(-1===e)return t;const i=t.slice(0,e),n=t.slice(e+1);return n?i+"?"+n.split("&").map(t=>t.split("=")).map(t=>t.map(et)).sort((t,e)=>t[0].localeCompare(e[0])).map(t=>t.map(encodeURIComponent)).map(t=>t.join("=")).join("&"):i}function nt(t){return(function(t){let e;try{e=new URL(t,"http://example.com").search.substring(1)}catch{}if(e)return e}(t)||"").replace(/\+/g,"%20").split("&").reduce((t,e)=>{const i=e.indexOf("="),n=-1!==i,s=et(n?e.slice(0,i):e);if(s){const o=n?et(e.slice(i+1)):"";!function(t,e,i){const n=e.length,s=n-1;for(let o=0;o{"link"===e.toLowerCase()&&(t.headers[e]=i.replace(/<([^>]+)>/,(t,e)=>`<${encodeURI(e)}>`))}),Promise.resolve(e?t.body:new window.Response(JSON.stringify(t.body),{status:200,statusText:"OK",headers:t.headers}))}}var ct=function(t){const{OPTIONS:e={},...i}=Object.fromEntries(Object.entries(t).map(([t,e])=>[it(t),e])),n=new Set(Object.keys(i)),s=new Set(Object.keys(e));let o=!1;const r=(t,r)=>{const{parse:a=!0}=t;let l=t.path;if(!l&&t.url){const{rest_route:e,...i}=nt(t.url);"string"==typeof e&&(l=ot(e,i))}if("string"!=typeof l)return r(t);const c=t.method||"GET",h=it(l);if("GET"===c&&i[h]){const t=i[h];return o||delete i[h],n.delete(h),lt(t,!!a)}if("OPTIONS"===c&&e[h]){const t=e[h];return o||delete e[h],s.delete(h),lt(t,!!a)}return r(t)};return r[rt]=()=>{o=!0},r[at]=()=>{const t=[...Array.from(n,t=>`GET ${t}`),...Array.from(s,t=>`OPTIONS ${t}`)];t.length?console.warn("[api-fetch][preload] Some preloads were never consumed:",t):console.log("[api-fetch][preload] All preloads consumed."),n.clear(),s.clear();for(const t of Object.keys(i))delete i[t];for(const t of Object.keys(e))delete e[t]},r},ht=({path:t,url:e,...i},n)=>({...i,url:e&&ot(e,n),path:t&&ot(t,n)}),dt=t=>t.json?t.json():Promise.reject(t),ut=t=>{const{next:e}=(t=>{if(!t)return{};const e=t.match(/<([^>]+)>; rel="next"/);return e?{next:e[1]}:{}})(t.headers.get("link"));return e},ft=async(t,e)=>{if(!1===t.parse)return e(t);if(!(t=>{const e=!!t.path&&-1!==t.path.indexOf("per_page=-1"),i=!!t.url&&-1!==t.url.indexOf("per_page=-1");return e||i})(t))return e(t);const i=await Pt({...ht(t,{per_page:100}),parse:!1}),n=await dt(i);if(!Array.isArray(n))return n;let s=ut(i);if(!s)return n;let o=[].concat(n);for(;s;){const e=await Pt({...t,path:void 0,url:s,parse:!1}),i=await dt(e);o=o.concat(i),s=ut(e)}return o},pt=new Set(["PATCH","PUT","DELETE"]),gt="GET",mt=(t,e)=>{const{method:i=gt}=t;return pt.has(i.toUpperCase())&&(t={...t,headers:{"Content-Type":"application/json",...t.headers,"X-HTTP-Method-Override":i},method:"POST"}),e(t)};function bt(t,e){return nt(t)[e]}function vt(t,e){return void 0!==bt(t,e)}async function yt(t,e=!1){try{if("function"!=typeof t.text)return await t.json();const i=await t.text();return e&&""===i?null:JSON.parse(i)}catch{throw{code:"invalid_json",message:$("The response is not a valid JSON response.")}}}async function xt(t,e=!0){return e?204===t.status?null:await yt(t,!0):t}async function _t(t,e=!0){if(!e)throw t;throw await yt(t)}var wt=(t,e)=>{if(!function(t){const e=!!t.method&&"POST"===t.method;return(!!t.path&&-1!==t.path.indexOf("/wp/v2/media")||!!t.url&&-1!==t.url.indexOf("/wp/v2/media"))&&e}(t))return e(t);let i=0;const n=t=>(i++,e({path:`/wp/v2/media/${t}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>i<5?n(t):(e({path:`/wp/v2/media/${t}?force=true`,method:"DELETE"}),Promise.reject())));return e({...t,parse:!1}).catch(e=>{if(!(e instanceof globalThis.Response))return Promise.reject(e);const i=e.headers.get("x-wp-upload-attachment-id");return e.status>=500&&e.status<600&&i?n(i).catch(()=>!1!==t.parse?Promise.reject({code:"post_process",message:$("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(e)):_t(e,t.parse)}).then(e=>xt(e,t.parse))};function kt(t,...e){const i=t.replace(/^[^#]*/,""),n=(t=t.replace(/#.*/,"")).indexOf("?");if(-1===n)return t+i;const s=nt(t),o=t.substr(0,n);e.forEach(t=>delete s[t]);const r=st(s);return(r?o+"?"+r:o)+i}var St=t=>(e,i)=>{if("string"==typeof e.url){const i=bt(e.url,"wp_theme_preview");void 0===i?e.url=ot(e.url,{wp_theme_preview:t}):""===i&&(e.url=kt(e.url,"wp_theme_preview"))}if("string"==typeof e.path){const i=bt(e.path,"wp_theme_preview");void 0===i?e.path=ot(e.path,{wp_theme_preview:t}):""===i&&(e.path=kt(e.path,"wp_theme_preview"))}return i(e)},Mt={Accept:"application/json, */*;q=0.1"},Ot={credentials:"include"},Et=[(t,e)=>("string"!=typeof t.url||vt(t.url,"_locale")||(t.url=ot(t.url,{_locale:"user"})),"string"!=typeof t.path||vt(t.path,"_locale")||(t.path=ot(t.path,{_locale:"user"})),e(t)),Z,mt,ft];var At=t=>{const{url:e,path:i,data:n,parse:s=!0,...o}=t;let{body:r,headers:a}=t;a={...Mt,...a},n&&(r=JSON.stringify(n),a["Content-Type"]="application/json");return globalThis.fetch(e||i||window.location.href,{...Ot,...o,body:r,headers:a}).then(t=>t.ok?xt(t,s):_t(t,s),t=>{if(t&&"AbortError"===t.name)throw t;if(!globalThis.navigator.onLine)throw{code:"offline_error",message:$("Unable to connect. Please check your Internet connection.")};throw{code:"fetch_error",message:$("Could not get a valid response from the server.")}})},Tt=At;var Ct=t=>Et.reduceRight((t,e)=>i=>e(i,t),Tt)(t).catch(e=>"rest_cookie_invalid_nonce"!==e.code?Promise.reject(e):globalThis.fetch(Ct.nonceEndpoint).then(t=>t.ok?t.text():Promise.reject(e)).then(e=>(Ct.nonceMiddleware.nonce=e,Ct(t))));Ct.use=function(t){Et.unshift(t)},Ct.unregister=function(t){const e=Et.indexOf(t);return-1!==e&&(Et.splice(e,1),!0)},Ct.setFetchHandler=function(t){Tt=t},Ct.defaultFetchHandler=At,Ct.privateApis={},G(Ct.privateApis,{enablePreloadMultiUse:function(){for(const t of Et)t[rt]?.()},clearPreloadedData:function(){for(const t of Et)t[at]?.()}}),Ct.createNonceMiddleware=Q,Ct.createPreloadingMiddleware=ct,Ct.createRootURLMiddleware=tt,Ct.fetchAllMiddleware=ft,Ct.httpV1Middleware=mt,Ct.mediaUploadMiddleware=wt,Ct.createThemePreviewMiddleware=St;var Pt=Ct;const Lt={wpWrap:document.getElementById("wpwrap"),adminbar:document.getElementById("wpadminbar"),wpContent:document.getElementById("wpbody-content"),libraryWrap:document.getElementById("cloudinary-dam"),cloudinaryHeader:document.getElementById("cloudinary-header"),wpFooter:document.getElementById("wpfooter"),importStatus:document.getElementById("import-status"),downloading:{},_init(){const t=this,e=this.libraryWrap,i=this.importStatus;"undefined"!=typeof CLDN&&document.querySelector(CLDN.mloptions.inline_container)&&(Pt.use(Pt.createNonceMiddleware(CLDN.nonce)),cloudinary.openMediaLibrary(CLDN.mloptions,{insertHandler(n){const s=[];for(let o=0;o{o.style.opacity=1},250),Pt({path:cldData.dam.fetch_url,data:{src:n.url,filename:n.filename,attachment_id:n.attachment_id,transformations:n.transformations},method:"POST"}).then(t=>{const n=s[r];delete s[r],n.removeChild(n.firstChild),setTimeout(()=>{n.style.opacity=0,setTimeout(()=>{n.parentNode.removeChild(n),Object.keys(s).length||(e.style.marginRight="0px",i.style.display="none")},1e3)},500)})})}}}),window.addEventListener("resize",function(){t._resize()}),t._resize())},_resize(){this.libraryWrap.style.height=this.wpFooter.offsetTop-this.libraryWrap.offsetTop-this.adminbar.offsetHeight+"px"},makeProgress(t){const e=document.createElement("div"),i=document.createElement("span"),n=document.createElement("span");return e.classList.add("cld-import-item"),i.classList.add("spinner"),n.classList.add("cld-import-item-id"),n.innerText=t.public_id,e.appendChild(i),e.appendChild(n),e}};window.addEventListener("load",()=>Lt._init());const Dt={_init(){const t=this;if("undefined"!=typeof CLDIS){[...document.getElementsByClassName("cld-notice-box")].forEach(e=>{const i=e.getElementsByClassName("notice-dismiss");i.length&&i[0].addEventListener("click",i=>{e.style.height=e.offsetHeight+"px",i.preventDefault(),setTimeout(function(){t._dismiss(e)},5)})})}},_dismiss(t){const e=t.dataset.dismiss,i=parseInt(t.dataset.duration);t.classList.add("dismissed"),t.style.height="0px",setTimeout(function(){t.remove()},400),00&&Nt(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Nt(n.height)/t.offsetHeight||1);var r=(Rt(t)?It(t):window).visualViewport,a=!Vt()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/s,c=(n.top+(a&&r?r.offsetTop:0))/o,h=n.width/s,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function $t(t){var e=It(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ut(t){return t?(t.nodeName||"").toLowerCase():null}function qt(t){return((Rt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Yt(t){return Ht(qt(t)).left+$t(t).scrollLeft}function Xt(t){return It(t).getComputedStyle(t)}function Jt(t){var e=Xt(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function Gt(t,e,i){void 0===i&&(i=!1);var n,s,o=jt(e),r=jt(e)&&function(t){var e=t.getBoundingClientRect(),i=Nt(e.width)/t.offsetWidth||1,n=Nt(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=qt(e),l=Ht(t,r,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!i)&&(("body"!==Ut(e)||Jt(a))&&(c=(n=e)!==It(n)&&jt(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:$t(n)),jt(e)?((h=Ht(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=Yt(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function Kt(t){var e=Ht(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Qt(t){return"html"===Ut(t)?t:t.assignedSlot||t.parentNode||(Ft(t)?t.host:null)||qt(t)}function Zt(t){return["html","body","#document"].indexOf(Ut(t))>=0?t.ownerDocument.body:jt(t)&&Jt(t)?t:Zt(Qt(t))}function te(t,e){var i;void 0===e&&(e=[]);var n=Zt(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=It(n),r=s?[o].concat(o.visualViewport||[],Jt(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(te(Qt(r)))}function ee(t){return["table","td","th"].indexOf(Ut(t))>=0}function ie(t){return jt(t)&&"fixed"!==Xt(t).position?t.offsetParent:null}function ne(t){for(var e=It(t),i=ie(t);i&&ee(i)&&"static"===Xt(i).position;)i=ie(i);return i&&("html"===Ut(i)||"body"===Ut(i)&&"static"===Xt(i).position)?e:i||function(t){var e=/firefox/i.test(Wt());if(/Trident/i.test(Wt())&&jt(t)&&"fixed"===Xt(t).position)return null;var i=Qt(t);for(Ft(i)&&(i=i.host);jt(i)&&["html","body"].indexOf(Ut(i))<0;){var n=Xt(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}var se="top",oe="bottom",re="right",ae="left",le="auto",ce=[se,oe,re,ae],he="start",de="end",ue="viewport",fe="popper",pe=ce.reduce(function(t,e){return t.concat([e+"-"+he,e+"-"+de])},[]),ge=[].concat(ce,[le]).reduce(function(t,e){return t.concat([e,e+"-"+he,e+"-"+de])},[]),me=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function be(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}}),n.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){i.has(t.name)||s(t)}),n}var ve={placement:"bottom",modifiers:[],strategy:"absolute"};function ye(){for(var t=arguments.length,e=new Array(t),i=0;i=0?"x":"y"}function Me(t){var e,i=t.reference,n=t.element,s=t.placement,o=s?we(s):null,r=s?ke(s):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case se:e={x:a,y:i.y-n.height};break;case oe:e={x:a,y:i.y+i.height};break;case re:e={x:i.x+i.width,y:l};break;case ae:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?Se(o):null;if(null!=c){var h="y"===c?"height":"width";switch(r){case he:e[c]=e[c]-(i[h]/2-n[h]/2);break;case de:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}var Oe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ee(t){var e,i=t.popper,n=t.popperRect,s=t.placement,o=t.variation,r=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,d=t.isFixed,u=r.x,f=void 0===u?0:u,p=r.y,g=void 0===p?0:p,m="function"==typeof h?h({x:f,y:g}):{x:f,y:g};f=m.x,g=m.y;var b=r.hasOwnProperty("x"),v=r.hasOwnProperty("y"),y=ae,x=se,_=window;if(c){var w=ne(i),k="clientHeight",S="clientWidth";if(w===It(i)&&"static"!==Xt(w=qt(i)).position&&"absolute"===a&&(k="scrollHeight",S="scrollWidth"),s===se||(s===ae||s===re)&&o===de)x=oe,g-=(d&&w===_&&_.visualViewport?_.visualViewport.height:w[k])-n.height,g*=l?1:-1;if(s===ae||(s===se||s===oe)&&o===de)y=re,f-=(d&&w===_&&_.visualViewport?_.visualViewport.width:w[S])-n.width,f*=l?1:-1}var M,O=Object.assign({position:a},c&&Oe),E=!0===h?function(t,e){var i=t.x,n=t.y,s=e.devicePixelRatio||1;return{x:Nt(i*s)/s||0,y:Nt(n*s)/s||0}}({x:f,y:g},It(i)):{x:f,y:g};return f=E.x,g=E.y,l?Object.assign({},O,((M={})[x]=v?"0":"",M[y]=b?"0":"",M.transform=(_.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",M)):Object.assign({},O,((e={})[x]=v?g+"px":"",e[y]=b?f+"px":"",e.transform="",e))}const Ae={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];jt(s)&&Ut(s)&&(Object.assign(s.style,i),Object.keys(n).forEach(function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(t){var n=e.elements[t],s=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce(function(t,e){return t[e]="",t},{});jt(n)&&Ut(n)&&(Object.assign(n.style,o),Object.keys(s).forEach(function(t){n.removeAttribute(t)}))})}},requires:["computeStyles"]};const Te={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.offset,o=void 0===s?[0,0]:s,r=ge.reduce(function(t,i){return t[i]=function(t,e,i){var n=we(t),s=[ae,se].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[ae,re].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}(i,e.rects,o),t},{}),a=r[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}};var Ce={left:"right",right:"left",bottom:"top",top:"bottom"};function Pe(t){return t.replace(/left|right|bottom|top/g,function(t){return Ce[t]})}var Le={start:"end",end:"start"};function De(t){return t.replace(/start|end/g,function(t){return Le[t]})}function Ie(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Ft(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Re(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function je(t,e,i){return e===ue?Re(function(t,e){var i=It(t),n=qt(t),s=i.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=Vt();(c||!c&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+Yt(t),y:l}}(t,i)):Rt(e)?function(t,e){var i=Ht(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):Re(function(t){var e,i=qt(t),n=$t(t),s=null==(e=t.ownerDocument)?void 0:e.body,o=zt(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=zt(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+Yt(t),l=-n.scrollTop;return"rtl"===Xt(s||i).direction&&(a+=zt(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}(qt(t)))}function Fe(t,e,i,n){var s="clippingParents"===e?function(t){var e=te(Qt(t)),i=["absolute","fixed"].indexOf(Xt(t).position)>=0&&jt(t)?ne(t):t;return Rt(i)?e.filter(function(t){return Rt(t)&&Ie(t,i)&&"body"!==Ut(t)}):[]}(t):[].concat(e),o=[].concat(s,[i]),r=o[0],a=o.reduce(function(e,i){var s=je(t,i,n);return e.top=zt(s.top,e.top),e.right=Bt(s.right,e.right),e.bottom=Bt(s.bottom,e.bottom),e.left=zt(s.left,e.left),e},je(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ze(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Be(t,e){return e.reduce(function(e,i){return e[i]=t,e},{})}function Ne(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=void 0===n?t.placement:n,o=i.strategy,r=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?"clippingParents":a,c=i.rootBoundary,h=void 0===c?ue:c,d=i.elementContext,u=void 0===d?fe:d,f=i.altBoundary,p=void 0!==f&&f,g=i.padding,m=void 0===g?0:g,b=ze("number"!=typeof m?m:Be(m,ce)),v=u===fe?"reference":fe,y=t.rects.popper,x=t.elements[p?v:u],_=Fe(Rt(x)?x:x.contextElement||qt(t.elements.popper),l,h,r),w=Ht(t.elements.reference),k=Me({reference:w,element:y,strategy:"absolute",placement:s}),S=Re(Object.assign({},y,k)),M=u===fe?S:w,O={top:_.top-M.top+b.top,bottom:M.bottom-_.bottom+b.bottom,left:_.left-M.left+b.left,right:M.right-_.right+b.right},E=t.modifiersData.offset;if(u===fe&&E){var A=E[s];Object.keys(O).forEach(function(t){var e=[re,oe].indexOf(t)>=0?1:-1,i=[se,oe].indexOf(t)>=0?"y":"x";O[t]+=A[i]*e})}return O}function We(t,e,i){return zt(t,Bt(e,i))}const Ve={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0!==r&&r,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,u=i.tether,f=void 0===u||u,p=i.tetherOffset,g=void 0===p?0:p,m=Ne(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),b=we(e.placement),v=ke(e.placement),y=!v,x=Se(b),_="x"===x?"y":"x",w=e.modifiersData.popperOffsets,k=e.rects.reference,S=e.rects.popper,M="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,O="number"==typeof M?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),E=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,A={x:0,y:0};if(w){if(o){var T,C="y"===x?se:ae,P="y"===x?oe:re,L="y"===x?"height":"width",D=w[x],I=D+m[C],R=D-m[P],j=f?-S[L]/2:0,F=v===he?k[L]:S[L],z=v===he?-S[L]:-k[L],B=e.elements.arrow,N=f&&B?Kt(B):{width:0,height:0},W=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=W[C],H=W[P],$=We(0,k[L],N[L]),U=y?k[L]/2-j-$-V-O.mainAxis:F-$-V-O.mainAxis,q=y?-k[L]/2+j+$+H+O.mainAxis:z+$+H+O.mainAxis,Y=e.elements.arrow&&ne(e.elements.arrow),X=Y?"y"===x?Y.clientTop||0:Y.clientLeft||0:0,J=null!=(T=null==E?void 0:E[x])?T:0,G=D+q-J,K=We(f?Bt(I,D+U-J-X):I,D,f?zt(R,G):R);w[x]=K,A[x]=K-D}if(a){var Q,Z="x"===x?se:ae,tt="x"===x?oe:re,et=w[_],it="y"===_?"height":"width",nt=et+m[Z],st=et-m[tt],ot=-1!==[se,ae].indexOf(b),rt=null!=(Q=null==E?void 0:E[_])?Q:0,at=ot?nt:et-k[it]-S[it]-rt+O.altAxis,lt=ot?et+k[it]+S[it]-rt-O.altAxis:st,ct=f&&ot?function(t,e,i){var n=We(t,e,i);return n>i?i:n}(at,et,lt):We(f?at:nt,et,f?lt:st);w[_]=ct,A[_]=ct-et}e.modifiersData[n]=A}},requiresIfExists:["offset"]};const He={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,s=t.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,a=we(i.placement),l=Se(a),c=[ae,re].indexOf(a)>=0?"height":"width";if(o&&r){var h=function(t,e){return ze("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Be(t,ce))}(s.padding,i),d=Kt(o),u="y"===l?se:ae,f="y"===l?oe:re,p=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],g=r[l]-i.rects.reference[l],m=ne(o),b=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,v=p/2-g/2,y=h[u],x=b-d[c]-h[f],_=b/2-d[c]/2+v,w=We(y,_,x),k=l;i.modifiersData[n]=((e={})[k]=w,e.centerOffset=w-_,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Ie(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function $e(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Ue(t){return[se,re,oe,ae].some(function(e){return t[e]>=0})}var qe=xe({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,l=It(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(t){t.addEventListener("scroll",i.update,_e)}),a&&l.addEventListener("resize",i.update,_e),function(){o&&c.forEach(function(t){t.removeEventListener("scroll",i.update,_e)}),a&&l.removeEventListener("resize",i.update,_e)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=Me({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:we(e.placement),variation:ke(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Ee(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ee(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},Ae,Te,{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0===r||r,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,u=i.altBoundary,f=i.flipVariations,p=void 0===f||f,g=i.allowedAutoPlacements,m=e.options.placement,b=we(m),v=l||(b===m||!p?[Pe(m)]:function(t){if(we(t)===le)return[];var e=Pe(t);return[De(t),e,De(e)]}(m)),y=[m].concat(v).reduce(function(t,i){return t.concat(we(i)===le?function(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,o=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?ge:l,h=ke(n),d=h?a?pe:pe.filter(function(t){return ke(t)===h}):ce,u=d.filter(function(t){return c.indexOf(t)>=0});0===u.length&&(u=d);var f=u.reduce(function(e,i){return e[i]=Ne(t,{placement:i,boundary:s,rootBoundary:o,padding:r})[we(i)],e},{});return Object.keys(f).sort(function(t,e){return f[t]-f[e]})}(e,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:g}):i)},[]),x=e.rects.reference,_=e.rects.popper,w=new Map,k=!0,S=y[0],M=0;M=0,C=T?"width":"height",P=Ne(e,{placement:O,boundary:h,rootBoundary:d,altBoundary:u,padding:c}),L=T?A?re:ae:A?oe:se;x[C]>_[C]&&(L=Pe(L));var D=Pe(L),I=[];if(o&&I.push(P[E]<=0),a&&I.push(P[L]<=0,P[D]<=0),I.every(function(t){return t})){S=O,k=!1;break}w.set(O,I)}if(k)for(var R=function(t){var e=y.find(function(e){var i=w.get(e);if(i)return i.slice(0,t).every(function(t){return t})});if(e)return S=e,"break"},j=p?3:1;j>0;j--){if("break"===R(j))break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Ve,He,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=Ne(e,{elementContext:"reference"}),a=Ne(e,{altBoundary:!0}),l=$e(r,n),c=$e(a,s,o),h=Ue(l),d=Ue(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}}]}),Ye="tippy-content",Xe="tippy-backdrop",Je="tippy-arrow",Ge="tippy-svg-arrow",Ke={passive:!0,capture:!0},Qe=function(){return document.body};function Ze(t,e,i){if(Array.isArray(t)){var n=t[e];return n??(Array.isArray(i)?i[e]:i)}return t}function ti(t,e){var i={}.toString.call(t);return 0===i.indexOf("[object")&&i.indexOf(e+"]")>-1}function ei(t,e){return"function"==typeof t?t.apply(void 0,e):t}function ii(t,e){return 0===e?t:function(n){clearTimeout(i),i=setTimeout(function(){t(n)},e)};var i}function ni(t){return[].concat(t)}function si(t,e){-1===t.indexOf(e)&&t.push(e)}function oi(t){return t.split("-")[0]}function ri(t){return[].slice.call(t)}function ai(t){return Object.keys(t).reduce(function(e,i){return void 0!==t[i]&&(e[i]=t[i]),e},{})}function li(){return document.createElement("div")}function ci(t){return["Element","Fragment"].some(function(e){return ti(t,e)})}function hi(t){return ti(t,"MouseEvent")}function di(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function ui(t){return ci(t)?[t]:function(t){return ti(t,"NodeList")}(t)?ri(t):Array.isArray(t)?t:ri(document.querySelectorAll(t))}function fi(t,e){t.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function pi(t,e){t.forEach(function(t){t&&t.setAttribute("data-state",e)})}function gi(t){var e,i=ni(t)[0];return null!=i&&null!=(e=i.ownerDocument)&&e.body?i.ownerDocument:document}function mi(t,e,i){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(e){t[n](e,i)})}function bi(t,e){for(var i=e;i;){var n;if(t.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var vi={isTouch:!1},yi=0;function xi(){vi.isTouch||(vi.isTouch=!0,window.performance&&document.addEventListener("mousemove",_i))}function _i(){var t=performance.now();t-yi<20&&(vi.isTouch=!1,document.removeEventListener("mousemove",_i)),yi=t}function wi(){var t=document.activeElement;if(di(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}var ki=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Si={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Mi=Object.assign({appendTo:Qe,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Si,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Oi=Object.keys(Mi);function Ei(t){var e=(t.plugins||[]).reduce(function(e,i){var n,s=i.name,o=i.defaultValue;s&&(e[s]=void 0!==t[s]?t[s]:null!=(n=Mi[s])?n:o);return e},{});return Object.assign({},t,e)}function Ai(t,e){var i=Object.assign({},e,{content:ei(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(Ei(Object.assign({},Mi,{plugins:e}))):Oi).reduce(function(e,i){var n=(t.getAttribute("data-tippy-"+i)||"").trim();if(!n)return e;if("content"===i)e[i]=n;else try{e[i]=JSON.parse(n)}catch(t){e[i]=n}return e},{})}(t,e.plugins));return i.aria=Object.assign({},Mi.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?e.interactive:i.aria.expanded,content:"auto"===i.aria.content?e.interactive?null:"describedby":i.aria.content},i}function Ti(t,e){t.innerHTML=e}function Ci(t){var e=li();return!0===t?e.className=Je:(e.className=Ge,ci(t)?e.appendChild(t):Ti(e,t)),e}function Pi(t,e){ci(e.content)?(Ti(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ti(t,e.content):t.textContent=e.content)}function Li(t){var e=t.firstElementChild,i=ri(e.children);return{box:e,content:i.find(function(t){return t.classList.contains(Ye)}),arrow:i.find(function(t){return t.classList.contains(Je)||t.classList.contains(Ge)}),backdrop:i.find(function(t){return t.classList.contains(Xe)})}}function Di(t){var e=li(),i=li();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=li();function s(i,n){var s=Li(e),o=s.box,r=s.content,a=s.arrow;n.theme?o.setAttribute("data-theme",n.theme):o.removeAttribute("data-theme"),"string"==typeof n.animation?o.setAttribute("data-animation",n.animation):o.removeAttribute("data-animation"),n.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?o.setAttribute("role",n.role):o.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||Pi(r,t.props),n.arrow?a?i.arrow!==n.arrow&&(o.removeChild(a),o.appendChild(Ci(n.arrow))):o.appendChild(Ci(n.arrow)):a&&o.removeChild(a)}return n.className=Ye,n.setAttribute("data-state","hidden"),Pi(n,t.props),e.appendChild(i),i.appendChild(n),s(t.props,t.props),{popper:e,onUpdate:s}}Di.$$tippy=!0;var Ii=1,Ri=[],ji=[];function Fi(t,e){var i,n,s,o,r,a,l,c,h=Ai(t,Object.assign({},Mi,Ei(ai(e)))),d=!1,u=!1,f=!1,p=!1,g=[],m=ii(Y,h.interactiveDebounce),b=Ii++,v=(c=h.plugins).filter(function(t,e){return c.indexOf(t)===e}),y={id:b,reference:t,popper:li(),popperInstance:null,props:h,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(s)},setProps:function(e){0;if(y.state.isDestroyed)return;D("onBeforeUpdate",[y,e]),U();var i=y.props,n=Ai(t,Object.assign({},i,ai(e),{ignoreAttributes:!0}));y.props=n,$(),i.interactiveDebounce!==n.interactiveDebounce&&(j(),m=ii(Y,n.interactiveDebounce));i.triggerTarget&&!n.triggerTarget?ni(i.triggerTarget).forEach(function(t){t.removeAttribute("aria-expanded")}):n.triggerTarget&&t.removeAttribute("aria-expanded");R(),L(),w&&w(i,n);y.popperInstance&&(K(),Z().forEach(function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}));D("onAfterUpdate",[y,e])},setContent:function(t){y.setProps({content:t})},show:function(){0;var t=y.state.isVisible,e=y.state.isDestroyed,i=!y.state.isEnabled,n=vi.isTouch&&!y.props.touch,s=Ze(y.props.duration,0,Mi.duration);if(t||e||i||n)return;if(A().hasAttribute("disabled"))return;if(D("onShow",[y],!1),!1===y.props.onShow(y))return;y.state.isVisible=!0,E()&&(_.style.visibility="visible");L(),N(),y.state.isMounted||(_.style.transition="none");if(E()){var o=C();fi([o.box,o.content],0)}a=function(){var t;if(y.state.isVisible&&!p){if(p=!0,_.offsetHeight,_.style.transition=y.props.moveTransition,E()&&y.props.animation){var e=C(),i=e.box,n=e.content;fi([i,n],s),pi([i,n],"visible")}I(),R(),si(ji,y),null==(t=y.popperInstance)||t.forceUpdate(),D("onMount",[y]),y.props.animation&&E()&&function(t,e){V(t,e)}(s,function(){y.state.isShown=!0,D("onShown",[y])})}},function(){var t,e=y.props.appendTo,i=A();t=y.props.interactive&&e===Qe||"parent"===e?i.parentNode:ei(e,[i]);t.contains(_)||t.appendChild(_);y.state.isMounted=!0,K(),!1}()},hide:function(){0;var t=!y.state.isVisible,e=y.state.isDestroyed,i=!y.state.isEnabled,n=Ze(y.props.duration,1,Mi.duration);if(t||e||i)return;if(D("onHide",[y],!1),!1===y.props.onHide(y))return;y.state.isVisible=!1,y.state.isShown=!1,p=!1,d=!1,E()&&(_.style.visibility="hidden");if(j(),W(),L(!0),E()){var s=C(),o=s.box,r=s.content;y.props.animation&&(fi([o,r],n),pi([o,r],"hidden"))}I(),R(),y.props.animation?E()&&function(t,e){V(t,function(){!y.state.isVisible&&_.parentNode&&_.parentNode.contains(_)&&e()})}(n,y.unmount):y.unmount()},hideWithInteractivity:function(t){0;T().addEventListener("mousemove",m),si(Ri,m),m(t)},enable:function(){y.state.isEnabled=!0},disable:function(){y.hide(),y.state.isEnabled=!1},unmount:function(){0;y.state.isVisible&&y.hide();if(!y.state.isMounted)return;Q(),Z().forEach(function(t){t._tippy.unmount()}),_.parentNode&&_.parentNode.removeChild(_);ji=ji.filter(function(t){return t!==y}),y.state.isMounted=!1,D("onHidden",[y])},destroy:function(){0;if(y.state.isDestroyed)return;y.clearDelayTimeouts(),y.unmount(),U(),delete t._tippy,y.state.isDestroyed=!0,D("onDestroy",[y])}};if(!h.render)return y;var x=h.render(y),_=x.popper,w=x.onUpdate;_.setAttribute("data-tippy-root",""),_.id="tippy-"+y.id,y.popper=_,t._tippy=y,_._tippy=y;var k=v.map(function(t){return t.fn(y)}),S=t.hasAttribute("aria-expanded");return $(),R(),L(),D("onCreate",[y]),h.showOnCreate&&tt(),_.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),_.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&T().addEventListener("mousemove",m)}),y;function M(){var t=y.props.touch;return Array.isArray(t)?t:[t,0]}function O(){return"hold"===M()[0]}function E(){var t;return!(null==(t=y.props.render)||!t.$$tippy)}function A(){return l||t}function T(){var t=A().parentNode;return t?gi(t):document}function C(){return Li(_)}function P(t){return y.state.isMounted&&!y.state.isVisible||vi.isTouch||o&&"focus"===o.type?0:Ze(y.props.delay,t?0:1,Mi.delay)}function L(t){void 0===t&&(t=!1),_.style.pointerEvents=y.props.interactive&&!t?"":"none",_.style.zIndex=""+y.props.zIndex}function D(t,e,i){var n;(void 0===i&&(i=!0),k.forEach(function(i){i[t]&&i[t].apply(i,e)}),i)&&(n=y.props)[t].apply(n,e)}function I(){var e=y.props.aria;if(e.content){var i="aria-"+e.content,n=_.id;ni(y.props.triggerTarget||t).forEach(function(t){var e=t.getAttribute(i);if(y.state.isVisible)t.setAttribute(i,e?e+" "+n:n);else{var s=e&&e.replace(n,"").trim();s?t.setAttribute(i,s):t.removeAttribute(i)}})}}function R(){!S&&y.props.aria.expanded&&ni(y.props.triggerTarget||t).forEach(function(t){y.props.interactive?t.setAttribute("aria-expanded",y.state.isVisible&&t===A()?"true":"false"):t.removeAttribute("aria-expanded")})}function j(){T().removeEventListener("mousemove",m),Ri=Ri.filter(function(t){return t!==m})}function F(e){if(!vi.isTouch||!f&&"mousedown"!==e.type){var i=e.composedPath&&e.composedPath()[0]||e.target;if(!y.props.interactive||!bi(_,i)){if(ni(y.props.triggerTarget||t).some(function(t){return bi(t,i)})){if(vi.isTouch)return;if(y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else D("onClickOutside",[y,e]);!0===y.props.hideOnClick&&(y.clearDelayTimeouts(),y.hide(),u=!0,setTimeout(function(){u=!1}),y.state.isMounted||W())}}}function z(){f=!0}function B(){f=!1}function N(){var t=T();t.addEventListener("mousedown",F,!0),t.addEventListener("touchend",F,Ke),t.addEventListener("touchstart",B,Ke),t.addEventListener("touchmove",z,Ke)}function W(){var t=T();t.removeEventListener("mousedown",F,!0),t.removeEventListener("touchend",F,Ke),t.removeEventListener("touchstart",B,Ke),t.removeEventListener("touchmove",z,Ke)}function V(t,e){var i=C().box;function n(t){t.target===i&&(mi(i,"remove",n),e())}if(0===t)return e();mi(i,"remove",r),mi(i,"add",n),r=n}function H(e,i,n){void 0===n&&(n=!1),ni(y.props.triggerTarget||t).forEach(function(t){t.addEventListener(e,i,n),g.push({node:t,eventType:e,handler:i,options:n})})}function $(){var t;O()&&(H("touchstart",q,{passive:!0}),H("touchend",X,{passive:!0})),(t=y.props.trigger,t.split(/\s+/).filter(Boolean)).forEach(function(t){if("manual"!==t)switch(H(t,q),t){case"mouseenter":H("mouseleave",X);break;case"focus":H(ki?"focusout":"blur",J);break;case"focusin":H("focusout",J)}})}function U(){g.forEach(function(t){var e=t.node,i=t.eventType,n=t.handler,s=t.options;e.removeEventListener(i,n,s)}),g=[]}function q(t){var e,i=!1;if(y.state.isEnabled&&!G(t)&&!u){var n="focus"===(null==(e=o)?void 0:e.type);o=t,l=t.currentTarget,R(),!y.state.isVisible&&hi(t)&&Ri.forEach(function(e){return e(t)}),"click"===t.type&&(y.props.trigger.indexOf("mouseenter")<0||d)&&!1!==y.props.hideOnClick&&y.state.isVisible?i=!0:tt(t),"click"===t.type&&(d=!i),i&&!n&&et(t)}}function Y(t){var e=t.target,i=A().contains(e)||_.contains(e);if("mousemove"!==t.type||!i){var n=Z().concat(_).map(function(t){var e,i=null==(e=t._tippy.popperInstance)?void 0:e.state;return i?{popperRect:t.getBoundingClientRect(),popperState:i,props:h}:null}).filter(Boolean);(function(t,e){var i=e.clientX,n=e.clientY;return t.every(function(t){var e=t.popperRect,s=t.popperState,o=t.props.interactiveBorder,r=oi(s.placement),a=s.modifiersData.offset;if(!a)return!0;var l="bottom"===r?a.top.y:0,c="top"===r?a.bottom.y:0,h="right"===r?a.left.x:0,d="left"===r?a.right.x:0,u=e.top-n+l>o,f=n-e.bottom-c>o,p=e.left-i+h>o,g=i-e.right-d>o;return u||f||p||g})})(n,t)&&(j(),et(t))}}function X(t){G(t)||y.props.trigger.indexOf("click")>=0&&d||(y.props.interactive?y.hideWithInteractivity(t):et(t))}function J(t){y.props.trigger.indexOf("focusin")<0&&t.target!==A()||y.props.interactive&&t.relatedTarget&&_.contains(t.relatedTarget)||et(t)}function G(t){return!!vi.isTouch&&O()!==t.type.indexOf("touch")>=0}function K(){Q();var e=y.props,i=e.popperOptions,n=e.placement,s=e.offset,o=e.getReferenceClientRect,r=e.moveTransition,l=E()?Li(_).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||A()}:t,h={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(E()){var i=C().box;["placement","reference-hidden","escaped"].forEach(function(t){"placement"===t?i.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?i.setAttribute("data-"+t,""):i.removeAttribute("data-"+t)}),e.attributes.popper={}}}},d=[{name:"offset",options:{offset:s}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!r}},h];E()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==i?void 0:i.modifiers)||[]),y.popperInstance=qe(c,_,Object.assign({},i,{placement:n,onFirstUpdate:a,modifiers:d}))}function Q(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function Z(){return ri(_.querySelectorAll("[data-tippy-root]"))}function tt(t){y.clearDelayTimeouts(),t&&D("onTrigger",[y,t]),N();var e=P(!0),n=M(),s=n[0],o=n[1];vi.isTouch&&"hold"===s&&o&&(e=o),e?i=setTimeout(function(){y.show()},e):y.show()}function et(t){if(y.clearDelayTimeouts(),D("onUntrigger",[y,t]),y.state.isVisible){if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&d)){var e=P(!1);e?n=setTimeout(function(){y.state.isVisible&&y.hide()},e):s=requestAnimationFrame(function(){y.hide()})}}else W()}}function zi(t,e){void 0===e&&(e={});var i=Mi.plugins.concat(e.plugins||[]);document.addEventListener("touchstart",xi,Ke),window.addEventListener("blur",wi);var n=Object.assign({},e,{plugins:i}),s=ui(t).reduce(function(t,e){var i=e&&Fi(e,n);return i&&t.push(i),t},[]);return ci(t)?s[0]:s}zi.defaultProps=Mi,zi.setDefaultProps=function(t){Object.keys(t).forEach(function(e){Mi[e]=t[e]})},zi.currentInput=vi;Object.assign({},Ae,{effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow)}});zi.setDefaultProps({render:Di});const Bi=zi;var Ni=i(951),Wi=i.n(Ni);const Vi={controlled:null,bind(t){this.controlled=t,this.controlled.forEach(t=>{this._main(t)}),this._init()},_init(){this.controlled.forEach(t=>{this._checkUp(t)})},_main(t){const e=JSON.parse(t.dataset.main);t.dataset.size&&(t.filesize=parseInt(t.dataset.size,10)),t.mains=e.map(e=>{const i=document.getElementById(e),n=document.getElementById(e+"_size_wrapper");return n&&(i.filesize=0,i.sizespan=n),this._addChild(i,t),i}),this._bindEvents(t),t.mains.forEach(t=>{this._bindEvents(t)})},_bindEvents(t){t.eventBound||(t.addEventListener("click",e=>{const i=e.target;i.elements&&(this._checkDown(i),this._evaluateSize(i)),i.mains&&this._checkUp(t)}),t.eventBound=!0)},_addChild(t,e){const i=t.elements?t.elements:[];-1===i.indexOf(e)&&(i.push(e),t.elements=i)},_removeChild(t,e){const i=t.elements.indexOf(e);-1{e.checked!==t.checked&&(e.checked=t.checked,e.disabled&&(e.checked=!1),e.dispatchEvent(new Event("change")))}),t.elements.forEach(e=>{this._checkDown(e),e.elements||this._checkUp(e,t)}))},_checkUp(t,e){t.mains&&[...t.mains].forEach(t=>{t!==e&&this._evaluateCheckStatus(t),this._checkUp(t),this._evaluateSize(t)})},_evaluateCheckStatus(t){let e=0,i=t.classList.contains("partial");i&&(t.classList.remove("partial"),i=!1),t.elements.forEach(n=>{null!==n.parentNode?(e+=n.checked,n.classList.contains("partial")&&(i=!0)):this._removeChild(t,n)});let n="some";e===t.elements.length?n="on":0===e?n="off":i=!0,i&&t.classList.add("partial");const s="off"!==n;t.checked===s&&t.value===n||(t.value=n,t.checked=s,t.dispatchEvent(new Event("change")))},_evaluateSize(t){if(t.sizespan&&t.elements){t.filesize=0,t.elements.forEach(e=>{e.checked&&(t.filesize+=e.filesize)});let e=null;0Math.max(Math.min(t,i),e);function Xi(t){return Yi(qi(2.55*t),0,255)}function Ji(t){return Yi(qi(255*t),0,255)}function Gi(t){return Yi(qi(t/2.55)/100,0,1)}function Ki(t){return Yi(qi(100*t),0,100)}const Qi={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Zi=[..."0123456789ABCDEF"],tn=t=>Zi[15&t],en=t=>Zi[(240&t)>>4]+Zi[15&t],nn=t=>(240&t)>>4==(15&t);function sn(t){var e=(t=>nn(t.r)&&nn(t.g)&&nn(t.b)&&nn(t.a))(t)?tn:en;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const on=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function rn(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function an(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function ln(t,e,i){const n=rn(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function cn(t){const e=t.r/255,i=t.g/255,n=t.b/255,s=Math.max(e,i,n),o=Math.min(e,i,n),r=(s+o)/2;let a,l,c;return s!==o&&(c=s-o,l=r>.5?c/(2-s-o):c/(s+o),a=function(t,e,i,n,s){return t===s?(e-i)/n+(e>16&255,o>>8&255,255&o]}return t}(),mn.transparent=[0,0,0,0]);const e=mn[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const vn=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const yn=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,xn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function _n(t,e,i){if(t){let n=cn(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=dn(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function wn(t,e){return t?Object.assign(e||{},t):t}function kn(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Ji(t[3]))):(e=wn(t,{r:0,g:0,b:0,a:1})).a=Ji(e.a),e}function Sn(t){return"r"===t.charAt(0)?function(t){const e=vn.exec(t);let i,n,s,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?Xi(t):Yi(255*t,0,255)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?Xi(i):Yi(i,0,255)),n=255&(e[4]?Xi(n):Yi(n,0,255)),s=255&(e[6]?Xi(s):Yi(s,0,255)),{r:i,g:n,b:s,a:o}}}(t):fn(t)}class Mn{constructor(t){if(t instanceof Mn)return t;const e=typeof t;let i;var n,s,o;"object"===e?i=kn(t):"string"===e&&(o=(n=t).length,"#"===n[0]&&(4===o||5===o?s={r:255&17*Qi[n[1]],g:255&17*Qi[n[2]],b:255&17*Qi[n[3]],a:5===o?17*Qi[n[4]]:255}:7!==o&&9!==o||(s={r:Qi[n[1]]<<4|Qi[n[2]],g:Qi[n[3]]<<4|Qi[n[4]],b:Qi[n[5]]<<4|Qi[n[6]],a:9===o?Qi[n[7]]<<4|Qi[n[8]]:255})),i=s||bn(t)||Sn(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=wn(this._rgb);return t&&(t.a=Gi(t.a)),t}set rgb(t){this._rgb=kn(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Gi(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?sn(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=cn(t),i=e[0],n=Ki(e[1]),s=Ki(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${Gi(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let s;const o=e===s?.5:e,r=2*o-1,a=i.a-n.a,l=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-l,i.r=255&l*i.r+s*n.r+.5,i.g=255&l*i.g+s*n.g+.5,i.b=255&l*i.b+s*n.b+.5,i.a=o*i.a+(1-o)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const n=xn(Gi(t.r)),s=xn(Gi(t.g)),o=xn(Gi(t.b));return{r:Ji(yn(n+i*(xn(Gi(e.r))-n))),g:Ji(yn(s+i*(xn(Gi(e.g))-s))),b:Ji(yn(o+i*(xn(Gi(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Mn(this.rgb)}alpha(t){return this._rgb.a=Ji(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=qi(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return _n(this._rgb,2,t),this}darken(t){return _n(this._rgb,2,-t),this}saturate(t){return _n(this._rgb,1,t),this}desaturate(t){return _n(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=cn(t);i[0]=un(i[0]+e),i=dn(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function On(){}const En=(()=>{let t=0;return()=>t++})();function An(t){return null==t}function Tn(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function Cn(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function Pn(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function Ln(t,e){return Pn(t)?t:e}function Dn(t,e){return void 0===t?e:t}const In=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Rn(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function jn(t,e,i,n){let s,o,r;if(Tn(t))if(o=t.length,n)for(s=o-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;st,x:t=>t.x,y:t=>t.y};function Un(t,e){const i=$n[e]||($n[e]=function(t){const e=function(t){const e=t.split("."),i=[];let n="";for(const t of e)n+=t,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function qn(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Yn=t=>void 0!==t,Xn=t=>"function"==typeof t,Jn=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};const Gn=Math.PI,Kn=2*Gn,Qn=Kn+Gn,Zn=Number.POSITIVE_INFINITY,ts=Gn/180,es=Gn/2,is=Gn/4,ns=2*Gn/3,ss=Math.log10,os=Math.sign;function rs(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function xs(t,e,i){i=i||(i=>t[i]1;)n=o+s>>1,i(n)?o=n:s=n;return{lo:o,hi:s}}const _s=(t,e,i,n)=>xs(t,i,n?n=>{const s=t[n][e];return st[n][e]xs(t,i,n=>t[n][e]>=i);const ks=["push","pop","shift","splice","unshift"];function Ss(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(ks.forEach(e=>{delete t[e]}),delete t._chartjs)}function Ms(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Os="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Es(t,e){let i=[],n=!1;return function(...s){i=s,n||(n=!0,Os.call(window,()=>{n=!1,t.apply(e,i)}))}}const As=t=>"start"===t?"left":"end"===t?"right":"center",Ts=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function Cs(t,e,i){const n=e.length;let s=0,o=n;if(t._sorted){const{iScale:r,vScale:a,_parsed:l}=t,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,h=r.axis,{min:d,max:u,minDefined:f,maxDefined:p}=r.getUserBounds();if(f){if(s=Math.min(_s(l,h,d).lo,i?n:_s(e,h,r.getPixelForValue(d)).lo),c){const t=l.slice(0,s+1).reverse().findIndex(t=>!An(t[a.axis]));s-=Math.max(0,t)}s=vs(s,0,n-1)}if(p){let t=Math.max(_s(l,r.axis,u,!0).hi+1,i?0:_s(e,h,r.getPixelForValue(u),!0).hi+1);if(c){const e=l.slice(t-1).findIndex(t=>!An(t[a.axis]));t+=Math.max(0,e)}o=vs(t,s,n)-s}else o=n-s}return{start:s,count:o}}function Ps(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const o=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),o}const Ls=t=>0===t||1===t,Ds=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*Kn/i),Is=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*Kn/i)+1,Rs={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*es),easeOutSine:t=>Math.sin(t*es),easeInOutSine:t=>-.5*(Math.cos(Gn*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Ls(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Ls(t)?t:Ds(t,.075,.3),easeOutElastic:t=>Ls(t)?t:Is(t,.075,.3),easeInOutElastic(t){const e=.1125;return Ls(t)?t:t<.5?.5*Ds(2*t,e,.45):.5+.5*Is(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Rs.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*Rs.easeInBounce(2*t):.5*Rs.easeOutBounce(2*t-1)+.5};function js(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Fs(t){return js(t)?t:new Mn(t)}function zs(t){return js(t)?t:new Mn(t).saturate(.5).darken(.1).hexString()}const Bs=["x","y","borderWidth","radius","tension"],Ns=["color","borderColor","backgroundColor"];const Ws=new Map;function Vs(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=Ws.get(i);return n||(n=new Intl.NumberFormat(t,e),Ws.set(i,n)),n}(e,i).format(t)}const Hs={values:t=>Tn(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let s,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(s="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const r=ss(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Vs(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(ss(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?Hs.numeric.call(this,t,e,i):""}};var $s={formatters:Hs};const Us=Object.create(null),qs=Object.create(null);function Ys(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>zs(e.backgroundColor),this.hoverBorderColor=(t,e)=>zs(e.borderColor),this.hoverColor=(t,e)=>zs(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Xs(this,t,e)}get(t){return Ys(this,t)}describe(t,e){return Xs(qs,t,e)}override(t,e){return Xs(Us,t,e)}route(t,e,i,n){const s=Ys(this,t),o=Ys(this,i),r="_"+e;Object.defineProperties(s,{[r]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=o[n];return Cn(t)?Object.assign({},e,t):Dn(t,e)},set(t){this[r]=t}}})}apply(t){t.forEach(t=>t(this))}}var Gs=new Js({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Ns},numbers:{type:"number",properties:Bs}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:$s.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function Ks(t,e,i,n,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,i.push(s)),o>n&&(n=o),n}function Qs(t,e,i,n){let s=(n=n||{}).data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},o=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const a=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function no(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==o.strokeColor;let l,c;for(t.save(),t.font=s.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),An(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l+t||0;function bo(t,e){const i={},n=Cn(e),s=n?Object.keys(e):e,o=Cn(t)?n?i=>Dn(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of s)i[t]=mo(o(t));return i}function vo(t){return bo(t,{top:"y",right:"x",bottom:"y",left:"x"})}function yo(t){return bo(t,["topLeft","topRight","bottomLeft","bottomRight"])}function xo(t){const e=vo(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function _o(t,e){t=t||{},e=e||Gs.font;let i=Dn(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=Dn(t.style,e.style);n&&!(""+n).match(po)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:Dn(t.family,e.family),lineHeight:go(Dn(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:Dn(t.weight,e.weight),string:""};return s.string=function(t){return!t||An(t.size)||An(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(s),s}function wo(t,e,i,n){let s,o,r,a=!0;for(s=0,o=t.length;st[0]){const o=i||t;void 0===n&&(n=Ro("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:n,_getTarget:s,override:i=>So([i,...t],e,o,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>To(i,n,()=>function(t,e,i,n){let s;for(const o of e)if(s=Ro(Eo(o,t),i),void 0!==s)return Ao(t,s)?Do(i,n,t,s):s}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>jo(t).includes(e),ownKeys:t=>jo(t),set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function Mo(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Oo(t,n),setContext:e=>Mo(t,e,i,n),override:s=>Mo(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>To(t,e,()=>function(t,e,i){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=t;let a=n[e];Xn(a)&&r.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(o,r||n);a.delete(t),Ao(t,l)&&(l=Do(s._scopes,s,t,l));return l}(e,a,t,i));Tn(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=i;if(void 0!==o.index&&n(t))return e[o.index%e.length];if(Cn(e[0])){const i=e,n=s._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=Do(n,s,t,l);e.push(Mo(i,o,r&&r[t],a))}}return e}(e,a,t,r.isIndexable));Ao(e,a)&&(a=Mo(a,s,o&&o[e],r));return a}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function Oo(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:Xn(i)?i:()=>i,isIndexable:Xn(n)?n:()=>n}}const Eo=(t,e)=>t?t+qn(e):e,Ao=(t,e)=>Cn(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function To(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const n=i();return t[e]=n,n}function Co(t,e,i){return Xn(t)?t(e,i):t}const Po=(t,e)=>!0===t?e:"string"==typeof t?Un(e,t):void 0;function Lo(t,e,i,n,s){for(const o of e){const e=Po(i,o);if(e){t.add(e);const o=Co(e._fallback,i,s);if(void 0!==o&&o!==i&&o!==n)return o}else if(!1===e&&void 0!==n&&i!==n)return null}return!1}function Do(t,e,i,n){const s=e._rootScopes,o=Co(e._fallback,i,n),r=[...t,...s],a=new Set;a.add(n);let l=Io(a,r,i,o||i,n);return null!==l&&((void 0===o||o===i||(l=Io(a,r,o,l,n),null!==l))&&So(Array.from(a),[""],s,o,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];if(Tn(s)&&Cn(i))return i;return s||{}}(e,i,n)))}function Io(t,e,i,n,s){for(;i;)i=Lo(t,e,i,n,s);return i}function Ro(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function jo(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function Fo(t,e,i,n){const{iScale:s}=t,{key:o="r"}=this._parsing,r=new Array(n);let a,l,c,h;for(a=0,l=n;ae"x"===t?"y":"x";function Wo(t,e,i,n){const s=t.skip?e:t,o=e,r=i.skip?e:i,a=ps(o,s),l=ps(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function Vo(t,e="x"){const i=No(e),n=t.length,s=Array(n).fill(0),o=Array(n);let r,a,l,c=Bo(t,0);for(r=0;r!t.skip)),"monotone"===e.cubicInterpolationMode)Vo(t,s);else{let i=n?t[t.length-1]:t[0];for(o=0,r=t.length;ot.ownerDocument.defaultView.getComputedStyle(t,null);const Jo=["top","right","bottom","left"];function Go(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const o=Jo[s];n[o]=parseFloat(t[e+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function Ko(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,s=Xo(i),o="border-box"===s.boxSizing,r=Go(s,"padding"),a=Go(s,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:s,offsetY:o}=n;let r,a,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,o,t.target))r=s,a=o;else{const t=e.getBoundingClientRect();r=n.clientX-t.left,a=n.clientY-t.top,l=!0}return{x:r,y:a,box:l}}(t,i),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:p}=e;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/p*i.height/n)}}const Qo=t=>Math.round(10*t)/10;function Zo(t,e,i,n){const s=Xo(t),o=Go(s,"margin"),r=Yo(s.maxWidth,t,"clientWidth")||Zn,a=Yo(s.maxHeight,t,"clientHeight")||Zn,l=function(t,e,i){let n,s;if(void 0===e||void 0===i){const o=t&&qo(t);if(o){const t=o.getBoundingClientRect(),r=Xo(o),a=Go(r,"border","width"),l=Go(r,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=Yo(r.maxWidth,o,"clientWidth"),s=Yo(r.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||Zn,maxHeight:s||Zn}}(t,e,i);let{width:c,height:h}=l;if("content-box"===s.boxSizing){const t=Go(s,"border","width"),e=Go(s,"padding");c-=e.width+t.width,h-=e.height+t.height}c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=Qo(Math.min(c,r,l.maxWidth)),h=Qo(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Qo(c/2));return(void 0!==e||void 0!==i)&&n&&l.height&&h>l.height&&(h=l.height,c=Qo(Math.floor(h*n))),{width:c,height:h}}function tr(t,e,i){const n=e||1,s=Qo(t.height*n),o=Qo(t.width*n);t.height=Qo(t.height),t.width=Qo(t.width);const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||r.height!==s||r.width!==o)&&(t.currentDevicePixelRatio=n,r.height=s,r.width=o,t.ctx.setTransform(n,0,0,n,0,0),!0)}const er=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Uo()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function ir(t,e){const i=function(t,e){return Xo(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function nr(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function sr(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function or(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},r=nr(t,s,i),a=nr(s,o,i),l=nr(o,e,i),c=nr(r,a,i),h=nr(a,l,i);return nr(c,h,i)}function rr(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function ar(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function lr(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function cr(t){return"angle"===t?{between:bs,compare:gs,normalize:ms}:{between:ys,compare:(t,e)=>t-e,normalize:t=>t}}function hr({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:s}}function dr(t,e,i){if(!i)return[t];const{property:n,start:s,end:o}=i,r=e.length,{compare:a,between:l,normalize:c}=cr(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:s,end:o}=i,{between:r,normalize:a}=cr(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cv||l(s,b,g)&&0!==a(s,b),_=()=>!v||0===a(o,g)||l(o,b,g);for(let t=h,i=h;t<=d;++t)m=e[t%r],m.skip||(g=c(m[n]),g!==b&&(v=l(g,s,o),null===y&&x()&&(y=0===a(g,s)?t:i),null!==y&&_()&&(p.push(hr({start:y,end:t,loop:u,count:r,style:f})),y=null),i=t,b=g));return null!==y&&p.push(hr({start:y,end:d,loop:u,count:r,style:f})),p}function ur(t,e){const i=[],n=t.segments;for(let s=0;sn({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Os.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let o,r=s.length-1,a=!1;for(;r>=0;--r)o=s[r],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),a=!0):(s[r]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var yr=new vr;const xr="transparent",_r={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Fs(t||xr),s=n.valid&&Fs(e||xr);return s&&s.valid?s.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class wr{constructor(t,e,i,n){const s=e[i];n=wo([t.to,n,s,t.from]);const o=wo([t.from,s,n]);this._active=!0,this._fn=t.fn||_r[t.type||typeof o],this._easing=Rs[t.easing]||Rs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=wo([t.to,e,n,t.from]),this._from=wo([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||e1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,r,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t{const s=t[n];if(!Cn(s))return;const o={};for(const t of e)o[t]=s[t];(Tn(s.properties)&&s.properties||[n]).forEach(t=>{t!==n&&i.has(t)||i.set(t,o)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),o=Object.keys(e),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const l=o[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=s[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,r);continue}h.cancel()}d&&d.duration?(s[l]=h=new wr(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(yr.add(this._chart,i),!0):void 0}}function Sr(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:n?o:s,end:n?s:o}}function Mr(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=n.length;s0||!i&&e<0)return s.index}return null}function Cr(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,r,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Lr(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i],void 0!==e[n]._visualValues&&void 0!==e[n]._visualValues[i]&&delete e[n]._visualValues[i]}}}const Dr=t=>"reset"===t||"none"===t,Ir=(t,e)=>e?t:Object.assign({},t);class Rr{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Er(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Lr(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=e.xAxisID=Dn(i.xAxisID,Pr(t,"x")),o=e.yAxisID=Dn(i.yAxisID,Pr(t,"y")),r=e.rAxisID=Dn(i.rAxisID,Pr(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,s,o,r),c=e.vAxisID=n(a,o,s,r);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ss(this._data,this),t._stacked&&Lr(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Cn(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:n}=e,s="x"===i.axis?"x":"y",o="x"===n.axis?"x":"y",r=Object.keys(t),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l{const e="_onData"+qn(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const s=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),s}})}))),this._syncList=[],this._data=e}var n,s}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=Er(e.vScale,e),e.stack!==i.stack&&(n=!0,Lr(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&(Cr(this,e._parsed),e._stacked=Er(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=Tn(n[t])?this.parseArrayData(i,n,t,e):Cn(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const s=()=>null===l[r]||d&&l[r]t&&!e.hidden&&e._stacked&&{keys:Mr(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}(r);let d,u;function f(){u=n[d];const e=u[r.axis];return!Pn(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,s,o;for(n=0,s=e.length;n=0&&tthis.getContext(i,n,e),h);return f.$shared&&(f.$shared=a,s[o]=Object.freeze(Ir(f,a))),f}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,o=`animation-${e}`,r=s[o];if(r)return r;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),o=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(o,this.getContext(t,i,e))}const l=new kr(n,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Dr(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(e,s)||s!==n;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:o}}updateElement(t,e,i,n){Dr(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Dr(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,s=e.length,o=Math.min(s,n);o&&this.parse(0,o),s>n?this._insertElements(n,s-n,t):s{for(t.length+=e,r=t.length-1;r>=o;r--)t[r]=t[r-e]};for(a(s),r=t;rt-e))}return t._cache.$bar}(e,t.type);let n,s,o,r,a=e._length;const l=()=>{32767!==o&&-32768!==o&&(Yn(r)&&(a=Math.min(a,Math.abs(o-r)||a)),r=o)};for(n=0,s=i.length;nMath.abs(a)&&(l=a,c=r),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function zr(t,e,i,n){const s=t.iScale,o=t.vScale,r=s.getLabels(),a=s===o,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:n,color:s,useBorderRadius:o,borderRadius:r}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((e,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:e,fillStyle:l.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(a),lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:l.borderWidth,strokeStyle:l.borderColor,textAlign:n,pointStyle:i,borderRadius:o&&(r||l.borderRadius),index:a}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let s,o,r=t=>+i[t];if(Cn(i[t])){const{key:t="value"}=this._parsing;r=e=>+Un(i[e],t)}for(s=t,o=t+e;sbs(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>bs(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),g=f(0,c,d),m=f(es,h,u),b=p(Gn,c,d),v=p(Gn+es,h,u);n=(g-b)/2,s=(m-v)/2,o=-(g+b)/2,r=-(m+v)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}(u,d,a),b=(i.width-o)/f,v=(i.height-o)/p,y=Math.max(Math.min(b,v)/2,0),x=In(this.options.radius,y),_=(x-Math.max(x*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=m*x,n.total=this.calculateTotal(),this.outerRadius=x-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*h,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*s/Kn)}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,r=o.chartArea,a=o.options.animation,l=(r.left+r.right)/2,c=(r.top+r.bottom)/2,h=s&&a.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,{sharedOptions:f,includeOptions:p}=this._getSharedOptions(e,n);let g,m=this._getRotation();for(g=0;g0&&!isNaN(t)?Kn*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=Vs(e._parsed[t],i.options.locale);return{label:n[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,o,r,a;if(!t)for(n=0,s=i.data.datasets.length;n{const o=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:n,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=Vs(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:s}}parseObjectData(t,e,i,n){return Fo.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{const n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(ne.max&&(e.max=n))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),o=(s-Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=s-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,r=o.options.animation,a=this._cachedMeta.rScale,l=a.xCenter,c=a.yCenter,h=a.getIndexAngle(0)-.5*Gn;let d,u=h;const f=360/this.countVisibleElements();for(d=0;d{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?hs(this.resolveDataElementOptions(t,e).angle||i):0}}var qr=Object.freeze({__proto__:null,BarController:class extends Rr{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,n){return zr(t,e,i,n)}parseArrayData(t,e,i,n){return zr(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:s,vScale:o}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,l="x"===s.axis?r:a,c="x"===o.axis?r:a,h=[];let d,u,f,p;for(d=i,u=i+n;dt.controller.options.grouped),s=i.options.stacked,o=[],r=this._cachedMeta.controller.getParsed(e),a=r&&r[i.axis],l=t=>{const e=t._parsed.find(t=>t[i.axis]===a),n=e&&e[t.vScale.axis];if(An(n)||isNaN(n))return!0};for(const i of n)if((void 0===e||!l(i))&&((!1===s||-1===o.indexOf(i.stack)||void 0===s&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Dn("x"===this.chart.options.indexAxis?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const n=this._getStacks(t,i),s=void 0!==e?n.indexOf(e):-1;return-1===s?n.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let s,o;for(s=0,o=e.data.length;s=i?1:-1)}(d,e,r)*o,u===r&&(m-=d/2);const t=e.getPixelForDecimal(0),s=e.getPixelForDecimal(1),l=Math.min(t,s),f=Math.max(t,s);m=Math.max(Math.min(m,f),l),h=m+d,i&&!c&&(a._stacks[e.axis]._visualValues[n]=e.getValueForPixel(h)-e.getValueForPixel(m))}if(m===e.getPixelForValue(r)){const t=os(d)*e.getLineWidthForValue(r)/2;m+=t,d-=t}return{size:d,base:m,head:h,center:h+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,s=n.skipNull,o=Dn(n.maxBarThickness,1/0);let r,a;const l=this._getAxisCount();if(e.grouped){const i=s?this._getStackCount(t):e.stackCount,c="flex"===n.barThickness?function(t,e,i,n){const s=e.pixels,o=s[t];let r=t>0?s[t-1]:null,a=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:s}=e,o=this.getParsed(t),r=n.getLabelForValue(o.x),a=s.getLabelForValue(o.y),l=o._custom;return{label:i[t]||"",value:"("+r+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(e,n),c=o.axis,h=r.axis;for(let d=e;d0&&this.getParsed(e-1);for(let i=0;i=b){v.skip=!0;continue}const x=this.getParsed(i),_=An(x[u]),w=v[d]=o.getPixelForValue(x[d],i),k=v[u]=s||_?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,x,a):x[u],i);v.skip=isNaN(w)||isNaN(k)||_,v.stop=i>0&&Math.abs(x[d]-y[d])>g,p&&(v.parsed=x,v.raw=l.data[i]),h&&(v.options=c||this.resolveDataElementOptions(i,f.active?"active":n)),m||this.updateElement(f,i,v,n),y=x}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends $r{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:Ur,RadarController:class extends Rr{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return Fo.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this._cachedMeta.rScale,o="reset"===n;for(let r=e;r0&&this.getParsed(e-1);for(let c=e;c0&&Math.abs(i[u]-v[u])>m,g&&(p.parsed=i,p.raw=l.data[c]),d&&(p.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),b||this.updateElement(e,c,p,n),v=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const s=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,s,o)/2}}});function Yr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xr{static override(t){Object.assign(Xr.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Yr()}parse(){return Yr()}format(){return Yr()}add(){return Yr()}diff(){return Yr()}startOf(){return Yr()}endOf(){return Yr()}}var Jr=Xr;function Gr(t,e,i,n){const{controller:s,data:o,_sorted:r}=t,a=s._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&"r"!==e&&r&&o.length){const r=a._reversePixels?ws:_s;if(!n){const n=r(o,e,i);if(l){const{vScale:e}=s._cachedMeta,{_parsed:i}=t,o=i.slice(0,n.lo+1).reverse().findIndex(t=>!An(t[e.axis]));n.lo-=Math.max(0,o);const r=i.slice(n.hi).findIndex(t=>!An(t[e.axis]));n.hi+=Math.max(0,r)}return n}if(s._sharedOptions){const t=o[0],n="function"==typeof t.getRange&&t.getRange(e);if(n){const t=r(o,e,i-n),s=r(o,e,i+n);return{lo:t.lo,hi:s.hi}}}}return{lo:0,hi:o.length-1}}function Kr(t,e,i,n,s){const o=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=o.length;t{t[r]&&t[r](e[i],s)&&(o.push({element:t,datasetIndex:n,index:l}),a=a||t.inRange(e.x,e.y,s))}),n&&!a?[]:o}var ia={evaluateInteractionItems:Kr,modes:{index(t,e,i,n){const s=Ko(e,t),o=i.axis||"x",r=i.includeInvisible||!1,a=i.intersect?Qr(t,s,o,n,r):ta(t,s,o,!1,n,r),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,n){const s=Ko(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;let a=i.intersect?Qr(t,s,o,n,r):ta(t,s,o,!1,n,r);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;tQr(t,Ko(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){const s=Ko(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;return ta(t,s,o,i.intersect,n,r)},x:(t,e,i,n)=>ea(t,Ko(e,t),"x",i.intersect,n),y:(t,e,i,n)=>ea(t,Ko(e,t),"y",i.intersect,n)}};const na=["left","top","right","bottom"];function sa(t,e){return t.filter(t=>t.pos===e)}function oa(t,e){return t.filter(t=>-1===na.indexOf(t.pos)&&t.box.axis===e)}function ra(t,e){return t.sort((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function aa(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:s}=i;if(!t||!na.includes(n))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let o,r,a;for(o=0,r=t.length;o{n[t]=Math.max(e[t],i[t])}),n}return n(t?["left","right"]:["top","bottom"])}function ua(t,e,i,n){const s=[];let o,r,a,l,c,h;for(o=0,r=t.length,c=0;ot.box.fullSize),!0),n=ra(sa(e,"left"),!0),s=ra(sa(e,"right")),o=ra(sa(e,"top"),!0),r=ra(sa(e,"bottom")),a=oa(e,"x"),l=oa(e,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:sa(e,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;jn(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},s);ca(u,xo(n));const f=Object.assign({maxPadding:u,w:o,h:r,x:s.left,y:s.top},s),p=aa(l.concat(c),d);ua(a.fullSize,f,d,p),ua(l,f,d,p),ua(c,f,d,p)&&ua(l,f,d,p),function(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),pa(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,pa(a.rightAndBottom,f,d,p),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},jn(a.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class ma{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class ba extends ma{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const va="$chartjs",ya={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xa=t=>null===t||""===t;const _a=!!er&&{passive:!0};function wa(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,_a)}function ka(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Sa(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||ka(i.addedNodes,n),e=e&&!ka(i.removedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function Ma(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||ka(i.removedNodes,n),e=e&&!ka(i.addedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}const Oa=new Map;let Ea=0;function Aa(){const t=window.devicePixelRatio;t!==Ea&&(Ea=t,Oa.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Ta(t,e,i){const n=t.canvas,s=n&&qo(n);if(!s)return;const o=Es((t,e)=>{const n=s.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||o(i,n)});return r.observe(s),function(t,e){Oa.size||window.addEventListener("resize",Aa),Oa.set(t,e)}(t,o),r}function Ca(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Oa.delete(t),Oa.size||window.removeEventListener("resize",Aa)}(t)}function Pa(t,e,i){const n=t.canvas,s=Es(e=>{null!==t.ctx&&i(function(t,e){const i=ya[t.type]||t.type,{x:n,y:s}=Ko(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==s?s:null}}(e,t))},t);return function(t,e,i){t&&t.addEventListener(e,i,_a)}(n,e,s),s}class La extends ma{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),s=t.getAttribute("width");if(t[va]={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",xa(s)){const e=ir(t,"width");void 0!==e&&(t.width=e)}if(xa(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ir(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[va])return!1;const i=e[va].initial;["height","width"].forEach(t=>{const n=i[t];An(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e[va],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:Sa,detach:Ma,resize:Ta}[e]||Pa;n[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:Ca,detach:Ca,resize:Ca}[e]||wa)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Zo(t,e,i,n)}isAttached(t){const e=t&&qo(t);return!(!e||!e.isConnected)}}class Da{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return ls(this.x)&&ls(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}function Ia(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),s=t._maxLength/i;return Math.floor(Math.min(n,s))}(t),s=Math.min(i.maxTicksLimit||n,n),o=i.major.enabled?function(t){const e=[];let i,n;for(i=0,n=t.length;is)return function(t,e,i,n){let s,o=0,r=i[0];for(n=Math.ceil(n),s=0;st-e).pop(),e}(n);for(let t=0,e=o.length-1;ts)return e}return Math.max(s,1)}(o,e,s);if(r>0){let t,i;const n=r>1?Math.round((l-a)/(r-1)):null;for(Ra(e,c,h,An(n)?0:a-n,a),t=0,i=r-1;t"top"===e||"left"===e?t[e]+i:t[e]-i,Fa=(t,e)=>Math.min(e||t,t);function za(t,e){const i=[],n=t.length/e,s=t.length;let o=0;for(;or+a)))return c}function Na(t){return t.drawTicks?t.tickLength:0}function Wa(t,e){if(!t.display)return 0;const i=_o(t.font,e),n=xo(t.padding);return(Tn(t.text)?t.text.length:1)*i.lineHeight+n.height}function Va(t,e,i){let n=As(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Ha extends Da{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=Ln(t,Number.POSITIVE_INFINITY),e=Ln(e,Number.NEGATIVE_INFINITY),i=Ln(i,Number.POSITIVE_INFINITY),n=Ln(n,Number.NEGATIVE_INFINITY),{min:Ln(t,i),max:Ln(e,n),minDefined:Pn(t),maxDefined:Pn(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:s,maxDefined:o}=this.getUserBounds();if(s&&o)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let a=0,l=r.length;an?n:i,n=s&&i>n?i:n,{min:Ln(i,Ln(n,i)),max:Ln(n,Ln(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Rn(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:s}=t,o=In(e,(s-n)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(n,-Math.abs(o)),max:r(s,o)}}(this,s,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=vs(this.chart.width-h,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),h+6>o&&(o=u/(i-(t.offset?.5:1)),r=this.maxHeight-Na(t.grid)-e.padding-Wa(t.title,this.chart.options.font),a=Math.sqrt(h*h+d*d),l=ds(Math.min(Math.asin(vs((c.highest.height+6)/o,-1,1)),Math.asin(vs(r/a,-1,1))-Math.asin(vs(d/a,-1,1)))),l=Math.max(n,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){Rn(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Rn(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const o=Wa(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Na(s)+o):(t.height=this.maxHeight,t.width=Na(s)+o),i.display&&this.ticks.length){const{first:e,last:n,widest:s,highest:o}=this._getLabelSizes(),a=2*i.padding,l=hs(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(r){const e=i.mirror?0:h*s.width+c*o.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:c*s.width+h*o.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:s,padding:o},position:r}=this.options,a=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;a?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?h=t.width:"inner"!==s&&(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-r+o)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-c+o)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+o,this.paddingBottom=n+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Rn(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s({width:o[t]||0,height:r[t]||0});return{first:k(0),last:k(e-1),widest:k(_),highest:k(w),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return vs(this._alignToPixels?Zs(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tr*n?r/i:a/n:a*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:s,position:o,border:r}=n,a=s.offset,l=this.isHorizontal(),c=this.ticks.length+(a?1:0),h=Na(s),d=[],u=r.setContext(this.getContext()),f=u.display?u.width:0,p=f/2,g=function(t){return Zs(i,t,f)};let m,b,v,y,x,_,w,k,S,M,O,E;if("top"===o)m=g(this.bottom),_=this.bottom-h,k=m-p,M=g(t.top)+p,E=t.bottom;else if("bottom"===o)m=g(this.top),M=t.top,E=g(t.bottom)-p,_=m+p,k=this.top+h;else if("left"===o)m=g(this.right),x=this.right-h,w=m-p,S=g(t.left)+p,O=t.right;else if("right"===o)m=g(this.left),S=t.left,O=g(t.right)-p,x=m+p,w=this.left+h;else if("x"===e){if("center"===o)m=g((t.top+t.bottom)/2+.5);else if(Cn(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}M=t.top,E=t.bottom,_=m+p,k=_+h}else if("y"===e){if("center"===o)m=g((t.left+t.right)/2);else if(Cn(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}x=m-p,w=x-h,S=t.left,O=t.right}const A=Dn(n.ticks.maxTicksLimit,c),T=Math.max(1,Math.ceil(c/A));for(b=0;b0&&(o-=n/2)}d={left:o,top:s,width:n+e.width,height:i+e.height,color:t.backdropColor}}g.push({label:y,font:S,textOffset:E,options:{rotation:p,color:i,strokeColor:a,strokeWidth:c,textAlign:u,textBaseline:A,translation:[x,_],backdrop:d}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-hs(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:s}}=this.options,o=t+s,r=this._getLabelSizes().widest.width;let a,l;return"left"===e?n?(l=this.right+s,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l+=r)):(l=this.right-o,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l=this.left)):"right"===e?n?(l=this.left+s,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l-=r)):(l=this.left+o,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:s,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,s,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(e=>e.value===t);if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,o=n.length;s{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,o;for(s=0,o=e.length;s{const n=i.split("."),s=n.pop(),o=[t].concat(n).join("."),r=e[i].split("."),a=r.pop(),l=r.join(".");Gs.route(o,s,l,a)})}(e,t.defaultRoutes);t.descriptors&&Gs.describe(e,t.descriptors)}(t,o,i),this.override&&Gs.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Gs[n]&&(delete Gs[n][i],this.override&&delete Us[i])}}class Ua{constructor(){this.controllers=new $a(Rr,"datasets",!0),this.elements=new $a(Da,"elements"),this.plugins=new $a(Object,"plugins"),this.scales=new $a(Ha,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):jn(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=qn(t);Rn(i["before"+n],[],i),e[t](i),Rn(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Xa(t,e){return e||!1!==t?!0===t?{}:t:null}function Ja(t,{plugin:e,local:i},n,s){const o=t.pluginScopeKeys(e),r=t.getOptionScopes(n,o);return i&&e.defaults&&r.push(e.defaults),t.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ga(t,e){const i=Gs.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Ka(t){if("x"===t||"y"===t||"r"===t)return t}function Qa(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function Za(t,...e){if(Ka(t))return t;for(const i of e){const e=i.axis||Qa(i.position)||t.length>1&&Ka(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function tl(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function el(t,e){const i=Us[t.type]||{scales:{}},n=e.scales||{},s=Ga(t.type,e),o=Object.create(null);return Object.keys(n).forEach(e=>{const r=n[e];if(!Cn(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const a=Za(e,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return tl(t,"x",i[0])||tl(t,"y",i[0])}return{}}(e,t),Gs.scales[r.type]),l=function(t,e){return t===e?"_index_":"_value_"}(a,s),c=i.scales||{};o[e]=Vn(Object.create(null),[{axis:a},r,c[a],c[l]])}),t.data.datasets.forEach(i=>{const s=i.type||t.type,r=i.indexAxis||Ga(s,e),a=(Us[s]||{}).scales||{};Object.keys(a).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),s=i[e+"AxisID"]||e;o[s]=o[s]||Object.create(null),Vn(o[s],[{axis:e},n[s],a[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];Vn(e,[Gs.scales[e.type],Gs.scale])}),o}function il(t){const e=t.options||(t.options={});e.plugins=Dn(e.plugins,{}),e.scales=el(t,e)}function nl(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const sl=new Map,ol=new Set;function rl(t,e){let i=sl.get(t);return i||(i=e(),sl.set(t,i),ol.add(i)),i}const al=(t,e,i)=>{const n=Un(e,i);void 0!==n&&t.add(n)};class ll{constructor(t){this._config=function(t){return(t=t||{}).data=nl(t.data),il(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=nl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),il(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return rl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return rl(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return rl(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return rl(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:s}=this,o=this._cachedScopes(t,i),r=o.get(e);if(r)return r;const a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>al(a,t,e))),e.forEach(t=>al(a,n,t)),e.forEach(t=>al(a,Us[s]||{},t)),e.forEach(t=>al(a,Gs,t)),e.forEach(t=>al(a,qs,t))});const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),ol.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Us[e]||{},Gs.datasets[e]||{},{type:e},Gs,qs]}resolveNamedOptions(t,e,i,n=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=cl(this._resolverCache,t,n);let a=o;if(function(t,e){const{isScriptable:i,isIndexable:n}=Oo(t);for(const s of e){const e=i(s),o=n(s),r=(o||e)&&t[s];if(e&&(Xn(r)||hl(r))||o&&Tn(r))return!0}return!1}(o,e)){s.$shared=!1;a=Mo(o,i=Xn(i)?i():i,this.createResolver(t,i,r))}for(const t of e)s[t]=a[t];return s}createResolver(t,e,i=[""],n){const{resolver:s}=cl(this._resolverCache,t,i);return Cn(e)?Mo(s,e,void 0,n):s}}function cl(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const s=i.join();let o=n.get(s);if(!o){o={resolver:So(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(s,o)}return o}const hl=t=>Cn(t)&&Object.getOwnPropertyNames(t).some(e=>Xn(t[e]));const dl=["top","bottom","left","right","chartArea"];function ul(t,e){return"top"===t||"bottom"===t||-1===dl.indexOf(t)&&"x"===e}function fl(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function pl(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Rn(i&&i.onComplete,[t],e)}function gl(t){const e=t.chart,i=e.options.animation;Rn(i&&i.onProgress,[t],e)}function ml(t){return Uo()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const bl={},vl=t=>{const e=ml(t);return Object.values(bl).filter(t=>t.canvas===e).pop()};function yl(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const o=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=o)}}}class xl{static defaults=Gs;static instances=bl;static overrides=Us;static registry=qa;static version="4.5.1";static getChart=vl;static register(...t){qa.add(...t),_l()}static unregister(...t){qa.remove(...t),_l()}constructor(t,e){const i=this.config=new ll(e),n=ml(t),s=vl(n);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Uo()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?ba:La}(n)),this.platform.updateConfig(i);const r=this.platform.acquireContext(n,o.aspectRatio),a=r&&r.canvas,l=a&&a.height,c=a&&a.width;this.id=En(),this.ctx=r,this.canvas=a,this.width=c,this.height=l,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ya,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),o.resizeDelay||0),this._dataChanges=[],bl[this.id]=this,r&&a?(yr.listen(this,"complete",pl),yr.listen(this,"progress",gl),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:s}=this;return An(t)?e&&s?s:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return qa}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return to(this.canvas,this.ctx),this}stop(){return yr.stop(this),this}resize(t,e){yr.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,t,e,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,tr(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Rn(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){jn(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let s=[];e&&(s=s.concat(Object.keys(e).map(t=>{const i=e[t],n=Za(t,i),s="r"===n,o="x"===n;return{options:i,dposition:s?"chartArea":o?"bottom":"left",dtype:s?"radialLinear":o?"category":"linear"}}))),jn(s,e=>{const s=e.options,o=s.id,r=Za(o,s),a=Dn(s.type,e.dtype);void 0!==s.position&&ul(s.position,r)===ul(e.dposition)||(s.position=e.dposition),n[o]=!0;let l=null;if(o in i&&i[o].type===a)l=i[o];else{l=new(qa.getScale(a))({id:o,type:a,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(s,t)}),jn(n,(t,e)=>{t||delete i[e]}),jn(i,t=>{ga.configure(this,t,t.options),ga.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(fl("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){jn(this.scales,t=>{ga.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);Jn(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e){yl(t,n,"_removeElements"===i?-s:s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;ga.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],jn(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},n=br(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(n&&so(e,n),t.controller.draw(),n&&oo(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return no(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const s=ia.modes[e];return"function"==typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=ko(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,n);Yn(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(s,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),yr.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};jn(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():o()}unbindEvents(){jn(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},jn(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,o,r,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),r=0,a=t.length;r{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!Fn(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=s(e,t),r=i?t:s(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:s}=this,o=e,r=this._getActiveElements(t,n,i,o),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,Rn(s.onHover,[t,r,this],this),a&&Rn(s.onClick,[t,r,this],this));const c=!Fn(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}function _l(){return jn(xl.instances,t=>t._plugins.invalidate())}function wl(t,e,i,n){const s=bo(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(i-e)/2,r=Math.min(o,n*e/2),a=t=>{const e=(i-Math.min(o,t))*n/2;return vs(t,0,Math.min(o,e))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:vs(s.innerStart,0,r),innerEnd:vs(s.innerEnd,0,r)}}function kl(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function Sl(t,e,i,n,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=e,d=Math.max(e.outerRadius+n+i-c,0),u=h>0?h+n+i+c:0;let f=0;const p=s-l;if(n){const t=((h>0?h-n:0)+(d>0?d-n:0))/2;f=(p-(0!==t?p*t/(t+n):p))/2}const g=(p-Math.max(.001,p*d-i/Gn)/d)/2,m=l+g+f,b=s-g-f,{outerStart:v,outerEnd:y,innerStart:x,innerEnd:_}=wl(e,u,d,b-m),w=d-v,k=d-y,S=m+v/w,M=b-y/k,O=u+x,E=u+_,A=m+x/O,T=b-_/E;if(t.beginPath(),o){const e=(S+M)/2;if(t.arc(r,a,d,S,e),t.arc(r,a,d,e,M),y>0){const e=kl(k,M,r,a);t.arc(e.x,e.y,y,M,b+es)}const i=kl(E,b,r,a);if(t.lineTo(i.x,i.y),_>0){const e=kl(E,T,r,a);t.arc(e.x,e.y,_,b+es,T+Math.PI)}const n=(b-_/u+(m+x/u))/2;if(t.arc(r,a,u,b-_/u,n,!0),t.arc(r,a,u,n,m+x/u,!0),x>0){const e=kl(O,A,r,a);t.arc(e.x,e.y,x,A+Math.PI,m-es)}const s=kl(w,m,r,a);if(t.lineTo(s.x,s.y),v>0){const e=kl(w,S,r,a);t.arc(e.x,e.y,v,m-es,S)}}else{t.moveTo(r,a);const e=Math.cos(S)*d+r,i=Math.sin(S)*d+a;t.lineTo(e,i);const n=Math.cos(M)*d+r,s=Math.sin(M)*d+a;t.lineTo(n,s)}t.closePath()}function Ml(t,e,i,n,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=e,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u,borderRadius:f}=l,p="inner"===l.borderAlign;if(!c)return;t.setLineDash(d||[]),t.lineDashOffset=u,p?(t.lineWidth=2*c,t.lineJoin=h||"round"):(t.lineWidth=c,t.lineJoin=h||"bevel");let g=e.endAngle;if(o){Sl(t,e,i,n,g,s);for(let e=0;es?(c=s/l,t.arc(o,r,l,i+c,n-c,!0)):t.arc(o,r,s,i+es,n-es),t.closePath(),t.clip()}(t,e,g),l.selfJoin&&g-r>=Gn&&0===f&&"miter"!==h&&function(t,e,i){const{startAngle:n,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=e,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/r,ms(n-i));if(t.beginPath(),t.arc(s,o,r-c/2,n+d/2,i-d/2),a>0){const e=Math.min(c/a,ms(n-i));t.arc(s,o,a+c/2,i-e/2,n+e/2,!0)}else{const e=Math.min(c/2,r*ms(n-i));if("round"===h)t.arc(s,o,e,i-Gn/2,n+Gn/2,!0);else if("bevel"===h){const r=2*e*e,a=-r*Math.cos(i+Gn/2)+s,l=-r*Math.sin(i+Gn/2)+o,c=r*Math.cos(n+Gn/2)+s,h=r*Math.sin(n+Gn/2)+o;t.lineTo(a,l),t.lineTo(c,h)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}(t,e,g),o||(Sl(t,e,i,n,g,s),t.stroke())}function Ol(t,e,i=e){t.lineCap=Dn(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Dn(i.borderDash,e.borderDash)),t.lineDashOffset=Dn(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Dn(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Dn(i.borderWidth,e.borderWidth),t.strokeStyle=Dn(i.borderColor,e.borderColor)}function El(t,e,i){t.lineTo(i.x,i.y)}function Al(t,e,i={}){const n=t.length,{start:s=0,end:o=n-1}=i,{start:r,end:a}=e,l=Math.max(s,r),c=Math.min(o,a),h=sa&&o>a;return{count:n,start:l,loop:e.loop,ilen:c(r+(c?a-t:t))%o,y=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=s[v(0)],t.moveTo(d.x,d.y)),h=0;h<=a;++h){if(d=s[v(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ip&&(p=i),m=(b*m+e)/++b):(y(),t.lineTo(e,i),u=n,b=0,f=p=i),g=i}y()}function Pl(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?Cl:Tl}const Ll="function"==typeof Path2D;function Dl(t,e,i,n){Ll&&!e.options.segment?function(t,e,i,n){let s=e._path;s||(s=e._path=new Path2D,e.path(s,i,n)&&s.closePath()),Ol(t,e.options),t.stroke(s)}(t,e,i,n):function(t,e,i,n){const{segments:s,options:o}=e,r=Pl(e);for(const a of s)Ol(t,o,a.style),t.beginPath(),r(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}class Il extends Da{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;$o(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const o=!!t._loop,{start:r,end:a}=function(t,e,i,n){let s=0,o=e-1;if(i&&!n)for(;ss&&t[o%e].skip;)o--;return o%=e,{start:s,end:o}}(i,s,o,n);return fr(t,!0===n?[{start:r,end:a,loop:o}]:function(t,e,i,n){const s=t.length,o=[];let r,a=e,l=t[e];for(r=e+1;r<=i;++r){const i=t[r%s];i.skip||i.stop?l.skip||(n=!1,o.push({start:e%s,end:(r-1)%s,loop:n}),e=a=i.stop?r:null):(a=r,l.skip&&(e=r)),l=i}return null!==a&&o.push({start:e%s,end:a%s,loop:n}),o}(i,r,a"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:s,distance:o}=fs(n,{x:t,y:e}),{startAngle:r,endAngle:a,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,u=Dn(h,a-r),f=bs(s,r,a)&&r!==a,p=u>=Kn||f,g=ys(o,l+d,c+d);return p&&g}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:a,spacing:l}=this.options,c=(n+s)/2,h=(o+r+l+a)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/4,s=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>Kn?Math.floor(i/Kn):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*n,Math.sin(r)*n);const a=n*(1-Math.sin(Math.min(Gn,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,n,s){const{fullCircles:o,startAngle:r,circumference:a}=e;let l=e.endAngle;if(o){Sl(t,e,i,n,l,s);for(let e=0;et.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ul(t){return Hl[t%Hl.length]}function ql(t){return $l[t%$l.length]}function Yl(t){let e=0;return(i,n)=>{const s=t.getDatasetMeta(n).controller;s instanceof $r?e=function(t,e){return t.backgroundColor=t.data.map(()=>Ul(e++)),e}(i,e):s instanceof Ur?e=function(t,e){return t.backgroundColor=t.data.map(()=>ql(e++)),e}(i,e):s&&(e=function(t,e){return t.borderColor=Ul(e),t.backgroundColor=ql(e),++e}(i,e))}}function Xl(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var Jl={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:n},options:s}=t.config,{elements:o}=s,r=Xl(n)||(a=s)&&(a.borderColor||a.backgroundColor)||o&&Xl(o)||"rgba(0,0,0,0.1)"!==Gs.borderColor||"rgba(0,0,0,0.1)"!==Gs.backgroundColor;var a;if(!i.forceOverride&&r)return;const l=Yl(t);n.forEach(l)}};function Gl(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Kl(t){t.data.datasets.forEach(t=>{Gl(t)})}var Ql={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Kl(t);const n=t.width;t.data.datasets.forEach((e,s)=>{const{_data:o,indexAxis:r}=e,a=t.getDatasetMeta(s),l=o||e.data;if("y"===wo([r,t.options.indexAxis]))return;if(!a.controller.supportsDecimation)return;const c=t.scales[a.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let{start:h,count:d}=function(t,e){const i=e.length;let n,s=0;const{iScale:o}=t,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(s=vs(_s(e,o.axis,r).lo,0,i-1)),n=c?vs(_s(e,o.axis,a).hi+1,s,i)-s:i-s,{start:s,count:n}}(a,l);if(d<=(i.threshold||4*n))return void Gl(e);let u;switch(An(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":u=function(t,e,i,n,s){const o=s.samples||n;if(o>=i)return t.slice(e,e+i);const r=[],a=(i-2)/(o-2);let l=0;const c=e+i-1;let h,d,u,f,p,g=e;for(r[l++]=t[g],h=0;hu&&(u=f,d=t[n],p=n);r[l++]=d,g=p}return r[l++]=t[c],r}(l,h,d,n,i);break;case"min-max":u=function(t,e,i,n){let s,o,r,a,l,c,h,d,u,f,p=0,g=0;const m=[],b=e+i-1,v=t[e].x,y=t[b].x-v;for(s=e;sf&&(f=a,h=s),p=(g*p+o.x)/++g;else{const i=s-1;if(!An(c)&&!An(h)){const e=Math.min(c,h),n=Math.max(c,h);e!==d&&e!==i&&m.push({...t[e],x:p}),n!==d&&n!==i&&m.push({...t[n],x:p})}s>0&&i!==d&&m.push(t[i]),m.push(o),l=e,g=0,u=f=a,c=h=d=s}}return m}(l,h,d,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=u})},destroy(t){Kl(t)}};function Zl(t,e,i,n){if(n)return;let s=e[t],o=i[t];return"angle"===t&&(s=ms(s),o=ms(o)),{property:t,start:s,end:o}}function tc(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function ec(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function ic(t,e){let i=[],n=!1;return Tn(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:n=null}=t||{},s=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=tc(t,e,s);const r=s[t],a=s[e];null!==n?(o.push({x:r.x,y:n}),o.push({x:a.x,y:n})):null!==i&&(o.push({x:i,y:r.y}),o.push({x:i,y:a.y}))}),o}(t,e),i.length?new Il({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function nc(t){return t&&!1!==t.fill}function sc(t,e,i){let n=t[e].fill;const s=[e];let o;if(!i)return n;for(;!1!==n&&-1===s.indexOf(n);){if(!Pn(n))return n;if(o=t[n],!o)return!1;if(o.visible)return n;s.push(n),n=o.fill}return!1}function oc(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=Dn(i&&i.target,i);void 0===n&&(n=!!e.backgroundColor);if(!1===n||null===n)return!1;if(!0===n)return"origin";return n}(t);if(Cn(n))return!isNaN(n.value)&&n;let s=parseFloat(n);return Pn(s)&&Math.floor(s)===s?function(t,e,i,n){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=n)return!1;return i}(n[0],e,s,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function rc(t,e,i){const n=[];for(let s=0;s=0;--e){const i=s[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),n&&i.fill&&hc(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;nc(i)&&hc(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;nc(n)&&"beforeDatasetDraw"===i.drawTime&&hc(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const bc=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}};class vc extends Da{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Rn(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,n=_o(i.font),s=n.size,o=this._computeTitleHeight(),{boxWidth:r,itemHeight:a}=bc(i,s);let l,c;e.font=n.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(o,s,r,a)+10):(c=this.maxHeight,l=this._fitCols(o,n,r,a)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:s,maxWidth:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],c=n+r;let h=t;s.textAlign="left",s.textBaseline="middle";let d=-1,u=-c;return this.legendItems.forEach((t,f)=>{const p=i+e/2+s.measureText(t.text).width;(0===f||l[l.length-1]+p+2*r>o)&&(h+=c,l[l.length-(f>0?0:1)]=0,u+=c,d++),a[f]={left:0,top:u,row:d,width:p,height:n},l[l.length-1]+=p+r}),h}_fitCols(t,e,i,n){const{ctx:s,maxHeight:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-t;let h=r,d=0,u=0,f=0,p=0;return this.legendItems.forEach((t,o)=>{const{itemWidth:g,itemHeight:m}=function(t,e,i,n,s){const o=function(t,e,i,n){let s=t.text;s&&"string"!=typeof s&&(s=s.reduce((t,e)=>t.length>e.length?t:e));return e+i.size/2+n.measureText(s).width}(n,t,e,i),r=function(t,e,i){let n=t;"string"!=typeof e.text&&(n=yc(e,i));return n}(s,n,e.lineHeight);return{itemWidth:o,itemHeight:r}}(i,e,s,t,n);o>0&&u+m+2*r>c&&(h+=d+r,l.push({width:d,height:u}),f+=d+r,p++,d=u=0),a[o]={left:f,top:u,col:p,width:g,height:m},d=Math.max(d,g),u+=m+r}),h+=d,l.push({width:d,height:u}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:s}}=this,o=rr(s,this.left,this.width);if(this.isHorizontal()){let s=0,r=Ts(i,this.left+n,this.right-this.lineWidths[s]);for(const a of e)s!==a.row&&(s=a.row,r=Ts(i,this.left+n,this.right-this.lineWidths[s])),a.top+=this.top+t+n,a.left=o.leftForLtr(o.x(r),a.width),r+=a.width+n}else{let s=0,r=Ts(i,this.top+t+n,this.bottom-this.columnSizes[s].height);for(const a of e)a.col!==s&&(s=a.col,r=Ts(i,this.top+t+n,this.bottom-this.columnSizes[s].height)),a.top=r,a.left+=this.left+n,a.left=o.leftForLtr(o.x(a.left),a.width),r+=a.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;so(t,this),this._draw(),oo(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:s,labels:o}=t,r=Gs.color,a=rr(t.rtl,this.left,this.width),l=_o(o.font),{padding:c}=o,h=l.size,d=h/2;let u;this.drawTitle(),n.textAlign=a.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:f,boxHeight:p,itemHeight:g}=bc(o,h),m=this.isHorizontal(),b=this._computeTitleHeight();u=m?{x:Ts(s,this.left+c,this.right-i[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:Ts(s,this.top+b+c,this.bottom-e[0].height),line:0},ar(this.ctx,t.textDirection);const v=g+c;this.legendItems.forEach((y,x)=>{n.strokeStyle=y.fontColor,n.fillStyle=y.fontColor;const _=n.measureText(y.text).width,w=a.textAlign(y.textAlign||(y.textAlign=o.textAlign)),k=f+d+_;let S=u.x,M=u.y;a.setWidth(this.width),m?x>0&&S+k+c>this.right&&(M=u.y+=v,u.line++,S=u.x=Ts(s,this.left+c,this.right-i[u.line])):x>0&&M+v>this.bottom&&(S=u.x=S+e[u.line].width+c,u.line++,M=u.y=Ts(s,this.top+b+c,this.bottom-e[u.line].height));if(function(t,e,i){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;n.save();const s=Dn(i.lineWidth,1);if(n.fillStyle=Dn(i.fillStyle,r),n.lineCap=Dn(i.lineCap,"butt"),n.lineDashOffset=Dn(i.lineDashOffset,0),n.lineJoin=Dn(i.lineJoin,"miter"),n.lineWidth=s,n.strokeStyle=Dn(i.strokeStyle,r),n.setLineDash(Dn(i.lineDash,[])),o.usePointStyle){const r={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:s},l=a.xPlus(t,f/2);io(n,r,l,e+d,o.pointStyleWidth&&f)}else{const o=e+Math.max((h-p)/2,0),r=a.leftForLtr(t,f),l=yo(i.borderRadius);n.beginPath(),Object.values(l).some(t=>0!==t)?uo(n,{x:r,y:o,w:f,h:p,radius:l}):n.rect(r,o,f,p),n.fill(),0!==s&&n.stroke()}n.restore()}(a.x(S),M,y),S=((t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e)(w,S+f+d,m?S+k:this.right,t.rtl),function(t,e,i){ho(n,i.text,t,e+g/2,l,{strikethrough:i.hidden,textAlign:a.textAlign(i.textAlign)})}(a.x(S),M,y),m)u.x+=k+c;else if("string"!=typeof y.text){const t=l.lineHeight;u.y+=yc(y,t)+c}else u.y+=v}),lr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=_o(e.font),n=xo(e.padding);if(!e.display)return;const s=rr(t.rtl,this.left,this.width),o=this.ctx,r=e.position,a=i.size/2,l=n.top+a;let c,h=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,h=Ts(t.align,h,this.right-d);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);c=l+Ts(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=Ts(r,h,h+d);o.textAlign=s.textAlign(As(r)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,ho(o,e.text,u,c,i)}_computeTitleHeight(){const t=this.options.title,e=_o(t.font),i=xo(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,s;if(ys(t,this.left,this.right)&&ys(e,this.top,this.bottom))for(s=this.legendHitBoxes,i=0;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const l=t.controller.getStyle(i?0:void 0),c=xo(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:s||l.textAlign,borderRadius:r&&(a||l.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class _c extends Da{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=Tn(i.text)?i.text.length:1;this._padding=xo(i.padding);const s=n*_o(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:s,options:o}=this,r=o.align;let a,l,c,h=0;return this.isHorizontal()?(l=Ts(r,i,s),c=e+t,a=s-i):("left"===o.position?(l=i+t,c=Ts(r,n,e),h=-.5*Gn):(l=s-t,c=Ts(r,e,n),h=.5*Gn),a=n-e),{titleX:l,titleY:c,maxWidth:a,rotation:h}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=_o(e.font),n=i.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:r,rotation:a}=this._drawArgs(n);ho(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:a,textAlign:As(e.align),textBaseline:"middle",translation:[s,o]})}}var wc={id:"title",_element:_c,start(t,e,i){!function(t,e){const i=new _c({ctx:t.ctx,options:e,chart:t});ga.configure(t,i,e),ga.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;ga.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;ga.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const kc=new WeakMap;var Sc={id:"subtitle",start(t,e,i){const n=new _c({ctx:t.ctx,options:i,chart:t});ga.configure(t,n,i),ga.addBox(t,n),kc.set(t,n)},stop(t){ga.removeBox(t,kc.get(t)),kc.delete(t)},beforeUpdate(t,e,i){const n=kc.get(t);ga.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Mc={average(t){if(!t.length)return!1;let e,i,n=new Set,s=0,o=0;for(e=0,i=t.length;et+e)/n.size,y:s/o}},nearest(t,e){if(!t.length)return!1;let i,n,s,o=e.x,r=e.y,a=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i-1?t.split("\n"):t}function Ac(t,e){const{element:i,datasetIndex:n,index:s}=e,o=t.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:t,label:r,parsed:o.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function Tc(t,e){const i=t.chart.ctx,{body:n,footer:s,title:o}=t,{boxWidth:r,boxHeight:a}=e,l=_o(e.bodyFont),c=_o(e.titleFont),h=_o(e.footerFont),d=o.length,u=s.length,f=n.length,p=xo(e.padding);let g=p.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b){g+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing}u&&(g+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let v=0;const y=function(t){m=Math.max(m,i.measureText(t).width+v)};return i.save(),i.font=c.string,jn(t.title,y),i.font=l.string,jn(t.beforeBody.concat(t.afterBody),y),v=e.displayColors?r+2+e.boxPadding:0,jn(n,t=>{jn(t.before,y),jn(t.lines,y),jn(t.after,y)}),v=0,i.font=h.string,jn(t.footer,y),i.restore(),m+=p.width,{width:m,height:g}}function Cc(t,e,i,n){const{x:s,width:o}=i,{width:r,chartArea:{left:a,right:l}}=t;let c="center";return"center"===n?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),function(t,e,i,n){const{x:s,width:o}=n,r=i.caretSize+i.caretPadding;return"left"===t&&s+o+r>e.width||"right"===t&&s-o-r<0||void 0}(c,t,e,i)&&(c="center"),c}function Pc(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Cc(t,e,i,n),yAlign:n}}function Lc(t,e,i,n){const{caretSize:s,caretPadding:o,cornerRadius:r}=t,{xAlign:a,yAlign:l}=i,c=s+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=yo(r);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const g=function(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}(e,l,c);return"center"===l?"left"===a?p+=c:"right"===a&&(p-=c):"left"===a?p-=Math.max(h,u)+s:"right"===a&&(p+=Math.max(d,f)+s),{x:vs(p,0,n.width-e.width),y:vs(g,0,n.height-e.height)}}function Dc(t,e,i){const n=xo(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function Ic(t){return Oc([],Ec(t))}function Rc(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const jc={beforeTitle:On,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex{const e={before:[],lines:[],after:[]},s=Rc(i,t);Oc(e.before,Ec(Fc(s,"beforeLabel",this,t))),Oc(e.lines,Fc(s,"label",this,t)),Oc(e.after,Ec(Fc(s,"afterLabel",this,t))),n.push(e)}),n}getAfterBody(t,e){return Ic(Fc(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=Fc(i,"beforeFooter",this,t),s=Fc(i,"footer",this,t),o=Fc(i,"afterFooter",this,t);let r=[];return r=Oc(r,Ec(n)),r=Oc(r,Ec(s)),r=Oc(r,Ec(o)),r}_createItems(t){const e=this._active,i=this.chart.data,n=[],s=[],o=[];let r,a,l=[];for(r=0,a=e.length;rt.filter(e,n,s,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),jn(l,e=>{const i=Rc(t.callbacks,e);n.push(Fc(i,"labelColor",this,e)),s.push(Fc(i,"labelPointStyle",this,e)),o.push(Fc(i,"labelTextColor",this,e))}),this.labelColors=n,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,o=[];if(n.length){const t=Mc[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Tc(this,i),r=Object.assign({},t,e),a=Pc(this.chart,i,r),l=Lc(i,r,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:h}=yo(r),{x:d,y:u}=t,{width:f,height:p}=e;let g,m,b,v,y,x;return"center"===s?(y=u+p/2,"left"===n?(g=d,m=g-o,v=y+o,x=y-o):(g=d+f,m=g+o,v=y-o,x=y+o),b=g):(m="left"===n?d+Math.max(a,c)+o:"right"===n?d+f-Math.max(l,h)-o:this.caretX,"top"===s?(v=u,y=v-o,g=m-o,b=m+o):(v=u+p,y=v+o,g=m+o,b=m-o),x=v),{x1:g,x2:m,x3:b,y1:v,y2:y,y3:x}}drawTitle(t,e,i){const n=this.title,s=n.length;let o,r,a;if(s){const l=rr(i.rtl,this.x,this.width);for(t.x=Dc(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=_o(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,a=0;a0!==t)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,uo(t,{x:e,y:f,w:l,h:a,radius:r}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),uo(t,{x:i,y:f+1,w:l-2,h:a-2,radius:r}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(e,f,l,a),t.strokeRect(e,f,l,a),t.fillStyle=o.backgroundColor,t.fillRect(i,f+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:l,boxPadding:c}=i,h=_o(i.bodyFont);let d=h.lineHeight,u=0;const f=rr(i.rtl,this.x,this.width),p=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+s},g=f.textAlign(o);let m,b,v,y,x,_,w;for(e.textAlign=o,e.textBaseline="middle",e.font=h.string,t.x=Dc(this,g,i),e.fillStyle=i.bodyColor,jn(this.beforeBody,p),u=r&&"right"!==g?"center"===o?l/2+c:l+2+c:0,y=0,_=n.length;y<_;++y){for(m=n[y],b=this.labelTextColors[y],e.fillStyle=b,jn(m.before,p),v=m.lines,r&&v.length&&(this._drawColorBox(e,t,y,f,i),d=Math.max(h.lineHeight,a)),x=0,w=v.length;x0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=Mc[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Tc(this,t),r=Object.assign({},i,this._size),a=Pc(e,t,r),l=Lc(t,r,a,e);n._to===l.x&&s._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=xo(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,n,e),ar(t,e.textDirection),s.y+=o.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),lr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),s=!Fn(i,n),o=this._positionChanged(n,e);(s||o)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,s=this._active||[],o=this._getActiveElements(t,s,e,i),r=this._positionChanged(o,t),a=e||!Fn(o,s)||r;return a&&(this._active=o,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));const o=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,o=Mc[s.position].call(this,t,e);return!1!==o&&(i!==o.x||n!==o.y)}}var Bc={id:"tooltip",_element:zc,positioners:Mc,afterInit(t,e,i){i&&(t.tooltip=new zc({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:jc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Nc=Object.freeze({__proto__:null,Colors:Jl,Decimation:Ql,Filler:mc,Legend:xc,SubTitle:Sc,Title:wc,Tooltip:Bc});function Wc(t,e,i,n){const s=t.indexOf(e);if(-1===s)return((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n);return s!==t.lastIndexOf(e)?i:s}function Vc(t){const e=this.getLabels();return t>=0&&tf&&(S=as(k*S/f/u)*u),An(a)||(x=Math.pow(10,a),S=Math.ceil(S*x)/x),"ticks"===n?(_=Math.floor(p/S)*S,w=Math.ceil(g/S)*S):(_=p,w=g),m&&b&&s&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((r-o)/s,S/1e3)?(k=Math.round(Math.min((r-o)/S,c)),S=(r-o)/k,_=o,w=r):v?(_=m?o:_,w=b?r:w,k=l-1,S=(w-_)/k):(k=(w-_)/S,k=rs(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const M=Math.max(us(S),us(_));x=Math.pow(10,An(a)?M:a),_=Math.round(_*x)/x,w=Math.round(w*x)/x;let O=0;for(m&&(d&&_!==o?(i.push({value:o}),_r)break;i.push({value:t})}return b&&d&&w!==r?i.length&&rs(i[i.length-1].value,r,$c(r,y,t))?i[i.length-1].value=r:i.push({value:r}):b&&w!==r||i.push({value:w}),i}function $c(t,e,{horizontal:i,minRotation:n}){const s=hs(n),o=(i?Math.sin(s):Math.cos(s))||.001,r=.75*e*(""+t).length;return Math.min(e/o,r)}class Uc extends Ha{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return An(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:s}=this;const o=t=>n=e?n:t,r=t=>s=i?s:t;if(t){const t=os(n),e=os(s);t<0&&e<0?r(0):t>0&&e>0&&o(0)}if(n===s){let e=0===s?1:Math.abs(.05*s);r(s+e),t||o(n-e)}this.min=n,this.max=s}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=Hc({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&cs(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Vs(t,this.chart.options.locale,this.options.ticks.format)}}class qc extends Uc{static id="linear";static defaults={ticks:{callback:$s.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pn(t)?t:0,this.max=Pn(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=hs(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,s.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Yc=t=>Math.floor(ss(t)),Xc=(t,e)=>Math.pow(10,Yc(t)+e);function Jc(t){return 1===t/Math.pow(10,Yc(t))}function Gc(t,e,i){const n=Math.pow(10,i),s=Math.floor(t/n);return Math.ceil(e/n)-s}function Kc(t,{min:e,max:i}){e=Ln(t.min,e);const n=[],s=Yc(e);let o=function(t,e){let i=Yc(e-t);for(;Gc(t,e,i)>10;)i++;for(;Gc(t,e,i)<10;)i--;return Math.min(i,Yc(t))}(e,i),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((e-l)*r)/r,h=Math.floor((e-l)/a/10)*a*10;let d=Math.floor((c-h)/Math.pow(10,o)),u=Ln(t.min,Math.round((l+h+d*Math.pow(10,o))*r)/r);for(;u=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),u=Math.round((l+h+d*Math.pow(10,o))*r)/r;const f=Ln(t.max,u);return n.push({value:f,major:Jc(f),significand:d}),n}class Qc extends Ha{static id="logarithmic";static defaults={ticks:{callback:$s.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Uc.prototype.parse.apply(this,[t,e]);if(0!==i)return Pn(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pn(t)?Math.max(0,t):null,this.max=Pn(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Pn(this._userMin)&&(this.min=t===Xc(this.min,0)?Xc(this.min,-1):Xc(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const s=e=>i=t?i:e,o=t=>n=e?n:t;i===n&&(i<=0?(s(1),o(10)):(s(Xc(i,-1)),o(Xc(n,1)))),i<=0&&s(Xc(n,-1)),n<=0&&o(Xc(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=Kc({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&cs(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":Vs(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ss(t),this._valueRange=ss(this.max)-ss(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ss(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Zc(t){const e=t.ticks;if(e.display&&t.display){const t=xo(e.backdropPadding);return Dn(e.font&&e.font.size,Gs.font.size)+t.height}return 0}function th(t,e,i){return i=Tn(i)?i:[i],{w:Qs(t,e.string,i),h:i.length*e.lineHeight}}function eh(t,e,i,n,s){return t===n||t===s?{start:e-i/2,end:e+i/2}:ts?{start:e-i,end:e}:{start:e,end:e+i}}function ih(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],s=[],o=t._pointLabels.length,r=t.options.pointLabels,a=r.centerPointLabels?Gn/o:0;for(let l=0;le.r&&(a=(n.end-e.r)/o,t.r=Math.max(t.r,e.r+a)),s.starte.b&&(l=(s.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}function sh(t,e,i){const n=t.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=i,l=t.getPointPosition(e,n+s+r,o),c=Math.round(ds(ms(l.angle+es))),h=function(t,e,i){90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e);return t}(l.y,a.h,c),d=function(t){if(0===t||180===t)return"center";if(t<180)return"left";return"right"}(c),u=function(t,e,i){"right"===i?t-=e:"center"===i&&(t-=e/2);return t}(l.x,a.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:u,top:h,right:u+a.w,bottom:h+a.h}}function oh(t,e){if(!e)return!0;const{left:i,top:n,right:s,bottom:o}=t;return!(no({x:i,y:n},e)||no({x:i,y:o},e)||no({x:s,y:n},e)||no({x:s,y:o},e))}function rh(t,e,i){const{left:n,top:s,right:o,bottom:r}=i,{backdropColor:a}=e;if(!An(a)){const i=yo(e.borderRadius),l=xo(e.backdropPadding);t.fillStyle=a;const c=n-l.left,h=s-l.top,d=o-n+l.width,u=r-s+l.height;Object.values(i).some(t=>0!==t)?(t.beginPath(),uo(t,{x:c,y:h,w:d,h:u,radius:i}),t.fill()):t.fillRect(c,h,d,u)}}function ah(t,e,i,n){const{ctx:s}=t;if(i)s.arc(t.xCenter,t.yCenter,e,0,Kn);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let o=1;ot,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=xo(Zc(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Pn(t)&&!isNaN(t)?t:0,this.max=Pn(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Zc(this.options))}generateTickLabels(t){Uc.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{const i=Rn(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?ih(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){return ms(t*(Kn/(this._pointLabels.length||1))+hs(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(An(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(An(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t=0;s--){const e=t._pointLabelItems[s];if(!e.visible)continue;const o=n.setContext(t.getPointLabelContext(s));rh(i,o,e);const r=_o(o.font),{x:a,y:l,textAlign:c}=e;ho(i,t._pointLabels[s],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}(this,o),n.display&&this.ticks.forEach((t,e)=>{if(0!==e||0===e&&this.min<0){a=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),r=n.setContext(i),l=s.setContext(i);!function(t,e,i,n,s){const o=t.ctx,r=e.circular,{color:a,lineWidth:l}=e;!r&&!n||!a||!l||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),ah(t,i,r,n),o.closePath(),o.stroke(),o.restore())}(this,r,a,o,l)}}),i.display){for(t.save(),r=o-1;r>=0;r--){const n=i.setContext(this.getPointLabelContext(r)),{color:s,lineWidth:o}=n;o&&s&&(t.lineWidth=o,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,a=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),l=this.getPointPosition(r,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,r)=>{if(0===r&&this.min>=0&&!e.reverse)return;const a=i.setContext(this.getContext(r)),l=_o(a.font);if(s=this.getDistanceFromCenterForValue(this.ticks[r].value),a.showLabelBackdrop){t.font=l.string,o=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=xo(a.backdropPadding);t.fillRect(-o/2-e.left,-s-l.size/2-e.top,o+e.width,l.size+e.height)}ho(t,n.label,0,-s,l,{color:a.color,strokeColor:a.textStrokeColor,strokeWidth:a.textStrokeWidth})}),t.restore()}drawTitle(){}}const ch={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},hh=Object.keys(ch);function dh(t,e){return t-e}function uh(t,e){if(An(e))return null;const i=t._adapter,{parser:n,round:s,isoWeekday:o}=t._parseOpts;let r=e;return"function"==typeof n&&(r=n(r)),Pn(r)||(r="string"==typeof n?i.parse(r,n):i.parse(r)),null===r?null:(s&&(r="week"!==s||!ls(o)&&!0!==o?i.startOf(r,s):i.startOf(r,"isoWeek",o)),+r)}function fh(t,e,i,n){const s=hh.length;for(let o=hh.indexOf(t);o=e?i[n]:i[s]]=!0}}else t[e]=!0}function gh(t,e,i){const n=[],s={},o=e.length;let r,a;for(r=0;r=0&&(e[l].major=!0);return e}(t,n,s,i):n}class mh extends Ha{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),n=this._adapter=new Jr(t.adapters.date);n.init(e),Vn(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:uh(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:s,minDefined:o,maxDefined:r}=this.getUserBounds();function a(t){o||isNaN(t.min)||(n=Math.min(n,t.min)),r||isNaN(t.max)||(s=Math.max(s,t.max))}o&&r||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=Pn(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),s=Pn(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,s-1),this.max=Math.max(n+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const s=this.min,o=function(t,e,i){let n=0,s=t.length;for(;nn&&t[s-1]>i;)s--;return n>0||s=hh.indexOf(i);o--){const i=hh[o];if(ch[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return hh[i?hh.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=hh.indexOf(t)+1,i=hh.length;e+t.value))}initOffsets(t=[]){let e,i,n=0,s=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),s=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=vs(n,0,o),s=vs(s,0,o),this._offsets={start:n,end:s,factor:1/(n+1+s)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,s=n.time,o=s.unit||fh(s.minUnit,e,i,this._getLabelCapacity(e)),r=Dn(n.ticks.stepSize,1),a="week"===o&&s.isoWeekday,l=ls(a)||!0===a,c={};let h,d,u=e;if(l&&(u=+t.startOf(u,"isoWeek",a)),u=+t.startOf(u,l?"day":o),t.diff(i,e,o)>1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+o);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;h+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,n=this._unit,s=e||i[n];return this._adapter.format(t,s)}_tickFormatFunction(t,e,i,n){const s=this.options,o=s.ticks.callback;if(o)return Rn(o,[t,e,i],this);const r=s.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&r[a],h=l&&r[l],d=i[e],u=l&&h&&d&&d.major;return this._adapter.format(t,n||(u?h:c))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=_s(t,"pos",e)),({pos:n,time:o}=t[a]),({pos:s,time:r}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=_s(t,"time",e)),({time:n,pos:o}=t[a]),({time:s,pos:r}=t[l]));const c=s-n;return c?o+(r-o)*(e-n)/c:o}var vh=Object.freeze({__proto__:null,CategoryScale:class extends Ha{static id="category";static defaults={ticks:{callback:Vc}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(An(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:vs(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:Wc(i,t,Dn(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){return Vc.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:qc,LogarithmicScale:Qc,RadialLinearScale:lh,TimeScale:mh,TimeSeriesScale:class extends mh{static id="timeseries";static defaults=mh.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=bh(e,this.min),this._tableRange=bh(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let o,r,a,l,c;for(o=0,r=t.length;o=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,r=n.length;ot-e)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(bh(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return bh(this._table,i*this._tableRange+this._minPos,!0)}}});const yh=[qr,Vl,Nc,vh];xl.register(...yh);const xh=xl;var _h=i(998),wh=i.n(_h);const kh={data:{},nonce:"",context:null,init(t){this.context=t;const e=t.querySelectorAll("[data-progress]"),i=t.querySelectorAll("[data-chart]");[...e].forEach(t=>{t.dataset.url&&(this.data[t.dataset.url]||(this.data[t.dataset.url]={items:[],poll:null}),this.data[t.dataset.url].items.push(t)),"line"===t.dataset.progress?this.line(t):"circle"===t.dataset.progress&&this.circle(t),this.nonce||(this.nonce=t.dataset?.nonce)});for(const t in this.data)this.getValues(t);[...i].forEach(t=>{const e={labels:JSON.parse(t.dataset.dates),datasets:[{backgroundColor:t.dataset.color,borderColor:t.dataset.color,data:JSON.parse(t.dataset.data),cubicInterpolationMode:"monotone"}]};new xh(t,{type:"line",data:e,options:{responsive:!0,radius:0,interaction:{intersect:!1},plugins:{legend:{display:!1}},scales:{y:{suggestedMin:0,ticks:{color:"#999999",callback:(t,e)=>wh()(t,{decimals:2,scale:"SI"})},grid:{color:"#d3dce3"}},x:{ticks:{color:"#999999"},grid:{color:"#d3dce3"}}}}})})},line(t){new(Ui().Line)(t,{strokeWidth:2,easing:"easeInOut",duration:1400,color:t.dataset.color,trailColor:"#d3dce3",trailWidth:2,svgStyle:{width:"100%",height:"100%",display:"block"}}).animate(t.dataset.value/100)},circle(t){t.dataset.basetext=t.dataset.text,t.dataset.text="";const e=t.dataset.value,i=this;if(t.bar=new(Ui().Circle)(t,{strokeWidth:3,easing:"easeInOut",duration:1400,color:t.dataset.color,trailColor:"#d3dce3",trailWidth:3,svgStyle:null,text:{autoStyleContainer:!1,style:{color:"#222222"}},step(e,n){const s=Math.floor(100*n.value());i.setText(n,parseFloat(s),t.dataset.text)}}),!t.dataset.url){const i=e/100;t.bar.animate(i)}},getValues(t){this.data[t].poll&&(clearTimeout(this.data[t].poll),this.data[t].poll=null),Pt({path:t,method:"GET",headers:{"X-WP-Nonce":this.nonce}}).then(e=>{this.data[t].items.forEach(i=>{void 0!==e[i.dataset.basetext]?i.dataset.text=e[i.dataset.basetext]:i.dataset.text=i.dataset.basetext,i.bar.animate(e[i.dataset.value]),i.dataset.poll&&!this.data[t].poll&&(this.data[t].poll=setTimeout(()=>{this.getValues(t)},1e4))});for(const t in e){const i=this.context.querySelectorAll(`[data-key="${t}"]`),n=this.context.querySelectorAll(`[data-text="${t}"]`);i.forEach(i=>{i.dataset.value=e[t],i.dispatchEvent(new Event("focus"))}),n.forEach(i=>{i.innerText=e[t],i.classList.contains("cld-toggle")&&(e[t]?i.classList.remove("hidden"):i.classList.add("hidden"))})}})},setText(t,e,i){if(!t)return;const n=document.createElement("span"),s=document.createElement("h2"),o=document.createTextNode(i);s.innerText=e+"%",n.appendChild(s),n.appendChild(o),t.setText(n)}},Sh=kh,Mh={key:"_cld_pending_state",data:null,pending:null,changed:!1,previous:{},init(){this.data=cldData.stateData?cldData.stateData:{};let t=localStorage.getItem(this.key);t&&(t=JSON.parse(t),this.data={...this.data,...t},this.sendStates()),this.previous=JSON.stringify(this.data)},_update(){this.pending&&(clearTimeout(this.pending),localStorage.removeItem(this.key)),this.previous!==JSON.stringify(this.data)&&(this.pending=setTimeout(()=>this.sendStates(),2e3),localStorage.setItem(this.key,JSON.stringify(this.data)))},set(t,e){this.data[t]&&this.data[t]===e||(this.data[t]=e,this._update())},get(t){let e=null;return this.data[t]&&(e=this.data[t]),e},sendStates(){fetch(cldData.stateURL,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":cldData.stateNonce},body:JSON.stringify(this.data)}).then(t=>t.json()).then(t=>{t.success&&(this.previous=JSON.stringify(t.state),localStorage.removeItem(this.key))})}},Oh={init(t){[...t.querySelectorAll("[data-remove]")].forEach(t=>{t.addEventListener("click",e=>{if(t.dataset.message&&!confirm(t.dataset.message))return;const i=document.getElementById(t.dataset.remove);i.parentNode.removeChild(i)})})}},Eh={values:{},inputs:{},context:null,init(t){this.context=t;t.querySelectorAll("[data-tags]").forEach(t=>this.bind(t))},bind(t){t.innerText=t.dataset.placeholder;const e=t.dataset.tags,i=document.getElementById(e),n=this.context.querySelectorAll(`[data-tags-delete="${e}"]`);this.values[e]=JSON.parse(i.value),this.inputs[e]=i,t.boundInput=e,t.boundDisplay=this.context.querySelector(`[data-tags-display="${e}"]`),t.boundDisplay.addEventListener("click",e=>{t.focus()}),t.addEventListener("focus",e=>{t.innerText=null}),t.addEventListener("blur",e=>{3{if("Tab"===i.key)3{"Comma"!==e.code&&"Enter"!==e.code&&"Tab"!==e.code&&"Space"!==e.code||(e.preventDefault(),3{t.parentNode.control=t,t.parentNode.style.width=getComputedStyle(t.parentNode).width,t.addEventListener("click",e=>{e.stopPropagation(),this.deleteTag(t)})})},deleteTag(t){const e=t.parentNode,i=e.dataset.inputId,n=this.values[i].indexOf(e.dataset.value);0<=n&&this.values[i].splice(n,1),e.style.width=0,e.style.opacity=0,e.style.padding=0,e.style.margin=0,setTimeout(()=>{e.parentNode.removeChild(e)},500),this.updateInput(i)},captureTag(t,e){if(this[t.dataset.format]&&"string"!=typeof(e=this[t.dataset.format](e)))return t.classList.add("pulse"),void setTimeout(()=>{t.classList.remove("pulse")},1e3);if(!this.validateUnique(t.boundDisplay,e)){const i=this.createTag(e);i.dataset.inputId=t.boundInput,this.values[t.boundInput].push(e),t.innerText=null,t.boundDisplay.insertBefore(i,t),i.style.width=getComputedStyle(i).width,i.style.opacity=1,this.updateInput(t.boundInput)}},createTag(t){const e=document.createElement("span"),i=document.createElement("span"),n=document.createElement("span");return e.classList.add("cld-input-tags-item"),i.classList.add("cld-input-tags-item-text"),n.className="cld-input-tags-item-delete dashicons dashicons-no-alt",n.addEventListener("click",()=>this.deleteTag(n)),i.innerText=t,e.appendChild(i),e.appendChild(n),e.dataset.value=t,e.style.opacity=0,e.control=n,e},validateUnique(t,e){const i=t.querySelector(`[data-value="${e}"]`);let n=!1;return i&&(i.classList.remove("pulse"),i.classList.add("pulse"),setTimeout(()=>{i.classList.remove("pulse")},500),n=!0),n},updateInput(t){this.inputs[t].value=JSON.stringify(this.values[t])},host(t){!1===/^(?:http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)/.test(t)&&(t="https://"+t);let e="";try{e=new URL(t)}catch(t){return t}return decodeURIComponent(e.host)}},Ah=Eh,Th={suffixInputs:null,init(t){this.suffixInputs=t.querySelectorAll("[data-suffix]"),[...this.suffixInputs].forEach(t=>this.bindInput(t))},bindInput(t){const e=document.getElementById(t.dataset.suffix),i=e.dataset.template.split("@value");this.setSuffix(e,i,t.value),t.addEventListener("change",()=>this.setSuffix(e,i,t.value)),t.addEventListener("input",()=>this.setSuffix(e,i,t.value))},setSuffix(t,e,i){t.innerHTML="",t.classList.add("hidden"),-1===["none","off",""].indexOf(i)&&t.classList.remove("hidden");const n=document.createTextNode(e.join(i));t.appendChild(n)}},Ch={wrappers:null,frame:null,error:'data:image/svg+xml;utf8,%26%23x26A0%3B︎',init(t){this.wrappers=t.querySelectorAll(".cld-size-items"),this.wrappers.forEach(t=>{const e=t.querySelectorAll(".cld-size-selector-item");e.forEach(i=>{i.addEventListener("click",()=>{e.forEach(t=>{delete t.dataset.selected}),i.dataset.selected=!0,this.switchSizeContent(t,i.dataset.size)})});const i=t.querySelector(".cld-size-selector-item[data-selected]");i&&this.switchSizeContent(t,i.dataset.size)})},switchSizeContent(t,e){t.querySelectorAll(".cld-size-content").forEach(t=>{t.style.display="none"});const i=t.querySelector(`.cld-size-content[data-size="${e}"]`);i&&(i.style.display="block",this.buildImages(t,i))},buildImages(t,e){const i=t.dataset.base,n=e.querySelector(".regular-text"),s=e.querySelector(".disable-toggle");if(!n||!s)return;const o=e.querySelectorAll("img"),r=n.value.length?n.value.replace(" ",""):n.placeholder;if(o.forEach(t=>{const e=t.dataset.size,o=t.dataset.file;s.checked?(n.disabled=!0,t.src=`${i}/${e}/${o}`):(n.disabled=!1,t.src=`${i}/${e},${r}/${o}`),t.bound||(t.addEventListener("error",()=>{t.src=this.error}),t.bound=!0)}),!n.bound){let i=null;n.addEventListener("input",()=>{i&&clearTimeout(i),i=setTimeout(()=>{this.buildImages(t,e)},1e3)}),n.bound=!0}s.bound||(s.addEventListener("change",()=>{this.buildImages(t,e)}),s.bound=!0);const a=e.querySelector(".clear-crop-input");a&&!a.bound&&(a.addEventListener("click",()=>{n.value="",this.buildImages(t,e)}),a.bound=!0)}},Ph={bindings:{},parent_check_data:{},check_parents:{},_init(t){const e=t.querySelectorAll("[data-condition]"),i=t.querySelectorAll("[data-toggle]"),n=t.querySelectorAll("[data-for]"),s=t.querySelectorAll("[data-tooltip]"),o=t.querySelectorAll("[data-bind-trigger]"),r=t.querySelectorAll("[data-main]"),a=t.querySelectorAll("[data-file]"),l=t.querySelectorAll("[data-auto-suffix]"),c=t.querySelectorAll("[data-confirm]"),h={};Mh.init(),Hi.bind(r),l.forEach(t=>this._autoSuffix(t)),o.forEach(t=>this._trigger(t)),i.forEach(t=>this._toggle(t)),e.forEach(t=>this._bind(t)),n.forEach(t=>this._alias(t)),a.forEach(t=>this._files(t,h)),Bi(s,{theme:"cloudinary",arrow:!1,placement:"bottom-start",aria:{content:"auto",expanded:"auto"},content:t=>document.getElementById(t.dataset.tooltip).innerHTML}),[...o].forEach(t=>{t.dispatchEvent(new Event("input"))}),c.forEach(t=>{t.addEventListener("click",e=>{confirm(t.dataset.confirm)||(e.preventDefault(),e.stopPropagation())})}),Sh.init(t),Oh.init(t),Ah.init(t),Th.init(t),Ch.init(t)},_autoSuffix(t){const e=t.dataset.autoSuffix;let i="";const n=[...e.split(";")].map(t=>0===t.indexOf("*")?(i=t.replace("*",""),i):t);t.addEventListener("change",()=>{const e=t.value.replace(" ",""),s=e.replace(/[^0-9]/g,""),o=e.replace(/[0-9]/g,"").toLowerCase();s&&(-1===n.indexOf(o)?t.value=s+i:t.value=s+o)}),t.dispatchEvent(new Event("change"))},_files(t,e){const i=t.dataset.parent;i&&(this.check_parents[i]=document.getElementById(i),this.parent_check_data[i]||(this.parent_check_data[i]=this.check_parents[i].value?JSON.parse(this.check_parents[i].value):[]),t.addEventListener("change",()=>{const n=this.parent_check_data[i].indexOf(t.value);t.checked?this.parent_check_data[i].push(t.value):this.parent_check_data[i].splice(n,1),e[i]&&clearTimeout(e[i]),e[i]=setTimeout(()=>{this._compileParent(i)},10)}))},_compileParent(t){this.check_parents[t].value=JSON.stringify(this.parent_check_data[t]),this.check_parents[t].dispatchEvent(new Event("change"))},_bind(t){t.condition=JSON.parse(t.dataset.condition);for(const e in t.condition)this.bindings[e]&&this.bindings[e].elements.push(t)},_trigger(t){const e=t.dataset.bindTrigger,i=this;i.bindings[e]={input:t,value:t.value,checked:!0,elements:[]},t.addEventListener("change",function(e){t.dispatchEvent(new Event("input"))}),t.addEventListener("input",function(){if(i.bindings[e].value=t.value,"checkbox"===t.type&&(i.bindings[e].checked=t.checked),"radio"!==t.type||!1!==t.checked)for(const n in i.bindings[e].elements)i.toggle(i.bindings[e].elements[n],t)})},_alias(t){t.addEventListener("click",function(){document.getElementById(t.dataset.for).dispatchEvent(new Event("click"))})},_toggle(t){const e=this,i=document.querySelector('[data-wrap="'+t.dataset.toggle+'"]');if(!i)return;const n=Mh.get(t.id);t.addEventListener("click",function(n){n.stopPropagation();const s=i.classList.contains("open")?"closed":"open";e.toggle(i,t,s)}),n!==t.dataset.state&&this.toggle(i,t,n)},toggle(t,e,i){if(!i){i="open";for(const e in t.condition){let n=this.bindings[e].value;const s=t.condition[e];"boolean"==typeof s&&(n=this.bindings[e].checked),s!==n&&(i="closed")}}"closed"===i?this.close(t,e):this.open(t,e),Mh.set(e.id,i)},open(t,e){const i=t.getElementsByClassName("cld-ui-input");t.classList.remove("closed"),t.classList.add("open"),e&&e.classList.contains("dashicons")&&(e.classList.remove("dashicons-arrow-down-alt2"),e.classList.add("dashicons-arrow-up-alt2")),[...i].forEach(function(t){t.dataset.disabled=!1})},close(t,e){const i=t.getElementsByClassName("cld-ui-input");t.classList.remove("open"),t.classList.add("closed"),e&&e.classList.contains("dashicons")&&(e.classList.remove("dashicons-arrow-up-alt2"),e.classList.add("dashicons-arrow-down-alt2")),[...i].forEach(function(t){t.dataset.disabled=!0})}},Lh=document.querySelectorAll(".cld-settings,.cld-meta-box");Lh.length&&Lh.forEach(t=>{t&&window.addEventListener("load",Ph._init(t))});const Dh={config:null,init(){this.config||"undefined"!=typeof cldData&&cldData.analytics&&cldData.analytics.enabled&&(this.config=cldData.analytics,Pt.use(Pt.createNonceMiddleware(this.config.nonce)))},track(t,e={},i="activation_funnel",n=null){if(this.config||this.init(),this.config&&this.config.enabled&&t)try{Pt({url:this.config.endpoint,method:"POST",data:{event_name:t,event_category:i,funnel_step:n,params:e}}).catch(()=>{})}catch(t){}},trackReliable(t,e={},i="activation_funnel"){if(this.config||this.init(),this.config&&this.config.enabled&&t)if(navigator.sendBeacon)try{const n=this.config.endpoint.includes("?")?"&":"?",s=this.config.endpoint+n+"_wpnonce="+encodeURIComponent(this.config.nonce),o=new Blob([JSON.stringify({event_name:t,event_category:i,funnel_step:null,params:e})],{type:"application/json"});navigator.sendBeacon(s,o)}catch(t){}else this.track(t,e,i)}};window.addEventListener("load",()=>Dh.init());const Ih=Dh,Rh={storageKey:"_cld_wizard",testing:null,connectAttempts:0,startedEntry:!1,startedTracked:!1,next:document.querySelector('[data-navigate="next"]'),back:document.querySelector('[data-navigate="back"]'),lock:document.getElementById("pad-lock"),lockIcon:document.getElementById("lock-icon"),options:document.querySelectorAll('.cld-ui-input[type="checkbox"]'),settings:document.getElementById("optimize"),tabBar:document.getElementById("wizard-tabs"),tracking:document.getElementById("tracking"),complete:document.getElementById("complete-wizard"),tabs:{"tab-1":document.getElementById("tab-icon-1"),"tab-2":document.getElementById("tab-icon-2"),"tab-3":document.getElementById("tab-icon-3")},content:{"tab-1":document.getElementById("tab-1"),"tab-2":document.getElementById("tab-2"),"tab-3":document.getElementById("tab-3"),"tab-4":document.getElementById("tab-4")},connection:{error:document.getElementById("connection-error"),success:document.getElementById("connection-success"),working:document.getElementById("connection-working")},debounceConnect:null,updateConnection:document.getElementById("update-connection"),cancelUpdateConnection:document.getElementById("cancel-update-connection"),config:{},didSave:!1,init(){if(!cldData.wizard)return;this.config=cldData.wizard.config,window.localStorage.getItem(this.storageKey)&&(this.config=JSON.parse(window.localStorage.getItem(this.storageKey))),document.location.hash.length&&this.hashChange(),Pt.use(Pt.createNonceMiddleware(cldData.wizard.saveNonce));const t=document.querySelectorAll("[data-navigate]"),e=document.getElementById("connect.cloudinary_url");this.updateConnection.addEventListener("click",()=>{this.lockNext(),e.parentNode.classList.remove("hidden"),this.cancelUpdateConnection.classList.remove("hidden"),this.updateConnection.classList.add("hidden")}),this.cancelUpdateConnection.addEventListener("click",()=>{this.unlockNext(),e.parentNode.classList.add("hidden"),this.cancelUpdateConnection.classList.add("hidden"),this.updateConnection.classList.remove("hidden"),this.config.cldString=!0,e.value="",this.connection.error.classList.remove("active"),this.connection.success.classList.add("active")}),[...t].forEach(t=>{t.addEventListener("click",()=>{this.navigate(t.dataset.navigate)})}),this.lock.addEventListener("click",()=>{this.lockIcon.classList.toggle("dashicons-unlock"),this.settings.classList.toggle("disabled"),this.options.forEach(t=>{t.disabled=t.disabled?"":"disabled"})}),e.addEventListener("input",t=>{this.lockNext(),this.startedEntry||(this.startedEntry=!0,Ih.track("credentials_entry_started",{},"activation_funnel",3));const i=e.value.replace("CLOUDINARY_URL=","");this.connection.error.classList.remove("active"),this.connection.success.classList.remove("active"),this.connection.working.classList.remove("active"),i.length&&(this.testing=i,this.debounceConnect&&clearTimeout(this.debounceConnect),this.debounceConnect=setTimeout(()=>{const t=this.evaluateConnectionString(i);Ih.track("credentials_format_validated",{format_valid:t,invalid_reason:t?"":this.invalidReason(i)},"activation_funnel",3),t?(this.connection.working.classList.add("active"),this.testConnection(i)):this.connection.error.classList.add("active")},500))}),this.config.cldString&&(e.parentNode.classList.add("hidden"),this.updateConnection.classList.remove("hidden"));const i=document.querySelector('a[href="https://cloudinary.com/signup"]');i&&i.addEventListener("click",()=>{Ih.track("wizard_signup_clicked",{},"activation_funnel",2)}),this.complete&&this.complete.addEventListener("click",()=>{Ih.track("wizard_dashboard_clicked",{},"activation_funnel",7)}),this.getTab(this.config.tab),this.initFeatures(),window.addEventListener("hashchange",t=>{this.hashChange()})},hashChange(){const t=parseInt(document.location.hash.replace("#",""));t&&0t&&this.getTab(t)},initFeatures(){const t=(t,e)=>{Ih.track("wizard_setting_toggled",{setting_key:t,enabled:e},"activation_funnel",4)},e=document.getElementById("media_library");e.checked=this.config.mediaLibrary,e.addEventListener("change",()=>{this.setConfig("mediaLibrary",e.checked),t("media_library",e.checked)});const i=document.getElementById("non_media");i.checked=this.config.nonMedia,i.addEventListener("change",()=>{this.setConfig("nonMedia",i.checked),t("non_media",i.checked)});const n=document.getElementById("advanced");n.checked=this.config.advanced,n.addEventListener("change",()=>{this.setConfig("advanced",n.checked),t("advanced",n.checked)})},getCurrent(){return this.content[`tab-${this.config.tab}`]},hideTabs(){Object.keys(this.content).forEach(t=>{this.hide(this.content[t])})},completeTab(t){this.incompleteTab(),Object.keys(this.tabs).forEach(e=>{const i=parseInt(this.tabs[e].dataset.tab);t>i?this.tabs[e].classList.add("complete"):t===i&&this.tabs[e].classList.add("active")})},incompleteTab(t){Object.keys(this.tabs).forEach(t=>{this.tabs[t].classList.remove("complete","active")})},getCurrentTab(){return this.tabs[`tab-icon-${this.config.tab}`]},getTab(t){if(4===t&&window.localStorage.getItem(this.storageKey)&&!this.didSave)return void this.saveConfig();const e=this.getCurrent(),i=document.getElementById(`tab-${t}`);switch(this.hideTabs(),this.completeTab(t),this.hide(document.getElementById(`tab-${this.config.tab}`)),e.classList.remove("active"),this.show(i),this.show(this.next),this.hide(this.lock),t){case 1:this.hide(this.back),this.unlockNext(),this.startedTracked||(this.startedTracked=!0,this.config.wizardStartedAt||this.setConfig("wizardStartedAt",Date.now()),Ih.track("wizard_started",{entry_point:this.getEntryPoint()},"activation_funnel",2));break;case 2:Ih.track("wizard_connect_viewed",{},"activation_funnel",3),this.show(this.back),this.config.cldString?this.showSuccess():(this.lockNext(),setTimeout(()=>{document.getElementById("connect.cloudinary_url").focus()},0)),this.updateConnection.classList.contains("hidden")&&this.lockNext();break;case 3:if(!this.config.cldString)return void(document.location.hash="1");Ih.track("wizard_settings_viewed",{},"activation_funnel",4),this.show(this.lock),this.show(this.back);break;case 4:if(!this.config.cldString)return void(document.location.hash="1");Ih.track("wizard_completed",{time_to_complete_sec:this.timeToCompleteSec()},"activation_funnel",6),this.hide(this.tabBar),this.hide(this.next),this.hide(this.back)}this.setConfig("tab",t)},navigate(t){"next"===t?this.navigateNext():"back"===t&&this.navigateBack()},navigateBack(){document.location.hash=this.config.tab-1},navigateNext(){document.location.hash=this.config.tab+1},showError(){this.connection.error.classList.add("active"),this.connection.success.classList.remove("active")},showSuccess(){this.connection.error.classList.remove("active"),this.connection.success.classList.add("active")},show(t){t.classList.remove("hidden"),t.style.display=""},hide(t){t.classList.add("hidden"),t.style.display="none"},lockNext(){this.next.disabled="disabled"},unlockNext(){this.next.disabled=""},evaluateConnectionString:t=>new RegExp(/^(?:CLOUDINARY_URL=)?(cloudinary:\/\/){1}(\d*)[:]{1}([^@]*)[@]{1}([^@]*)$/gim).test(t),invalidReason(t){const e=t.replace("CLOUDINARY_URL=","");if(0!==e.indexOf("cloudinary://"))return"missing_scheme";if(-1===e.indexOf("@"))return"missing_cloud_name";const i=e.replace("cloudinary://","").split("@")[0];return-1===i.indexOf(":")?"missing_secret":/^\d+$/.test(i.split(":")[0])?"invalid_format":"invalid_api_key"},getEntryPoint:()=>-1!==document.referrer.indexOf("plugins.php")?"auto_redirect":"menu",timeToCompleteSec(){const t=this.config.wizardStartedAt;return t?Math.max(0,Math.round((Date.now()-t)/1e3)):null},testConnection(t){this.connectAttempts+=1,Ih.track("connection_test_started",{attempt_number:this.connectAttempts},"activation_funnel",3),Pt({path:cldData.wizard.testURL,data:{cloudinary_url:t,attempt_number:this.connectAttempts},method:"POST"}).then(e=>{e.url===this.testing&&(this.connection.working.classList.remove("active"),"connection_error"===e.type?this.showError():"connection_success"===e.type&&(this.showSuccess(),this.unlockNext(),this.setConfig("cldString",t)))})},setConfig(t,e){this.config[t]=e,window.localStorage.setItem(this.storageKey,JSON.stringify(this.config))},saveConfig(){this.lockNext(),this.next.innerText=$("Setting up Cloudinary","cloudinary"),this.didSave=!0,Pt({path:cldData.wizard.saveURL,data:this.config,method:"POST"}).then(t=>{this.next.innerText=$("Next","cloudinary"),this.unlockNext(),this.getTab(4),window.localStorage.removeItem(this.storageKey)}).fail(t=>{this.didSave=!1})}};window.addEventListener("load",()=>Rh.init());const jh={select:document.getElementById("connect.offload"),tooltip:null,descriptions:{},change(){[...this.descriptions].forEach(t=>{t.classList.remove("selected")}),this.tooltip.querySelector("."+this.select.value).classList.add("selected")},addEventListener(){this.select.addEventListener("change",this.change.bind(this))},_init(){this.select&&(this.addEventListener(),this.tooltip=this.select.parentNode.querySelector(".cld-tooltip"),this.descriptions=this.tooltip.querySelectorAll("li"),this.change())}};window.addEventListener("load",()=>jh._init());const Fh={pageReloader:document.getElementById("page-reloader"),init(){if(!cldData.extensions)return;Pt.use(Pt.createNonceMiddleware(cldData.extensions.nonce));[...document.querySelectorAll("[data-extension]")].forEach(t=>{t.addEventListener("change",e=>{t.spinner||(t.spinner=this.createSpinner(),t.parentNode.appendChild(t.spinner)),t.debounce&&clearTimeout(t.debounce),t.debounce=setTimeout(()=>{this.toggleExtension(t),t.debounce=null},1e3)})})},toggleExtension(t){const e=t.dataset.extension,i=t.checked;Ih.track("extension_toggled",{extension_id:e,enabled:i},"features"),Pt({path:cldData.extensions.url,data:{extension:e,enabled:i},method:"POST"}).then(e=>{t.spinner&&(t.parentNode.removeChild(t.spinner),delete t.spinner),Object.keys(e).forEach(t=>{document.querySelectorAll(`[data-text="${t}"]`).forEach(i=>{i.innerText=e[t]})}),this.pageReloader.style.display="block"})},createSpinner(){const t=document.createElement("span");return t.classList.add("spinner"),t.classList.add("cld-extension-spinner"),t}};window.addEventListener("load",()=>Fh.init());const zh={tabButtonSelectors:null,selectedTabID:"",deselectOldTab(){document.getElementById(this.selectedTabID).classList.remove("is-active"),this.filterActive([...this.tabButtonSelectors]).classList.remove("is-active")},selectCurrentTab(t){this.selectedTabID=t.dataset.tab,t.classList.add("is-active"),document.getElementById(this.selectedTabID).classList.add("is-active")},selectTab(t){t.preventDefault(),t.target.classList.contains("is-active")||(this.deselectOldTab(),this.selectCurrentTab(t.target))},filterTabs(){[...this.tabButtonSelectors].forEach(t=>{t.dataset.tab&&t.addEventListener("click",this.selectTab.bind(this))})},filterActive:t=>t.filter(t=>t.classList.contains("is-active")).pop(),init(){this.tabButtonSelectors=document.querySelectorAll(".cld-page-tabs-tab button"),0!==this.tabButtonSelectors.length&&(this.selectCurrentTab(this.filterActive([...this.tabButtonSelectors])),this.filterTabs())}};window.addEventListener("load",()=>zh.init());const Bh={init(){document.querySelectorAll(".cld-special-offer-link").forEach(t=>{t.addEventListener("click",()=>{Ih.track("special_offer_clicked",{offer_id:"small_plan_29"},"settings")})})}};window.addEventListener("load",()=>Bh.init());i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p;window.$=window.jQuery})()})(); +(()=>{var t={951(t,e){var i,n,s,o;o=function(){var t="BKMGTPEZY".split("");function e(t,e){return t&&t.toLowerCase()===e.toLowerCase()}return function(i,n){return i="number"==typeof i?i:0,(n=n||{}).fixed="number"==typeof n.fixed?n.fixed:2,n.spacer="string"==typeof n.spacer?n.spacer:" ",n.calculate=function(t){var s=e(t,"si")?["k","B"]:["K","iB"],o=e(t,"si")?1e3:1024,r=Math.log(i)/Math.log(o)|0,a=i/Math.pow(o,r),l=a.toFixed(n.fixed);return r-1<3&&!e(t,"si")&&e(t,"jedec")&&(s[1]="B"),{suffix:r?(s[0]+"MGTPEZY")[r-1]+s[1]:1==(0|l)?"Byte":"Bytes",magnitude:r,result:a,fixed:l,bits:{result:a/8,fixed:(a/8).toFixed(n.fixed)}}},n.to=function(n,s){var o=e(s,"si")?1e3:1024,r=t.indexOf("string"==typeof n?n[0].toUpperCase():"B"),a=i;if(-1===r||0===r)return a.toFixed(2);for(;r>0;r--)a/=o;return a.toFixed(2)},n.human=function(t){var e=n.calculate(t);return e.fixed+n.spacer+e.suffix},n}},t.exports?t.exports=o():(n=[],void 0===(s="function"==typeof(i=o)?i.apply(e,n):i)||(t.exports=s))},998(t,e){var i,n,s;n=[],i=function(){"use strict";function t(t,e){var i,s,o;for(i=1,s=arguments.length;i>1].factor>t?s=e-1:n=e;return i[n]},r.prototype.parse=function(t,e){var i=t.match(this._regexp);if(null!==i){var s,o=i[3];if(n(this._prefixes,o))s=this._prefixes[o];else{if(e||(o=o.toLowerCase(),!n(this._lcPrefixes,o)))return;o=this._lcPrefixes[o],s=this._prefixes[o]}var r=+i[2];return void 0!==i[1]&&(r=-r),{factor:s,prefix:o,unit:i[4],value:r}}};var a={binary:r.create(",Ki,Mi,Gi,Ti,Pi,Ei,Zi,Yi".split(","),1024),SI:r.create("q,r,y,z,a,f,p,n,µ,m,,k,M,G,T,P,E,Z,Y,R,Q".split(","),1e3,-10)},l=t({},a.binary._prefixes),c=a.SI._prefixes;for(var h in c)c[h]>=1&&(l[h]=c[h]);var d=new r(l),u={maxDecimals:2,separator:" ",unit:""},f={rounding:"round",scale:"SI",strict:!1};function p(t,e){var n=i(e,u,"decimals"),s=E(t,e,void 0!==n?n:i(e,u,"maxDecimals"));t=void 0!==n?s.value.toFixed(n):String(s.value);var o=s.prefix+i(e,u,"unit");return""===o?t:t+i(e,u,"separator")+o}var g={scale:"binary",unit:"B"};function m(e,i){return p(e,void 0===i?g:t({},g,i))}function b(t,e){return x(_(t,e))}var v={scale:d,unit:"B"};function y(e,i){return x(w(e,void 0===i?v:t({},v,i),!0))}function x(t){var e=String(t.value).split(".")[1];if(void 0!==e&&-1===e.indexOf("e")){var i=Math.pow(10,e.length),n=Math.round(t.value*i)*t.factor;if(n%1==0&&Math.abs(n)<=s)return n/i}return t.value*t.factor}function _(t,e){return w(t,e,!1)}function w(t,e,n){if("string"!=typeof t)throw new TypeError("str must be a string");var s=o(a,i(e,f,"scale"));if(void 0===s)throw new Error("missing scale");var r=i(e,f,"strict"),l=i(e,f,"unit");if(void 0!==l){var c=(t=t.trim()).slice(-l.length);""!==l&&(c===l||n&&!r&&c.toLowerCase()===l.toLowerCase())?t=t.slice(0,-l.length):l=""}var h=s.parse(t,r);if(void 0===h||void 0!==l&&""!==h.unit)throw new Error("cannot parse str");return void 0!==l&&(h.unit=l),h}var k={ceil:function(t){return Math.ceil(+t.toPrecision(15))},floor:function(t){return Math.floor(+t.toPrecision(15))},round:Math.round},S={ceil:"floor",floor:"ceil"};function M(t,e){return t<10*e?10:1}function O(t,e){return E(t,e,i(e,f,"maxDecimals"))}function E(t,e,s){if("number"!=typeof t||t!=t)throw new TypeError("value must be a number");if(0===t)return{value:0,prefix:""};if(!isFinite(t))return{value:t,prefix:""};var r=t<0;r&&(t=-t);var l=o(a,i(e,f,"scale"));if(void 0===l)throw new Error("missing scale");var c=i(e,f,"rounding");if(!n(k,c))throw new Error("invalid rounding");r&&n(S,c)&&(c=S[c]);var h,d=k[c],u="auto"===s;void 0===s||u||(h=Math.pow(10,s));var p,g=i(e,f,"prefix");if(void 0!==g){if(!n(l._prefixes,g))throw new Error("invalid prefix");p=l._prefixes[g]}else{var m=l.findPrefix(t);if(void 0!==s)do{p=m.factor,u&&(h=M(t,p));var b=p/h;t=d(t/b)*b}while((m=l.findPrefix(t)).factor!==p);else p=m.factor;g=m.prefix}return u&&(h=M(t,p)),t=void 0===h?t/p:d(t*h/p)/h,{prefix:g,value:r?-t:t}}return p.bytes=m,p.parse=b,b.bytes=y,b.raw=_,p.raw=O,p.Scale=r,p},void 0===(s="function"==typeof i?i.apply(e,n):i)||(t.exports=s)},336(t){var e,i="loading"in HTMLImageElement.prototype,n="loading"in HTMLIFrameElement.prototype,s="onscroll"in window;function o(t){var e,i,n=[];"picture"===t.parentNode.tagName.toLowerCase()&&((i=(e=t.parentNode).querySelector("source[data-lazy-remove]"))&&e.removeChild(i),n=Array.prototype.slice.call(t.parentNode.querySelectorAll("source"))),n.push(t),n.forEach(function(t){t.hasAttribute("data-lazy-srcset")&&(t.setAttribute("srcset",t.getAttribute("data-lazy-srcset")),t.removeAttribute("data-lazy-srcset"))}),t.setAttribute("src",t.getAttribute("data-lazy-src")),t.removeAttribute("data-lazy-src")}function r(t){var o=document.createElement("div");for(o.innerHTML=function(t){var o=t.textContent||t.innerHTML,r="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 "+((o.match(/width=['"](\d+)['"]/)||!1)[1]||1)+" "+((o.match(/height=['"](\d+)['"]/)||!1)[1]||1)+"%27%3E%3C/svg%3E";return(/\n-1}function zt(t,e){var i=this.__data__,n=te(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this}function Bt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e1?i[s-1]:void 0,r=s>2?i[2]:void 0;for(o=t.length>3&&"function"==typeof o?(s--,o):void 0,r&&ke(i[0],i[1],r)&&(o=s<3?void 0:o,s=1),e=Object(e);++n-1&&t%1==0&&t0){if(++e>=o)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function De(t){if(null!=t){try{return ot.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ie(t,e){return t===e||t!=t&&e!=e}var Re=se(function(){return arguments}())?se:function(t){return He(t)&&rt.call(t,"callee")&&!bt.call(t,"callee")},je=Array.isArray;function Fe(t){return null!=t&&We(t.length)&&!Ne(t)}function ze(t){return He(t)&&Fe(t)}var Be=_t||Ke;function Ne(t){if(!Ve(t))return!1;var e=ne(t);return e==p||e==g||e==h||e==x}function We(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Ve(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function He(t){return null!=t&&"object"==typeof t}function $e(t){if(!He(t)||ne(t)!=y)return!1;var e=gt(t);if(null===e)return!0;var i=rt.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&ot.call(i)==ct}var Ue=X?K(X):re;function qe(t){return ge(t,Ye(t))}function Ye(t){return Fe(t)?Kt(t,!0):ae(t)}var Xe=me(function(t,e,i){le(t,e,i)});function Je(t){return function(){return t}}function Ge(t){return t}function Ke(){return!1}e.exports=Xe}).call(this)}).call(this,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,i,n){var s,o;s=self,o=function(){return function(){"use strict";var t={720:function(t,e,i){i.r(e),i.d(e,{Scene:function(){return ae},Tweenable:function(){return Mt},interpolate:function(){return ee},processTweens:function(){return bt},setBezierFunction:function(){return H},shouldScheduleUpdate:function(){return xt},tween:function(){return Ot},unsetBezierFunction:function(){return $}});var n={};i.r(n),i.d(n,{bounce:function(){return R},bouncePast:function(){return j},easeFrom:function(){return z},easeFromTo:function(){return F},easeInBack:function(){return A},easeInCirc:function(){return S},easeInCubic:function(){return c},easeInExpo:function(){return _},easeInOutBack:function(){return C},easeInOutCirc:function(){return O},easeInOutCubic:function(){return d},easeInOutExpo:function(){return k},easeInOutQuad:function(){return l},easeInOutQuart:function(){return p},easeInOutQuint:function(){return b},easeInOutSine:function(){return x},easeInQuad:function(){return r},easeInQuart:function(){return u},easeInQuint:function(){return g},easeInSine:function(){return v},easeOutBack:function(){return T},easeOutBounce:function(){return E},easeOutCirc:function(){return M},easeOutCubic:function(){return h},easeOutExpo:function(){return w},easeOutQuad:function(){return a},easeOutQuart:function(){return f},easeOutQuint:function(){return m},easeOutSine:function(){return y},easeTo:function(){return B},elastic:function(){return P},linear:function(){return o},swingFrom:function(){return D},swingFromTo:function(){return L},swingTo:function(){return I}});var s={};i.r(s),i.d(s,{afterTween:function(){return Jt},beforeTween:function(){return Xt},doesApply:function(){return qt},tweenCreated:function(){return Yt}});var o=function(t){return t},r=function(t){return Math.pow(t,2)},a=function(t){return-(Math.pow(t-1,2)-1)},l=function(t){return(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2)},c=function(t){return Math.pow(t,3)},h=function(t){return Math.pow(t-1,3)+1},d=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)},u=function(t){return Math.pow(t,4)},f=function(t){return-(Math.pow(t-1,4)-1)},p=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},g=function(t){return Math.pow(t,5)},m=function(t){return Math.pow(t-1,5)+1},b=function(t){return(t/=.5)<1?.5*Math.pow(t,5):.5*(Math.pow(t-2,5)+2)},v=function(t){return 1-Math.cos(t*(Math.PI/2))},y=function(t){return Math.sin(t*(Math.PI/2))},x=function(t){return-.5*(Math.cos(Math.PI*t)-1)},_=function(t){return 0===t?0:Math.pow(2,10*(t-1))},w=function(t){return 1===t?1:1-Math.pow(2,-10*t)},k=function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},S=function(t){return-(Math.sqrt(1-t*t)-1)},M=function(t){return Math.sqrt(1-Math.pow(t-1,2))},O=function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},E=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},A=function(t){var e=1.70158;return t*t*((e+1)*t-e)},T=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},C=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},P=function(t){return-1*Math.pow(4,-8*t)*Math.sin((6*t-1)*(2*Math.PI)/2)+1},L=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},D=function(t){var e=1.70158;return t*t*((e+1)*t-e)},I=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},R=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},j=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?2-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?2-(7.5625*(t-=2.25/2.75)*t+.9375):2-(7.5625*(t-=2.625/2.75)*t+.984375)},F=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},z=function(t){return Math.pow(t,4)},B=function(t){return Math.pow(t,.25)};function N(t,e,i,n,s,o){var r,a,l,c,h,d=0,u=0,f=0,p=function(t){return((d*t+u)*t+f)*t},g=function(t){return(3*d*t+2*u)*t+f},m=function(t){return t>=0?t:0-t};return d=1-(f=3*e)-(u=3*(n-e)-f),l=1-(h=3*i)-(c=3*(s-i)-h),r=t,a=function(t){return 1/(200*t)}(o),function(t){return((l*t+c)*t+h)*t}(function(t,e){var i,n,s,o,r,a;for(s=t,a=0;a<8;a++){if(o=p(s)-t,m(o)(n=1))return n;for(;io?i=s:n=s,s=.5*(n-i)+i}return s}(r,a))}var W,V=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.25,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.25,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.75,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.75;return function(s){return N(s,t,e,i,n,1)}},H=function(t,e,i,n,s){var o=V(e,i,n,s);return o.displayName=t,o.x1=e,o.y1=i,o.x2=n,o.y2=s,Mt.formulas[t]=o},$=function(t){return delete Mt.formulas[t]};function U(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function q(t,e){for(var i=0;it.length)&&(e=t.length);for(var i=0,n=new Array(e);ia?a:e;t._hasEnded=l>=a;var c=o-(a-l),h=t._filters.length>0;if(t._hasEnded)return t._render(r,t._data,c),t.stop(!0);h&&t._applyFilter(rt),l1&&void 0!==arguments[1]?arguments[1]:it,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Array.isArray(e))return V.apply(void 0,X(e));var n=Y(e);if(pt[e])return pt[e];if(n===ct||n===lt)for(var s in t)i[s]=e;else for(var o in t)i[o]=e[o]||it;return i},kt=function(t){t===ut?(ut=t._next)?ut._previous=null:ft=null:t===ft?(ft=t._previous)?ft._next=null:ut=null:(tt=t._previous,et=t._next,tt._next=et,et._previous=tt),t._previous=t._next=null},St="function"==typeof Promise?Promise:null;W=Symbol.toStringTag;var Mt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;U(this,t),Q(this,W,"Promise"),this._config={},this._data={},this._delay=0,this._filters=[],this._next=null,this._previous=null,this._timestamp=null,this._hasEnded=!1,this._resolve=null,this._reject=null,this._currentState=e||{},this._originalState={},this._targetState={},this._start=dt,this._render=dt,this._promiseCtor=St,i&&this.setConfig(i)}var e;return e=[{key:"_applyFilter",value:function(t){for(var e=this._filters.length;e>0;e--){var i=this._filters[e-e][t];i&&i(this)}}},{key:"tween",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return this._isPlaying&&this.stop(),!e&&this._config||this.setConfig(e),this._pausedAtTime=null,this._timestamp=t.now(),this._start(this.get(),this._data),this._delay&&this._render(this._currentState,this._data,0),this._resume(this._timestamp)}},{key:"setConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this._config;for(var n in e)i[n]=e[n];var s=i.promise,o=void 0===s?this._promiseCtor:s,r=i.start,a=void 0===r?dt:r,l=i.finish,c=i.render,h=void 0===c?this._config.step||dt:c,d=i.step,u=void 0===d?dt:d;this._data=i.data||i.attachment||this._data,this._isPlaying=!1,this._pausedAtTime=null,this._scheduleId=null,this._delay=e.delay||0,this._start=a,this._render=h||u,this._duration=i.duration||500,this._promiseCtor=o,l&&(this._resolve=l);var f=e.from,p=e.to,g=void 0===p?{}:p,m=this._currentState,b=this._originalState,v=this._targetState;for(var y in f)m[y]=f[y];var x=!1;for(var _ in m){var w=m[_];x||Y(w)!==ct||(x=!0),b[_]=w,v[_]=g.hasOwnProperty(_)?g[_]:w}if(this._easing=wt(this._currentState,i.easing,this._easing),this._filters.length=0,x){for(var k in t.filters)t.filters[k].doesApply(this)&&this._filters.push(t.filters[k]);this._applyFilter(at)}return this}},{key:"then",value:function(t,e){var i=this;return this._promise=new this._promiseCtor(function(t,e){i._resolve=t,i._reject=e}),this._promise.then(t,e)}},{key:"catch",value:function(t){return this.then().catch(t)}},{key:"finally",value:function(t){return this.then().finally(t)}},{key:"get",value:function(){return K({},this._currentState)}},{key:"set",value:function(t){this._currentState=t}},{key:"pause",value:function(){if(this._isPlaying)return this._pausedAtTime=t.now(),this._isPlaying=!1,kt(this),this}},{key:"resume",value:function(){return this._resume()}},{key:"_resume",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.now();return null===this._timestamp?this.tween():this._isPlaying?this._promise:(this._pausedAtTime&&(this._timestamp+=e-this._pausedAtTime,this._pausedAtTime=null),this._isPlaying=!0,null===ut?(ut=this,ft=this):(this._previous=ft,ft._next=this,ft=this),this)}},{key:"seek",value:function(e){e=Math.max(e,0);var i=t.now();return this._timestamp+e===0||(this._timestamp=i-e,mt(this,i)),this}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._isPlaying)return this;this._isPlaying=!1,kt(this);var e=this._filters.length>0;return t&&(e&&this._applyFilter(rt),gt(1,this._currentState,this._originalState,this._targetState,1,0,this._easing),e&&(this._applyFilter(st),this._applyFilter(ot))),this._resolve&&this._resolve({data:this._data,state:this._currentState,tweenable:this}),this._resolve=null,this._reject=null,this}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._currentState,i=this._data;return this._isPlaying?(this._reject&&this._reject({data:i,state:e,tweenable:this}),this._resolve=null,this._reject=null,this.stop(t)):this}},{key:"isPlaying",value:function(){return this._isPlaying}},{key:"hasEnded",value:function(){return this._hasEnded}},{key:"setScheduleFunction",value:function(e){t.setScheduleFunction(e)}},{key:"data",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t&&(this._data=K({},t)),this._data}},{key:"dispose",value:function(){for(var t in this)delete this[t]}}],e&&q(t.prototype,e),t}();function Ot(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new Mt;return e.tween(t),e.tweenable=e,e}Q(Mt,"now",function(){return Z}),Q(Mt,"setScheduleFunction",function(t){return ht=t}),Q(Mt,"filters",{}),Q(Mt,"formulas",pt),xt(!0);var Et,At,Tt=/(\d|-|\.)/,Ct=/([^\-0-9.]+)/g,Pt=/[0-9.-]+/g,Lt=(Et=Pt.source,At=/,\s*/.source,new RegExp("rgba?\\(".concat(Et).concat(At).concat(Et).concat(At).concat(Et,"(").concat(At).concat(Et,")?\\)"),"g")),Dt=/^.*\(/,It=/#([0-9]|[a-f]){3,6}/gi,Rt="VAL",jt=function(t,e){return t.map(function(t,i){return"_".concat(e,"_").concat(i)})};function Ft(t){return parseInt(t,16)}var zt=function(t){return"rgb(".concat((e=t,3===(e=e.replace(/#/,"")).length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[Ft(e.substr(0,2)),Ft(e.substr(2,2)),Ft(e.substr(4,2))]).join(","),")");var e},Bt=function(t,e,i){var n=e.match(t),s=e.replace(t,Rt);return n&&n.forEach(function(t){return s=s.replace(Rt,i(t))}),s},Nt=function(t){for(var e in t){var i=t[e];"string"==typeof i&&i.match(It)&&(t[e]=Bt(It,i,zt))}},Wt=function(t){var e=t.match(Pt),i=e.slice(0,3).map(Math.floor),n=t.match(Dt)[0];if(3===e.length)return"".concat(n).concat(i.join(","),")");if(4===e.length)return"".concat(n).concat(i.join(","),",").concat(e[3],")");throw new Error("Invalid rgbChunk: ".concat(t))},Vt=function(t){return t.match(Pt)},Ht=function(t,e){var i={};return e.forEach(function(e){i[e]=t[e],delete t[e]}),i},$t=function(t,e){return e.map(function(e){return t[e]})},Ut=function(t,e){return e.forEach(function(e){return t=t.replace(Rt,+e.toFixed(4))}),t},qt=function(t){for(var e in t._currentState)if("string"==typeof t._currentState[e])return!0;return!1};function Yt(t){var e=t._currentState;[e,t._originalState,t._targetState].forEach(Nt),t._tokenData=function(t){var e,i,n={};for(var s in t){var o=t[s];"string"==typeof o&&(n[s]={formatString:(e=o,i=void 0,i=e.match(Ct),i?(1===i.length||e.charAt(0).match(Tt))&&i.unshift(""):i=["",""],i.join(Rt)),chunkNames:jt(Vt(o),s)})}return n}(e)}function Xt(t){var e=t._currentState,i=t._originalState,n=t._targetState,s=t._easing,o=t._tokenData;!function(t,e){var i=function(i){var n=e[i].chunkNames,s=t[i];if("string"==typeof s){var o=s.split(" "),r=o[o.length-1];n.forEach(function(e,i){return t[e]=o[i]||r})}else n.forEach(function(e){return t[e]=s});delete t[i]};for(var n in e)i(n)}(s,o),[e,i,n].forEach(function(t){return function(t,e){var i=function(i){Vt(t[i]).forEach(function(n,s){return t[e[i].chunkNames[s]]=+n}),delete t[i]};for(var n in e)i(n)}(t,o)})}function Jt(t){var e=t._currentState,i=t._originalState,n=t._targetState,s=t._easing,o=t._tokenData;[e,i,n].forEach(function(t){return function(t,e){for(var i in e){var n=e[i],s=n.chunkNames,o=n.formatString,r=Ut(o,$t(Ht(t,s),s));t[i]=Bt(Lt,r,Wt)}}(t,o)}),function(t,e){for(var i in e){var n=e[i].chunkNames,s=t[n[0]];t[i]="string"==typeof s?n.map(function(e){var i=t[e];return delete t[e],i}).join(" "):s}}(s,o)}function Gt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function Kt(t){for(var e=1;e4&&void 0!==arguments[4]?arguments[4]:0,o=Kt({},t),r=wt(t,n);for(var a in Zt._filters.length=0,Zt.set({}),Zt._currentState=o,Zt._originalState=t,Zt._targetState=e,Zt._easing=r,te)te[a].doesApply(Zt)&&Zt._filters.push(te[a]);Zt._applyFilter("tweenCreated"),Zt._applyFilter("beforeTween");var l=gt(i,o,t,e,1,s,r);return Zt._applyFilter("afterTween"),l};function ie(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);it.strokeWidth&&(e=t.trailWidth);var i=50-e/2;return s.render(this._pathTemplate,{radius:i,"2radius":2*i})},o.prototype._trailString=function(t){return this._pathString(t)},e.exports=o},{"./shape":8,"./utils":10}],4:[function(t,e,i){var n=t("./shape"),s=t("./utils"),o=function(t,e){this._pathTemplate=e.vertical?"M {center},100 L {center},0":"M 0,{center} L 100,{center}",n.apply(this,arguments)};o.prototype=new n,o.prototype.constructor=o,o.prototype._initializeSvg=function(t,e){var i=e.vertical?"0 0 "+e.strokeWidth+" 100":"0 0 100 "+e.strokeWidth;t.setAttribute("viewBox",i),t.setAttribute("preserveAspectRatio","none")},o.prototype._pathString=function(t){return s.render(this._pathTemplate,{center:t.strokeWidth/2})},o.prototype._trailString=function(t){return this._pathString(t)},e.exports=o},{"./shape":8,"./utils":10}],5:[function(t,e,i){e.exports={Line:t("./line"),Circle:t("./circle"),SemiCircle:t("./semicircle"),Square:t("./square"),Path:t("./path"),Shape:t("./shape"),utils:t("./utils")}},{"./circle":3,"./line":4,"./path":6,"./semicircle":7,"./shape":8,"./square":9,"./utils":10}],6:[function(t,e,i){var n=t("shifty"),s=t("./utils"),o=n.Tweenable,r={easeIn:"easeInCubic",easeOut:"easeOutCubic",easeInOut:"easeInOutCubic"},a=function t(e,i){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");var n;i=s.extend({delay:0,duration:800,easing:"linear",from:{},to:{},step:function(){}},i),n=s.isString(e)?document.querySelector(e):e,this.path=n,this._opts=i,this._tweenable=null;var o=this.path.getTotalLength();this.path.style.strokeDasharray=o+" "+o,this.set(0)};a.prototype.value=function(){var t=this._getComputedDashOffset(),e=this.path.getTotalLength();return parseFloat((1-t/e).toFixed(6),10)},a.prototype.set=function(t){this.stop(),this.path.style.strokeDashoffset=this._progressToOffset(t);var e=this._opts.step;if(s.isFunction(e)){var i=this._easing(this._opts.easing);e(this._calculateTo(t,i),this._opts.shape||this,this._opts.attachment)}},a.prototype.stop=function(){this._stopTween(),this.path.style.strokeDashoffset=this._getComputedDashOffset()},a.prototype.animate=function(t,e,i){e=e||{},s.isFunction(e)&&(i=e,e={});var n=s.extend({},e),r=s.extend({},this._opts);e=s.extend(r,e);var a=this._easing(e.easing),l=this._resolveFromAndTo(t,a,n);this.stop(),this.path.getBoundingClientRect();var c=this._getComputedDashOffset(),h=this._progressToOffset(t),d=this;this._tweenable=new o,this._tweenable.tween({from:s.extend({offset:c},l.from),to:s.extend({offset:h},l.to),duration:e.duration,delay:e.delay,easing:a,step:function(t){d.path.style.strokeDashoffset=t.offset;var i=e.shape||d;e.step(t,i,e.attachment)}}).then(function(t){s.isFunction(i)&&i()}).catch(function(t){throw console.error("Error in tweening:",t),t})},a.prototype._getComputedDashOffset=function(){var t=window.getComputedStyle(this.path,null);return parseFloat(t.getPropertyValue("stroke-dashoffset"),10)},a.prototype._progressToOffset=function(t){var e=this.path.getTotalLength();return e-t*e},a.prototype._resolveFromAndTo=function(t,e,i){return i.from&&i.to?{from:i.from,to:i.to}:{from:this._calculateFrom(e),to:this._calculateTo(t,e)}},a.prototype._calculateFrom=function(t){return n.interpolate(this._opts.from,this._opts.to,this.value(),t)},a.prototype._calculateTo=function(t,e){return n.interpolate(this._opts.from,this._opts.to,t,e)},a.prototype._stopTween=function(){null!==this._tweenable&&(this._tweenable.stop(!0),this._tweenable=null)},a.prototype._easing=function(t){return r.hasOwnProperty(t)?r[t]:t},e.exports=a},{"./utils":10,shifty:2}],7:[function(t,e,i){var n=t("./shape"),s=t("./circle"),o=t("./utils"),r=function(t,e){this._pathTemplate="M 50,50 m -{radius},0 a {radius},{radius} 0 1 1 {2radius},0",this.containerAspectRatio=2,n.apply(this,arguments)};r.prototype=new n,r.prototype.constructor=r,r.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 50")},r.prototype._initializeTextContainer=function(t,e,i){t.text.style&&(i.style.top="auto",i.style.bottom="0",t.text.alignToBottom?o.setStyle(i,"transform","translate(-50%, 0)"):o.setStyle(i,"transform","translate(-50%, 50%)"))},r.prototype._pathString=s.prototype._pathString,r.prototype._trailString=s.prototype._trailString,e.exports=r},{"./circle":3,"./shape":8,"./utils":10}],8:[function(t,e,i){var n=t("./path"),s=t("./utils"),o="Object is destroyed",r=function t(e,i){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");if(0!==arguments.length){this._opts=s.extend({color:"#555",strokeWidth:1,trailColor:null,trailWidth:null,fill:null,text:{style:{color:null,position:"absolute",left:"50%",top:"50%",padding:0,margin:0,transform:{prefix:!0,value:"translate(-50%, -50%)"}},autoStyleContainer:!0,alignToBottom:!0,value:null,className:"progressbar-text"},svgStyle:{display:"block",width:"100%"},warnings:!1},i,!0),s.isObject(i)&&void 0!==i.svgStyle&&(this._opts.svgStyle=i.svgStyle),s.isObject(i)&&s.isObject(i.text)&&void 0!==i.text.style&&(this._opts.text.style=i.text.style);var o,r=this._createSvgView(this._opts);if(!(o=s.isString(e)?document.querySelector(e):e))throw new Error("Container does not exist: "+e);this._container=o,this._container.appendChild(r.svg),this._opts.warnings&&this._warnContainerAspectRatio(this._container),this._opts.svgStyle&&s.setStyles(r.svg,this._opts.svgStyle),this.svg=r.svg,this.path=r.path,this.trail=r.trail,this.text=null;var a=s.extend({attachment:void 0,shape:this},this._opts);this._progressPath=new n(r.path,a),s.isObject(this._opts.text)&&null!==this._opts.text.value&&this.setText(this._opts.text.value)}};r.prototype.animate=function(t,e,i){if(null===this._progressPath)throw new Error(o);this._progressPath.animate(t,e,i)},r.prototype.stop=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath.stop()},r.prototype.pause=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.pause()},r.prototype.resume=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.resume()},r.prototype.destroy=function(){if(null===this._progressPath)throw new Error(o);this.stop(),this.svg.parentNode.removeChild(this.svg),this.svg=null,this.path=null,this.trail=null,this._progressPath=null,null!==this.text&&(this.text.parentNode.removeChild(this.text),this.text=null)},r.prototype.set=function(t){if(null===this._progressPath)throw new Error(o);this._progressPath.set(t)},r.prototype.value=function(){if(null===this._progressPath)throw new Error(o);return void 0===this._progressPath?0:this._progressPath.value()},r.prototype.setText=function(t){if(null===this._progressPath)throw new Error(o);null===this.text&&(this.text=this._createTextContainer(this._opts,this._container),this._container.appendChild(this.text)),s.isObject(t)?(s.removeChildren(this.text),this.text.appendChild(t)):this.text.innerHTML=t},r.prototype._createSvgView=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");this._initializeSvg(e,t);var i=null;(t.trailColor||t.trailWidth)&&(i=this._createTrail(t),e.appendChild(i));var n=this._createPath(t);return e.appendChild(n),{svg:e,path:n,trail:i}},r.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 100")},r.prototype._createPath=function(t){var e=this._pathString(t);return this._createPathElement(e,t)},r.prototype._createTrail=function(t){var e=this._trailString(t),i=s.extend({},t);return i.trailColor||(i.trailColor="#eee"),i.trailWidth||(i.trailWidth=i.strokeWidth),i.color=i.trailColor,i.strokeWidth=i.trailWidth,i.fill=null,this._createPathElement(e,i)},r.prototype._createPathElement=function(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",t),i.setAttribute("stroke",e.color),i.setAttribute("stroke-width",e.strokeWidth),e.fill?i.setAttribute("fill",e.fill):i.setAttribute("fill-opacity","0"),i},r.prototype._createTextContainer=function(t,e){var i=document.createElement("div");i.className=t.text.className;var n=t.text.style;return n&&(t.text.autoStyleContainer&&(e.style.position="relative"),s.setStyles(i,n),n.color||(i.style.color=t.color)),this._initializeTextContainer(t,e,i),i},r.prototype._initializeTextContainer=function(t,e,i){},r.prototype._pathString=function(t){throw new Error("Override this function for each progress bar")},r.prototype._trailString=function(t){throw new Error("Override this function for each progress bar")},r.prototype._warnContainerAspectRatio=function(t){if(this.containerAspectRatio){var e=window.getComputedStyle(t,null),i=parseFloat(e.getPropertyValue("width"),10),n=parseFloat(e.getPropertyValue("height"),10);s.floatEquals(this.containerAspectRatio,i/n)||(console.warn("Incorrect aspect ratio of container","#"+t.id,"detected:",e.getPropertyValue("width")+"(width)","/",e.getPropertyValue("height")+"(height)","=",i/n),console.warn("Aspect ratio of should be",this.containerAspectRatio))}},e.exports=r},{"./path":6,"./utils":10}],9:[function(t,e,i){var n=t("./shape"),s=t("./utils"),o=function(t,e){this._pathTemplate="M 0,{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{strokeWidth}",this._trailTemplate="M {startMargin},{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{halfOfStrokeWidth}",n.apply(this,arguments)};o.prototype=new n,o.prototype.constructor=o,o.prototype._pathString=function(t){var e=100-t.strokeWidth/2;return s.render(this._pathTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2})},o.prototype._trailString=function(t){var e=100-t.strokeWidth/2;return s.render(this._trailTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2,startMargin:t.strokeWidth/2-t.trailWidth/2})},e.exports=o},{"./shape":8,"./utils":10}],10:[function(t,e,i){var n=t("lodash.merge"),s="Webkit Moz O ms".split(" "),o=.001;function r(t,e){var i=t;for(var n in e)if(e.hasOwnProperty(n)){var s=e[n],o=new RegExp("\\{"+n+"\\}","g");i=i.replace(o,s)}return i}function a(t,e,i){for(var n=t.style,o=0;oo[0];break;case"lt":i=this.value{const e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.hasOwn(t,e),(()=>{let t;globalThis.importScripts&&(t=globalThis.location+"");const e=globalThis.document;if(!t&&e&&("SCRIPT"===e.currentScript?.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){const i=e.getElementsByTagName("script");if(i.length){let e=i.length-1;for(;e>-1&&(!t||!/^https?:/.test(t));)t=i[e--].src}}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),i.p=t})(),(()=>{"use strict";i(336),i(712),i(544);const t={sample:{image:document.getElementById("transformation-sample-image"),video:document.getElementById("transformation-sample-video")},preview:{image:document.getElementById("sample-image"),video:document.getElementById("sample-video")},fields:document.getElementsByClassName("cld-ui-input"),button:{image:document.getElementById("refresh-image-preview"),video:document.getElementById("refresh-video-preview")},spinner:{image:document.getElementById("image-loader"),video:document.getElementById("video-loader")},optimization:{image:document.getElementById("image_settings.image_optimization"),video:document.getElementById("video_settings.video_optimization")},error_container:document.getElementById("cld-preview-error"),activeItem:null,elements:{image:[],video:[]},_placeItem(t){null!==t&&(t.style.display="block",t.style.visibility="visible",t.style.position="absolute",t.style.top=t.parentElement.clientHeight/2-t.clientHeight/2+"px",t.style.left=t.parentElement.clientWidth/2-t.clientWidth/2+"px")},_setLoading(t){this.sample[t]&&(this.button[t].style.display="block",this._placeItem(this.button[t]),this.preview[t].style.opacity="0.1")},_build(t){if(!this.sample[t])return;this.sample[t].innerHTML="",this.elements[t]=[];for(const e of this.fields){if(t!==e.dataset.context||e.dataset.disabled&&"true"===e.dataset.disabled)continue;let i=e.value.trim();if(i.length){if("select-one"===e.type){if("none"===i||!1===this.optimization[t].checked)continue;i=e.dataset.meta+"_"+i}else t=e.dataset.context,e.dataset.meta&&(i=e.dataset.meta+"_"+i),e.dataset.suffix&&(i+=e.dataset.suffix),i=this._transformations(i,t,!0);i&&this.elements[t].push(i)}}let e="";this.elements[t].length&&(e="/"+this._getGlobalTransformationElements(t).replace(/ /g,"%20")),this.sample[t].textContent=e,this.sample[t].parentElement.href="https://res.cloudinary.com/demo/"+this.sample[t].parentElement.innerText.trim().replace("../","").replace(/ /g,"%20")},_clearLoading(t){this.spinner[t].style.visibility="hidden",this.activeItem=null,this.preview[t].style.opacity=1},_refresh(t,e){if(t&&t.preventDefault(),!this.sample[e])return;const i=this,n=CLD_GLOBAL_TRANSFORMATIONS[e].preview_url+this._getGlobalTransformationElements(e)+CLD_GLOBAL_TRANSFORMATIONS[e].file;if(this.button[e].style.display="none",this._placeItem(this.spinner[e]),"image"===e){const t=new Image;t.onload=function(){i.preview[e].src=this.src,i._clearLoading(e),i.error_container&&(i.error_container.style.display="none"),t.remove()},t.onerror=function(){const t=i.elements[e].includes("f_mp4");i.error_container&&(i.error_container.style.display="block",t?(i.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[e].warning.replace("%s","f_mp4"),i.error_container.classList.replace("settings-alert-error","settings-alert-warning")):(i.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[e].error,i.error_container.classList.replace("settings-alert-warning","settings-alert-error"))),i._clearLoading(e)},t.src=n}else{const t=i._transformations(i._getGlobalTransformationElements(e),e);samplePlayer.source({publicId:"sailing_boat",transformation:t}),i._clearLoading(e)}},_getGlobalTransformationElements(t){let e=[];return e.push(this.elements[t].slice(0,2).join(",")),e.push(this.elements[t].slice(2).join(",")),e=e.filter(t=>t).join("/"),e},_transformations(t,e,i=!1){const n=CLD_GLOBAL_TRANSFORMATIONS[e].valid_types;let s=null;const o=t.split("/"),r=[];for(let t=0;t":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},n=["(","?"],s={")":["("],":":["?","?:"]},o=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var r={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,i){if(t)throw e;return i}};function a(t){var i=function(t){for(var i,r,a,l,c=[],h=[];i=t.match(o);){for(r=i[0],(a=t.substr(0,i.index).trim())&&c.push(a);l=h.pop();){if(s[r]){if(s[r][0]===l){r=s[r][1]||r;break}}else if(n.indexOf(l)>=0||e[l]1===t?0:1},d=/^i18n\.(n?gettext|has_translation)(_|$)/;var u=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var f=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var p=function(t,e){return function(i,n,s,o=10){const r=t[e];if(!f(i))return;if(!u(n))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof o)return void console.error("If specified, the hook priority must be a number.");const a={callback:s,priority:o,namespace:n};if(r[i]){const t=r[i].handlers;let e;for(e=t.length;e>0&&!(o>=t[e-1].priority);e--);e===t.length?t[e]=a:t.splice(e,0,a),r.__current.forEach(t=>{t.name===i&&t.currentIndex>=e&&t.currentIndex++})}else r[i]={handlers:[a],runs:0};"hookAdded"!==i&&t.doAction("hookAdded",i,n,s,o)}};var g=function(t,e,i=!1){return function(n,s){const o=t[e];if(!f(n))return;if(!i&&!u(s))return;if(!o[n])return 0;let r=0;if(i)r=o[n].handlers.length,o[n]={runs:o[n].runs,handlers:[]};else{const t=o[n].handlers;for(let e=t.length-1;e>=0;e--)t[e].namespace===s&&(t.splice(e,1),r++,o.__current.forEach(t=>{t.name===n&&t.currentIndex>=e&&t.currentIndex--}))}return"hookRemoved"!==n&&t.doAction("hookRemoved",n,s),r}};var m=function(t,e){return function(i,n){const s=t[e];return void 0!==n?i in s&&s[i].handlers.some(t=>t.namespace===n):i in s}};var b=function(t,e,i,n){return function(s,...o){const r=t[e];r[s]||(r[s]={handlers:[],runs:0}),r[s].runs++;const a=r[s].handlers;if(!a||!a.length)return i?o[0]:void 0;const l={name:s,currentIndex:0};return(n?async function(){try{r.__current.add(l);let t=i?o[0]:void 0;for(;l.currentIndex0:Array.from(n.__current).some(t=>t.name===i)}};var x=function(t,e){return function(i){const n=t[e];if(f(i))return n[i]&&n[i].runs?n[i].runs:0}},_=class{actions;filters;addAction;addFilter;removeAction;removeFilter;hasAction;hasFilter;removeAllActions;removeAllFilters;doAction;doActionAsync;applyFilters;applyFiltersAsync;currentAction;currentFilter;doingAction;doingFilter;didAction;didFilter;constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=p(this,"actions"),this.addFilter=p(this,"filters"),this.removeAction=g(this,"actions"),this.removeFilter=g(this,"filters"),this.hasAction=m(this,"actions"),this.hasFilter=m(this,"filters"),this.removeAllActions=g(this,"actions",!0),this.removeAllFilters=g(this,"filters",!0),this.doAction=b(this,"actions",!1,!1),this.doActionAsync=b(this,"actions",!1,!0),this.applyFilters=b(this,"filters",!0,!1),this.applyFiltersAsync=b(this,"filters",!0,!0),this.currentAction=v(this,"actions"),this.currentFilter=v(this,"filters"),this.doingAction=y(this,"actions"),this.doingFilter=y(this,"filters"),this.didAction=x(this,"actions"),this.didFilter=x(this,"filters")}};var w=function(){return new _}(),{addAction:k,addFilter:S,removeAction:M,removeFilter:O,hasAction:E,hasFilter:A,removeAllActions:T,removeAllFilters:C,doAction:P,doActionAsync:L,applyFilters:D,applyFiltersAsync:I,currentAction:R,currentFilter:j,doingAction:F,doingFilter:z,didAction:B,didFilter:N,actions:W,filters:V}=w,H=((t,e,i)=>{const n=new c({}),s=new Set,o=()=>{s.forEach(t=>t())},r=(t,e="default")=>{n.data[e]={...n.data[e],...t},n.data[e][""]={...h,...n.data[e]?.[""]},delete n.pluralForms[e]},a=(t,e)=>{r(t,e),o()},l=(t="default",e,i,s,o)=>(n.data[t]||r(void 0,t),n.dcnpgettext(t,e,i,s,o)),u=t=>t||"default",f=(t,e,n)=>{let s=l(n,e,t);return i?(s=i.applyFilters("i18n.gettext_with_context",s,t,e,n),i.applyFilters("i18n.gettext_with_context_"+u(n),s,t,e,n)):s};if(t&&a(t,e),i){const t=t=>{d.test(t)&&o()};i.addAction("hookAdded","core/i18n",t),i.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:(t="default")=>n.data[t],setLocaleData:a,addLocaleData:(t,e="default")=>{n.data[e]={...n.data[e],...t,"":{...h,...n.data[e]?.[""],...t?.[""]}},delete n.pluralForms[e],o()},resetLocaleData:(t,e)=>{n.data={},n.pluralForms={},a(t,e)},subscribe:t=>(s.add(t),()=>s.delete(t)),__:(t,e)=>{let n=l(e,void 0,t);return i?(n=i.applyFilters("i18n.gettext",n,t,e),i.applyFilters("i18n.gettext_"+u(e),n,t,e)):n},_x:f,_n:(t,e,n,s)=>{let o=l(s,void 0,t,e,n);return i?(o=i.applyFilters("i18n.ngettext",o,t,e,n,s),i.applyFilters("i18n.ngettext_"+u(s),o,t,e,n,s)):o},_nx:(t,e,n,s,o)=>{let r=l(o,s,t,e,n);return i?(r=i.applyFilters("i18n.ngettext_with_context",r,t,e,n,s,o),i.applyFilters("i18n.ngettext_with_context_"+u(o),r,t,e,n,s,o)):r},isRTL:()=>"rtl"===f("ltr","text direction"),hasTranslation:(t,e,s)=>{const o=e?e+""+t:t;let r=!!n.data?.[s??"default"]?.[o];return i&&(r=i.applyFilters("i18n.has_translation",r,t,e,s),r=i.applyFilters("i18n.has_translation_"+u(s),r,t,e,s)),r}}})(void 0,void 0,w),$=(H.getLocaleData.bind(H),H.setLocaleData.bind(H),H.resetLocaleData.bind(H),H.subscribe.bind(H),H.__.bind(H)),U=(H._x.bind(H),H._n.bind(H),H._nx.bind(H),H.isRTL.bind(H),H.hasTranslation.bind(H),["@wordpress/admin-ui","@wordpress/api-fetch","@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/boot","@wordpress/commands","@wordpress/compose","@wordpress/connectors","@wordpress/workflows","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/font-list-route","@wordpress/format-library","@wordpress/patterns","@wordpress/preferences","@wordpress/rich-text","@wordpress/route","@wordpress/router","@wordpress/routes","@wordpress/storybook","@wordpress/sync","@wordpress/theme","@wordpress/dataviews","@wordpress/fields","@wordpress/lazy-editor","@wordpress/media-editor","@wordpress/media-utils","@wordpress/upload-media","@wordpress/global-styles-engine","@wordpress/global-styles-ui","@wordpress/ui","@wordpress/views","@wordpress/widget-dashboard"]);function q(t,e){if(!t)throw new Error("Cannot lock an undefined object.");const i=t;J in i||(i[J]={}),X.set(i[J],e)}function Y(t){if(!t)throw new Error("Cannot unlock an undefined object.");const e=t;if(!(J in e))throw new Error("Cannot unlock an object that was not locked before. ");return X.get(e[J])}var X=new WeakMap,J=Symbol("Private API ID");var{lock:G,unlock:K}=((t,e)=>{if(!U.includes(e))throw new Error(`You tried to opt-in to unstable APIs as module "${e}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress."!==t)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return{lock:q,unlock:Y}})("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/api-fetch");var Q=function(t){const e=(t,i)=>{const{headers:n={}}=t;for(const s in n)if("x-wp-nonce"===s.toLowerCase()&&n[s]===e.nonce)return i(t);return i({...t,headers:{...n,"X-WP-Nonce":e.nonce}})};return e.nonce=t,e},Z=(t,e)=>{let i,n,s=t.path;return"string"==typeof t.namespace&&"string"==typeof t.endpoint&&(i=t.namespace.replace(/^\/|\/$/g,""),n=t.endpoint.replace(/^\//,""),s=n?i+"/"+n:i),delete t.namespace,delete t.endpoint,e({...t,path:s})},tt=t=>(e,i)=>Z(e,e=>{let n,s=e.url,o=e.path;return"string"==typeof o&&(n=t,-1!==t.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(o=o.replace("?","&")),s=n+o),i({...e,url:s})});function et(t){try{return decodeURIComponent(t)}catch{return t}}function it(t){const e=t.indexOf("?");if(-1===e)return t;const i=t.slice(0,e),n=t.slice(e+1);return n?i+"?"+n.split("&").map(t=>t.split("=")).map(t=>t.map(et)).sort((t,e)=>t[0].localeCompare(e[0])).map(t=>t.map(encodeURIComponent)).map(t=>t.join("=")).join("&"):i}function nt(t){return(function(t){let e;try{e=new URL(t,"http://example.com").search.substring(1)}catch{}if(e)return e}(t)||"").replace(/\+/g,"%20").split("&").reduce((t,e)=>{const i=e.indexOf("="),n=-1!==i,s=et(n?e.slice(0,i):e);if(s){const o=n?et(e.slice(i+1)):"";!function(t,e,i){const n=e.length,s=n-1;for(let o=0;o{"link"===e.toLowerCase()&&(t.headers[e]=i.replace(/<([^>]+)>/,(t,e)=>`<${encodeURI(e)}>`))}),Promise.resolve(e?t.body:new window.Response(JSON.stringify(t.body),{status:200,statusText:"OK",headers:t.headers}))}}var ct=function(t){const{OPTIONS:e={},...i}=Object.fromEntries(Object.entries(t).map(([t,e])=>[it(t),e])),n=new Set(Object.keys(i)),s=new Set(Object.keys(e));let o=!1;const r=(t,r)=>{const{parse:a=!0}=t;let l=t.path;if(!l&&t.url){const{rest_route:e,...i}=nt(t.url);"string"==typeof e&&(l=ot(e,i))}if("string"!=typeof l)return r(t);const c=t.method||"GET",h=it(l);if("GET"===c&&i[h]){const t=i[h];return o||delete i[h],n.delete(h),lt(t,!!a)}if("OPTIONS"===c&&e[h]){const t=e[h];return o||delete e[h],s.delete(h),lt(t,!!a)}return r(t)};return r[rt]=()=>{o=!0},r[at]=()=>{const t=[...Array.from(n,t=>`GET ${t}`),...Array.from(s,t=>`OPTIONS ${t}`)];t.length?console.warn("[api-fetch][preload] Some preloads were never consumed:",t):console.log("[api-fetch][preload] All preloads consumed."),n.clear(),s.clear();for(const t of Object.keys(i))delete i[t];for(const t of Object.keys(e))delete e[t]},r},ht=({path:t,url:e,...i},n)=>({...i,url:e&&ot(e,n),path:t&&ot(t,n)}),dt=t=>t.json?t.json():Promise.reject(t),ut=t=>{const{next:e}=(t=>{if(!t)return{};const e=t.match(/<([^>]+)>; rel="next"/);return e?{next:e[1]}:{}})(t.headers.get("link"));return e},ft=async(t,e)=>{if(!1===t.parse)return e(t);if(!(t=>{const e=!!t.path&&-1!==t.path.indexOf("per_page=-1"),i=!!t.url&&-1!==t.url.indexOf("per_page=-1");return e||i})(t))return e(t);const i=await Pt({...ht(t,{per_page:100}),parse:!1}),n=await dt(i);if(!Array.isArray(n))return n;let s=ut(i);if(!s)return n;let o=[].concat(n);for(;s;){const e=await Pt({...t,path:void 0,url:s,parse:!1}),i=await dt(e);o=o.concat(i),s=ut(e)}return o},pt=new Set(["PATCH","PUT","DELETE"]),gt="GET",mt=(t,e)=>{const{method:i=gt}=t;return pt.has(i.toUpperCase())&&(t={...t,headers:{"Content-Type":"application/json",...t.headers,"X-HTTP-Method-Override":i},method:"POST"}),e(t)};function bt(t,e){return nt(t)[e]}function vt(t,e){return void 0!==bt(t,e)}async function yt(t,e=!1){try{if("function"!=typeof t.text)return await t.json();const i=await t.text();return e&&""===i?null:JSON.parse(i)}catch{throw{code:"invalid_json",message:$("The response is not a valid JSON response.")}}}async function xt(t,e=!0){return e?204===t.status?null:await yt(t,!0):t}async function _t(t,e=!0){if(!e)throw t;throw await yt(t)}var wt=(t,e)=>{if(!function(t){const e=!!t.method&&"POST"===t.method;return(!!t.path&&-1!==t.path.indexOf("/wp/v2/media")||!!t.url&&-1!==t.url.indexOf("/wp/v2/media"))&&e}(t))return e(t);let i=0;const n=t=>(i++,e({path:`/wp/v2/media/${t}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>i<5?n(t):(e({path:`/wp/v2/media/${t}?force=true`,method:"DELETE"}),Promise.reject())));return e({...t,parse:!1}).catch(e=>{if(!(e instanceof globalThis.Response))return Promise.reject(e);const i=e.headers.get("x-wp-upload-attachment-id");return e.status>=500&&e.status<600&&i?n(i).catch(()=>!1!==t.parse?Promise.reject({code:"post_process",message:$("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(e)):_t(e,t.parse)}).then(e=>xt(e,t.parse))};function kt(t,...e){const i=t.replace(/^[^#]*/,""),n=(t=t.replace(/#.*/,"")).indexOf("?");if(-1===n)return t+i;const s=nt(t),o=t.substr(0,n);e.forEach(t=>delete s[t]);const r=st(s);return(r?o+"?"+r:o)+i}var St=t=>(e,i)=>{if("string"==typeof e.url){const i=bt(e.url,"wp_theme_preview");void 0===i?e.url=ot(e.url,{wp_theme_preview:t}):""===i&&(e.url=kt(e.url,"wp_theme_preview"))}if("string"==typeof e.path){const i=bt(e.path,"wp_theme_preview");void 0===i?e.path=ot(e.path,{wp_theme_preview:t}):""===i&&(e.path=kt(e.path,"wp_theme_preview"))}return i(e)},Mt={Accept:"application/json, */*;q=0.1"},Ot={credentials:"include"},Et=[(t,e)=>("string"!=typeof t.url||vt(t.url,"_locale")||(t.url=ot(t.url,{_locale:"user"})),"string"!=typeof t.path||vt(t.path,"_locale")||(t.path=ot(t.path,{_locale:"user"})),e(t)),Z,mt,ft];var At=t=>{const{url:e,path:i,data:n,parse:s=!0,...o}=t;let{body:r,headers:a}=t;a={...Mt,...a},n&&(r=JSON.stringify(n),a["Content-Type"]="application/json");return globalThis.fetch(e||i||window.location.href,{...Ot,...o,body:r,headers:a}).then(t=>t.ok?xt(t,s):_t(t,s),t=>{if(t&&"AbortError"===t.name)throw t;if(!globalThis.navigator.onLine)throw{code:"offline_error",message:$("Unable to connect. Please check your Internet connection.")};throw{code:"fetch_error",message:$("Could not get a valid response from the server.")}})},Tt=At;var Ct=t=>Et.reduceRight((t,e)=>i=>e(i,t),Tt)(t).catch(e=>"rest_cookie_invalid_nonce"!==e.code?Promise.reject(e):globalThis.fetch(Ct.nonceEndpoint).then(t=>t.ok?t.text():Promise.reject(e)).then(e=>(Ct.nonceMiddleware.nonce=e,Ct(t))));Ct.use=function(t){Et.unshift(t)},Ct.unregister=function(t){const e=Et.indexOf(t);return-1!==e&&(Et.splice(e,1),!0)},Ct.setFetchHandler=function(t){Tt=t},Ct.defaultFetchHandler=At,Ct.privateApis={},G(Ct.privateApis,{enablePreloadMultiUse:function(){for(const t of Et)t[rt]?.()},clearPreloadedData:function(){for(const t of Et)t[at]?.()}}),Ct.createNonceMiddleware=Q,Ct.createPreloadingMiddleware=ct,Ct.createRootURLMiddleware=tt,Ct.fetchAllMiddleware=ft,Ct.httpV1Middleware=mt,Ct.mediaUploadMiddleware=wt,Ct.createThemePreviewMiddleware=St;var Pt=Ct;const Lt={wpWrap:document.getElementById("wpwrap"),adminbar:document.getElementById("wpadminbar"),wpContent:document.getElementById("wpbody-content"),libraryWrap:document.getElementById("cloudinary-dam"),cloudinaryHeader:document.getElementById("cloudinary-header"),wpFooter:document.getElementById("wpfooter"),importStatus:document.getElementById("import-status"),downloading:{},_init(){const t=this,e=this.libraryWrap,i=this.importStatus;"undefined"!=typeof CLDN&&document.querySelector(CLDN.mloptions.inline_container)&&(Pt.use(Pt.createNonceMiddleware(CLDN.nonce)),cloudinary.openMediaLibrary(CLDN.mloptions,{insertHandler(n){const s=[];for(let o=0;o{o.style.opacity=1},250),Pt({path:cldData.dam.fetch_url,data:{src:n.url,filename:n.filename,attachment_id:n.attachment_id,transformations:n.transformations},method:"POST"}).then(t=>{const n=s[r];delete s[r],n.removeChild(n.firstChild),setTimeout(()=>{n.style.opacity=0,setTimeout(()=>{n.parentNode.removeChild(n),Object.keys(s).length||(e.style.marginRight="0px",i.style.display="none")},1e3)},500)})})}}}),window.addEventListener("resize",function(){t._resize()}),t._resize())},_resize(){this.libraryWrap.style.height=this.wpFooter.offsetTop-this.libraryWrap.offsetTop-this.adminbar.offsetHeight+"px"},makeProgress(t){const e=document.createElement("div"),i=document.createElement("span"),n=document.createElement("span");return e.classList.add("cld-import-item"),i.classList.add("spinner"),n.classList.add("cld-import-item-id"),n.innerText=t.public_id,e.appendChild(i),e.appendChild(n),e}};window.addEventListener("load",()=>Lt._init());const Dt={_init(){const t=this;if("undefined"!=typeof CLDIS){[...document.getElementsByClassName("cld-notice-box")].forEach(e=>{const i=e.getElementsByClassName("notice-dismiss");i.length&&i[0].addEventListener("click",i=>{e.style.height=e.offsetHeight+"px",i.preventDefault(),setTimeout(function(){t._dismiss(e)},5)})})}},_dismiss(t){const e=t.dataset.dismiss,i=parseInt(t.dataset.duration);t.classList.add("dismissed"),t.style.height="0px",setTimeout(function(){t.remove()},400),00&&Nt(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Nt(n.height)/t.offsetHeight||1);var r=(Rt(t)?It(t):window).visualViewport,a=!Vt()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/s,c=(n.top+(a&&r?r.offsetTop:0))/o,h=n.width/s,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function $t(t){var e=It(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ut(t){return t?(t.nodeName||"").toLowerCase():null}function qt(t){return((Rt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Yt(t){return Ht(qt(t)).left+$t(t).scrollLeft}function Xt(t){return It(t).getComputedStyle(t)}function Jt(t){var e=Xt(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function Gt(t,e,i){void 0===i&&(i=!1);var n,s,o=jt(e),r=jt(e)&&function(t){var e=t.getBoundingClientRect(),i=Nt(e.width)/t.offsetWidth||1,n=Nt(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=qt(e),l=Ht(t,r,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!i)&&(("body"!==Ut(e)||Jt(a))&&(c=(n=e)!==It(n)&&jt(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:$t(n)),jt(e)?((h=Ht(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=Yt(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function Kt(t){var e=Ht(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Qt(t){return"html"===Ut(t)?t:t.assignedSlot||t.parentNode||(Ft(t)?t.host:null)||qt(t)}function Zt(t){return["html","body","#document"].indexOf(Ut(t))>=0?t.ownerDocument.body:jt(t)&&Jt(t)?t:Zt(Qt(t))}function te(t,e){var i;void 0===e&&(e=[]);var n=Zt(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=It(n),r=s?[o].concat(o.visualViewport||[],Jt(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(te(Qt(r)))}function ee(t){return["table","td","th"].indexOf(Ut(t))>=0}function ie(t){return jt(t)&&"fixed"!==Xt(t).position?t.offsetParent:null}function ne(t){for(var e=It(t),i=ie(t);i&&ee(i)&&"static"===Xt(i).position;)i=ie(i);return i&&("html"===Ut(i)||"body"===Ut(i)&&"static"===Xt(i).position)?e:i||function(t){var e=/firefox/i.test(Wt());if(/Trident/i.test(Wt())&&jt(t)&&"fixed"===Xt(t).position)return null;var i=Qt(t);for(Ft(i)&&(i=i.host);jt(i)&&["html","body"].indexOf(Ut(i))<0;){var n=Xt(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}var se="top",oe="bottom",re="right",ae="left",le="auto",ce=[se,oe,re,ae],he="start",de="end",ue="viewport",fe="popper",pe=ce.reduce(function(t,e){return t.concat([e+"-"+he,e+"-"+de])},[]),ge=[].concat(ce,[le]).reduce(function(t,e){return t.concat([e,e+"-"+he,e+"-"+de])},[]),me=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function be(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}}),n.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){i.has(t.name)||s(t)}),n}var ve={placement:"bottom",modifiers:[],strategy:"absolute"};function ye(){for(var t=arguments.length,e=new Array(t),i=0;i=0?"x":"y"}function Me(t){var e,i=t.reference,n=t.element,s=t.placement,o=s?we(s):null,r=s?ke(s):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case se:e={x:a,y:i.y-n.height};break;case oe:e={x:a,y:i.y+i.height};break;case re:e={x:i.x+i.width,y:l};break;case ae:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?Se(o):null;if(null!=c){var h="y"===c?"height":"width";switch(r){case he:e[c]=e[c]-(i[h]/2-n[h]/2);break;case de:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}var Oe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ee(t){var e,i=t.popper,n=t.popperRect,s=t.placement,o=t.variation,r=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,d=t.isFixed,u=r.x,f=void 0===u?0:u,p=r.y,g=void 0===p?0:p,m="function"==typeof h?h({x:f,y:g}):{x:f,y:g};f=m.x,g=m.y;var b=r.hasOwnProperty("x"),v=r.hasOwnProperty("y"),y=ae,x=se,_=window;if(c){var w=ne(i),k="clientHeight",S="clientWidth";if(w===It(i)&&"static"!==Xt(w=qt(i)).position&&"absolute"===a&&(k="scrollHeight",S="scrollWidth"),s===se||(s===ae||s===re)&&o===de)x=oe,g-=(d&&w===_&&_.visualViewport?_.visualViewport.height:w[k])-n.height,g*=l?1:-1;if(s===ae||(s===se||s===oe)&&o===de)y=re,f-=(d&&w===_&&_.visualViewport?_.visualViewport.width:w[S])-n.width,f*=l?1:-1}var M,O=Object.assign({position:a},c&&Oe),E=!0===h?function(t,e){var i=t.x,n=t.y,s=e.devicePixelRatio||1;return{x:Nt(i*s)/s||0,y:Nt(n*s)/s||0}}({x:f,y:g},It(i)):{x:f,y:g};return f=E.x,g=E.y,l?Object.assign({},O,((M={})[x]=v?"0":"",M[y]=b?"0":"",M.transform=(_.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",M)):Object.assign({},O,((e={})[x]=v?g+"px":"",e[y]=b?f+"px":"",e.transform="",e))}const Ae={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];jt(s)&&Ut(s)&&(Object.assign(s.style,i),Object.keys(n).forEach(function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(t){var n=e.elements[t],s=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce(function(t,e){return t[e]="",t},{});jt(n)&&Ut(n)&&(Object.assign(n.style,o),Object.keys(s).forEach(function(t){n.removeAttribute(t)}))})}},requires:["computeStyles"]};const Te={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.offset,o=void 0===s?[0,0]:s,r=ge.reduce(function(t,i){return t[i]=function(t,e,i){var n=we(t),s=[ae,se].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[ae,re].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}(i,e.rects,o),t},{}),a=r[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}};var Ce={left:"right",right:"left",bottom:"top",top:"bottom"};function Pe(t){return t.replace(/left|right|bottom|top/g,function(t){return Ce[t]})}var Le={start:"end",end:"start"};function De(t){return t.replace(/start|end/g,function(t){return Le[t]})}function Ie(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Ft(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Re(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function je(t,e,i){return e===ue?Re(function(t,e){var i=It(t),n=qt(t),s=i.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=Vt();(c||!c&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+Yt(t),y:l}}(t,i)):Rt(e)?function(t,e){var i=Ht(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):Re(function(t){var e,i=qt(t),n=$t(t),s=null==(e=t.ownerDocument)?void 0:e.body,o=zt(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=zt(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+Yt(t),l=-n.scrollTop;return"rtl"===Xt(s||i).direction&&(a+=zt(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}(qt(t)))}function Fe(t,e,i,n){var s="clippingParents"===e?function(t){var e=te(Qt(t)),i=["absolute","fixed"].indexOf(Xt(t).position)>=0&&jt(t)?ne(t):t;return Rt(i)?e.filter(function(t){return Rt(t)&&Ie(t,i)&&"body"!==Ut(t)}):[]}(t):[].concat(e),o=[].concat(s,[i]),r=o[0],a=o.reduce(function(e,i){var s=je(t,i,n);return e.top=zt(s.top,e.top),e.right=Bt(s.right,e.right),e.bottom=Bt(s.bottom,e.bottom),e.left=zt(s.left,e.left),e},je(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ze(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Be(t,e){return e.reduce(function(e,i){return e[i]=t,e},{})}function Ne(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=void 0===n?t.placement:n,o=i.strategy,r=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?"clippingParents":a,c=i.rootBoundary,h=void 0===c?ue:c,d=i.elementContext,u=void 0===d?fe:d,f=i.altBoundary,p=void 0!==f&&f,g=i.padding,m=void 0===g?0:g,b=ze("number"!=typeof m?m:Be(m,ce)),v=u===fe?"reference":fe,y=t.rects.popper,x=t.elements[p?v:u],_=Fe(Rt(x)?x:x.contextElement||qt(t.elements.popper),l,h,r),w=Ht(t.elements.reference),k=Me({reference:w,element:y,strategy:"absolute",placement:s}),S=Re(Object.assign({},y,k)),M=u===fe?S:w,O={top:_.top-M.top+b.top,bottom:M.bottom-_.bottom+b.bottom,left:_.left-M.left+b.left,right:M.right-_.right+b.right},E=t.modifiersData.offset;if(u===fe&&E){var A=E[s];Object.keys(O).forEach(function(t){var e=[re,oe].indexOf(t)>=0?1:-1,i=[se,oe].indexOf(t)>=0?"y":"x";O[t]+=A[i]*e})}return O}function We(t,e,i){return zt(t,Bt(e,i))}const Ve={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0!==r&&r,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,u=i.tether,f=void 0===u||u,p=i.tetherOffset,g=void 0===p?0:p,m=Ne(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),b=we(e.placement),v=ke(e.placement),y=!v,x=Se(b),_="x"===x?"y":"x",w=e.modifiersData.popperOffsets,k=e.rects.reference,S=e.rects.popper,M="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,O="number"==typeof M?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),E=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,A={x:0,y:0};if(w){if(o){var T,C="y"===x?se:ae,P="y"===x?oe:re,L="y"===x?"height":"width",D=w[x],I=D+m[C],R=D-m[P],j=f?-S[L]/2:0,F=v===he?k[L]:S[L],z=v===he?-S[L]:-k[L],B=e.elements.arrow,N=f&&B?Kt(B):{width:0,height:0},W=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=W[C],H=W[P],$=We(0,k[L],N[L]),U=y?k[L]/2-j-$-V-O.mainAxis:F-$-V-O.mainAxis,q=y?-k[L]/2+j+$+H+O.mainAxis:z+$+H+O.mainAxis,Y=e.elements.arrow&&ne(e.elements.arrow),X=Y?"y"===x?Y.clientTop||0:Y.clientLeft||0:0,J=null!=(T=null==E?void 0:E[x])?T:0,G=D+q-J,K=We(f?Bt(I,D+U-J-X):I,D,f?zt(R,G):R);w[x]=K,A[x]=K-D}if(a){var Q,Z="x"===x?se:ae,tt="x"===x?oe:re,et=w[_],it="y"===_?"height":"width",nt=et+m[Z],st=et-m[tt],ot=-1!==[se,ae].indexOf(b),rt=null!=(Q=null==E?void 0:E[_])?Q:0,at=ot?nt:et-k[it]-S[it]-rt+O.altAxis,lt=ot?et+k[it]+S[it]-rt-O.altAxis:st,ct=f&&ot?function(t,e,i){var n=We(t,e,i);return n>i?i:n}(at,et,lt):We(f?at:nt,et,f?lt:st);w[_]=ct,A[_]=ct-et}e.modifiersData[n]=A}},requiresIfExists:["offset"]};const He={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,s=t.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,a=we(i.placement),l=Se(a),c=[ae,re].indexOf(a)>=0?"height":"width";if(o&&r){var h=function(t,e){return ze("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Be(t,ce))}(s.padding,i),d=Kt(o),u="y"===l?se:ae,f="y"===l?oe:re,p=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],g=r[l]-i.rects.reference[l],m=ne(o),b=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,v=p/2-g/2,y=h[u],x=b-d[c]-h[f],_=b/2-d[c]/2+v,w=We(y,_,x),k=l;i.modifiersData[n]=((e={})[k]=w,e.centerOffset=w-_,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Ie(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function $e(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Ue(t){return[se,re,oe,ae].some(function(e){return t[e]>=0})}var qe=xe({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,l=It(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(t){t.addEventListener("scroll",i.update,_e)}),a&&l.addEventListener("resize",i.update,_e),function(){o&&c.forEach(function(t){t.removeEventListener("scroll",i.update,_e)}),a&&l.removeEventListener("resize",i.update,_e)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=Me({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:we(e.placement),variation:ke(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Ee(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ee(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},Ae,Te,{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0===r||r,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,u=i.altBoundary,f=i.flipVariations,p=void 0===f||f,g=i.allowedAutoPlacements,m=e.options.placement,b=we(m),v=l||(b===m||!p?[Pe(m)]:function(t){if(we(t)===le)return[];var e=Pe(t);return[De(t),e,De(e)]}(m)),y=[m].concat(v).reduce(function(t,i){return t.concat(we(i)===le?function(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,o=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?ge:l,h=ke(n),d=h?a?pe:pe.filter(function(t){return ke(t)===h}):ce,u=d.filter(function(t){return c.indexOf(t)>=0});0===u.length&&(u=d);var f=u.reduce(function(e,i){return e[i]=Ne(t,{placement:i,boundary:s,rootBoundary:o,padding:r})[we(i)],e},{});return Object.keys(f).sort(function(t,e){return f[t]-f[e]})}(e,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:g}):i)},[]),x=e.rects.reference,_=e.rects.popper,w=new Map,k=!0,S=y[0],M=0;M=0,C=T?"width":"height",P=Ne(e,{placement:O,boundary:h,rootBoundary:d,altBoundary:u,padding:c}),L=T?A?re:ae:A?oe:se;x[C]>_[C]&&(L=Pe(L));var D=Pe(L),I=[];if(o&&I.push(P[E]<=0),a&&I.push(P[L]<=0,P[D]<=0),I.every(function(t){return t})){S=O,k=!1;break}w.set(O,I)}if(k)for(var R=function(t){var e=y.find(function(e){var i=w.get(e);if(i)return i.slice(0,t).every(function(t){return t})});if(e)return S=e,"break"},j=p?3:1;j>0;j--){if("break"===R(j))break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Ve,He,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=Ne(e,{elementContext:"reference"}),a=Ne(e,{altBoundary:!0}),l=$e(r,n),c=$e(a,s,o),h=Ue(l),d=Ue(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}}]}),Ye="tippy-content",Xe="tippy-backdrop",Je="tippy-arrow",Ge="tippy-svg-arrow",Ke={passive:!0,capture:!0},Qe=function(){return document.body};function Ze(t,e,i){if(Array.isArray(t)){var n=t[e];return n??(Array.isArray(i)?i[e]:i)}return t}function ti(t,e){var i={}.toString.call(t);return 0===i.indexOf("[object")&&i.indexOf(e+"]")>-1}function ei(t,e){return"function"==typeof t?t.apply(void 0,e):t}function ii(t,e){return 0===e?t:function(n){clearTimeout(i),i=setTimeout(function(){t(n)},e)};var i}function ni(t){return[].concat(t)}function si(t,e){-1===t.indexOf(e)&&t.push(e)}function oi(t){return t.split("-")[0]}function ri(t){return[].slice.call(t)}function ai(t){return Object.keys(t).reduce(function(e,i){return void 0!==t[i]&&(e[i]=t[i]),e},{})}function li(){return document.createElement("div")}function ci(t){return["Element","Fragment"].some(function(e){return ti(t,e)})}function hi(t){return ti(t,"MouseEvent")}function di(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function ui(t){return ci(t)?[t]:function(t){return ti(t,"NodeList")}(t)?ri(t):Array.isArray(t)?t:ri(document.querySelectorAll(t))}function fi(t,e){t.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function pi(t,e){t.forEach(function(t){t&&t.setAttribute("data-state",e)})}function gi(t){var e,i=ni(t)[0];return null!=i&&null!=(e=i.ownerDocument)&&e.body?i.ownerDocument:document}function mi(t,e,i){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(e){t[n](e,i)})}function bi(t,e){for(var i=e;i;){var n;if(t.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var vi={isTouch:!1},yi=0;function xi(){vi.isTouch||(vi.isTouch=!0,window.performance&&document.addEventListener("mousemove",_i))}function _i(){var t=performance.now();t-yi<20&&(vi.isTouch=!1,document.removeEventListener("mousemove",_i)),yi=t}function wi(){var t=document.activeElement;if(di(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}var ki=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Si={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Mi=Object.assign({appendTo:Qe,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Si,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Oi=Object.keys(Mi);function Ei(t){var e=(t.plugins||[]).reduce(function(e,i){var n,s=i.name,o=i.defaultValue;s&&(e[s]=void 0!==t[s]?t[s]:null!=(n=Mi[s])?n:o);return e},{});return Object.assign({},t,e)}function Ai(t,e){var i=Object.assign({},e,{content:ei(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(Ei(Object.assign({},Mi,{plugins:e}))):Oi).reduce(function(e,i){var n=(t.getAttribute("data-tippy-"+i)||"").trim();if(!n)return e;if("content"===i)e[i]=n;else try{e[i]=JSON.parse(n)}catch(t){e[i]=n}return e},{})}(t,e.plugins));return i.aria=Object.assign({},Mi.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?e.interactive:i.aria.expanded,content:"auto"===i.aria.content?e.interactive?null:"describedby":i.aria.content},i}function Ti(t,e){t.innerHTML=e}function Ci(t){var e=li();return!0===t?e.className=Je:(e.className=Ge,ci(t)?e.appendChild(t):Ti(e,t)),e}function Pi(t,e){ci(e.content)?(Ti(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ti(t,e.content):t.textContent=e.content)}function Li(t){var e=t.firstElementChild,i=ri(e.children);return{box:e,content:i.find(function(t){return t.classList.contains(Ye)}),arrow:i.find(function(t){return t.classList.contains(Je)||t.classList.contains(Ge)}),backdrop:i.find(function(t){return t.classList.contains(Xe)})}}function Di(t){var e=li(),i=li();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=li();function s(i,n){var s=Li(e),o=s.box,r=s.content,a=s.arrow;n.theme?o.setAttribute("data-theme",n.theme):o.removeAttribute("data-theme"),"string"==typeof n.animation?o.setAttribute("data-animation",n.animation):o.removeAttribute("data-animation"),n.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?o.setAttribute("role",n.role):o.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||Pi(r,t.props),n.arrow?a?i.arrow!==n.arrow&&(o.removeChild(a),o.appendChild(Ci(n.arrow))):o.appendChild(Ci(n.arrow)):a&&o.removeChild(a)}return n.className=Ye,n.setAttribute("data-state","hidden"),Pi(n,t.props),e.appendChild(i),i.appendChild(n),s(t.props,t.props),{popper:e,onUpdate:s}}Di.$$tippy=!0;var Ii=1,Ri=[],ji=[];function Fi(t,e){var i,n,s,o,r,a,l,c,h=Ai(t,Object.assign({},Mi,Ei(ai(e)))),d=!1,u=!1,f=!1,p=!1,g=[],m=ii(Y,h.interactiveDebounce),b=Ii++,v=(c=h.plugins).filter(function(t,e){return c.indexOf(t)===e}),y={id:b,reference:t,popper:li(),popperInstance:null,props:h,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(s)},setProps:function(e){0;if(y.state.isDestroyed)return;D("onBeforeUpdate",[y,e]),U();var i=y.props,n=Ai(t,Object.assign({},i,ai(e),{ignoreAttributes:!0}));y.props=n,$(),i.interactiveDebounce!==n.interactiveDebounce&&(j(),m=ii(Y,n.interactiveDebounce));i.triggerTarget&&!n.triggerTarget?ni(i.triggerTarget).forEach(function(t){t.removeAttribute("aria-expanded")}):n.triggerTarget&&t.removeAttribute("aria-expanded");R(),L(),w&&w(i,n);y.popperInstance&&(K(),Z().forEach(function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}));D("onAfterUpdate",[y,e])},setContent:function(t){y.setProps({content:t})},show:function(){0;var t=y.state.isVisible,e=y.state.isDestroyed,i=!y.state.isEnabled,n=vi.isTouch&&!y.props.touch,s=Ze(y.props.duration,0,Mi.duration);if(t||e||i||n)return;if(A().hasAttribute("disabled"))return;if(D("onShow",[y],!1),!1===y.props.onShow(y))return;y.state.isVisible=!0,E()&&(_.style.visibility="visible");L(),N(),y.state.isMounted||(_.style.transition="none");if(E()){var o=C();fi([o.box,o.content],0)}a=function(){var t;if(y.state.isVisible&&!p){if(p=!0,_.offsetHeight,_.style.transition=y.props.moveTransition,E()&&y.props.animation){var e=C(),i=e.box,n=e.content;fi([i,n],s),pi([i,n],"visible")}I(),R(),si(ji,y),null==(t=y.popperInstance)||t.forceUpdate(),D("onMount",[y]),y.props.animation&&E()&&function(t,e){V(t,e)}(s,function(){y.state.isShown=!0,D("onShown",[y])})}},function(){var t,e=y.props.appendTo,i=A();t=y.props.interactive&&e===Qe||"parent"===e?i.parentNode:ei(e,[i]);t.contains(_)||t.appendChild(_);y.state.isMounted=!0,K(),!1}()},hide:function(){0;var t=!y.state.isVisible,e=y.state.isDestroyed,i=!y.state.isEnabled,n=Ze(y.props.duration,1,Mi.duration);if(t||e||i)return;if(D("onHide",[y],!1),!1===y.props.onHide(y))return;y.state.isVisible=!1,y.state.isShown=!1,p=!1,d=!1,E()&&(_.style.visibility="hidden");if(j(),W(),L(!0),E()){var s=C(),o=s.box,r=s.content;y.props.animation&&(fi([o,r],n),pi([o,r],"hidden"))}I(),R(),y.props.animation?E()&&function(t,e){V(t,function(){!y.state.isVisible&&_.parentNode&&_.parentNode.contains(_)&&e()})}(n,y.unmount):y.unmount()},hideWithInteractivity:function(t){0;T().addEventListener("mousemove",m),si(Ri,m),m(t)},enable:function(){y.state.isEnabled=!0},disable:function(){y.hide(),y.state.isEnabled=!1},unmount:function(){0;y.state.isVisible&&y.hide();if(!y.state.isMounted)return;Q(),Z().forEach(function(t){t._tippy.unmount()}),_.parentNode&&_.parentNode.removeChild(_);ji=ji.filter(function(t){return t!==y}),y.state.isMounted=!1,D("onHidden",[y])},destroy:function(){0;if(y.state.isDestroyed)return;y.clearDelayTimeouts(),y.unmount(),U(),delete t._tippy,y.state.isDestroyed=!0,D("onDestroy",[y])}};if(!h.render)return y;var x=h.render(y),_=x.popper,w=x.onUpdate;_.setAttribute("data-tippy-root",""),_.id="tippy-"+y.id,y.popper=_,t._tippy=y,_._tippy=y;var k=v.map(function(t){return t.fn(y)}),S=t.hasAttribute("aria-expanded");return $(),R(),L(),D("onCreate",[y]),h.showOnCreate&&tt(),_.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),_.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&T().addEventListener("mousemove",m)}),y;function M(){var t=y.props.touch;return Array.isArray(t)?t:[t,0]}function O(){return"hold"===M()[0]}function E(){var t;return!(null==(t=y.props.render)||!t.$$tippy)}function A(){return l||t}function T(){var t=A().parentNode;return t?gi(t):document}function C(){return Li(_)}function P(t){return y.state.isMounted&&!y.state.isVisible||vi.isTouch||o&&"focus"===o.type?0:Ze(y.props.delay,t?0:1,Mi.delay)}function L(t){void 0===t&&(t=!1),_.style.pointerEvents=y.props.interactive&&!t?"":"none",_.style.zIndex=""+y.props.zIndex}function D(t,e,i){var n;(void 0===i&&(i=!0),k.forEach(function(i){i[t]&&i[t].apply(i,e)}),i)&&(n=y.props)[t].apply(n,e)}function I(){var e=y.props.aria;if(e.content){var i="aria-"+e.content,n=_.id;ni(y.props.triggerTarget||t).forEach(function(t){var e=t.getAttribute(i);if(y.state.isVisible)t.setAttribute(i,e?e+" "+n:n);else{var s=e&&e.replace(n,"").trim();s?t.setAttribute(i,s):t.removeAttribute(i)}})}}function R(){!S&&y.props.aria.expanded&&ni(y.props.triggerTarget||t).forEach(function(t){y.props.interactive?t.setAttribute("aria-expanded",y.state.isVisible&&t===A()?"true":"false"):t.removeAttribute("aria-expanded")})}function j(){T().removeEventListener("mousemove",m),Ri=Ri.filter(function(t){return t!==m})}function F(e){if(!vi.isTouch||!f&&"mousedown"!==e.type){var i=e.composedPath&&e.composedPath()[0]||e.target;if(!y.props.interactive||!bi(_,i)){if(ni(y.props.triggerTarget||t).some(function(t){return bi(t,i)})){if(vi.isTouch)return;if(y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else D("onClickOutside",[y,e]);!0===y.props.hideOnClick&&(y.clearDelayTimeouts(),y.hide(),u=!0,setTimeout(function(){u=!1}),y.state.isMounted||W())}}}function z(){f=!0}function B(){f=!1}function N(){var t=T();t.addEventListener("mousedown",F,!0),t.addEventListener("touchend",F,Ke),t.addEventListener("touchstart",B,Ke),t.addEventListener("touchmove",z,Ke)}function W(){var t=T();t.removeEventListener("mousedown",F,!0),t.removeEventListener("touchend",F,Ke),t.removeEventListener("touchstart",B,Ke),t.removeEventListener("touchmove",z,Ke)}function V(t,e){var i=C().box;function n(t){t.target===i&&(mi(i,"remove",n),e())}if(0===t)return e();mi(i,"remove",r),mi(i,"add",n),r=n}function H(e,i,n){void 0===n&&(n=!1),ni(y.props.triggerTarget||t).forEach(function(t){t.addEventListener(e,i,n),g.push({node:t,eventType:e,handler:i,options:n})})}function $(){var t;O()&&(H("touchstart",q,{passive:!0}),H("touchend",X,{passive:!0})),(t=y.props.trigger,t.split(/\s+/).filter(Boolean)).forEach(function(t){if("manual"!==t)switch(H(t,q),t){case"mouseenter":H("mouseleave",X);break;case"focus":H(ki?"focusout":"blur",J);break;case"focusin":H("focusout",J)}})}function U(){g.forEach(function(t){var e=t.node,i=t.eventType,n=t.handler,s=t.options;e.removeEventListener(i,n,s)}),g=[]}function q(t){var e,i=!1;if(y.state.isEnabled&&!G(t)&&!u){var n="focus"===(null==(e=o)?void 0:e.type);o=t,l=t.currentTarget,R(),!y.state.isVisible&&hi(t)&&Ri.forEach(function(e){return e(t)}),"click"===t.type&&(y.props.trigger.indexOf("mouseenter")<0||d)&&!1!==y.props.hideOnClick&&y.state.isVisible?i=!0:tt(t),"click"===t.type&&(d=!i),i&&!n&&et(t)}}function Y(t){var e=t.target,i=A().contains(e)||_.contains(e);if("mousemove"!==t.type||!i){var n=Z().concat(_).map(function(t){var e,i=null==(e=t._tippy.popperInstance)?void 0:e.state;return i?{popperRect:t.getBoundingClientRect(),popperState:i,props:h}:null}).filter(Boolean);(function(t,e){var i=e.clientX,n=e.clientY;return t.every(function(t){var e=t.popperRect,s=t.popperState,o=t.props.interactiveBorder,r=oi(s.placement),a=s.modifiersData.offset;if(!a)return!0;var l="bottom"===r?a.top.y:0,c="top"===r?a.bottom.y:0,h="right"===r?a.left.x:0,d="left"===r?a.right.x:0,u=e.top-n+l>o,f=n-e.bottom-c>o,p=e.left-i+h>o,g=i-e.right-d>o;return u||f||p||g})})(n,t)&&(j(),et(t))}}function X(t){G(t)||y.props.trigger.indexOf("click")>=0&&d||(y.props.interactive?y.hideWithInteractivity(t):et(t))}function J(t){y.props.trigger.indexOf("focusin")<0&&t.target!==A()||y.props.interactive&&t.relatedTarget&&_.contains(t.relatedTarget)||et(t)}function G(t){return!!vi.isTouch&&O()!==t.type.indexOf("touch")>=0}function K(){Q();var e=y.props,i=e.popperOptions,n=e.placement,s=e.offset,o=e.getReferenceClientRect,r=e.moveTransition,l=E()?Li(_).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||A()}:t,h={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(E()){var i=C().box;["placement","reference-hidden","escaped"].forEach(function(t){"placement"===t?i.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?i.setAttribute("data-"+t,""):i.removeAttribute("data-"+t)}),e.attributes.popper={}}}},d=[{name:"offset",options:{offset:s}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!r}},h];E()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==i?void 0:i.modifiers)||[]),y.popperInstance=qe(c,_,Object.assign({},i,{placement:n,onFirstUpdate:a,modifiers:d}))}function Q(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function Z(){return ri(_.querySelectorAll("[data-tippy-root]"))}function tt(t){y.clearDelayTimeouts(),t&&D("onTrigger",[y,t]),N();var e=P(!0),n=M(),s=n[0],o=n[1];vi.isTouch&&"hold"===s&&o&&(e=o),e?i=setTimeout(function(){y.show()},e):y.show()}function et(t){if(y.clearDelayTimeouts(),D("onUntrigger",[y,t]),y.state.isVisible){if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&d)){var e=P(!1);e?n=setTimeout(function(){y.state.isVisible&&y.hide()},e):s=requestAnimationFrame(function(){y.hide()})}}else W()}}function zi(t,e){void 0===e&&(e={});var i=Mi.plugins.concat(e.plugins||[]);document.addEventListener("touchstart",xi,Ke),window.addEventListener("blur",wi);var n=Object.assign({},e,{plugins:i}),s=ui(t).reduce(function(t,e){var i=e&&Fi(e,n);return i&&t.push(i),t},[]);return ci(t)?s[0]:s}zi.defaultProps=Mi,zi.setDefaultProps=function(t){Object.keys(t).forEach(function(e){Mi[e]=t[e]})},zi.currentInput=vi;Object.assign({},Ae,{effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow)}});zi.setDefaultProps({render:Di});const Bi=zi;var Ni=i(951),Wi=i.n(Ni);const Vi={controlled:null,bind(t){this.controlled=t,this.controlled.forEach(t=>{this._main(t)}),this._init()},_init(){this.controlled.forEach(t=>{this._checkUp(t)})},_main(t){const e=JSON.parse(t.dataset.main);t.dataset.size&&(t.filesize=parseInt(t.dataset.size,10)),t.mains=e.map(e=>{const i=document.getElementById(e),n=document.getElementById(e+"_size_wrapper");return n&&(i.filesize=0,i.sizespan=n),this._addChild(i,t),i}),this._bindEvents(t),t.mains.forEach(t=>{this._bindEvents(t)})},_bindEvents(t){t.eventBound||(t.addEventListener("click",e=>{const i=e.target;i.elements&&(this._checkDown(i),this._evaluateSize(i)),i.mains&&this._checkUp(t)}),t.eventBound=!0)},_addChild(t,e){const i=t.elements?t.elements:[];-1===i.indexOf(e)&&(i.push(e),t.elements=i)},_removeChild(t,e){const i=t.elements.indexOf(e);-1{e.checked!==t.checked&&(e.checked=t.checked,e.disabled&&(e.checked=!1),e.dispatchEvent(new Event("change")))}),t.elements.forEach(e=>{this._checkDown(e),e.elements||this._checkUp(e,t)}))},_checkUp(t,e){t.mains&&[...t.mains].forEach(t=>{t!==e&&this._evaluateCheckStatus(t),this._checkUp(t),this._evaluateSize(t)})},_evaluateCheckStatus(t){let e=0,i=t.classList.contains("partial");i&&(t.classList.remove("partial"),i=!1),t.elements.forEach(n=>{null!==n.parentNode?(e+=n.checked,n.classList.contains("partial")&&(i=!0)):this._removeChild(t,n)});let n="some";e===t.elements.length?n="on":0===e?n="off":i=!0,i&&t.classList.add("partial");const s="off"!==n;t.checked===s&&t.value===n||(t.value=n,t.checked=s,t.dispatchEvent(new Event("change")))},_evaluateSize(t){if(t.sizespan&&t.elements){t.filesize=0,t.elements.forEach(e=>{e.checked&&(t.filesize+=e.filesize)});let e=null;0Math.max(Math.min(t,i),e);function Xi(t){return Yi(qi(2.55*t),0,255)}function Ji(t){return Yi(qi(255*t),0,255)}function Gi(t){return Yi(qi(t/2.55)/100,0,1)}function Ki(t){return Yi(qi(100*t),0,100)}const Qi={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Zi=[..."0123456789ABCDEF"],tn=t=>Zi[15&t],en=t=>Zi[(240&t)>>4]+Zi[15&t],nn=t=>(240&t)>>4==(15&t);function sn(t){var e=(t=>nn(t.r)&&nn(t.g)&&nn(t.b)&&nn(t.a))(t)?tn:en;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const on=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function rn(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function an(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function ln(t,e,i){const n=rn(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function cn(t){const e=t.r/255,i=t.g/255,n=t.b/255,s=Math.max(e,i,n),o=Math.min(e,i,n),r=(s+o)/2;let a,l,c;return s!==o&&(c=s-o,l=r>.5?c/(2-s-o):c/(s+o),a=function(t,e,i,n,s){return t===s?(e-i)/n+(e>16&255,o>>8&255,255&o]}return t}(),mn.transparent=[0,0,0,0]);const e=mn[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const vn=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const yn=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,xn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function _n(t,e,i){if(t){let n=cn(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=dn(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function wn(t,e){return t?Object.assign(e||{},t):t}function kn(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Ji(t[3]))):(e=wn(t,{r:0,g:0,b:0,a:1})).a=Ji(e.a),e}function Sn(t){return"r"===t.charAt(0)?function(t){const e=vn.exec(t);let i,n,s,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?Xi(t):Yi(255*t,0,255)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?Xi(i):Yi(i,0,255)),n=255&(e[4]?Xi(n):Yi(n,0,255)),s=255&(e[6]?Xi(s):Yi(s,0,255)),{r:i,g:n,b:s,a:o}}}(t):fn(t)}class Mn{constructor(t){if(t instanceof Mn)return t;const e=typeof t;let i;var n,s,o;"object"===e?i=kn(t):"string"===e&&(o=(n=t).length,"#"===n[0]&&(4===o||5===o?s={r:255&17*Qi[n[1]],g:255&17*Qi[n[2]],b:255&17*Qi[n[3]],a:5===o?17*Qi[n[4]]:255}:7!==o&&9!==o||(s={r:Qi[n[1]]<<4|Qi[n[2]],g:Qi[n[3]]<<4|Qi[n[4]],b:Qi[n[5]]<<4|Qi[n[6]],a:9===o?Qi[n[7]]<<4|Qi[n[8]]:255})),i=s||bn(t)||Sn(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=wn(this._rgb);return t&&(t.a=Gi(t.a)),t}set rgb(t){this._rgb=kn(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Gi(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?sn(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=cn(t),i=e[0],n=Ki(e[1]),s=Ki(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${Gi(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let s;const o=e===s?.5:e,r=2*o-1,a=i.a-n.a,l=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-l,i.r=255&l*i.r+s*n.r+.5,i.g=255&l*i.g+s*n.g+.5,i.b=255&l*i.b+s*n.b+.5,i.a=o*i.a+(1-o)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const n=xn(Gi(t.r)),s=xn(Gi(t.g)),o=xn(Gi(t.b));return{r:Ji(yn(n+i*(xn(Gi(e.r))-n))),g:Ji(yn(s+i*(xn(Gi(e.g))-s))),b:Ji(yn(o+i*(xn(Gi(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Mn(this.rgb)}alpha(t){return this._rgb.a=Ji(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=qi(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return _n(this._rgb,2,t),this}darken(t){return _n(this._rgb,2,-t),this}saturate(t){return _n(this._rgb,1,t),this}desaturate(t){return _n(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=cn(t);i[0]=un(i[0]+e),i=dn(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function On(){}const En=(()=>{let t=0;return()=>t++})();function An(t){return null==t}function Tn(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function Cn(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function Pn(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function Ln(t,e){return Pn(t)?t:e}function Dn(t,e){return void 0===t?e:t}const In=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Rn(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function jn(t,e,i,n){let s,o,r;if(Tn(t))if(o=t.length,n)for(s=o-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;st,x:t=>t.x,y:t=>t.y};function Un(t,e){const i=$n[e]||($n[e]=function(t){const e=function(t){const e=t.split("."),i=[];let n="";for(const t of e)n+=t,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function qn(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Yn=t=>void 0!==t,Xn=t=>"function"==typeof t,Jn=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};const Gn=Math.PI,Kn=2*Gn,Qn=Kn+Gn,Zn=Number.POSITIVE_INFINITY,ts=Gn/180,es=Gn/2,is=Gn/4,ns=2*Gn/3,ss=Math.log10,os=Math.sign;function rs(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function xs(t,e,i){i=i||(i=>t[i]1;)n=o+s>>1,i(n)?o=n:s=n;return{lo:o,hi:s}}const _s=(t,e,i,n)=>xs(t,i,n?n=>{const s=t[n][e];return st[n][e]xs(t,i,n=>t[n][e]>=i);const ks=["push","pop","shift","splice","unshift"];function Ss(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(ks.forEach(e=>{delete t[e]}),delete t._chartjs)}function Ms(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Os="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Es(t,e){let i=[],n=!1;return function(...s){i=s,n||(n=!0,Os.call(window,()=>{n=!1,t.apply(e,i)}))}}const As=t=>"start"===t?"left":"end"===t?"right":"center",Ts=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function Cs(t,e,i){const n=e.length;let s=0,o=n;if(t._sorted){const{iScale:r,vScale:a,_parsed:l}=t,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,h=r.axis,{min:d,max:u,minDefined:f,maxDefined:p}=r.getUserBounds();if(f){if(s=Math.min(_s(l,h,d).lo,i?n:_s(e,h,r.getPixelForValue(d)).lo),c){const t=l.slice(0,s+1).reverse().findIndex(t=>!An(t[a.axis]));s-=Math.max(0,t)}s=vs(s,0,n-1)}if(p){let t=Math.max(_s(l,r.axis,u,!0).hi+1,i?0:_s(e,h,r.getPixelForValue(u),!0).hi+1);if(c){const e=l.slice(t-1).findIndex(t=>!An(t[a.axis]));t+=Math.max(0,e)}o=vs(t,s,n)-s}else o=n-s}return{start:s,count:o}}function Ps(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const o=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),o}const Ls=t=>0===t||1===t,Ds=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*Kn/i),Is=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*Kn/i)+1,Rs={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*es),easeOutSine:t=>Math.sin(t*es),easeInOutSine:t=>-.5*(Math.cos(Gn*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Ls(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Ls(t)?t:Ds(t,.075,.3),easeOutElastic:t=>Ls(t)?t:Is(t,.075,.3),easeInOutElastic(t){const e=.1125;return Ls(t)?t:t<.5?.5*Ds(2*t,e,.45):.5+.5*Is(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Rs.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*Rs.easeInBounce(2*t):.5*Rs.easeOutBounce(2*t-1)+.5};function js(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Fs(t){return js(t)?t:new Mn(t)}function zs(t){return js(t)?t:new Mn(t).saturate(.5).darken(.1).hexString()}const Bs=["x","y","borderWidth","radius","tension"],Ns=["color","borderColor","backgroundColor"];const Ws=new Map;function Vs(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=Ws.get(i);return n||(n=new Intl.NumberFormat(t,e),Ws.set(i,n)),n}(e,i).format(t)}const Hs={values:t=>Tn(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let s,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(s="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const r=ss(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Vs(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(ss(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?Hs.numeric.call(this,t,e,i):""}};var $s={formatters:Hs};const Us=Object.create(null),qs=Object.create(null);function Ys(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>zs(e.backgroundColor),this.hoverBorderColor=(t,e)=>zs(e.borderColor),this.hoverColor=(t,e)=>zs(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Xs(this,t,e)}get(t){return Ys(this,t)}describe(t,e){return Xs(qs,t,e)}override(t,e){return Xs(Us,t,e)}route(t,e,i,n){const s=Ys(this,t),o=Ys(this,i),r="_"+e;Object.defineProperties(s,{[r]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=o[n];return Cn(t)?Object.assign({},e,t):Dn(t,e)},set(t){this[r]=t}}})}apply(t){t.forEach(t=>t(this))}}var Gs=new Js({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Ns},numbers:{type:"number",properties:Bs}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:$s.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function Ks(t,e,i,n,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,i.push(s)),o>n&&(n=o),n}function Qs(t,e,i,n){let s=(n=n||{}).data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},o=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const a=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function no(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==o.strokeColor;let l,c;for(t.save(),t.font=s.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),An(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l+t||0;function bo(t,e){const i={},n=Cn(e),s=n?Object.keys(e):e,o=Cn(t)?n?i=>Dn(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of s)i[t]=mo(o(t));return i}function vo(t){return bo(t,{top:"y",right:"x",bottom:"y",left:"x"})}function yo(t){return bo(t,["topLeft","topRight","bottomLeft","bottomRight"])}function xo(t){const e=vo(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function _o(t,e){t=t||{},e=e||Gs.font;let i=Dn(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=Dn(t.style,e.style);n&&!(""+n).match(po)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:Dn(t.family,e.family),lineHeight:go(Dn(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:Dn(t.weight,e.weight),string:""};return s.string=function(t){return!t||An(t.size)||An(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(s),s}function wo(t,e,i,n){let s,o,r,a=!0;for(s=0,o=t.length;st[0]){const o=i||t;void 0===n&&(n=Ro("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:n,_getTarget:s,override:i=>So([i,...t],e,o,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>To(i,n,()=>function(t,e,i,n){let s;for(const o of e)if(s=Ro(Eo(o,t),i),void 0!==s)return Ao(t,s)?Do(i,n,t,s):s}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>jo(t).includes(e),ownKeys:t=>jo(t),set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function Mo(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Oo(t,n),setContext:e=>Mo(t,e,i,n),override:s=>Mo(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>To(t,e,()=>function(t,e,i){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=t;let a=n[e];Xn(a)&&r.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(o,r||n);a.delete(t),Ao(t,l)&&(l=Do(s._scopes,s,t,l));return l}(e,a,t,i));Tn(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=i;if(void 0!==o.index&&n(t))return e[o.index%e.length];if(Cn(e[0])){const i=e,n=s._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=Do(n,s,t,l);e.push(Mo(i,o,r&&r[t],a))}}return e}(e,a,t,r.isIndexable));Ao(e,a)&&(a=Mo(a,s,o&&o[e],r));return a}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function Oo(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:Xn(i)?i:()=>i,isIndexable:Xn(n)?n:()=>n}}const Eo=(t,e)=>t?t+qn(e):e,Ao=(t,e)=>Cn(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function To(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const n=i();return t[e]=n,n}function Co(t,e,i){return Xn(t)?t(e,i):t}const Po=(t,e)=>!0===t?e:"string"==typeof t?Un(e,t):void 0;function Lo(t,e,i,n,s){for(const o of e){const e=Po(i,o);if(e){t.add(e);const o=Co(e._fallback,i,s);if(void 0!==o&&o!==i&&o!==n)return o}else if(!1===e&&void 0!==n&&i!==n)return null}return!1}function Do(t,e,i,n){const s=e._rootScopes,o=Co(e._fallback,i,n),r=[...t,...s],a=new Set;a.add(n);let l=Io(a,r,i,o||i,n);return null!==l&&((void 0===o||o===i||(l=Io(a,r,o,l,n),null!==l))&&So(Array.from(a),[""],s,o,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];if(Tn(s)&&Cn(i))return i;return s||{}}(e,i,n)))}function Io(t,e,i,n,s){for(;i;)i=Lo(t,e,i,n,s);return i}function Ro(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function jo(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function Fo(t,e,i,n){const{iScale:s}=t,{key:o="r"}=this._parsing,r=new Array(n);let a,l,c,h;for(a=0,l=n;ae"x"===t?"y":"x";function Wo(t,e,i,n){const s=t.skip?e:t,o=e,r=i.skip?e:i,a=ps(o,s),l=ps(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function Vo(t,e="x"){const i=No(e),n=t.length,s=Array(n).fill(0),o=Array(n);let r,a,l,c=Bo(t,0);for(r=0;r!t.skip)),"monotone"===e.cubicInterpolationMode)Vo(t,s);else{let i=n?t[t.length-1]:t[0];for(o=0,r=t.length;ot.ownerDocument.defaultView.getComputedStyle(t,null);const Jo=["top","right","bottom","left"];function Go(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const o=Jo[s];n[o]=parseFloat(t[e+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function Ko(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,s=Xo(i),o="border-box"===s.boxSizing,r=Go(s,"padding"),a=Go(s,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:s,offsetY:o}=n;let r,a,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,o,t.target))r=s,a=o;else{const t=e.getBoundingClientRect();r=n.clientX-t.left,a=n.clientY-t.top,l=!0}return{x:r,y:a,box:l}}(t,i),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:p}=e;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/p*i.height/n)}}const Qo=t=>Math.round(10*t)/10;function Zo(t,e,i,n){const s=Xo(t),o=Go(s,"margin"),r=Yo(s.maxWidth,t,"clientWidth")||Zn,a=Yo(s.maxHeight,t,"clientHeight")||Zn,l=function(t,e,i){let n,s;if(void 0===e||void 0===i){const o=t&&qo(t);if(o){const t=o.getBoundingClientRect(),r=Xo(o),a=Go(r,"border","width"),l=Go(r,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=Yo(r.maxWidth,o,"clientWidth"),s=Yo(r.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||Zn,maxHeight:s||Zn}}(t,e,i);let{width:c,height:h}=l;if("content-box"===s.boxSizing){const t=Go(s,"border","width"),e=Go(s,"padding");c-=e.width+t.width,h-=e.height+t.height}c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=Qo(Math.min(c,r,l.maxWidth)),h=Qo(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Qo(c/2));return(void 0!==e||void 0!==i)&&n&&l.height&&h>l.height&&(h=l.height,c=Qo(Math.floor(h*n))),{width:c,height:h}}function tr(t,e,i){const n=e||1,s=Qo(t.height*n),o=Qo(t.width*n);t.height=Qo(t.height),t.width=Qo(t.width);const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||r.height!==s||r.width!==o)&&(t.currentDevicePixelRatio=n,r.height=s,r.width=o,t.ctx.setTransform(n,0,0,n,0,0),!0)}const er=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Uo()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function ir(t,e){const i=function(t,e){return Xo(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function nr(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function sr(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function or(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},r=nr(t,s,i),a=nr(s,o,i),l=nr(o,e,i),c=nr(r,a,i),h=nr(a,l,i);return nr(c,h,i)}function rr(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function ar(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function lr(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function cr(t){return"angle"===t?{between:bs,compare:gs,normalize:ms}:{between:ys,compare:(t,e)=>t-e,normalize:t=>t}}function hr({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:s}}function dr(t,e,i){if(!i)return[t];const{property:n,start:s,end:o}=i,r=e.length,{compare:a,between:l,normalize:c}=cr(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:s,end:o}=i,{between:r,normalize:a}=cr(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cv||l(s,b,g)&&0!==a(s,b),_=()=>!v||0===a(o,g)||l(o,b,g);for(let t=h,i=h;t<=d;++t)m=e[t%r],m.skip||(g=c(m[n]),g!==b&&(v=l(g,s,o),null===y&&x()&&(y=0===a(g,s)?t:i),null!==y&&_()&&(p.push(hr({start:y,end:t,loop:u,count:r,style:f})),y=null),i=t,b=g));return null!==y&&p.push(hr({start:y,end:d,loop:u,count:r,style:f})),p}function ur(t,e){const i=[],n=t.segments;for(let s=0;sn({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Os.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let o,r=s.length-1,a=!1;for(;r>=0;--r)o=s[r],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),a=!0):(s[r]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var yr=new vr;const xr="transparent",_r={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Fs(t||xr),s=n.valid&&Fs(e||xr);return s&&s.valid?s.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class wr{constructor(t,e,i,n){const s=e[i];n=wo([t.to,n,s,t.from]);const o=wo([t.from,s,n]);this._active=!0,this._fn=t.fn||_r[t.type||typeof o],this._easing=Rs[t.easing]||Rs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=wo([t.to,e,n,t.from]),this._from=wo([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||e1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,r,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t{const s=t[n];if(!Cn(s))return;const o={};for(const t of e)o[t]=s[t];(Tn(s.properties)&&s.properties||[n]).forEach(t=>{t!==n&&i.has(t)||i.set(t,o)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),o=Object.keys(e),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const l=o[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=s[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,r);continue}h.cancel()}d&&d.duration?(s[l]=h=new wr(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(yr.add(this._chart,i),!0):void 0}}function Sr(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:n?o:s,end:n?s:o}}function Mr(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=n.length;s0||!i&&e<0)return s.index}return null}function Cr(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,r,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Lr(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i],void 0!==e[n]._visualValues&&void 0!==e[n]._visualValues[i]&&delete e[n]._visualValues[i]}}}const Dr=t=>"reset"===t||"none"===t,Ir=(t,e)=>e?t:Object.assign({},t);class Rr{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Er(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Lr(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=e.xAxisID=Dn(i.xAxisID,Pr(t,"x")),o=e.yAxisID=Dn(i.yAxisID,Pr(t,"y")),r=e.rAxisID=Dn(i.rAxisID,Pr(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,s,o,r),c=e.vAxisID=n(a,o,s,r);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ss(this._data,this),t._stacked&&Lr(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Cn(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:n}=e,s="x"===i.axis?"x":"y",o="x"===n.axis?"x":"y",r=Object.keys(t),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l{const e="_onData"+qn(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const s=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),s}})}))),this._syncList=[],this._data=e}var n,s}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=Er(e.vScale,e),e.stack!==i.stack&&(n=!0,Lr(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&(Cr(this,e._parsed),e._stacked=Er(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=Tn(n[t])?this.parseArrayData(i,n,t,e):Cn(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const s=()=>null===l[r]||d&&l[r]t&&!e.hidden&&e._stacked&&{keys:Mr(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}(r);let d,u;function f(){u=n[d];const e=u[r.axis];return!Pn(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,s,o;for(n=0,s=e.length;n=0&&tthis.getContext(i,n,e),h);return f.$shared&&(f.$shared=a,s[o]=Object.freeze(Ir(f,a))),f}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,o=`animation-${e}`,r=s[o];if(r)return r;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),o=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(o,this.getContext(t,i,e))}const l=new kr(n,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Dr(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(e,s)||s!==n;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:o}}updateElement(t,e,i,n){Dr(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Dr(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,s=e.length,o=Math.min(s,n);o&&this.parse(0,o),s>n?this._insertElements(n,s-n,t):s{for(t.length+=e,r=t.length-1;r>=o;r--)t[r]=t[r-e]};for(a(s),r=t;rt-e))}return t._cache.$bar}(e,t.type);let n,s,o,r,a=e._length;const l=()=>{32767!==o&&-32768!==o&&(Yn(r)&&(a=Math.min(a,Math.abs(o-r)||a)),r=o)};for(n=0,s=i.length;nMath.abs(a)&&(l=a,c=r),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function zr(t,e,i,n){const s=t.iScale,o=t.vScale,r=s.getLabels(),a=s===o,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:n,color:s,useBorderRadius:o,borderRadius:r}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((e,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:e,fillStyle:l.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(a),lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:l.borderWidth,strokeStyle:l.borderColor,textAlign:n,pointStyle:i,borderRadius:o&&(r||l.borderRadius),index:a}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let s,o,r=t=>+i[t];if(Cn(i[t])){const{key:t="value"}=this._parsing;r=e=>+Un(i[e],t)}for(s=t,o=t+e;sbs(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>bs(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),g=f(0,c,d),m=f(es,h,u),b=p(Gn,c,d),v=p(Gn+es,h,u);n=(g-b)/2,s=(m-v)/2,o=-(g+b)/2,r=-(m+v)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}(u,d,a),b=(i.width-o)/f,v=(i.height-o)/p,y=Math.max(Math.min(b,v)/2,0),x=In(this.options.radius,y),_=(x-Math.max(x*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=m*x,n.total=this.calculateTotal(),this.outerRadius=x-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*h,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*s/Kn)}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,r=o.chartArea,a=o.options.animation,l=(r.left+r.right)/2,c=(r.top+r.bottom)/2,h=s&&a.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,{sharedOptions:f,includeOptions:p}=this._getSharedOptions(e,n);let g,m=this._getRotation();for(g=0;g0&&!isNaN(t)?Kn*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=Vs(e._parsed[t],i.options.locale);return{label:n[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,o,r,a;if(!t)for(n=0,s=i.data.datasets.length;n{const o=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:n,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=Vs(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:s}}parseObjectData(t,e,i,n){return Fo.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{const n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(ne.max&&(e.max=n))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),o=(s-Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=s-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,r=o.options.animation,a=this._cachedMeta.rScale,l=a.xCenter,c=a.yCenter,h=a.getIndexAngle(0)-.5*Gn;let d,u=h;const f=360/this.countVisibleElements();for(d=0;d{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?hs(this.resolveDataElementOptions(t,e).angle||i):0}}var qr=Object.freeze({__proto__:null,BarController:class extends Rr{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,n){return zr(t,e,i,n)}parseArrayData(t,e,i,n){return zr(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:s,vScale:o}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,l="x"===s.axis?r:a,c="x"===o.axis?r:a,h=[];let d,u,f,p;for(d=i,u=i+n;dt.controller.options.grouped),s=i.options.stacked,o=[],r=this._cachedMeta.controller.getParsed(e),a=r&&r[i.axis],l=t=>{const e=t._parsed.find(t=>t[i.axis]===a),n=e&&e[t.vScale.axis];if(An(n)||isNaN(n))return!0};for(const i of n)if((void 0===e||!l(i))&&((!1===s||-1===o.indexOf(i.stack)||void 0===s&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Dn("x"===this.chart.options.indexAxis?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const n=this._getStacks(t,i),s=void 0!==e?n.indexOf(e):-1;return-1===s?n.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let s,o;for(s=0,o=e.data.length;s=i?1:-1)}(d,e,r)*o,u===r&&(m-=d/2);const t=e.getPixelForDecimal(0),s=e.getPixelForDecimal(1),l=Math.min(t,s),f=Math.max(t,s);m=Math.max(Math.min(m,f),l),h=m+d,i&&!c&&(a._stacks[e.axis]._visualValues[n]=e.getValueForPixel(h)-e.getValueForPixel(m))}if(m===e.getPixelForValue(r)){const t=os(d)*e.getLineWidthForValue(r)/2;m+=t,d-=t}return{size:d,base:m,head:h,center:h+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,s=n.skipNull,o=Dn(n.maxBarThickness,1/0);let r,a;const l=this._getAxisCount();if(e.grouped){const i=s?this._getStackCount(t):e.stackCount,c="flex"===n.barThickness?function(t,e,i,n){const s=e.pixels,o=s[t];let r=t>0?s[t-1]:null,a=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:s}=e,o=this.getParsed(t),r=n.getLabelForValue(o.x),a=s.getLabelForValue(o.y),l=o._custom;return{label:i[t]||"",value:"("+r+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(e,n),c=o.axis,h=r.axis;for(let d=e;d0&&this.getParsed(e-1);for(let i=0;i=b){v.skip=!0;continue}const x=this.getParsed(i),_=An(x[u]),w=v[d]=o.getPixelForValue(x[d],i),k=v[u]=s||_?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,x,a):x[u],i);v.skip=isNaN(w)||isNaN(k)||_,v.stop=i>0&&Math.abs(x[d]-y[d])>g,p&&(v.parsed=x,v.raw=l.data[i]),h&&(v.options=c||this.resolveDataElementOptions(i,f.active?"active":n)),m||this.updateElement(f,i,v,n),y=x}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends $r{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:Ur,RadarController:class extends Rr{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return Fo.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this._cachedMeta.rScale,o="reset"===n;for(let r=e;r0&&this.getParsed(e-1);for(let c=e;c0&&Math.abs(i[u]-v[u])>m,g&&(p.parsed=i,p.raw=l.data[c]),d&&(p.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),b||this.updateElement(e,c,p,n),v=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const s=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,s,o)/2}}});function Yr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xr{static override(t){Object.assign(Xr.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Yr()}parse(){return Yr()}format(){return Yr()}add(){return Yr()}diff(){return Yr()}startOf(){return Yr()}endOf(){return Yr()}}var Jr=Xr;function Gr(t,e,i,n){const{controller:s,data:o,_sorted:r}=t,a=s._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&"r"!==e&&r&&o.length){const r=a._reversePixels?ws:_s;if(!n){const n=r(o,e,i);if(l){const{vScale:e}=s._cachedMeta,{_parsed:i}=t,o=i.slice(0,n.lo+1).reverse().findIndex(t=>!An(t[e.axis]));n.lo-=Math.max(0,o);const r=i.slice(n.hi).findIndex(t=>!An(t[e.axis]));n.hi+=Math.max(0,r)}return n}if(s._sharedOptions){const t=o[0],n="function"==typeof t.getRange&&t.getRange(e);if(n){const t=r(o,e,i-n),s=r(o,e,i+n);return{lo:t.lo,hi:s.hi}}}}return{lo:0,hi:o.length-1}}function Kr(t,e,i,n,s){const o=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=o.length;t{t[r]&&t[r](e[i],s)&&(o.push({element:t,datasetIndex:n,index:l}),a=a||t.inRange(e.x,e.y,s))}),n&&!a?[]:o}var ia={evaluateInteractionItems:Kr,modes:{index(t,e,i,n){const s=Ko(e,t),o=i.axis||"x",r=i.includeInvisible||!1,a=i.intersect?Qr(t,s,o,n,r):ta(t,s,o,!1,n,r),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,n){const s=Ko(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;let a=i.intersect?Qr(t,s,o,n,r):ta(t,s,o,!1,n,r);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;tQr(t,Ko(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){const s=Ko(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;return ta(t,s,o,i.intersect,n,r)},x:(t,e,i,n)=>ea(t,Ko(e,t),"x",i.intersect,n),y:(t,e,i,n)=>ea(t,Ko(e,t),"y",i.intersect,n)}};const na=["left","top","right","bottom"];function sa(t,e){return t.filter(t=>t.pos===e)}function oa(t,e){return t.filter(t=>-1===na.indexOf(t.pos)&&t.box.axis===e)}function ra(t,e){return t.sort((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function aa(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:s}=i;if(!t||!na.includes(n))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let o,r,a;for(o=0,r=t.length;o{n[t]=Math.max(e[t],i[t])}),n}return n(t?["left","right"]:["top","bottom"])}function ua(t,e,i,n){const s=[];let o,r,a,l,c,h;for(o=0,r=t.length,c=0;ot.box.fullSize),!0),n=ra(sa(e,"left"),!0),s=ra(sa(e,"right")),o=ra(sa(e,"top"),!0),r=ra(sa(e,"bottom")),a=oa(e,"x"),l=oa(e,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:sa(e,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;jn(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},s);ca(u,xo(n));const f=Object.assign({maxPadding:u,w:o,h:r,x:s.left,y:s.top},s),p=aa(l.concat(c),d);ua(a.fullSize,f,d,p),ua(l,f,d,p),ua(c,f,d,p)&&ua(l,f,d,p),function(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),pa(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,pa(a.rightAndBottom,f,d,p),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},jn(a.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class ma{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class ba extends ma{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const va="$chartjs",ya={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xa=t=>null===t||""===t;const _a=!!er&&{passive:!0};function wa(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,_a)}function ka(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Sa(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||ka(i.addedNodes,n),e=e&&!ka(i.removedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function Ma(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||ka(i.removedNodes,n),e=e&&!ka(i.addedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}const Oa=new Map;let Ea=0;function Aa(){const t=window.devicePixelRatio;t!==Ea&&(Ea=t,Oa.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Ta(t,e,i){const n=t.canvas,s=n&&qo(n);if(!s)return;const o=Es((t,e)=>{const n=s.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||o(i,n)});return r.observe(s),function(t,e){Oa.size||window.addEventListener("resize",Aa),Oa.set(t,e)}(t,o),r}function Ca(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Oa.delete(t),Oa.size||window.removeEventListener("resize",Aa)}(t)}function Pa(t,e,i){const n=t.canvas,s=Es(e=>{null!==t.ctx&&i(function(t,e){const i=ya[t.type]||t.type,{x:n,y:s}=Ko(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==s?s:null}}(e,t))},t);return function(t,e,i){t&&t.addEventListener(e,i,_a)}(n,e,s),s}class La extends ma{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),s=t.getAttribute("width");if(t[va]={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",xa(s)){const e=ir(t,"width");void 0!==e&&(t.width=e)}if(xa(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ir(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[va])return!1;const i=e[va].initial;["height","width"].forEach(t=>{const n=i[t];An(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e[va],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:Sa,detach:Ma,resize:Ta}[e]||Pa;n[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:Ca,detach:Ca,resize:Ca}[e]||wa)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Zo(t,e,i,n)}isAttached(t){const e=t&&qo(t);return!(!e||!e.isConnected)}}class Da{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return ls(this.x)&&ls(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}function Ia(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),s=t._maxLength/i;return Math.floor(Math.min(n,s))}(t),s=Math.min(i.maxTicksLimit||n,n),o=i.major.enabled?function(t){const e=[];let i,n;for(i=0,n=t.length;is)return function(t,e,i,n){let s,o=0,r=i[0];for(n=Math.ceil(n),s=0;st-e).pop(),e}(n);for(let t=0,e=o.length-1;ts)return e}return Math.max(s,1)}(o,e,s);if(r>0){let t,i;const n=r>1?Math.round((l-a)/(r-1)):null;for(Ra(e,c,h,An(n)?0:a-n,a),t=0,i=r-1;t"top"===e||"left"===e?t[e]+i:t[e]-i,Fa=(t,e)=>Math.min(e||t,t);function za(t,e){const i=[],n=t.length/e,s=t.length;let o=0;for(;or+a)))return c}function Na(t){return t.drawTicks?t.tickLength:0}function Wa(t,e){if(!t.display)return 0;const i=_o(t.font,e),n=xo(t.padding);return(Tn(t.text)?t.text.length:1)*i.lineHeight+n.height}function Va(t,e,i){let n=As(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Ha extends Da{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=Ln(t,Number.POSITIVE_INFINITY),e=Ln(e,Number.NEGATIVE_INFINITY),i=Ln(i,Number.POSITIVE_INFINITY),n=Ln(n,Number.NEGATIVE_INFINITY),{min:Ln(t,i),max:Ln(e,n),minDefined:Pn(t),maxDefined:Pn(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:s,maxDefined:o}=this.getUserBounds();if(s&&o)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let a=0,l=r.length;an?n:i,n=s&&i>n?i:n,{min:Ln(i,Ln(n,i)),max:Ln(n,Ln(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Rn(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:s}=t,o=In(e,(s-n)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(n,-Math.abs(o)),max:r(s,o)}}(this,s,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=vs(this.chart.width-h,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),h+6>o&&(o=u/(i-(t.offset?.5:1)),r=this.maxHeight-Na(t.grid)-e.padding-Wa(t.title,this.chart.options.font),a=Math.sqrt(h*h+d*d),l=ds(Math.min(Math.asin(vs((c.highest.height+6)/o,-1,1)),Math.asin(vs(r/a,-1,1))-Math.asin(vs(d/a,-1,1)))),l=Math.max(n,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){Rn(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Rn(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const o=Wa(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Na(s)+o):(t.height=this.maxHeight,t.width=Na(s)+o),i.display&&this.ticks.length){const{first:e,last:n,widest:s,highest:o}=this._getLabelSizes(),a=2*i.padding,l=hs(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(r){const e=i.mirror?0:h*s.width+c*o.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:c*s.width+h*o.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:s,padding:o},position:r}=this.options,a=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;a?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?h=t.width:"inner"!==s&&(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-r+o)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-c+o)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+o,this.paddingBottom=n+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Rn(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s({width:o[t]||0,height:r[t]||0});return{first:k(0),last:k(e-1),widest:k(_),highest:k(w),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return vs(this._alignToPixels?Zs(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tr*n?r/i:a/n:a*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:s,position:o,border:r}=n,a=s.offset,l=this.isHorizontal(),c=this.ticks.length+(a?1:0),h=Na(s),d=[],u=r.setContext(this.getContext()),f=u.display?u.width:0,p=f/2,g=function(t){return Zs(i,t,f)};let m,b,v,y,x,_,w,k,S,M,O,E;if("top"===o)m=g(this.bottom),_=this.bottom-h,k=m-p,M=g(t.top)+p,E=t.bottom;else if("bottom"===o)m=g(this.top),M=t.top,E=g(t.bottom)-p,_=m+p,k=this.top+h;else if("left"===o)m=g(this.right),x=this.right-h,w=m-p,S=g(t.left)+p,O=t.right;else if("right"===o)m=g(this.left),S=t.left,O=g(t.right)-p,x=m+p,w=this.left+h;else if("x"===e){if("center"===o)m=g((t.top+t.bottom)/2+.5);else if(Cn(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}M=t.top,E=t.bottom,_=m+p,k=_+h}else if("y"===e){if("center"===o)m=g((t.left+t.right)/2);else if(Cn(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}x=m-p,w=x-h,S=t.left,O=t.right}const A=Dn(n.ticks.maxTicksLimit,c),T=Math.max(1,Math.ceil(c/A));for(b=0;b0&&(o-=n/2)}d={left:o,top:s,width:n+e.width,height:i+e.height,color:t.backdropColor}}g.push({label:y,font:S,textOffset:E,options:{rotation:p,color:i,strokeColor:a,strokeWidth:c,textAlign:u,textBaseline:A,translation:[x,_],backdrop:d}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-hs(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:s}}=this.options,o=t+s,r=this._getLabelSizes().widest.width;let a,l;return"left"===e?n?(l=this.right+s,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l+=r)):(l=this.right-o,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l=this.left)):"right"===e?n?(l=this.left+s,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l-=r)):(l=this.left+o,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:s,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,s,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(e=>e.value===t);if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,o=n.length;s{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,o;for(s=0,o=e.length;s{const n=i.split("."),s=n.pop(),o=[t].concat(n).join("."),r=e[i].split("."),a=r.pop(),l=r.join(".");Gs.route(o,s,l,a)})}(e,t.defaultRoutes);t.descriptors&&Gs.describe(e,t.descriptors)}(t,o,i),this.override&&Gs.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Gs[n]&&(delete Gs[n][i],this.override&&delete Us[i])}}class Ua{constructor(){this.controllers=new $a(Rr,"datasets",!0),this.elements=new $a(Da,"elements"),this.plugins=new $a(Object,"plugins"),this.scales=new $a(Ha,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):jn(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=qn(t);Rn(i["before"+n],[],i),e[t](i),Rn(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Xa(t,e){return e||!1!==t?!0===t?{}:t:null}function Ja(t,{plugin:e,local:i},n,s){const o=t.pluginScopeKeys(e),r=t.getOptionScopes(n,o);return i&&e.defaults&&r.push(e.defaults),t.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ga(t,e){const i=Gs.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Ka(t){if("x"===t||"y"===t||"r"===t)return t}function Qa(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function Za(t,...e){if(Ka(t))return t;for(const i of e){const e=i.axis||Qa(i.position)||t.length>1&&Ka(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function tl(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function el(t,e){const i=Us[t.type]||{scales:{}},n=e.scales||{},s=Ga(t.type,e),o=Object.create(null);return Object.keys(n).forEach(e=>{const r=n[e];if(!Cn(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const a=Za(e,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return tl(t,"x",i[0])||tl(t,"y",i[0])}return{}}(e,t),Gs.scales[r.type]),l=function(t,e){return t===e?"_index_":"_value_"}(a,s),c=i.scales||{};o[e]=Vn(Object.create(null),[{axis:a},r,c[a],c[l]])}),t.data.datasets.forEach(i=>{const s=i.type||t.type,r=i.indexAxis||Ga(s,e),a=(Us[s]||{}).scales||{};Object.keys(a).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),s=i[e+"AxisID"]||e;o[s]=o[s]||Object.create(null),Vn(o[s],[{axis:e},n[s],a[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];Vn(e,[Gs.scales[e.type],Gs.scale])}),o}function il(t){const e=t.options||(t.options={});e.plugins=Dn(e.plugins,{}),e.scales=el(t,e)}function nl(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const sl=new Map,ol=new Set;function rl(t,e){let i=sl.get(t);return i||(i=e(),sl.set(t,i),ol.add(i)),i}const al=(t,e,i)=>{const n=Un(e,i);void 0!==n&&t.add(n)};class ll{constructor(t){this._config=function(t){return(t=t||{}).data=nl(t.data),il(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=nl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),il(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return rl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return rl(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return rl(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return rl(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:s}=this,o=this._cachedScopes(t,i),r=o.get(e);if(r)return r;const a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>al(a,t,e))),e.forEach(t=>al(a,n,t)),e.forEach(t=>al(a,Us[s]||{},t)),e.forEach(t=>al(a,Gs,t)),e.forEach(t=>al(a,qs,t))});const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),ol.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Us[e]||{},Gs.datasets[e]||{},{type:e},Gs,qs]}resolveNamedOptions(t,e,i,n=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=cl(this._resolverCache,t,n);let a=o;if(function(t,e){const{isScriptable:i,isIndexable:n}=Oo(t);for(const s of e){const e=i(s),o=n(s),r=(o||e)&&t[s];if(e&&(Xn(r)||hl(r))||o&&Tn(r))return!0}return!1}(o,e)){s.$shared=!1;a=Mo(o,i=Xn(i)?i():i,this.createResolver(t,i,r))}for(const t of e)s[t]=a[t];return s}createResolver(t,e,i=[""],n){const{resolver:s}=cl(this._resolverCache,t,i);return Cn(e)?Mo(s,e,void 0,n):s}}function cl(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const s=i.join();let o=n.get(s);if(!o){o={resolver:So(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(s,o)}return o}const hl=t=>Cn(t)&&Object.getOwnPropertyNames(t).some(e=>Xn(t[e]));const dl=["top","bottom","left","right","chartArea"];function ul(t,e){return"top"===t||"bottom"===t||-1===dl.indexOf(t)&&"x"===e}function fl(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function pl(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Rn(i&&i.onComplete,[t],e)}function gl(t){const e=t.chart,i=e.options.animation;Rn(i&&i.onProgress,[t],e)}function ml(t){return Uo()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const bl={},vl=t=>{const e=ml(t);return Object.values(bl).filter(t=>t.canvas===e).pop()};function yl(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const o=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=o)}}}class xl{static defaults=Gs;static instances=bl;static overrides=Us;static registry=qa;static version="4.5.1";static getChart=vl;static register(...t){qa.add(...t),_l()}static unregister(...t){qa.remove(...t),_l()}constructor(t,e){const i=this.config=new ll(e),n=ml(t),s=vl(n);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Uo()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?ba:La}(n)),this.platform.updateConfig(i);const r=this.platform.acquireContext(n,o.aspectRatio),a=r&&r.canvas,l=a&&a.height,c=a&&a.width;this.id=En(),this.ctx=r,this.canvas=a,this.width=c,this.height=l,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ya,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),o.resizeDelay||0),this._dataChanges=[],bl[this.id]=this,r&&a?(yr.listen(this,"complete",pl),yr.listen(this,"progress",gl),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:s}=this;return An(t)?e&&s?s:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return qa}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return to(this.canvas,this.ctx),this}stop(){return yr.stop(this),this}resize(t,e){yr.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,t,e,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,tr(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Rn(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){jn(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let s=[];e&&(s=s.concat(Object.keys(e).map(t=>{const i=e[t],n=Za(t,i),s="r"===n,o="x"===n;return{options:i,dposition:s?"chartArea":o?"bottom":"left",dtype:s?"radialLinear":o?"category":"linear"}}))),jn(s,e=>{const s=e.options,o=s.id,r=Za(o,s),a=Dn(s.type,e.dtype);void 0!==s.position&&ul(s.position,r)===ul(e.dposition)||(s.position=e.dposition),n[o]=!0;let l=null;if(o in i&&i[o].type===a)l=i[o];else{l=new(qa.getScale(a))({id:o,type:a,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(s,t)}),jn(n,(t,e)=>{t||delete i[e]}),jn(i,t=>{ga.configure(this,t,t.options),ga.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(fl("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){jn(this.scales,t=>{ga.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);Jn(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e){yl(t,n,"_removeElements"===i?-s:s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;ga.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],jn(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},n=br(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(n&&so(e,n),t.controller.draw(),n&&oo(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return no(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const s=ia.modes[e];return"function"==typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=ko(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,n);Yn(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(s,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),yr.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};jn(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():o()}unbindEvents(){jn(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},jn(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,o,r,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),r=0,a=t.length;r{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!Fn(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=s(e,t),r=i?t:s(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:s}=this,o=e,r=this._getActiveElements(t,n,i,o),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,Rn(s.onHover,[t,r,this],this),a&&Rn(s.onClick,[t,r,this],this));const c=!Fn(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}function _l(){return jn(xl.instances,t=>t._plugins.invalidate())}function wl(t,e,i,n){const s=bo(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(i-e)/2,r=Math.min(o,n*e/2),a=t=>{const e=(i-Math.min(o,t))*n/2;return vs(t,0,Math.min(o,e))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:vs(s.innerStart,0,r),innerEnd:vs(s.innerEnd,0,r)}}function kl(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function Sl(t,e,i,n,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=e,d=Math.max(e.outerRadius+n+i-c,0),u=h>0?h+n+i+c:0;let f=0;const p=s-l;if(n){const t=((h>0?h-n:0)+(d>0?d-n:0))/2;f=(p-(0!==t?p*t/(t+n):p))/2}const g=(p-Math.max(.001,p*d-i/Gn)/d)/2,m=l+g+f,b=s-g-f,{outerStart:v,outerEnd:y,innerStart:x,innerEnd:_}=wl(e,u,d,b-m),w=d-v,k=d-y,S=m+v/w,M=b-y/k,O=u+x,E=u+_,A=m+x/O,T=b-_/E;if(t.beginPath(),o){const e=(S+M)/2;if(t.arc(r,a,d,S,e),t.arc(r,a,d,e,M),y>0){const e=kl(k,M,r,a);t.arc(e.x,e.y,y,M,b+es)}const i=kl(E,b,r,a);if(t.lineTo(i.x,i.y),_>0){const e=kl(E,T,r,a);t.arc(e.x,e.y,_,b+es,T+Math.PI)}const n=(b-_/u+(m+x/u))/2;if(t.arc(r,a,u,b-_/u,n,!0),t.arc(r,a,u,n,m+x/u,!0),x>0){const e=kl(O,A,r,a);t.arc(e.x,e.y,x,A+Math.PI,m-es)}const s=kl(w,m,r,a);if(t.lineTo(s.x,s.y),v>0){const e=kl(w,S,r,a);t.arc(e.x,e.y,v,m-es,S)}}else{t.moveTo(r,a);const e=Math.cos(S)*d+r,i=Math.sin(S)*d+a;t.lineTo(e,i);const n=Math.cos(M)*d+r,s=Math.sin(M)*d+a;t.lineTo(n,s)}t.closePath()}function Ml(t,e,i,n,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=e,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u,borderRadius:f}=l,p="inner"===l.borderAlign;if(!c)return;t.setLineDash(d||[]),t.lineDashOffset=u,p?(t.lineWidth=2*c,t.lineJoin=h||"round"):(t.lineWidth=c,t.lineJoin=h||"bevel");let g=e.endAngle;if(o){Sl(t,e,i,n,g,s);for(let e=0;es?(c=s/l,t.arc(o,r,l,i+c,n-c,!0)):t.arc(o,r,s,i+es,n-es),t.closePath(),t.clip()}(t,e,g),l.selfJoin&&g-r>=Gn&&0===f&&"miter"!==h&&function(t,e,i){const{startAngle:n,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=e,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/r,ms(n-i));if(t.beginPath(),t.arc(s,o,r-c/2,n+d/2,i-d/2),a>0){const e=Math.min(c/a,ms(n-i));t.arc(s,o,a+c/2,i-e/2,n+e/2,!0)}else{const e=Math.min(c/2,r*ms(n-i));if("round"===h)t.arc(s,o,e,i-Gn/2,n+Gn/2,!0);else if("bevel"===h){const r=2*e*e,a=-r*Math.cos(i+Gn/2)+s,l=-r*Math.sin(i+Gn/2)+o,c=r*Math.cos(n+Gn/2)+s,h=r*Math.sin(n+Gn/2)+o;t.lineTo(a,l),t.lineTo(c,h)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}(t,e,g),o||(Sl(t,e,i,n,g,s),t.stroke())}function Ol(t,e,i=e){t.lineCap=Dn(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Dn(i.borderDash,e.borderDash)),t.lineDashOffset=Dn(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Dn(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Dn(i.borderWidth,e.borderWidth),t.strokeStyle=Dn(i.borderColor,e.borderColor)}function El(t,e,i){t.lineTo(i.x,i.y)}function Al(t,e,i={}){const n=t.length,{start:s=0,end:o=n-1}=i,{start:r,end:a}=e,l=Math.max(s,r),c=Math.min(o,a),h=sa&&o>a;return{count:n,start:l,loop:e.loop,ilen:c(r+(c?a-t:t))%o,y=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=s[v(0)],t.moveTo(d.x,d.y)),h=0;h<=a;++h){if(d=s[v(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ip&&(p=i),m=(b*m+e)/++b):(y(),t.lineTo(e,i),u=n,b=0,f=p=i),g=i}y()}function Pl(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?Cl:Tl}const Ll="function"==typeof Path2D;function Dl(t,e,i,n){Ll&&!e.options.segment?function(t,e,i,n){let s=e._path;s||(s=e._path=new Path2D,e.path(s,i,n)&&s.closePath()),Ol(t,e.options),t.stroke(s)}(t,e,i,n):function(t,e,i,n){const{segments:s,options:o}=e,r=Pl(e);for(const a of s)Ol(t,o,a.style),t.beginPath(),r(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}class Il extends Da{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;$o(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const o=!!t._loop,{start:r,end:a}=function(t,e,i,n){let s=0,o=e-1;if(i&&!n)for(;ss&&t[o%e].skip;)o--;return o%=e,{start:s,end:o}}(i,s,o,n);return fr(t,!0===n?[{start:r,end:a,loop:o}]:function(t,e,i,n){const s=t.length,o=[];let r,a=e,l=t[e];for(r=e+1;r<=i;++r){const i=t[r%s];i.skip||i.stop?l.skip||(n=!1,o.push({start:e%s,end:(r-1)%s,loop:n}),e=a=i.stop?r:null):(a=r,l.skip&&(e=r)),l=i}return null!==a&&o.push({start:e%s,end:a%s,loop:n}),o}(i,r,a"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:s,distance:o}=fs(n,{x:t,y:e}),{startAngle:r,endAngle:a,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,u=Dn(h,a-r),f=bs(s,r,a)&&r!==a,p=u>=Kn||f,g=ys(o,l+d,c+d);return p&&g}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:a,spacing:l}=this.options,c=(n+s)/2,h=(o+r+l+a)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/4,s=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>Kn?Math.floor(i/Kn):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*n,Math.sin(r)*n);const a=n*(1-Math.sin(Math.min(Gn,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,n,s){const{fullCircles:o,startAngle:r,circumference:a}=e;let l=e.endAngle;if(o){Sl(t,e,i,n,l,s);for(let e=0;et.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ul(t){return Hl[t%Hl.length]}function ql(t){return $l[t%$l.length]}function Yl(t){let e=0;return(i,n)=>{const s=t.getDatasetMeta(n).controller;s instanceof $r?e=function(t,e){return t.backgroundColor=t.data.map(()=>Ul(e++)),e}(i,e):s instanceof Ur?e=function(t,e){return t.backgroundColor=t.data.map(()=>ql(e++)),e}(i,e):s&&(e=function(t,e){return t.borderColor=Ul(e),t.backgroundColor=ql(e),++e}(i,e))}}function Xl(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var Jl={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:n},options:s}=t.config,{elements:o}=s,r=Xl(n)||(a=s)&&(a.borderColor||a.backgroundColor)||o&&Xl(o)||"rgba(0,0,0,0.1)"!==Gs.borderColor||"rgba(0,0,0,0.1)"!==Gs.backgroundColor;var a;if(!i.forceOverride&&r)return;const l=Yl(t);n.forEach(l)}};function Gl(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Kl(t){t.data.datasets.forEach(t=>{Gl(t)})}var Ql={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Kl(t);const n=t.width;t.data.datasets.forEach((e,s)=>{const{_data:o,indexAxis:r}=e,a=t.getDatasetMeta(s),l=o||e.data;if("y"===wo([r,t.options.indexAxis]))return;if(!a.controller.supportsDecimation)return;const c=t.scales[a.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let{start:h,count:d}=function(t,e){const i=e.length;let n,s=0;const{iScale:o}=t,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(s=vs(_s(e,o.axis,r).lo,0,i-1)),n=c?vs(_s(e,o.axis,a).hi+1,s,i)-s:i-s,{start:s,count:n}}(a,l);if(d<=(i.threshold||4*n))return void Gl(e);let u;switch(An(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":u=function(t,e,i,n,s){const o=s.samples||n;if(o>=i)return t.slice(e,e+i);const r=[],a=(i-2)/(o-2);let l=0;const c=e+i-1;let h,d,u,f,p,g=e;for(r[l++]=t[g],h=0;hu&&(u=f,d=t[n],p=n);r[l++]=d,g=p}return r[l++]=t[c],r}(l,h,d,n,i);break;case"min-max":u=function(t,e,i,n){let s,o,r,a,l,c,h,d,u,f,p=0,g=0;const m=[],b=e+i-1,v=t[e].x,y=t[b].x-v;for(s=e;sf&&(f=a,h=s),p=(g*p+o.x)/++g;else{const i=s-1;if(!An(c)&&!An(h)){const e=Math.min(c,h),n=Math.max(c,h);e!==d&&e!==i&&m.push({...t[e],x:p}),n!==d&&n!==i&&m.push({...t[n],x:p})}s>0&&i!==d&&m.push(t[i]),m.push(o),l=e,g=0,u=f=a,c=h=d=s}}return m}(l,h,d,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=u})},destroy(t){Kl(t)}};function Zl(t,e,i,n){if(n)return;let s=e[t],o=i[t];return"angle"===t&&(s=ms(s),o=ms(o)),{property:t,start:s,end:o}}function tc(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function ec(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function ic(t,e){let i=[],n=!1;return Tn(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:n=null}=t||{},s=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=tc(t,e,s);const r=s[t],a=s[e];null!==n?(o.push({x:r.x,y:n}),o.push({x:a.x,y:n})):null!==i&&(o.push({x:i,y:r.y}),o.push({x:i,y:a.y}))}),o}(t,e),i.length?new Il({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function nc(t){return t&&!1!==t.fill}function sc(t,e,i){let n=t[e].fill;const s=[e];let o;if(!i)return n;for(;!1!==n&&-1===s.indexOf(n);){if(!Pn(n))return n;if(o=t[n],!o)return!1;if(o.visible)return n;s.push(n),n=o.fill}return!1}function oc(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=Dn(i&&i.target,i);void 0===n&&(n=!!e.backgroundColor);if(!1===n||null===n)return!1;if(!0===n)return"origin";return n}(t);if(Cn(n))return!isNaN(n.value)&&n;let s=parseFloat(n);return Pn(s)&&Math.floor(s)===s?function(t,e,i,n){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=n)return!1;return i}(n[0],e,s,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function rc(t,e,i){const n=[];for(let s=0;s=0;--e){const i=s[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),n&&i.fill&&hc(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;nc(i)&&hc(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;nc(n)&&"beforeDatasetDraw"===i.drawTime&&hc(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const bc=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}};class vc extends Da{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Rn(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,n=_o(i.font),s=n.size,o=this._computeTitleHeight(),{boxWidth:r,itemHeight:a}=bc(i,s);let l,c;e.font=n.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(o,s,r,a)+10):(c=this.maxHeight,l=this._fitCols(o,n,r,a)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:s,maxWidth:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],c=n+r;let h=t;s.textAlign="left",s.textBaseline="middle";let d=-1,u=-c;return this.legendItems.forEach((t,f)=>{const p=i+e/2+s.measureText(t.text).width;(0===f||l[l.length-1]+p+2*r>o)&&(h+=c,l[l.length-(f>0?0:1)]=0,u+=c,d++),a[f]={left:0,top:u,row:d,width:p,height:n},l[l.length-1]+=p+r}),h}_fitCols(t,e,i,n){const{ctx:s,maxHeight:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-t;let h=r,d=0,u=0,f=0,p=0;return this.legendItems.forEach((t,o)=>{const{itemWidth:g,itemHeight:m}=function(t,e,i,n,s){const o=function(t,e,i,n){let s=t.text;s&&"string"!=typeof s&&(s=s.reduce((t,e)=>t.length>e.length?t:e));return e+i.size/2+n.measureText(s).width}(n,t,e,i),r=function(t,e,i){let n=t;"string"!=typeof e.text&&(n=yc(e,i));return n}(s,n,e.lineHeight);return{itemWidth:o,itemHeight:r}}(i,e,s,t,n);o>0&&u+m+2*r>c&&(h+=d+r,l.push({width:d,height:u}),f+=d+r,p++,d=u=0),a[o]={left:f,top:u,col:p,width:g,height:m},d=Math.max(d,g),u+=m+r}),h+=d,l.push({width:d,height:u}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:s}}=this,o=rr(s,this.left,this.width);if(this.isHorizontal()){let s=0,r=Ts(i,this.left+n,this.right-this.lineWidths[s]);for(const a of e)s!==a.row&&(s=a.row,r=Ts(i,this.left+n,this.right-this.lineWidths[s])),a.top+=this.top+t+n,a.left=o.leftForLtr(o.x(r),a.width),r+=a.width+n}else{let s=0,r=Ts(i,this.top+t+n,this.bottom-this.columnSizes[s].height);for(const a of e)a.col!==s&&(s=a.col,r=Ts(i,this.top+t+n,this.bottom-this.columnSizes[s].height)),a.top=r,a.left+=this.left+n,a.left=o.leftForLtr(o.x(a.left),a.width),r+=a.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;so(t,this),this._draw(),oo(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:s,labels:o}=t,r=Gs.color,a=rr(t.rtl,this.left,this.width),l=_o(o.font),{padding:c}=o,h=l.size,d=h/2;let u;this.drawTitle(),n.textAlign=a.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:f,boxHeight:p,itemHeight:g}=bc(o,h),m=this.isHorizontal(),b=this._computeTitleHeight();u=m?{x:Ts(s,this.left+c,this.right-i[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:Ts(s,this.top+b+c,this.bottom-e[0].height),line:0},ar(this.ctx,t.textDirection);const v=g+c;this.legendItems.forEach((y,x)=>{n.strokeStyle=y.fontColor,n.fillStyle=y.fontColor;const _=n.measureText(y.text).width,w=a.textAlign(y.textAlign||(y.textAlign=o.textAlign)),k=f+d+_;let S=u.x,M=u.y;a.setWidth(this.width),m?x>0&&S+k+c>this.right&&(M=u.y+=v,u.line++,S=u.x=Ts(s,this.left+c,this.right-i[u.line])):x>0&&M+v>this.bottom&&(S=u.x=S+e[u.line].width+c,u.line++,M=u.y=Ts(s,this.top+b+c,this.bottom-e[u.line].height));if(function(t,e,i){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;n.save();const s=Dn(i.lineWidth,1);if(n.fillStyle=Dn(i.fillStyle,r),n.lineCap=Dn(i.lineCap,"butt"),n.lineDashOffset=Dn(i.lineDashOffset,0),n.lineJoin=Dn(i.lineJoin,"miter"),n.lineWidth=s,n.strokeStyle=Dn(i.strokeStyle,r),n.setLineDash(Dn(i.lineDash,[])),o.usePointStyle){const r={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:s},l=a.xPlus(t,f/2);io(n,r,l,e+d,o.pointStyleWidth&&f)}else{const o=e+Math.max((h-p)/2,0),r=a.leftForLtr(t,f),l=yo(i.borderRadius);n.beginPath(),Object.values(l).some(t=>0!==t)?uo(n,{x:r,y:o,w:f,h:p,radius:l}):n.rect(r,o,f,p),n.fill(),0!==s&&n.stroke()}n.restore()}(a.x(S),M,y),S=((t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e)(w,S+f+d,m?S+k:this.right,t.rtl),function(t,e,i){ho(n,i.text,t,e+g/2,l,{strikethrough:i.hidden,textAlign:a.textAlign(i.textAlign)})}(a.x(S),M,y),m)u.x+=k+c;else if("string"!=typeof y.text){const t=l.lineHeight;u.y+=yc(y,t)+c}else u.y+=v}),lr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=_o(e.font),n=xo(e.padding);if(!e.display)return;const s=rr(t.rtl,this.left,this.width),o=this.ctx,r=e.position,a=i.size/2,l=n.top+a;let c,h=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,h=Ts(t.align,h,this.right-d);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);c=l+Ts(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=Ts(r,h,h+d);o.textAlign=s.textAlign(As(r)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,ho(o,e.text,u,c,i)}_computeTitleHeight(){const t=this.options.title,e=_o(t.font),i=xo(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,s;if(ys(t,this.left,this.right)&&ys(e,this.top,this.bottom))for(s=this.legendHitBoxes,i=0;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const l=t.controller.getStyle(i?0:void 0),c=xo(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:s||l.textAlign,borderRadius:r&&(a||l.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class _c extends Da{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=Tn(i.text)?i.text.length:1;this._padding=xo(i.padding);const s=n*_o(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:s,options:o}=this,r=o.align;let a,l,c,h=0;return this.isHorizontal()?(l=Ts(r,i,s),c=e+t,a=s-i):("left"===o.position?(l=i+t,c=Ts(r,n,e),h=-.5*Gn):(l=s-t,c=Ts(r,e,n),h=.5*Gn),a=n-e),{titleX:l,titleY:c,maxWidth:a,rotation:h}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=_o(e.font),n=i.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:r,rotation:a}=this._drawArgs(n);ho(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:a,textAlign:As(e.align),textBaseline:"middle",translation:[s,o]})}}var wc={id:"title",_element:_c,start(t,e,i){!function(t,e){const i=new _c({ctx:t.ctx,options:e,chart:t});ga.configure(t,i,e),ga.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;ga.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;ga.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const kc=new WeakMap;var Sc={id:"subtitle",start(t,e,i){const n=new _c({ctx:t.ctx,options:i,chart:t});ga.configure(t,n,i),ga.addBox(t,n),kc.set(t,n)},stop(t){ga.removeBox(t,kc.get(t)),kc.delete(t)},beforeUpdate(t,e,i){const n=kc.get(t);ga.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Mc={average(t){if(!t.length)return!1;let e,i,n=new Set,s=0,o=0;for(e=0,i=t.length;et+e)/n.size,y:s/o}},nearest(t,e){if(!t.length)return!1;let i,n,s,o=e.x,r=e.y,a=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i-1?t.split("\n"):t}function Ac(t,e){const{element:i,datasetIndex:n,index:s}=e,o=t.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:t,label:r,parsed:o.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function Tc(t,e){const i=t.chart.ctx,{body:n,footer:s,title:o}=t,{boxWidth:r,boxHeight:a}=e,l=_o(e.bodyFont),c=_o(e.titleFont),h=_o(e.footerFont),d=o.length,u=s.length,f=n.length,p=xo(e.padding);let g=p.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b){g+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing}u&&(g+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let v=0;const y=function(t){m=Math.max(m,i.measureText(t).width+v)};return i.save(),i.font=c.string,jn(t.title,y),i.font=l.string,jn(t.beforeBody.concat(t.afterBody),y),v=e.displayColors?r+2+e.boxPadding:0,jn(n,t=>{jn(t.before,y),jn(t.lines,y),jn(t.after,y)}),v=0,i.font=h.string,jn(t.footer,y),i.restore(),m+=p.width,{width:m,height:g}}function Cc(t,e,i,n){const{x:s,width:o}=i,{width:r,chartArea:{left:a,right:l}}=t;let c="center";return"center"===n?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),function(t,e,i,n){const{x:s,width:o}=n,r=i.caretSize+i.caretPadding;return"left"===t&&s+o+r>e.width||"right"===t&&s-o-r<0||void 0}(c,t,e,i)&&(c="center"),c}function Pc(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Cc(t,e,i,n),yAlign:n}}function Lc(t,e,i,n){const{caretSize:s,caretPadding:o,cornerRadius:r}=t,{xAlign:a,yAlign:l}=i,c=s+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=yo(r);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const g=function(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}(e,l,c);return"center"===l?"left"===a?p+=c:"right"===a&&(p-=c):"left"===a?p-=Math.max(h,u)+s:"right"===a&&(p+=Math.max(d,f)+s),{x:vs(p,0,n.width-e.width),y:vs(g,0,n.height-e.height)}}function Dc(t,e,i){const n=xo(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function Ic(t){return Oc([],Ec(t))}function Rc(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const jc={beforeTitle:On,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex{const e={before:[],lines:[],after:[]},s=Rc(i,t);Oc(e.before,Ec(Fc(s,"beforeLabel",this,t))),Oc(e.lines,Fc(s,"label",this,t)),Oc(e.after,Ec(Fc(s,"afterLabel",this,t))),n.push(e)}),n}getAfterBody(t,e){return Ic(Fc(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=Fc(i,"beforeFooter",this,t),s=Fc(i,"footer",this,t),o=Fc(i,"afterFooter",this,t);let r=[];return r=Oc(r,Ec(n)),r=Oc(r,Ec(s)),r=Oc(r,Ec(o)),r}_createItems(t){const e=this._active,i=this.chart.data,n=[],s=[],o=[];let r,a,l=[];for(r=0,a=e.length;rt.filter(e,n,s,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),jn(l,e=>{const i=Rc(t.callbacks,e);n.push(Fc(i,"labelColor",this,e)),s.push(Fc(i,"labelPointStyle",this,e)),o.push(Fc(i,"labelTextColor",this,e))}),this.labelColors=n,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,o=[];if(n.length){const t=Mc[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Tc(this,i),r=Object.assign({},t,e),a=Pc(this.chart,i,r),l=Lc(i,r,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:h}=yo(r),{x:d,y:u}=t,{width:f,height:p}=e;let g,m,b,v,y,x;return"center"===s?(y=u+p/2,"left"===n?(g=d,m=g-o,v=y+o,x=y-o):(g=d+f,m=g+o,v=y-o,x=y+o),b=g):(m="left"===n?d+Math.max(a,c)+o:"right"===n?d+f-Math.max(l,h)-o:this.caretX,"top"===s?(v=u,y=v-o,g=m-o,b=m+o):(v=u+p,y=v+o,g=m+o,b=m-o),x=v),{x1:g,x2:m,x3:b,y1:v,y2:y,y3:x}}drawTitle(t,e,i){const n=this.title,s=n.length;let o,r,a;if(s){const l=rr(i.rtl,this.x,this.width);for(t.x=Dc(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=_o(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,a=0;a0!==t)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,uo(t,{x:e,y:f,w:l,h:a,radius:r}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),uo(t,{x:i,y:f+1,w:l-2,h:a-2,radius:r}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(e,f,l,a),t.strokeRect(e,f,l,a),t.fillStyle=o.backgroundColor,t.fillRect(i,f+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:l,boxPadding:c}=i,h=_o(i.bodyFont);let d=h.lineHeight,u=0;const f=rr(i.rtl,this.x,this.width),p=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+s},g=f.textAlign(o);let m,b,v,y,x,_,w;for(e.textAlign=o,e.textBaseline="middle",e.font=h.string,t.x=Dc(this,g,i),e.fillStyle=i.bodyColor,jn(this.beforeBody,p),u=r&&"right"!==g?"center"===o?l/2+c:l+2+c:0,y=0,_=n.length;y<_;++y){for(m=n[y],b=this.labelTextColors[y],e.fillStyle=b,jn(m.before,p),v=m.lines,r&&v.length&&(this._drawColorBox(e,t,y,f,i),d=Math.max(h.lineHeight,a)),x=0,w=v.length;x0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=Mc[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Tc(this,t),r=Object.assign({},i,this._size),a=Pc(e,t,r),l=Lc(t,r,a,e);n._to===l.x&&s._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=xo(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,n,e),ar(t,e.textDirection),s.y+=o.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),lr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),s=!Fn(i,n),o=this._positionChanged(n,e);(s||o)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,s=this._active||[],o=this._getActiveElements(t,s,e,i),r=this._positionChanged(o,t),a=e||!Fn(o,s)||r;return a&&(this._active=o,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));const o=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,o=Mc[s.position].call(this,t,e);return!1!==o&&(i!==o.x||n!==o.y)}}var Bc={id:"tooltip",_element:zc,positioners:Mc,afterInit(t,e,i){i&&(t.tooltip=new zc({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:jc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Nc=Object.freeze({__proto__:null,Colors:Jl,Decimation:Ql,Filler:mc,Legend:xc,SubTitle:Sc,Title:wc,Tooltip:Bc});function Wc(t,e,i,n){const s=t.indexOf(e);if(-1===s)return((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n);return s!==t.lastIndexOf(e)?i:s}function Vc(t){const e=this.getLabels();return t>=0&&tf&&(S=as(k*S/f/u)*u),An(a)||(x=Math.pow(10,a),S=Math.ceil(S*x)/x),"ticks"===n?(_=Math.floor(p/S)*S,w=Math.ceil(g/S)*S):(_=p,w=g),m&&b&&s&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((r-o)/s,S/1e3)?(k=Math.round(Math.min((r-o)/S,c)),S=(r-o)/k,_=o,w=r):v?(_=m?o:_,w=b?r:w,k=l-1,S=(w-_)/k):(k=(w-_)/S,k=rs(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const M=Math.max(us(S),us(_));x=Math.pow(10,An(a)?M:a),_=Math.round(_*x)/x,w=Math.round(w*x)/x;let O=0;for(m&&(d&&_!==o?(i.push({value:o}),_r)break;i.push({value:t})}return b&&d&&w!==r?i.length&&rs(i[i.length-1].value,r,$c(r,y,t))?i[i.length-1].value=r:i.push({value:r}):b&&w!==r||i.push({value:w}),i}function $c(t,e,{horizontal:i,minRotation:n}){const s=hs(n),o=(i?Math.sin(s):Math.cos(s))||.001,r=.75*e*(""+t).length;return Math.min(e/o,r)}class Uc extends Ha{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return An(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:s}=this;const o=t=>n=e?n:t,r=t=>s=i?s:t;if(t){const t=os(n),e=os(s);t<0&&e<0?r(0):t>0&&e>0&&o(0)}if(n===s){let e=0===s?1:Math.abs(.05*s);r(s+e),t||o(n-e)}this.min=n,this.max=s}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=Hc({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&cs(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Vs(t,this.chart.options.locale,this.options.ticks.format)}}class qc extends Uc{static id="linear";static defaults={ticks:{callback:$s.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pn(t)?t:0,this.max=Pn(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=hs(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,s.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Yc=t=>Math.floor(ss(t)),Xc=(t,e)=>Math.pow(10,Yc(t)+e);function Jc(t){return 1===t/Math.pow(10,Yc(t))}function Gc(t,e,i){const n=Math.pow(10,i),s=Math.floor(t/n);return Math.ceil(e/n)-s}function Kc(t,{min:e,max:i}){e=Ln(t.min,e);const n=[],s=Yc(e);let o=function(t,e){let i=Yc(e-t);for(;Gc(t,e,i)>10;)i++;for(;Gc(t,e,i)<10;)i--;return Math.min(i,Yc(t))}(e,i),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((e-l)*r)/r,h=Math.floor((e-l)/a/10)*a*10;let d=Math.floor((c-h)/Math.pow(10,o)),u=Ln(t.min,Math.round((l+h+d*Math.pow(10,o))*r)/r);for(;u=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),u=Math.round((l+h+d*Math.pow(10,o))*r)/r;const f=Ln(t.max,u);return n.push({value:f,major:Jc(f),significand:d}),n}class Qc extends Ha{static id="logarithmic";static defaults={ticks:{callback:$s.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Uc.prototype.parse.apply(this,[t,e]);if(0!==i)return Pn(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pn(t)?Math.max(0,t):null,this.max=Pn(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Pn(this._userMin)&&(this.min=t===Xc(this.min,0)?Xc(this.min,-1):Xc(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const s=e=>i=t?i:e,o=t=>n=e?n:t;i===n&&(i<=0?(s(1),o(10)):(s(Xc(i,-1)),o(Xc(n,1)))),i<=0&&s(Xc(n,-1)),n<=0&&o(Xc(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=Kc({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&cs(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":Vs(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ss(t),this._valueRange=ss(this.max)-ss(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ss(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Zc(t){const e=t.ticks;if(e.display&&t.display){const t=xo(e.backdropPadding);return Dn(e.font&&e.font.size,Gs.font.size)+t.height}return 0}function th(t,e,i){return i=Tn(i)?i:[i],{w:Qs(t,e.string,i),h:i.length*e.lineHeight}}function eh(t,e,i,n,s){return t===n||t===s?{start:e-i/2,end:e+i/2}:ts?{start:e-i,end:e}:{start:e,end:e+i}}function ih(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],s=[],o=t._pointLabels.length,r=t.options.pointLabels,a=r.centerPointLabels?Gn/o:0;for(let l=0;le.r&&(a=(n.end-e.r)/o,t.r=Math.max(t.r,e.r+a)),s.starte.b&&(l=(s.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}function sh(t,e,i){const n=t.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=i,l=t.getPointPosition(e,n+s+r,o),c=Math.round(ds(ms(l.angle+es))),h=function(t,e,i){90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e);return t}(l.y,a.h,c),d=function(t){if(0===t||180===t)return"center";if(t<180)return"left";return"right"}(c),u=function(t,e,i){"right"===i?t-=e:"center"===i&&(t-=e/2);return t}(l.x,a.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:u,top:h,right:u+a.w,bottom:h+a.h}}function oh(t,e){if(!e)return!0;const{left:i,top:n,right:s,bottom:o}=t;return!(no({x:i,y:n},e)||no({x:i,y:o},e)||no({x:s,y:n},e)||no({x:s,y:o},e))}function rh(t,e,i){const{left:n,top:s,right:o,bottom:r}=i,{backdropColor:a}=e;if(!An(a)){const i=yo(e.borderRadius),l=xo(e.backdropPadding);t.fillStyle=a;const c=n-l.left,h=s-l.top,d=o-n+l.width,u=r-s+l.height;Object.values(i).some(t=>0!==t)?(t.beginPath(),uo(t,{x:c,y:h,w:d,h:u,radius:i}),t.fill()):t.fillRect(c,h,d,u)}}function ah(t,e,i,n){const{ctx:s}=t;if(i)s.arc(t.xCenter,t.yCenter,e,0,Kn);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let o=1;ot,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=xo(Zc(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Pn(t)&&!isNaN(t)?t:0,this.max=Pn(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Zc(this.options))}generateTickLabels(t){Uc.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{const i=Rn(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?ih(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){return ms(t*(Kn/(this._pointLabels.length||1))+hs(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(An(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(An(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t=0;s--){const e=t._pointLabelItems[s];if(!e.visible)continue;const o=n.setContext(t.getPointLabelContext(s));rh(i,o,e);const r=_o(o.font),{x:a,y:l,textAlign:c}=e;ho(i,t._pointLabels[s],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}(this,o),n.display&&this.ticks.forEach((t,e)=>{if(0!==e||0===e&&this.min<0){a=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),r=n.setContext(i),l=s.setContext(i);!function(t,e,i,n,s){const o=t.ctx,r=e.circular,{color:a,lineWidth:l}=e;!r&&!n||!a||!l||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),ah(t,i,r,n),o.closePath(),o.stroke(),o.restore())}(this,r,a,o,l)}}),i.display){for(t.save(),r=o-1;r>=0;r--){const n=i.setContext(this.getPointLabelContext(r)),{color:s,lineWidth:o}=n;o&&s&&(t.lineWidth=o,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,a=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),l=this.getPointPosition(r,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,r)=>{if(0===r&&this.min>=0&&!e.reverse)return;const a=i.setContext(this.getContext(r)),l=_o(a.font);if(s=this.getDistanceFromCenterForValue(this.ticks[r].value),a.showLabelBackdrop){t.font=l.string,o=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=xo(a.backdropPadding);t.fillRect(-o/2-e.left,-s-l.size/2-e.top,o+e.width,l.size+e.height)}ho(t,n.label,0,-s,l,{color:a.color,strokeColor:a.textStrokeColor,strokeWidth:a.textStrokeWidth})}),t.restore()}drawTitle(){}}const ch={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},hh=Object.keys(ch);function dh(t,e){return t-e}function uh(t,e){if(An(e))return null;const i=t._adapter,{parser:n,round:s,isoWeekday:o}=t._parseOpts;let r=e;return"function"==typeof n&&(r=n(r)),Pn(r)||(r="string"==typeof n?i.parse(r,n):i.parse(r)),null===r?null:(s&&(r="week"!==s||!ls(o)&&!0!==o?i.startOf(r,s):i.startOf(r,"isoWeek",o)),+r)}function fh(t,e,i,n){const s=hh.length;for(let o=hh.indexOf(t);o=e?i[n]:i[s]]=!0}}else t[e]=!0}function gh(t,e,i){const n=[],s={},o=e.length;let r,a;for(r=0;r=0&&(e[l].major=!0);return e}(t,n,s,i):n}class mh extends Ha{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),n=this._adapter=new Jr(t.adapters.date);n.init(e),Vn(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:uh(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:s,minDefined:o,maxDefined:r}=this.getUserBounds();function a(t){o||isNaN(t.min)||(n=Math.min(n,t.min)),r||isNaN(t.max)||(s=Math.max(s,t.max))}o&&r||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=Pn(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),s=Pn(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,s-1),this.max=Math.max(n+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const s=this.min,o=function(t,e,i){let n=0,s=t.length;for(;nn&&t[s-1]>i;)s--;return n>0||s=hh.indexOf(i);o--){const i=hh[o];if(ch[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return hh[i?hh.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=hh.indexOf(t)+1,i=hh.length;e+t.value))}initOffsets(t=[]){let e,i,n=0,s=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),s=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=vs(n,0,o),s=vs(s,0,o),this._offsets={start:n,end:s,factor:1/(n+1+s)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,s=n.time,o=s.unit||fh(s.minUnit,e,i,this._getLabelCapacity(e)),r=Dn(n.ticks.stepSize,1),a="week"===o&&s.isoWeekday,l=ls(a)||!0===a,c={};let h,d,u=e;if(l&&(u=+t.startOf(u,"isoWeek",a)),u=+t.startOf(u,l?"day":o),t.diff(i,e,o)>1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+o);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;h+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,n=this._unit,s=e||i[n];return this._adapter.format(t,s)}_tickFormatFunction(t,e,i,n){const s=this.options,o=s.ticks.callback;if(o)return Rn(o,[t,e,i],this);const r=s.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&r[a],h=l&&r[l],d=i[e],u=l&&h&&d&&d.major;return this._adapter.format(t,n||(u?h:c))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=_s(t,"pos",e)),({pos:n,time:o}=t[a]),({pos:s,time:r}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=_s(t,"time",e)),({time:n,pos:o}=t[a]),({time:s,pos:r}=t[l]));const c=s-n;return c?o+(r-o)*(e-n)/c:o}var vh=Object.freeze({__proto__:null,CategoryScale:class extends Ha{static id="category";static defaults={ticks:{callback:Vc}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(An(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:vs(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:Wc(i,t,Dn(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){return Vc.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:qc,LogarithmicScale:Qc,RadialLinearScale:lh,TimeScale:mh,TimeSeriesScale:class extends mh{static id="timeseries";static defaults=mh.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=bh(e,this.min),this._tableRange=bh(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let o,r,a,l,c;for(o=0,r=t.length;o=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,r=n.length;ot-e)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(bh(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return bh(this._table,i*this._tableRange+this._minPos,!0)}}});const yh=[qr,Vl,Nc,vh];xl.register(...yh);const xh=xl;var _h=i(998),wh=i.n(_h);const kh={data:{},nonce:"",context:null,init(t){this.context=t;const e=t.querySelectorAll("[data-progress]"),i=t.querySelectorAll("[data-chart]");[...e].forEach(t=>{t.dataset.url&&(this.data[t.dataset.url]||(this.data[t.dataset.url]={items:[],poll:null}),this.data[t.dataset.url].items.push(t)),"line"===t.dataset.progress?this.line(t):"circle"===t.dataset.progress&&this.circle(t),this.nonce||(this.nonce=t.dataset?.nonce)});for(const t in this.data)this.getValues(t);[...i].forEach(t=>{const e={labels:JSON.parse(t.dataset.dates),datasets:[{backgroundColor:t.dataset.color,borderColor:t.dataset.color,data:JSON.parse(t.dataset.data),cubicInterpolationMode:"monotone"}]};new xh(t,{type:"line",data:e,options:{responsive:!0,radius:0,interaction:{intersect:!1},plugins:{legend:{display:!1}},scales:{y:{suggestedMin:0,ticks:{color:"#999999",callback:(t,e)=>wh()(t,{decimals:2,scale:"SI"})},grid:{color:"#d3dce3"}},x:{ticks:{color:"#999999"},grid:{color:"#d3dce3"}}}}})})},line(t){new(Ui().Line)(t,{strokeWidth:2,easing:"easeInOut",duration:1400,color:t.dataset.color,trailColor:"#d3dce3",trailWidth:2,svgStyle:{width:"100%",height:"100%",display:"block"}}).animate(t.dataset.value/100)},circle(t){t.dataset.basetext=t.dataset.text,t.dataset.text="";const e=t.dataset.value,i=this;if(t.bar=new(Ui().Circle)(t,{strokeWidth:3,easing:"easeInOut",duration:1400,color:t.dataset.color,trailColor:"#d3dce3",trailWidth:3,svgStyle:null,text:{autoStyleContainer:!1,style:{color:"#222222"}},step(e,n){const s=Math.floor(100*n.value());i.setText(n,parseFloat(s),t.dataset.text)}}),!t.dataset.url){const i=e/100;t.bar.animate(i)}},getValues(t){this.data[t].poll&&(clearTimeout(this.data[t].poll),this.data[t].poll=null),Pt({path:t,method:"GET",headers:{"X-WP-Nonce":this.nonce}}).then(e=>{this.data[t].items.forEach(i=>{void 0!==e[i.dataset.basetext]?i.dataset.text=e[i.dataset.basetext]:i.dataset.text=i.dataset.basetext,i.bar.animate(e[i.dataset.value]),i.dataset.poll&&!this.data[t].poll&&(this.data[t].poll=setTimeout(()=>{this.getValues(t)},1e4))});for(const t in e){const i=this.context.querySelectorAll(`[data-key="${t}"]`),n=this.context.querySelectorAll(`[data-text="${t}"]`);i.forEach(i=>{i.dataset.value=e[t],i.dispatchEvent(new Event("focus"))}),n.forEach(i=>{i.innerText=e[t],i.classList.contains("cld-toggle")&&(e[t]?i.classList.remove("hidden"):i.classList.add("hidden"))})}})},setText(t,e,i){if(!t)return;const n=document.createElement("span"),s=document.createElement("h2"),o=document.createTextNode(i);s.innerText=e+"%",n.appendChild(s),n.appendChild(o),t.setText(n)}},Sh=kh,Mh={key:"_cld_pending_state",data:null,pending:null,changed:!1,previous:{},init(){this.data=cldData.stateData?cldData.stateData:{};let t=localStorage.getItem(this.key);t&&(t=JSON.parse(t),this.data={...this.data,...t},this.sendStates()),this.previous=JSON.stringify(this.data)},_update(){this.pending&&(clearTimeout(this.pending),localStorage.removeItem(this.key)),this.previous!==JSON.stringify(this.data)&&(this.pending=setTimeout(()=>this.sendStates(),2e3),localStorage.setItem(this.key,JSON.stringify(this.data)))},set(t,e){this.data[t]&&this.data[t]===e||(this.data[t]=e,this._update())},get(t){let e=null;return this.data[t]&&(e=this.data[t]),e},sendStates(){fetch(cldData.stateURL,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":cldData.stateNonce},body:JSON.stringify(this.data)}).then(t=>t.json()).then(t=>{t.success&&(this.previous=JSON.stringify(t.state),localStorage.removeItem(this.key))})}},Oh={init(t){[...t.querySelectorAll("[data-remove]")].forEach(t=>{t.addEventListener("click",e=>{if(t.dataset.message&&!confirm(t.dataset.message))return;const i=document.getElementById(t.dataset.remove);i.parentNode.removeChild(i)})})}},Eh={values:{},inputs:{},context:null,init(t){this.context=t;t.querySelectorAll("[data-tags]").forEach(t=>this.bind(t))},bind(t){t.innerText=t.dataset.placeholder;const e=t.dataset.tags,i=document.getElementById(e),n=this.context.querySelectorAll(`[data-tags-delete="${e}"]`);this.values[e]=JSON.parse(i.value),this.inputs[e]=i,t.boundInput=e,t.boundDisplay=this.context.querySelector(`[data-tags-display="${e}"]`),t.boundDisplay.addEventListener("click",e=>{t.focus()}),t.addEventListener("focus",e=>{t.innerText=null}),t.addEventListener("blur",e=>{3{if("Tab"===i.key)3{"Comma"!==e.code&&"Enter"!==e.code&&"Tab"!==e.code&&"Space"!==e.code||(e.preventDefault(),3{t.parentNode.control=t,t.parentNode.style.width=getComputedStyle(t.parentNode).width,t.addEventListener("click",e=>{e.stopPropagation(),this.deleteTag(t)})})},deleteTag(t){const e=t.parentNode,i=e.dataset.inputId,n=this.values[i].indexOf(e.dataset.value);0<=n&&this.values[i].splice(n,1),e.style.width=0,e.style.opacity=0,e.style.padding=0,e.style.margin=0,setTimeout(()=>{e.parentNode.removeChild(e)},500),this.updateInput(i)},captureTag(t,e){if(this[t.dataset.format]&&"string"!=typeof(e=this[t.dataset.format](e)))return t.classList.add("pulse"),void setTimeout(()=>{t.classList.remove("pulse")},1e3);if(!this.validateUnique(t.boundDisplay,e)){const i=this.createTag(e);i.dataset.inputId=t.boundInput,this.values[t.boundInput].push(e),t.innerText=null,t.boundDisplay.insertBefore(i,t),i.style.width=getComputedStyle(i).width,i.style.opacity=1,this.updateInput(t.boundInput)}},createTag(t){const e=document.createElement("span"),i=document.createElement("span"),n=document.createElement("span");return e.classList.add("cld-input-tags-item"),i.classList.add("cld-input-tags-item-text"),n.className="cld-input-tags-item-delete dashicons dashicons-no-alt",n.addEventListener("click",()=>this.deleteTag(n)),i.innerText=t,e.appendChild(i),e.appendChild(n),e.dataset.value=t,e.style.opacity=0,e.control=n,e},validateUnique(t,e){const i=t.querySelector(`[data-value="${e}"]`);let n=!1;return i&&(i.classList.remove("pulse"),i.classList.add("pulse"),setTimeout(()=>{i.classList.remove("pulse")},500),n=!0),n},updateInput(t){this.inputs[t].value=JSON.stringify(this.values[t])},host(t){!1===/^(?:http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)/.test(t)&&(t="https://"+t);let e="";try{e=new URL(t)}catch(t){return t}return decodeURIComponent(e.host)}},Ah=Eh,Th={suffixInputs:null,init(t){this.suffixInputs=t.querySelectorAll("[data-suffix]"),[...this.suffixInputs].forEach(t=>this.bindInput(t))},bindInput(t){const e=document.getElementById(t.dataset.suffix),i=e.dataset.template.split("@value");this.setSuffix(e,i,t.value),t.addEventListener("change",()=>this.setSuffix(e,i,t.value)),t.addEventListener("input",()=>this.setSuffix(e,i,t.value))},setSuffix(t,e,i){t.innerHTML="",t.classList.add("hidden"),-1===["none","off",""].indexOf(i)&&t.classList.remove("hidden");const n=document.createTextNode(e.join(i));t.appendChild(n)}},Ch={wrappers:null,frame:null,error:'data:image/svg+xml;utf8,%26%23x26A0%3B︎',init(t){this.wrappers=t.querySelectorAll(".cld-size-items"),this.wrappers.forEach(t=>{const e=t.querySelectorAll(".cld-size-selector-item");e.forEach(i=>{i.addEventListener("click",()=>{e.forEach(t=>{delete t.dataset.selected}),i.dataset.selected=!0,this.switchSizeContent(t,i.dataset.size)})});const i=t.querySelector(".cld-size-selector-item[data-selected]");i&&this.switchSizeContent(t,i.dataset.size)})},switchSizeContent(t,e){t.querySelectorAll(".cld-size-content").forEach(t=>{t.style.display="none"});const i=t.querySelector(`.cld-size-content[data-size="${e}"]`);i&&(i.style.display="block",this.buildImages(t,i))},buildImages(t,e){const i=t.dataset.base,n=e.querySelector(".regular-text"),s=e.querySelector(".disable-toggle");if(!n||!s)return;const o=e.querySelectorAll("img"),r=n.value.length?n.value.replace(" ",""):n.placeholder;if(o.forEach(t=>{const e=t.dataset.size,o=t.dataset.file;s.checked?(n.disabled=!0,t.src=`${i}/${e}/${o}`):(n.disabled=!1,t.src=`${i}/${e},${r}/${o}`),t.bound||(t.addEventListener("error",()=>{t.src=this.error}),t.bound=!0)}),!n.bound){let i=null;n.addEventListener("input",()=>{i&&clearTimeout(i),i=setTimeout(()=>{this.buildImages(t,e)},1e3)}),n.bound=!0}s.bound||(s.addEventListener("change",()=>{this.buildImages(t,e)}),s.bound=!0);const a=e.querySelector(".clear-crop-input");a&&!a.bound&&(a.addEventListener("click",()=>{n.value="",this.buildImages(t,e)}),a.bound=!0)}},Ph={bindings:{},parent_check_data:{},check_parents:{},_init(t){const e=t.querySelectorAll("[data-condition]"),i=t.querySelectorAll("[data-toggle]"),n=t.querySelectorAll("[data-for]"),s=t.querySelectorAll("[data-tooltip]"),o=t.querySelectorAll("[data-bind-trigger]"),r=t.querySelectorAll("[data-main]"),a=t.querySelectorAll("[data-file]"),l=t.querySelectorAll("[data-auto-suffix]"),c=t.querySelectorAll("[data-confirm]"),h={};Mh.init(),Hi.bind(r),l.forEach(t=>this._autoSuffix(t)),o.forEach(t=>this._trigger(t)),i.forEach(t=>this._toggle(t)),e.forEach(t=>this._bind(t)),n.forEach(t=>this._alias(t)),a.forEach(t=>this._files(t,h)),Bi(s,{theme:"cloudinary",arrow:!1,placement:"bottom-start",aria:{content:"auto",expanded:"auto"},content:t=>document.getElementById(t.dataset.tooltip).innerHTML}),[...o].forEach(t=>{t.dispatchEvent(new Event("input"))}),c.forEach(t=>{t.addEventListener("click",e=>{confirm(t.dataset.confirm)||(e.preventDefault(),e.stopPropagation())})}),Sh.init(t),Oh.init(t),Ah.init(t),Th.init(t),Ch.init(t)},_autoSuffix(t){const e=t.dataset.autoSuffix;let i="";const n=[...e.split(";")].map(t=>0===t.indexOf("*")?(i=t.replace("*",""),i):t);t.addEventListener("change",()=>{const e=t.value.replace(" ",""),s=e.replace(/[^0-9]/g,""),o=e.replace(/[0-9]/g,"").toLowerCase();s&&(-1===n.indexOf(o)?t.value=s+i:t.value=s+o)}),t.dispatchEvent(new Event("change"))},_files(t,e){const i=t.dataset.parent;i&&(this.check_parents[i]=document.getElementById(i),this.parent_check_data[i]||(this.parent_check_data[i]=this.check_parents[i].value?JSON.parse(this.check_parents[i].value):[]),t.addEventListener("change",()=>{const n=this.parent_check_data[i].indexOf(t.value);t.checked?this.parent_check_data[i].push(t.value):this.parent_check_data[i].splice(n,1),e[i]&&clearTimeout(e[i]),e[i]=setTimeout(()=>{this._compileParent(i)},10)}))},_compileParent(t){this.check_parents[t].value=JSON.stringify(this.parent_check_data[t]),this.check_parents[t].dispatchEvent(new Event("change"))},_bind(t){t.condition=JSON.parse(t.dataset.condition);for(const e in t.condition)this.bindings[e]&&this.bindings[e].elements.push(t)},_trigger(t){const e=t.dataset.bindTrigger,i=this;i.bindings[e]={input:t,value:t.value,checked:!0,elements:[]},t.addEventListener("change",function(e){t.dispatchEvent(new Event("input"))}),t.addEventListener("input",function(){if(i.bindings[e].value=t.value,"checkbox"===t.type&&(i.bindings[e].checked=t.checked),"radio"!==t.type||!1!==t.checked)for(const n in i.bindings[e].elements)i.toggle(i.bindings[e].elements[n],t)})},_alias(t){t.addEventListener("click",function(){document.getElementById(t.dataset.for).dispatchEvent(new Event("click"))})},_toggle(t){const e=this,i=document.querySelector('[data-wrap="'+t.dataset.toggle+'"]');if(!i)return;const n=Mh.get(t.id);t.addEventListener("click",function(n){n.stopPropagation();const s=i.classList.contains("open")?"closed":"open";e.toggle(i,t,s)}),n!==t.dataset.state&&this.toggle(i,t,n)},toggle(t,e,i){if(!i){i="open";for(const e in t.condition){let n=this.bindings[e].value;const s=t.condition[e];"boolean"==typeof s&&(n=this.bindings[e].checked),s!==n&&(i="closed")}}"closed"===i?this.close(t,e):this.open(t,e),Mh.set(e.id,i)},open(t,e){const i=t.getElementsByClassName("cld-ui-input");t.classList.remove("closed"),t.classList.add("open"),e&&e.classList.contains("dashicons")&&(e.classList.remove("dashicons-arrow-down-alt2"),e.classList.add("dashicons-arrow-up-alt2")),[...i].forEach(function(t){t.dataset.disabled=!1})},close(t,e){const i=t.getElementsByClassName("cld-ui-input");t.classList.remove("open"),t.classList.add("closed"),e&&e.classList.contains("dashicons")&&(e.classList.remove("dashicons-arrow-up-alt2"),e.classList.add("dashicons-arrow-down-alt2")),[...i].forEach(function(t){t.dataset.disabled=!0})}},Lh=document.querySelectorAll(".cld-settings,.cld-meta-box");Lh.length&&Lh.forEach(t=>{t&&window.addEventListener("load",Ph._init(t))});const Dh={config:null,init(){this.config||"undefined"!=typeof cldData&&cldData.analytics&&cldData.analytics.enabled&&(this.config=cldData.analytics,Pt.use(Pt.createNonceMiddleware(this.config.nonce)))},track(t,e={},i="activation_funnel",n=null){if(this.config||this.init(),this.config&&this.config.enabled&&t)try{Pt({url:this.config.endpoint,method:"POST",data:{event_name:t,event_category:i,funnel_step:n,params:e}}).catch(()=>{})}catch(t){}},trackReliable(t,e={},i="activation_funnel"){if(this.config||this.init(),this.config&&this.config.enabled&&t)if(navigator.sendBeacon)try{const n=this.config.endpoint.includes("?")?"&":"?",s=this.config.endpoint+n+"_wpnonce="+encodeURIComponent(this.config.nonce),o=new Blob([JSON.stringify({event_name:t,event_category:i,funnel_step:null,params:e})],{type:"application/json"});navigator.sendBeacon(s,o)}catch(t){}else this.track(t,e,i)}};window.addEventListener("load",()=>Dh.init());const Ih=Dh,Rh={storageKey:"_cld_wizard",testing:null,connectAttempts:0,startedEntry:!1,startedTracked:!1,next:document.querySelector('[data-navigate="next"]'),back:document.querySelector('[data-navigate="back"]'),lock:document.getElementById("pad-lock"),lockIcon:document.getElementById("lock-icon"),options:document.querySelectorAll('.cld-ui-input[type="checkbox"]'),settings:document.getElementById("optimize"),tabBar:document.getElementById("wizard-tabs"),tracking:document.getElementById("tracking"),complete:document.getElementById("complete-wizard"),tabs:{"tab-1":document.getElementById("tab-icon-1"),"tab-2":document.getElementById("tab-icon-2"),"tab-3":document.getElementById("tab-icon-3")},content:{"tab-1":document.getElementById("tab-1"),"tab-2":document.getElementById("tab-2"),"tab-3":document.getElementById("tab-3"),"tab-4":document.getElementById("tab-4")},connection:{error:document.getElementById("connection-error"),success:document.getElementById("connection-success"),working:document.getElementById("connection-working")},debounceConnect:null,updateConnection:document.getElementById("update-connection"),cancelUpdateConnection:document.getElementById("cancel-update-connection"),config:{},didSave:!1,init(){if(!cldData.wizard)return;this.config=cldData.wizard.config,window.localStorage.getItem(this.storageKey)&&(this.config=JSON.parse(window.localStorage.getItem(this.storageKey))),document.location.hash.length&&this.hashChange(),Pt.use(Pt.createNonceMiddleware(cldData.wizard.saveNonce));const t=document.querySelectorAll("[data-navigate]"),e=document.getElementById("connect.cloudinary_url");this.updateConnection.addEventListener("click",()=>{this.lockNext(),e.parentNode.classList.remove("hidden"),this.cancelUpdateConnection.classList.remove("hidden"),this.updateConnection.classList.add("hidden")}),this.cancelUpdateConnection.addEventListener("click",()=>{this.unlockNext(),e.parentNode.classList.add("hidden"),this.cancelUpdateConnection.classList.add("hidden"),this.updateConnection.classList.remove("hidden"),this.config.cldString=!0,e.value="",this.connection.error.classList.remove("active"),this.connection.success.classList.add("active")}),[...t].forEach(t=>{t.addEventListener("click",()=>{this.navigate(t.dataset.navigate)})}),this.lock.addEventListener("click",()=>{this.lockIcon.classList.toggle("dashicons-unlock"),this.settings.classList.toggle("disabled"),this.options.forEach(t=>{t.disabled=t.disabled?"":"disabled"})}),e.addEventListener("input",t=>{this.lockNext(),this.startedEntry||(this.startedEntry=!0,Ih.track("credentials_entry_started",{},"activation_funnel",3));const i=e.value.replace("CLOUDINARY_URL=","");this.connection.error.classList.remove("active"),this.connection.success.classList.remove("active"),this.connection.working.classList.remove("active"),i.length&&(this.testing=i,this.debounceConnect&&clearTimeout(this.debounceConnect),this.debounceConnect=setTimeout(()=>{const t=this.evaluateConnectionString(i);Ih.track("credentials_format_validated",{format_valid:t,invalid_reason:t?"":this.invalidReason(i)},"activation_funnel",3),t?(this.connection.working.classList.add("active"),this.testConnection(i)):this.connection.error.classList.add("active")},500))}),this.config.cldString&&(e.parentNode.classList.add("hidden"),this.updateConnection.classList.remove("hidden"));const i=document.querySelector('a[href="https://cloudinary.com/signup"]');i&&i.addEventListener("click",()=>{Ih.track("wizard_signup_clicked",{},"activation_funnel",2)}),this.complete&&this.complete.addEventListener("click",()=>{Ih.track("wizard_dashboard_clicked",{},"activation_funnel",7)}),this.getTab(this.config.tab),this.initFeatures(),window.addEventListener("hashchange",t=>{this.hashChange()})},hashChange(){const t=parseInt(document.location.hash.replace("#",""));t&&0t&&this.getTab(t)},initFeatures(){const t=(t,e)=>{Ih.track("wizard_setting_toggled",{setting_key:t,enabled:e},"activation_funnel",4)},e=document.getElementById("media_library");e.checked=this.config.mediaLibrary,e.addEventListener("change",()=>{this.setConfig("mediaLibrary",e.checked),t("media_library",e.checked)});const i=document.getElementById("non_media");i.checked=this.config.nonMedia,i.addEventListener("change",()=>{this.setConfig("nonMedia",i.checked),t("non_media",i.checked)});const n=document.getElementById("advanced");n.checked=this.config.advanced,n.addEventListener("change",()=>{this.setConfig("advanced",n.checked),t("advanced",n.checked)})},getCurrent(){return this.content[`tab-${this.config.tab}`]},hideTabs(){Object.keys(this.content).forEach(t=>{this.hide(this.content[t])})},completeTab(t){this.incompleteTab(),Object.keys(this.tabs).forEach(e=>{const i=parseInt(this.tabs[e].dataset.tab);t>i?this.tabs[e].classList.add("complete"):t===i&&this.tabs[e].classList.add("active")})},incompleteTab(t){Object.keys(this.tabs).forEach(t=>{this.tabs[t].classList.remove("complete","active")})},getCurrentTab(){return this.tabs[`tab-icon-${this.config.tab}`]},getTab(t){if(4===t&&window.localStorage.getItem(this.storageKey)&&!this.didSave)return void this.saveConfig();const e=this.getCurrent(),i=document.getElementById(`tab-${t}`);switch(this.hideTabs(),this.completeTab(t),this.hide(document.getElementById(`tab-${this.config.tab}`)),e.classList.remove("active"),this.show(i),this.show(this.next),this.hide(this.lock),t){case 1:this.hide(this.back),this.unlockNext(),this.startedTracked||(this.startedTracked=!0,this.config.wizardStartedAt||this.setConfig("wizardStartedAt",Date.now()),Ih.track("wizard_started",{entry_point:this.getEntryPoint()},"activation_funnel",2));break;case 2:Ih.track("wizard_connect_viewed",{},"activation_funnel",3),this.show(this.back),this.config.cldString?this.showSuccess():(this.lockNext(),setTimeout(()=>{document.getElementById("connect.cloudinary_url").focus()},0)),this.updateConnection.classList.contains("hidden")&&this.lockNext();break;case 3:if(!this.config.cldString)return void(document.location.hash="1");Ih.track("wizard_settings_viewed",{},"activation_funnel",4),this.show(this.lock),this.show(this.back);break;case 4:if(!this.config.cldString)return void(document.location.hash="1");Ih.track("wizard_completed",{time_to_complete_sec:this.timeToCompleteSec()},"activation_funnel",6),this.hide(this.tabBar),this.hide(this.next),this.hide(this.back)}this.setConfig("tab",t)},navigate(t){"next"===t?this.navigateNext():"back"===t&&this.navigateBack()},navigateBack(){document.location.hash=this.config.tab-1},navigateNext(){document.location.hash=this.config.tab+1},showError(){this.connection.error.classList.add("active"),this.connection.success.classList.remove("active")},showSuccess(){this.connection.error.classList.remove("active"),this.connection.success.classList.add("active")},show(t){t.classList.remove("hidden"),t.style.display=""},hide(t){t.classList.add("hidden"),t.style.display="none"},lockNext(){this.next.disabled="disabled"},unlockNext(){this.next.disabled=""},evaluateConnectionString:t=>new RegExp(/^(?:CLOUDINARY_URL=)?(cloudinary:\/\/){1}(\d*)[:]{1}([^@]*)[@]{1}([^@]*)$/gim).test(t),invalidReason(t){const e=t.replace("CLOUDINARY_URL=","");if(0!==e.indexOf("cloudinary://"))return"missing_scheme";if(-1===e.indexOf("@"))return"missing_cloud_name";const i=e.replace("cloudinary://","").split("@")[0];return-1===i.indexOf(":")?"missing_secret":/^\d+$/.test(i.split(":")[0])?"invalid_format":"invalid_api_key"},getEntryPoint:()=>-1!==document.referrer.indexOf("plugins.php")?"auto_redirect":"menu",timeToCompleteSec(){const t=this.config.wizardStartedAt;return t?Math.max(0,Math.round((Date.now()-t)/1e3)):null},testConnection(t){this.connectAttempts+=1,Ih.track("connection_test_started",{attempt_number:this.connectAttempts},"activation_funnel",3),Pt({path:cldData.wizard.testURL,data:{cloudinary_url:t,attempt_number:this.connectAttempts},method:"POST"}).then(e=>{e.url===this.testing&&(this.connection.working.classList.remove("active"),"connection_error"===e.type?this.showError():"connection_success"===e.type&&(this.showSuccess(),this.unlockNext(),this.setConfig("cldString",t)))})},setConfig(t,e){this.config[t]=e,window.localStorage.setItem(this.storageKey,JSON.stringify(this.config))},saveConfig(){this.lockNext(),this.next.innerText=$("Setting up Cloudinary","cloudinary"),this.didSave=!0,Pt({path:cldData.wizard.saveURL,data:this.config,method:"POST"}).then(t=>{this.next.innerText=$("Next","cloudinary"),this.unlockNext(),this.getTab(4),window.localStorage.removeItem(this.storageKey)}).fail(t=>{this.didSave=!1})}};window.addEventListener("load",()=>Rh.init());const jh={select:document.getElementById("connect.offload"),tooltip:null,descriptions:{},change(){[...this.descriptions].forEach(t=>{t.classList.remove("selected")}),this.tooltip.querySelector("."+this.select.value).classList.add("selected")},addEventListener(){this.select.addEventListener("change",this.change.bind(this))},_init(){this.select&&(this.addEventListener(),this.tooltip=this.select.parentNode.querySelector(".cld-tooltip"),this.descriptions=this.tooltip.querySelectorAll("li"),this.change())}};window.addEventListener("load",()=>jh._init());const Fh={pageReloader:document.getElementById("page-reloader"),init(){if(!cldData.extensions)return;Pt.use(Pt.createNonceMiddleware(cldData.extensions.nonce));[...document.querySelectorAll("[data-extension]")].forEach(t=>{t.addEventListener("change",e=>{t.spinner||(t.spinner=this.createSpinner(),t.parentNode.appendChild(t.spinner)),t.debounce&&clearTimeout(t.debounce),t.debounce=setTimeout(()=>{this.toggleExtension(t),t.debounce=null},1e3)})})},toggleExtension(t){const e=t.dataset.extension,i=t.checked;Ih.track("extension_toggled",{extension_id:e,enabled:i},"features"),Pt({path:cldData.extensions.url,data:{extension:e,enabled:i},method:"POST"}).then(e=>{t.spinner&&(t.parentNode.removeChild(t.spinner),delete t.spinner),Object.keys(e).forEach(t=>{document.querySelectorAll(`[data-text="${t}"]`).forEach(i=>{i.innerText=e[t]})}),this.pageReloader.style.display="block"})},createSpinner(){const t=document.createElement("span");return t.classList.add("spinner"),t.classList.add("cld-extension-spinner"),t}};window.addEventListener("load",()=>Fh.init());const zh={tabButtonSelectors:null,selectedTabID:"",deselectOldTab(){document.getElementById(this.selectedTabID).classList.remove("is-active"),this.filterActive([...this.tabButtonSelectors]).classList.remove("is-active")},selectCurrentTab(t){this.selectedTabID=t.dataset.tab,t.classList.add("is-active"),document.getElementById(this.selectedTabID).classList.add("is-active")},selectTab(t){t.preventDefault(),t.target.classList.contains("is-active")||(this.deselectOldTab(),this.selectCurrentTab(t.target))},filterTabs(){[...this.tabButtonSelectors].forEach(t=>{t.dataset.tab&&t.addEventListener("click",this.selectTab.bind(this))})},filterActive:t=>t.filter(t=>t.classList.contains("is-active")).pop(),init(){this.tabButtonSelectors=document.querySelectorAll(".cld-page-tabs-tab button"),0!==this.tabButtonSelectors.length&&(this.selectCurrentTab(this.filterActive([...this.tabButtonSelectors])),this.filterTabs())}};window.addEventListener("load",()=>zh.init());const Bh={init(){document.querySelectorAll(".cld-special-offer-link").forEach(t=>{t.addEventListener("click",()=>{Ih.track("special_offer_clicked",{offer_id:"small_plan_29"},"settings")})})}};window.addEventListener("load",()=>Bh.init());i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p;window.$=window.jQuery})()})(); //# sourceMappingURL=cloudinary.js.map \ No newline at end of file diff --git a/js/deactivate.asset.php b/js/deactivate.asset.php index 6990b3b0f..3488680a7 100644 --- a/js/deactivate.asset.php +++ b/js/deactivate.asset.php @@ -1 +1,6 @@ - array('wp-api-fetch'), 'version' => '24f5905e1f37fc7522df'); + array( + 'wp-api-fetch' + ), + 'version' => '24f5905e1f37fc7522df' +); diff --git a/js/gallery-block.asset.php b/js/gallery-block.asset.php index 071acdfa5..c8826fa0e 100644 --- a/js/gallery-block.asset.php +++ b/js/gallery-block.asset.php @@ -1 +1,13 @@ - array('wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-components/build-style/style.css', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '204a233955ee49cd6bc1'); + array( + 'wp-api-fetch', + 'wp-block-editor', + 'wp-blocks', + 'wp-components', + 'wp-components/build-style/style.css', + 'wp-data', + 'wp-element', + 'wp-i18n' + ), + 'version' => 'f4dd3a6a83f3bee704eb' +); diff --git a/js/gallery-block.js b/js/gallery-block.js index baefbab13..bf8fbbff7 100644 --- a/js/gallery-block.js +++ b/js/gallery-block.js @@ -1,2 +1,2 @@ -(()=>{var e={5580(e,t,r){var n=r(6110)(r(9325),"DataView");e.exports=n},1549(e,t,r){var n=r(2032),o=r(3862),a=r(6721),i=r(2749),s=r(5749);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1}},1175(e,t,r){var n=r(6025);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},3040(e,t,r){var n=r(1549),o=r(79),a=r(8223);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||o),string:new n}}},7670(e,t,r){var n=r(2651);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},289(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).get(e)}},4509(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).has(e)}},2949(e,t,r){var n=r(2651);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},1042(e,t,r){var n=r(6110)(Object,"create");e.exports=n},3650(e,t,r){var n=r(4335)(Object.keys,Object);e.exports=n},181(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},6009(e,t,r){e=r.nmd(e);var n=r(4840),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s},9350(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335(e){e.exports=function(e,t){return function(r){return e(t(r))}}},9325(e,t,r){var n=r(4840),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},1420(e,t,r){var n=r(79);e.exports=function(){this.__data__=new n,this.size=0}},938(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},3605(e){e.exports=function(e){return this.__data__.get(e)}},9817(e){e.exports=function(e){return this.__data__.has(e)}},945(e,t,r){var n=r(79),o=r(8223),a=r(3661);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var i=r.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(i)}return r.set(e,t),this.size=r.size,this}},7473(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},8055(e,t,r){var n=r(9999);e.exports=function(e){return n(e,5)}},5288(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},2428(e,t,r){var n=r(7534),o=r(346),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return o(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449(e){var t=Array.isArray;e.exports=t},4894(e,t,r){var n=r(1882),o=r(294);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},3656(e,t,r){e=r.nmd(e);var n=r(9325),o=r(9935),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,s=i&&i.exports===a?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||o;e.exports=l},1882(e,t,r){var n=r(2552),o=r(3805);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730(e,t,r){var n=r(9172),o=r(7301),a=r(6009),i=a&&a.isMap,s=i?o(i):n;e.exports=s},3805(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346(e){e.exports=function(e){return null!=e&&"object"==typeof e}},8440(e,t,r){var n=r(6038),o=r(7301),a=r(6009),i=a&&a.isSet,s=i?o(i):n;e.exports=s},7167(e,t,r){var n=r(4901),o=r(7301),a=r(6009),i=a&&a.isTypedArray,s=i?o(i):n;e.exports=s},5950(e,t,r){var n=r(695),o=r(8984),a=r(4894);e.exports=function(e){return a(e)?n(e):o(e)}},7241(e,t,r){var n=r(695),o=r(2903),a=r(4894);e.exports=function(e){return a(e)?n(e,!0):o(e)}},3345(e){e.exports=function(){return[]}},9935(e){e.exports=function(){return!1}},6087(e){"use strict";e.exports=window.wp.element},6942(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e="",t=0;t{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.hasOwn(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.dn=e=>{var t=Object.getOwnPropertyDescriptor(e,"name");(!t||!t.writable&&t.configurable)&&Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{"use strict";var e=r.cw(function(e,t){function r(e,t){var r,n;if("function"==typeof t)void 0!==(n=t(e))&&(e=n);else if(Array.isArray(t))for(r=0;r=0&&(e=e.replace(/\[/g,t).replace(/]/g,""));var r=e.split(t);if(r.filter(l).length!==r.length)throw Error("Refusing to update blacklisted property "+e);return r}var u=Object.prototype.hasOwnProperty;function p(e,t,r,n){if(!(this instanceof p))return new p(e,t,r,n);void 0===t&&(t=!1),void 0===r&&(r=!0),void 0===n&&(n=!0),this.separator=e||".",this.override=t,this.useArray=r,this.useBrackets=n,this.keepArray=!1,this.cleanup=[]}var d=new p(".",!1,!0,!0);function f(e){return function(){return d[e].apply(d,arguments)}}p.prototype._fill=function(e,t,n,o){var s=e.shift();if(e.length>0){if(t[s]=t[s]||(this.useArray&&function(e){return/^\d+$/.test(e)}(e[0])?[]:{}),!a(t[s])){if(!this.override){if(!a(n)||!i(n))throw new Error("Trying to redefine `"+s+"` which is a "+typeof t[s]);return}t[s]={}}this._fill(e,t[s],n,o)}else{if(!this.override&&a(t[s])&&!i(t[s])){if(!a(n)||!i(n))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}t[s]=r(n,o)}},p.prototype.object=function(e,t){var n=this;return Object.keys(e).forEach(function(o){var a=void 0===t?null:t[o],i=c(o,n.separator).join(n.separator);-1!==i.indexOf(n.separator)?(n._fill(i.split(n.separator),e,e[o],a),delete e[o]):e[o]=r(e[o],a)}),e},p.prototype.str=function(e,t,n,o){var a=c(e,this.separator).join(this.separator);return-1!==e.indexOf(this.separator)?this._fill(a.split(this.separator),n,t,o):n[e]=r(t,o),n},p.prototype.pick=function(e,t,r,o){var a,i,s,l,u;for(i=c(e,this.separator),a=0;ad.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-round"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-round",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 Z M12,5 C8.13400675,5 5,8.13400675 5,12 C5,15.8659932 8.13400675,19 12,19 C15.8659932,19 19,15.8659932 19,12 C19,8.13400675 15.8659932,5 12,5 Z",id:"Combined-Shape"})))),m=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"ratio-square"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-square",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M3,3 L3,21 L21,21 L21,3 L3,3 Z M5,5 L5,19 L19,19 L19,5 L5,5 Z",id:"shape"})))),v=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-radius"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-radius",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M17,3 C19.209139,3 21,4.790861 21,7 L21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 L3,7 C3,4.790861 4.790861,3 7,3 L17,3 Z M17,5 L7,5 C5.9456382,5 5.08183488,5.81587779 5.00548574,6.85073766 L5,7 L5,17 C5,18.0543618 5.81587779,18.9181651 6.85073766,18.9945143 L7,19 L17,19 C18.0543618,19 18.9181651,18.1841222 18.9945143,17.1492623 L19,17 L19,7 C19,5.9456382 18.1841222,5.08183488 17.1492623,5.00548574 L17,5 Z",id:"Rectangle"})))),h=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-none"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-none",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M5,19 L5,21 L3,21 L3,19 L5,19 Z M21,19 L21,21 L19,21 L19,19 L21,19 Z M13,19 L13,21 L11,21 L11,19 L13,19 Z M9,19 L9,21 L7,21 L7,19 L9,19 Z M17,19 L17,21 L15,21 L15,19 L17,19 Z M21,15 L21,17 L19,17 L19,15 L21,15 Z M21,11 L21,13 L19,13 L19,11 L21,11 Z M5,11 L5,13 L3,13 L3,11 L5,11 Z M21,7 L21,9 L19,9 L19,7 L21,7 Z M5,7 L5,9 L3,9 L3,7 L5,7 Z M13,3 L13,5 L11,5 L11,3 L13,3 Z M9,3 L9,5 L7,5 L7,3 L9,3 Z M17,3 L17,5 L15,5 L15,3 L17,3 Z M21,3 L21,5 L19,5 L19,3 L21,3 Z M5,3 L5,5 L3,5 L3,3 L5,3 Z M3,15 L5,15 L5,17 L3,17 L3,15 Z",id:"Shape"})))),y=[{value:{type:"expanded",columns:1},icon:()=>d.createElement("svg",{width:"17px",height:"20px",viewBox:"0 0 17 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-modern"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-modern",transform:"translate(-2.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M2,10 L5,10 L5,7 L2,7 L2,10 Z M2,14 L5,14 L5,11 L2,11 L2,14 Z M2,6 L5,6 L5,3 L2,3 L2,6 Z M6,3 L6,17 L19,17 L19,3 L6,3 Z M8,5 L8,15 L17,15 L17,5 L8,5 Z M6,18 L6,23 L19,23 L19,18 L6,18 Z M8,20 L8,23 L17,23 L17,20 L8,20 Z",id:"shape"})))),label:(0,t.__)("Expanded - 1 Column","cloudinary")},{value:{type:"expanded",columns:2},icon:()=>d.createElement("svg",{width:"18px",height:"17px",viewBox:"0 0 18 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-grid-2-column"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-gird-2-col",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M11,12 L11,20 L3,20 L3,12 L11,12 Z M21,12 L21,20 L13,20 L13,12 L21,12 Z M9,14 L5,14 L5,18 L9,18 L9,14 Z M19,14 L15,14 L15,18 L19,18 L19,14 Z M11,3 L11,11 L3,11 L3,3 L11,3 Z M21,3 L21,11 L13,11 L13,3 L21,3 Z M9,5 L5,5 L5,9 L9,9 L9,5 Z M19,5 L15,5 L15,9 L19,9 L19,5 Z",id:"Shape"})))),label:(0,t.__)("Expanded - 2 Column","cloudinary")},{value:{type:"expanded",columns:3},icon:()=>d.createElement("svg",{width:"20px",height:"13px",viewBox:"0 0 20 13",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-grid-3-column"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-gird-3-col",transform:"translate(-2.000000, -5.000000)",fill:"#000000"},d.createElement("path",{d:"M8,12 L8,18 L2,18 L2,12 L8,12 Z M15,12 L15,18 L9,18 L9,12 L15,12 Z M22,12 L22,18 L16,18 L16,12 L22,12 Z M6,14 L4,14 L4,16 L6,16 L6,14 Z M13,14 L11,14 L11,16 L13,16 L13,14 Z M20,14 L18,14 L18,16 L20,16 L20,14 Z M8,5 L8,11 L2,11 L2,5 L8,5 Z M15,5 L15,11 L9,11 L9,5 L15,5 Z M22,5 L22,11 L16,11 L16,5 L22,5 Z M6,7 L4,7 L4,9 L6,9 L6,7 Z M13,7 L11,7 L11,9 L13,9 L13,7 Z M20,7 L18,7 L18,9 L20,9 L20,7 Z",id:"Combined-Shape"})))),label:(0,t.__)("Expanded - 3 Column","cloudinary")},{value:{type:"classic",columns:1},icon:()=>d.createElement("svg",{width:"17px",height:"14px",viewBox:"0 0 17 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-classic"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-classic",transform:"translate(-3.000000, -5.000000)",fill:"#000000"},d.createElement("path",{d:"M3,12 L6,12 L6,9 L3,9 L3,12 Z M3,16 L6,16 L6,13 L3,13 L3,16 Z M3,8 L6,8 L6,5 L3,5 L3,8 Z M7,5 L7,19 L20,19 L20,5 L7,5 Z M9,7 L9,17 L18,17 L18,7 L9,7 Z",id:"shape"})))),label:(0,t.__)("Classic","cloudinary")}],g=["image"],b=[{label:(0,t.__)("1:1","cloudinary"),value:"1:1"},{label:(0,t.__)("3:4","cloudinary"),value:"3:4"},{label:(0,t.__)("4:3","cloudinary"),value:"4:3"},{label:(0,t.__)("4:6","cloudinary"),value:"4:6"},{label:(0,t.__)("6:4","cloudinary"),value:"6:4"},{label:(0,t.__)("5:7","cloudinary"),value:"5:7"},{label:(0,t.__)("7:5","cloudinary"),value:"7:5"},{label:(0,t.__)("8:5","cloudinary"),value:"8:5"},{label:(0,t.__)("5:8","cloudinary"),value:"5:8"},{label:(0,t.__)("9:16","cloudinary"),value:"9:16"},{label:(0,t.__)("16:9","cloudinary"),value:"16:9"}],_=[{label:(0,t.__)("None","cloudinary"),value:"none"},{label:(0,t.__)("Fade","cloudinary"),value:"fade"},{label:(0,t.__)("Slide","cloudinary"),value:"slide"}],x=[{label:(0,t.__)("Always","cloudinary"),value:"always"},{label:(0,t.__)("None","cloudinary"),value:"none"},{label:(0,t.__)("MouseOver","cloudinary"),value:"mouseover"}],w=[{label:(0,t.__)("Inline","cloudinary"),value:"inline"},{label:(0,t.__)("Flyout","cloudinary"),value:"flyout"},{label:(0,t.__)("Popup","cloudinary"),value:"popup"}],L=[{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"}],E=[{label:(0,t.__)("Click","cloudinary"),value:"click"},{label:(0,t.__)("Hover","cloudinary"),value:"hover"}],O=[{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"},{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"}],j=[{label:(0,t.__)("Thumbnails","cloudinary"),value:"thumbnails"},{label:(0,t.__)("Indicators","cloudinary"),value:"indicators"},{label:(0,t.__)("None","cloudinary"),value:"none"}],A=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"none",icon:h,label:(0,t.__)("None","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")},{value:"rectangle",icon:()=>d.createElement("svg",{width:"14px",height:"20px",viewBox:"0 0 14 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"ratio-9-16"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"ratio/9-16",transform:"translate(-5.000000, -2.000000)",fill:"#000000"},d.createElement("path",{d:"M22,5.5 L22,18.5 L2,18.5 L2,5.5 L22,5.5 Z M20,7.5 L4,7.5 L4,16.5 L20,16.5 L20,7.5 Z",id:"Combined-Shape",transform:"translate(12.000000, 12.000000) rotate(-90.000000) translate(-12.000000, -12.000000) "})))),label:(0,t.__)("Rectangle","cloudinary")}],k=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")}],P=[{label:(0,t.__)("All","cloudinary"),value:"all"},{label:(0,t.__)("Border","cloudinary"),value:"border"},{label:(0,t.__)("Gradient","cloudinary"),value:"gradient"}],S=[{label:(0,t.__)("All","cloudinary"),value:"all"},{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Top-Bottom","cloudinary"),value:"top-bottom"},{label:(0,t.__)("Left-Right","cloudinary"),value:"left-right"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"}],C=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"none",icon:h,label:(0,t.__)("None","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")}],M=[{label:(0,t.__)("Pad","cloudinary"),value:"pad"},{label:(0,t.__)("Fill","cloudinary"),value:"fill"}],B=[{label:(0,t.__)("White padding","cloudinary"),value:"rgb:FFFFFF"},{label:(0,t.__)("Border color padding","cloudinary"),value:"auto"},{label:(0,t.__)("Predominant color padding","cloudinary"),value:"auto:predominant"},{label:(0,t.__)("Gradient fade padding","cloudinary"),value:"auto:predominant_gradient"}];var T=r(6942),D=r.n(T),N=r(6087);const R=({value:e,children:t,icon:r,onChange:n,current:o})=>{const a="object"==typeof e?JSON.stringify(e)===JSON.stringify(o):o===e;return N.createElement("button",{type:"button",onClick:()=>n(e),className:D()("radio-select",{"radio-select--active":a})},N.createElement(r,null),N.createElement("div",{className:"radio-select__label"},t))};r.dn(R);const Z=window.wp.data,z=e=>e<10?"0"+String(e):e.toString(16),I=e=>{const t=new Uint8Array((e||40)/2);return window.crypto.getRandomValues(t),Array.from(t,z).join("")},F=e=>{const t=/var\((.*)\)/g.exec(e);return t?getComputedStyle(document.documentElement).getPropertyValue(t[1]):e};function W(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function H(e){return e instanceof W(e).Element||e instanceof Element}function V(e){return e instanceof W(e).HTMLElement||e instanceof HTMLElement}function U(e){return"undefined"!=typeof ShadowRoot&&(e instanceof W(e).ShadowRoot||e instanceof ShadowRoot)}var q=Math.max,$=Math.min,G=Math.round;function X(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function J(){return!/^((?!chrome|android).)*safari/i.test(X())}function Y(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.getBoundingClientRect(),o=1,a=1;t&&V(e)&&(o=e.offsetWidth>0&&G(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&G(n.height)/e.offsetHeight||1);var i=(H(e)?W(e):window).visualViewport,s=!J()&&r,l=(n.left+(s&&i?i.offsetLeft:0))/o,c=(n.top+(s&&i?i.offsetTop:0))/a,u=n.width/o,p=n.height/a;return{width:u,height:p,top:c,right:l+u,bottom:c+p,left:l,x:l,y:c}}function K(e){var t=W(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Q(e){return e?(e.nodeName||"").toLowerCase():null}function ee(e){return((H(e)?e.ownerDocument:e.document)||window.document).documentElement}function te(e){return Y(ee(e)).left+K(e).scrollLeft}function re(e){return W(e).getComputedStyle(e)}function ne(e){var t=re(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function oe(e,t,r){void 0===r&&(r=!1);var n,o,a=V(t),i=V(t)&&function(e){var t=e.getBoundingClientRect(),r=G(t.width)/e.offsetWidth||1,n=G(t.height)/e.offsetHeight||1;return 1!==r||1!==n}(t),s=ee(t),l=Y(e,i,r),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(a||!a&&!r)&&(("body"!==Q(t)||ne(s))&&(c=(n=t)!==W(n)&&V(n)?{scrollLeft:(o=n).scrollLeft,scrollTop:o.scrollTop}:K(n)),V(t)?((u=Y(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=te(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function ae(e){var t=Y(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function ie(e){return"html"===Q(e)?e:e.assignedSlot||e.parentNode||(U(e)?e.host:null)||ee(e)}function se(e){return["html","body","#document"].indexOf(Q(e))>=0?e.ownerDocument.body:V(e)&&ne(e)?e:se(ie(e))}function le(e,t){var r;void 0===t&&(t=[]);var n=se(e),o=n===(null==(r=e.ownerDocument)?void 0:r.body),a=W(n),i=o?[a].concat(a.visualViewport||[],ne(n)?n:[]):n,s=t.concat(i);return o?s:s.concat(le(ie(i)))}function ce(e){return["table","td","th"].indexOf(Q(e))>=0}function ue(e){return V(e)&&"fixed"!==re(e).position?e.offsetParent:null}function pe(e){for(var t=W(e),r=ue(e);r&&ce(r)&&"static"===re(r).position;)r=ue(r);return r&&("html"===Q(r)||"body"===Q(r)&&"static"===re(r).position)?t:r||function(e){var t=/firefox/i.test(X());if(/Trident/i.test(X())&&V(e)&&"fixed"===re(e).position)return null;var r=ie(e);for(U(r)&&(r=r.host);V(r)&&["html","body"].indexOf(Q(r))<0;){var n=re(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(e)||t}var de="top",fe="bottom",me="right",ve="left",he="auto",ye=[de,fe,me,ve],ge="start",be="end",_e="viewport",xe="popper",we=ye.reduce(function(e,t){return e.concat([t+"-"+ge,t+"-"+be])},[]),Le=[].concat(ye,[he]).reduce(function(e,t){return e.concat([t,t+"-"+ge,t+"-"+be])},[]),Ee=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Oe(e){var t=new Map,r=new Set,n=[];function o(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!r.has(e)){var n=t.get(e);n&&o(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){r.has(e.name)||o(e)}),n}var je={placement:"bottom",modifiers:[],strategy:"absolute"};function Ae(){for(var e=arguments.length,t=new Array(e),r=0;r=0?"x":"y"}function Be(e){var t,r=e.reference,n=e.element,o=e.placement,a=o?Se(o):null,i=o?Ce(o):null,s=r.x+r.width/2-n.width/2,l=r.y+r.height/2-n.height/2;switch(a){case de:t={x:s,y:r.y-n.height};break;case fe:t={x:s,y:r.y+r.height};break;case me:t={x:r.x+r.width,y:l};break;case ve:t={x:r.x-n.width,y:l};break;default:t={x:r.x,y:r.y}}var c=a?Me(a):null;if(null!=c){var u="y"===c?"height":"width";switch(i){case ge:t[c]=t[c]-(r[u]/2-n[u]/2);break;case be:t[c]=t[c]+(r[u]/2-n[u]/2)}}return t}var Te={top:"auto",right:"auto",bottom:"auto",left:"auto"};function De(e){var t,r=e.popper,n=e.popperRect,o=e.placement,a=e.variation,i=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,p=e.isFixed,d=i.x,f=void 0===d?0:d,m=i.y,v=void 0===m?0:m,h="function"==typeof u?u({x:f,y:v}):{x:f,y:v};f=h.x,v=h.y;var y=i.hasOwnProperty("x"),g=i.hasOwnProperty("y"),b=ve,_=de,x=window;if(c){var w=pe(r),L="clientHeight",E="clientWidth";if(w===W(r)&&"static"!==re(w=ee(r)).position&&"absolute"===s&&(L="scrollHeight",E="scrollWidth"),o===de||(o===ve||o===me)&&a===be)_=fe,v-=(p&&w===x&&x.visualViewport?x.visualViewport.height:w[L])-n.height,v*=l?1:-1;if(o===ve||(o===de||o===fe)&&a===be)b=me,f-=(p&&w===x&&x.visualViewport?x.visualViewport.width:w[E])-n.width,f*=l?1:-1}var O,j=Object.assign({position:s},c&&Te),A=!0===u?function(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:G(r*o)/o||0,y:G(n*o)/o||0}}({x:f,y:v},W(r)):{x:f,y:v};return f=A.x,v=A.y,l?Object.assign({},j,((O={})[_]=g?"0":"",O[b]=y?"0":"",O.transform=(x.devicePixelRatio||1)<=1?"translate("+f+"px, "+v+"px)":"translate3d("+f+"px, "+v+"px, 0)",O)):Object.assign({},j,((t={})[_]=g?v+"px":"",t[b]=y?f+"px":"",t.transform="",t))}const Ne={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var r=t.styles[e]||{},n=t.attributes[e]||{},o=t.elements[e];V(o)&&Q(o)&&(Object.assign(o.style,r),Object.keys(n).forEach(function(e){var t=n[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],o=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce(function(e,t){return e[t]="",e},{});V(n)&&Q(n)&&(Object.assign(n.style,a),Object.keys(o).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};const Re={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.offset,a=void 0===o?[0,0]:o,i=Le.reduce(function(e,r){return e[r]=function(e,t,r){var n=Se(e),o=[ve,de].indexOf(n)>=0?-1:1,a="function"==typeof r?r(Object.assign({},t,{placement:e})):r,i=a[0],s=a[1];return i=i||0,s=(s||0)*o,[ve,me].indexOf(n)>=0?{x:s,y:i}:{x:i,y:s}}(r,t.rects,a),e},{}),s=i[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=i}};var Ze={left:"right",right:"left",bottom:"top",top:"bottom"};function ze(e){return e.replace(/left|right|bottom|top/g,function(e){return Ze[e]})}var Ie={start:"end",end:"start"};function Fe(e){return e.replace(/start|end/g,function(e){return Ie[e]})}function We(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&U(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function He(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ve(e,t,r){return t===_e?He(function(e,t){var r=W(e),n=ee(e),o=r.visualViewport,a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;var c=J();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s+te(e),y:l}}(e,r)):H(t)?function(e,t){var r=Y(e,!1,"fixed"===t);return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}(t,r):He(function(e){var t,r=ee(e),n=K(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=q(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=q(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+te(e),l=-n.scrollTop;return"rtl"===re(o||r).direction&&(s+=q(r.clientWidth,o?o.clientWidth:0)-a),{width:a,height:i,x:s,y:l}}(ee(e)))}function Ue(e,t,r,n){var o="clippingParents"===t?function(e){var t=le(ie(e)),r=["absolute","fixed"].indexOf(re(e).position)>=0&&V(e)?pe(e):e;return H(r)?t.filter(function(e){return H(e)&&We(e,r)&&"body"!==Q(e)}):[]}(e):[].concat(t),a=[].concat(o,[r]),i=a[0],s=a.reduce(function(t,r){var o=Ve(e,r,n);return t.top=q(o.top,t.top),t.right=$(o.right,t.right),t.bottom=$(o.bottom,t.bottom),t.left=q(o.left,t.left),t},Ve(e,i,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function qe(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function $e(e,t){return t.reduce(function(t,r){return t[r]=e,t},{})}function Ge(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=void 0===n?e.placement:n,a=r.strategy,i=void 0===a?e.strategy:a,s=r.boundary,l=void 0===s?"clippingParents":s,c=r.rootBoundary,u=void 0===c?_e:c,p=r.elementContext,d=void 0===p?xe:p,f=r.altBoundary,m=void 0!==f&&f,v=r.padding,h=void 0===v?0:v,y=qe("number"!=typeof h?h:$e(h,ye)),g=d===xe?"reference":xe,b=e.rects.popper,_=e.elements[m?g:d],x=Ue(H(_)?_:_.contextElement||ee(e.elements.popper),l,u,i),w=Y(e.elements.reference),L=Be({reference:w,element:b,strategy:"absolute",placement:o}),E=He(Object.assign({},b,L)),O=d===xe?E:w,j={top:x.top-O.top+y.top,bottom:O.bottom-x.bottom+y.bottom,left:x.left-O.left+y.left,right:O.right-x.right+y.right},A=e.modifiersData.offset;if(d===xe&&A){var k=A[o];Object.keys(j).forEach(function(e){var t=[me,fe].indexOf(e)>=0?1:-1,r=[de,fe].indexOf(e)>=0?"y":"x";j[e]+=k[r]*t})}return j}function Xe(e,t,r){return q(e,$(t,r))}const Je={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0!==i&&i,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,p=r.padding,d=r.tether,f=void 0===d||d,m=r.tetherOffset,v=void 0===m?0:m,h=Ge(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:u}),y=Se(t.placement),g=Ce(t.placement),b=!g,_=Me(y),x="x"===_?"y":"x",w=t.modifiersData.popperOffsets,L=t.rects.reference,E=t.rects.popper,O="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,j="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(w){if(a){var P,S="y"===_?de:ve,C="y"===_?fe:me,M="y"===_?"height":"width",B=w[_],T=B+h[S],D=B-h[C],N=f?-E[M]/2:0,R=g===ge?L[M]:E[M],Z=g===ge?-E[M]:-L[M],z=t.elements.arrow,I=f&&z?ae(z):{width:0,height:0},F=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},W=F[S],H=F[C],V=Xe(0,L[M],I[M]),U=b?L[M]/2-N-V-W-j.mainAxis:R-V-W-j.mainAxis,G=b?-L[M]/2+N+V+H+j.mainAxis:Z+V+H+j.mainAxis,X=t.elements.arrow&&pe(t.elements.arrow),J=X?"y"===_?X.clientTop||0:X.clientLeft||0:0,Y=null!=(P=null==A?void 0:A[_])?P:0,K=B+G-Y,Q=Xe(f?$(T,B+U-Y-J):T,B,f?q(D,K):D);w[_]=Q,k[_]=Q-B}if(s){var ee,te="x"===_?de:ve,re="x"===_?fe:me,ne=w[x],oe="y"===x?"height":"width",ie=ne+h[te],se=ne-h[re],le=-1!==[de,ve].indexOf(y),ce=null!=(ee=null==A?void 0:A[x])?ee:0,ue=le?ie:ne-L[oe]-E[oe]-ce+j.altAxis,he=le?ne+L[oe]+E[oe]-ce-j.altAxis:se,ye=f&&le?function(e,t,r){var n=Xe(e,t,r);return n>r?r:n}(ue,ne,he):Xe(f?ue:ie,ne,f?he:se);w[x]=ye,k[x]=ye-ne}t.modifiersData[n]=k}},requiresIfExists:["offset"]};const Ye={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state,n=e.name,o=e.options,a=r.elements.arrow,i=r.modifiersData.popperOffsets,s=Se(r.placement),l=Me(s),c=[ve,me].indexOf(s)>=0?"height":"width";if(a&&i){var u=function(e,t){return qe("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:$e(e,ye))}(o.padding,r),p=ae(a),d="y"===l?de:ve,f="y"===l?fe:me,m=r.rects.reference[c]+r.rects.reference[l]-i[l]-r.rects.popper[c],v=i[l]-r.rects.reference[l],h=pe(a),y=h?"y"===l?h.clientHeight||0:h.clientWidth||0:0,g=m/2-v/2,b=u[d],_=y-p[c]-u[f],x=y/2-p[c]/2+g,w=Xe(b,x,_),L=l;r.modifiersData[n]=((t={})[L]=w,t.centerOffset=w-x,t)}},effect:function(e){var t=e.state,r=e.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&We(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ke(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Qe(e){return[de,me,fe,ve].some(function(t){return e[t]>=0})}var et=ke({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,a=void 0===o||o,i=n.resize,s=void 0===i||i,l=W(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach(function(e){e.addEventListener("scroll",r.update,Pe)}),s&&l.addEventListener("resize",r.update,Pe),function(){a&&c.forEach(function(e){e.removeEventListener("scroll",r.update,Pe)}),s&&l.removeEventListener("resize",r.update,Pe)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,r=e.name;t.modifiersData[r]=Be({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=void 0===n||n,a=r.adaptive,i=void 0===a||a,s=r.roundOffsets,l=void 0===s||s,c={placement:Se(t.placement),variation:Ce(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,De(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,De(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Ne,Re,{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0===i||i,l=r.fallbackPlacements,c=r.padding,u=r.boundary,p=r.rootBoundary,d=r.altBoundary,f=r.flipVariations,m=void 0===f||f,v=r.allowedAutoPlacements,h=t.options.placement,y=Se(h),g=l||(y===h||!m?[ze(h)]:function(e){if(Se(e)===he)return[];var t=ze(e);return[Fe(e),t,Fe(t)]}(h)),b=[h].concat(g).reduce(function(e,r){return e.concat(Se(r)===he?function(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=r.boundary,a=r.rootBoundary,i=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,c=void 0===l?Le:l,u=Ce(n),p=u?s?we:we.filter(function(e){return Ce(e)===u}):ye,d=p.filter(function(e){return c.indexOf(e)>=0});0===d.length&&(d=p);var f=d.reduce(function(t,r){return t[r]=Ge(e,{placement:r,boundary:o,rootBoundary:a,padding:i})[Se(r)],t},{});return Object.keys(f).sort(function(e,t){return f[e]-f[t]})}(t,{placement:r,boundary:u,rootBoundary:p,padding:c,flipVariations:m,allowedAutoPlacements:v}):r)},[]),_=t.rects.reference,x=t.rects.popper,w=new Map,L=!0,E=b[0],O=0;O=0,S=P?"width":"height",C=Ge(t,{placement:j,boundary:u,rootBoundary:p,altBoundary:d,padding:c}),M=P?k?me:ve:k?fe:de;_[S]>x[S]&&(M=ze(M));var B=ze(M),T=[];if(a&&T.push(C[A]<=0),s&&T.push(C[M]<=0,C[B]<=0),T.every(function(e){return e})){E=j,L=!1;break}w.set(j,T)}if(L)for(var D=function(e){var t=b.find(function(t){var r=w.get(t);if(r)return r.slice(0,e).every(function(e){return e})});if(t)return E=t,"break"},N=m?3:1;N>0;N--){if("break"===D(N))break}t.placement!==E&&(t.modifiersData[n]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Je,Ye,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,a=t.modifiersData.preventOverflow,i=Ge(t,{elementContext:"reference"}),s=Ge(t,{altBoundary:!0}),l=Ke(i,n),c=Ke(s,o,a),u=Qe(l),p=Qe(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}}]}),tt="tippy-content",rt="tippy-backdrop",nt="tippy-arrow",ot="tippy-svg-arrow",at={passive:!0,capture:!0},it=function(){return document.body};function st(e,t,r){if(Array.isArray(e)){var n=e[t];return n??(Array.isArray(r)?r[t]:r)}return e}function lt(e,t){var r={}.toString.call(e);return 0===r.indexOf("[object")&&r.indexOf(t+"]")>-1}function ct(e,t){return"function"==typeof e?e.apply(void 0,t):e}function ut(e,t){return 0===t?e:function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)};var r}function pt(e){return[].concat(e)}function dt(e,t){-1===e.indexOf(t)&&e.push(t)}function ft(e){return e.split("-")[0]}function mt(e){return[].slice.call(e)}function vt(e){return Object.keys(e).reduce(function(t,r){return void 0!==e[r]&&(t[r]=e[r]),t},{})}function ht(){return document.createElement("div")}function yt(e){return["Element","Fragment"].some(function(t){return lt(e,t)})}function gt(e){return lt(e,"MouseEvent")}function bt(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function _t(e){return yt(e)?[e]:function(e){return lt(e,"NodeList")}(e)?mt(e):Array.isArray(e)?e:mt(document.querySelectorAll(e))}function xt(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function wt(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function Lt(e){var t,r=pt(e)[0];return null!=r&&null!=(t=r.ownerDocument)&&t.body?r.ownerDocument:document}function Et(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[n](t,r)})}function Ot(e,t){for(var r=t;r;){var n;if(e.contains(r))return!0;r=null==r.getRootNode||null==(n=r.getRootNode())?void 0:n.host}return!1}var jt={isTouch:!1},At=0;function kt(){jt.isTouch||(jt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Pt))}function Pt(){var e=performance.now();e-At<20&&(jt.isTouch=!1,document.removeEventListener("mousemove",Pt)),At=e}function St(){var e=document.activeElement;if(bt(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ct=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Mt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Bt=Object.assign({appendTo:it,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Mt,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Tt=Object.keys(Bt);function Dt(e){var t=(e.plugins||[]).reduce(function(t,r){var n,o=r.name,a=r.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(n=Bt[o])?n:a);return t},{});return Object.assign({},e,t)}function Nt(e,t){var r=Object.assign({},t,{content:ct(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Dt(Object.assign({},Bt,{plugins:t}))):Tt).reduce(function(t,r){var n=(e.getAttribute("data-tippy-"+r)||"").trim();if(!n)return t;if("content"===r)t[r]=n;else try{t[r]=JSON.parse(n)}catch(e){t[r]=n}return t},{})}(e,t.plugins));return r.aria=Object.assign({},Bt.aria,r.aria),r.aria={expanded:"auto"===r.aria.expanded?t.interactive:r.aria.expanded,content:"auto"===r.aria.content?t.interactive?null:"describedby":r.aria.content},r}function Rt(e,t){e.innerHTML=t}function Zt(e){var t=ht();return!0===e?t.className=nt:(t.className=ot,yt(e)?t.appendChild(e):Rt(t,e)),t}function zt(e,t){yt(t.content)?(Rt(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Rt(e,t.content):e.textContent=t.content)}function It(e){var t=e.firstElementChild,r=mt(t.children);return{box:t,content:r.find(function(e){return e.classList.contains(tt)}),arrow:r.find(function(e){return e.classList.contains(nt)||e.classList.contains(ot)}),backdrop:r.find(function(e){return e.classList.contains(rt)})}}function Ft(e){var t=ht(),r=ht();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=ht();function o(r,n){var o=It(t),a=o.box,i=o.content,s=o.arrow;n.theme?a.setAttribute("data-theme",n.theme):a.removeAttribute("data-theme"),"string"==typeof n.animation?a.setAttribute("data-animation",n.animation):a.removeAttribute("data-animation"),n.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?a.setAttribute("role",n.role):a.removeAttribute("role"),r.content===n.content&&r.allowHTML===n.allowHTML||zt(i,e.props),n.arrow?s?r.arrow!==n.arrow&&(a.removeChild(s),a.appendChild(Zt(n.arrow))):a.appendChild(Zt(n.arrow)):s&&a.removeChild(s)}return n.className=tt,n.setAttribute("data-state","hidden"),zt(n,e.props),t.appendChild(r),r.appendChild(n),o(e.props,e.props),{popper:t,onUpdate:o}}Ft.$$tippy=!0;var Wt=1,Ht=[],Vt=[];function Ut(e,t){var r,n,o,a,i,s,l,c,u=Nt(e,Object.assign({},Bt,Dt(vt(t)))),p=!1,d=!1,f=!1,m=!1,v=[],h=ut($,u.interactiveDebounce),y=Wt++,g=(c=u.plugins).filter(function(e,t){return c.indexOf(e)===t}),b={id:y,reference:e,popper:ht(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:g,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(n),cancelAnimationFrame(o)},setProps:function(t){0;if(b.state.isDestroyed)return;B("onBeforeUpdate",[b,t]),U();var r=b.props,n=Nt(e,Object.assign({},r,vt(t),{ignoreAttributes:!0}));b.props=n,V(),r.interactiveDebounce!==n.interactiveDebounce&&(N(),h=ut($,n.interactiveDebounce));r.triggerTarget&&!n.triggerTarget?pt(r.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):n.triggerTarget&&e.removeAttribute("aria-expanded");D(),M(),w&&w(r,n);b.popperInstance&&(Y(),Q().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}));B("onAfterUpdate",[b,t])},setContent:function(e){b.setProps({content:e})},show:function(){0;var e=b.state.isVisible,t=b.state.isDestroyed,r=!b.state.isEnabled,n=jt.isTouch&&!b.props.touch,o=st(b.props.duration,0,Bt.duration);if(e||t||r||n)return;if(k().hasAttribute("disabled"))return;if(B("onShow",[b],!1),!1===b.props.onShow(b))return;b.state.isVisible=!0,A()&&(x.style.visibility="visible");M(),I(),b.state.isMounted||(x.style.transition="none");if(A()){var a=S();xt([a.box,a.content],0)}s=function(){var e;if(b.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=b.props.moveTransition,A()&&b.props.animation){var t=S(),r=t.box,n=t.content;xt([r,n],o),wt([r,n],"visible")}T(),D(),dt(Vt,b),null==(e=b.popperInstance)||e.forceUpdate(),B("onMount",[b]),b.props.animation&&A()&&function(e,t){W(e,t)}(o,function(){b.state.isShown=!0,B("onShown",[b])})}},function(){var e,t=b.props.appendTo,r=k();e=b.props.interactive&&t===it||"parent"===t?r.parentNode:ct(t,[r]);e.contains(x)||e.appendChild(x);b.state.isMounted=!0,Y(),!1}()},hide:function(){0;var e=!b.state.isVisible,t=b.state.isDestroyed,r=!b.state.isEnabled,n=st(b.props.duration,1,Bt.duration);if(e||t||r)return;if(B("onHide",[b],!1),!1===b.props.onHide(b))return;b.state.isVisible=!1,b.state.isShown=!1,m=!1,p=!1,A()&&(x.style.visibility="hidden");if(N(),F(),M(!0),A()){var o=S(),a=o.box,i=o.content;b.props.animation&&(xt([a,i],n),wt([a,i],"hidden"))}T(),D(),b.props.animation?A()&&function(e,t){W(e,function(){!b.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()})}(n,b.unmount):b.unmount()},hideWithInteractivity:function(e){0;P().addEventListener("mousemove",h),dt(Ht,h),h(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){0;b.state.isVisible&&b.hide();if(!b.state.isMounted)return;K(),Q().forEach(function(e){e._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x);Vt=Vt.filter(function(e){return e!==b}),b.state.isMounted=!1,B("onHidden",[b])},destroy:function(){0;if(b.state.isDestroyed)return;b.clearDelayTimeouts(),b.unmount(),U(),delete e._tippy,b.state.isDestroyed=!0,B("onDestroy",[b])}};if(!u.render)return b;var _=u.render(b),x=_.popper,w=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+b.id,b.popper=x,e._tippy=b,x._tippy=b;var L=g.map(function(e){return e.fn(b)}),E=e.hasAttribute("aria-expanded");return V(),D(),M(),B("onCreate",[b]),u.showOnCreate&&ee(),x.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&P().addEventListener("mousemove",h)}),b;function O(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function j(){return"hold"===O()[0]}function A(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function k(){return l||e}function P(){var e=k().parentNode;return e?Lt(e):document}function S(){return It(x)}function C(e){return b.state.isMounted&&!b.state.isVisible||jt.isTouch||a&&"focus"===a.type?0:st(b.props.delay,e?0:1,Bt.delay)}function M(e){void 0===e&&(e=!1),x.style.pointerEvents=b.props.interactive&&!e?"":"none",x.style.zIndex=""+b.props.zIndex}function B(e,t,r){var n;(void 0===r&&(r=!0),L.forEach(function(r){r[e]&&r[e].apply(r,t)}),r)&&(n=b.props)[e].apply(n,t)}function T(){var t=b.props.aria;if(t.content){var r="aria-"+t.content,n=x.id;pt(b.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(r);if(b.state.isVisible)e.setAttribute(r,t?t+" "+n:n);else{var o=t&&t.replace(n,"").trim();o?e.setAttribute(r,o):e.removeAttribute(r)}})}}function D(){!E&&b.props.aria.expanded&&pt(b.props.triggerTarget||e).forEach(function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===k()?"true":"false"):e.removeAttribute("aria-expanded")})}function N(){P().removeEventListener("mousemove",h),Ht=Ht.filter(function(e){return e!==h})}function R(t){if(!jt.isTouch||!f&&"mousedown"!==t.type){var r=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!Ot(x,r)){if(pt(b.props.triggerTarget||e).some(function(e){return Ot(e,r)})){if(jt.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else B("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),d=!0,setTimeout(function(){d=!1}),b.state.isMounted||F())}}}function Z(){f=!0}function z(){f=!1}function I(){var e=P();e.addEventListener("mousedown",R,!0),e.addEventListener("touchend",R,at),e.addEventListener("touchstart",z,at),e.addEventListener("touchmove",Z,at)}function F(){var e=P();e.removeEventListener("mousedown",R,!0),e.removeEventListener("touchend",R,at),e.removeEventListener("touchstart",z,at),e.removeEventListener("touchmove",Z,at)}function W(e,t){var r=S().box;function n(e){e.target===r&&(Et(r,"remove",n),t())}if(0===e)return t();Et(r,"remove",i),Et(r,"add",n),i=n}function H(t,r,n){void 0===n&&(n=!1),pt(b.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,r,n),v.push({node:e,eventType:t,handler:r,options:n})})}function V(){var e;j()&&(H("touchstart",q,{passive:!0}),H("touchend",G,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach(function(e){if("manual"!==e)switch(H(e,q),e){case"mouseenter":H("mouseleave",G);break;case"focus":H(Ct?"focusout":"blur",X);break;case"focusin":H("focusout",X)}})}function U(){v.forEach(function(e){var t=e.node,r=e.eventType,n=e.handler,o=e.options;t.removeEventListener(r,n,o)}),v=[]}function q(e){var t,r=!1;if(b.state.isEnabled&&!J(e)&&!d){var n="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,D(),!b.state.isVisible&>(e)&&Ht.forEach(function(t){return t(e)}),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||p)&&!1!==b.props.hideOnClick&&b.state.isVisible?r=!0:ee(e),"click"===e.type&&(p=!r),r&&!n&&te(e)}}function $(e){var t=e.target,r=k().contains(t)||x.contains(t);if("mousemove"!==e.type||!r){var n=Q().concat(x).map(function(e){var t,r=null==(t=e._tippy.popperInstance)?void 0:t.state;return r?{popperRect:e.getBoundingClientRect(),popperState:r,props:u}:null}).filter(Boolean);(function(e,t){var r=t.clientX,n=t.clientY;return e.every(function(e){var t=e.popperRect,o=e.popperState,a=e.props.interactiveBorder,i=ft(o.placement),s=o.modifiersData.offset;if(!s)return!0;var l="bottom"===i?s.top.y:0,c="top"===i?s.bottom.y:0,u="right"===i?s.left.x:0,p="left"===i?s.right.x:0,d=t.top-n+l>a,f=n-t.bottom-c>a,m=t.left-r+u>a,v=r-t.right-p>a;return d||f||m||v})})(n,e)&&(N(),te(e))}}function G(e){J(e)||b.props.trigger.indexOf("click")>=0&&p||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function X(e){b.props.trigger.indexOf("focusin")<0&&e.target!==k()||b.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function J(e){return!!jt.isTouch&&j()!==e.type.indexOf("touch")>=0}function Y(){K();var t=b.props,r=t.popperOptions,n=t.placement,o=t.offset,a=t.getReferenceClientRect,i=t.moveTransition,l=A()?It(x).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||k()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(A()){var r=S().box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?r.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?r.setAttribute("data-"+e,""):r.removeAttribute("data-"+e)}),t.attributes.popper={}}}},p=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!i}},u];A()&&l&&p.push({name:"arrow",options:{element:l,padding:3}}),p.push.apply(p,(null==r?void 0:r.modifiers)||[]),b.popperInstance=et(c,x,Object.assign({},r,{placement:n,onFirstUpdate:s,modifiers:p}))}function K(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Q(){return mt(x.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&B("onTrigger",[b,e]),I();var t=C(!0),n=O(),o=n[0],a=n[1];jt.isTouch&&"hold"===o&&a&&(t=a),t?r=setTimeout(function(){b.show()},t):b.show()}function te(e){if(b.clearDelayTimeouts(),B("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=C(!1);t?n=setTimeout(function(){b.state.isVisible&&b.hide()},t):o=requestAnimationFrame(function(){b.hide()})}}else F()}}function qt(e,t){void 0===t&&(t={});var r=Bt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",kt,at),window.addEventListener("blur",St);var n=Object.assign({},t,{plugins:r}),o=_t(e).reduce(function(e,t){var r=t&&Ut(t,n);return r&&e.push(r),e},[]);return yt(e)?o[0]:o}qt.defaultProps=Bt,qt.setDefaultProps=function(e){Object.keys(e).forEach(function(t){Bt[t]=e[t]})},qt.currentInput=jt;Object.assign({},Ne,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}});qt.setDefaultProps({render:Ft});const $t=qt;var Gt=r(6087);const Xt=({children:e,value:t})=>Gt.createElement("div",{className:"colorpalette-color-label"},Gt.createElement("span",null,e),Gt.createElement("span",{className:"component-color-indicator","aria-label":`Color: ${t}`,style:{background:t}})),Jt=new(o()())("_"),Yt=({attributes:e,setAttributes:r,colors:n})=>{const o=p()(e),a=Jt.object(o),[i,u]=(0,l.useState)(a.customSettings);e.transformation_crop||(e.transformation_crop="pad",e.transformation_background="rgb:FFFFFF"),"fill"===e.transformation_crop&&delete e.transformation_background;const d=(e,t)=>{const n={[t]:F(e)};r(n)},f=(e=>{const[t,r]=(0,l.useState)(null),n=(0,l.useCallback)(e=>r(e),[]);return(0,l.useEffect)(()=>{if(!t)return;const r=$t(t,{content:e});return()=>{r?.destroy()}},[t,e]),n})((0,t.__)("How to resize or crop images to fit the gallery. Pad adds padding around the image using the specified padding style. Fill crops the image from the center so it fills as much of the available space as possible.","cloudinary"));return Gt.createElement(Gt.Fragment,null,Gt.createElement(s.PanelBody,{title:(0,t.__)("Layout","cloudinary")},y.map(t=>Gt.createElement(R,{key:`${t.value.type}-${t.value.columns}-layout`,value:t.value,onChange:e=>{r({displayProps_mode:e.type,displayProps_columns:e.columns||1})},icon:t.icon,current:{type:e.displayProps_mode,columns:e.displayProps_columns||1}},t.label))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Color Palette","cloudinary"),initialOpen:!1},Gt.createElement(Xt,{value:e.themeProps_primary},(0,t.__)("Primary","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_primary,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_primary")}),Gt.createElement(Xt,{value:e.themeProps_onPrimary},(0,t.__)("On Primary","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_onPrimary,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_onPrimary")}),Gt.createElement(Xt,{value:e.themeProps_active},(0,t.__)("Active","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_active,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_active")})),"classic"===e.displayProps_mode&&Gt.createElement(s.PanelBody,{title:(0,t.__)("Fade Transition","cloudinary"),initialOpen:!1},Gt.createElement(s.SelectControl,{value:e.transition,options:_,onChange:e=>r({transition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),Gt.createElement(s.PanelBody,{title:(0,t.__)("Main Viewer Parameters","cloudinary"),initialOpen:!1},Gt.createElement(s.SelectControl,{label:(0,t.__)("Aspect Ratio","cloudinary"),value:e.aspectRatio,options:b,onChange:e=>r({aspectRatio:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,Gt.createElement("div",{className:"cld-ui-title"},(0,t.__)("Resize/Crop Mode","cloudinary"),Gt.createElement("span",{className:"dashicons dashicons-info cld-tooltip",ref:f})),Gt.createElement(s.ButtonGroup,null,M.map(t=>Gt.createElement(s.Button,{key:t.value+"-look-and-feel",variant:"secondary",isSecondary:!0,isPressed:t.value===e.transformation_crop,onClick:()=>r({transformation_crop:t.value,transformation_background:null})},t.label)))),"pad"===e.transformation_crop&&Gt.createElement(s.SelectControl,{label:(0,t.__)("Pad style","cloudinary"),value:e.transformation_background,options:B,onChange:e=>{r({transformation_background:e})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Navigation","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,x.map(t=>Gt.createElement(s.Button,{key:t.value+"-navigation",variant:"secondary",isSecondary:!0,isPressed:t.value===e.navigation,onClick:()=>r({navigation:t.value})},t.label)))),Gt.createElement("div",{style:{marginTop:"30px"}},Gt.createElement(s.ToggleControl,{label:(0,t.__)("Show Zoom","cloudinary"),checked:e.zoom,onChange:()=>r({zoom:!e.zoom}),__nextHasNoMarginBottom:!0}),e.zoom&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Zoom Type","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,w.map(t=>Gt.createElement(s.Button,{key:t.value+"-zoom-type",variant:"secondary",isSecondary:!0,isPressed:t.value===e.zoomProps_type,onClick:()=>r({zoomProps_type:t.value})},t.label)))),"flyout"===e.zoomProps_type&&Gt.createElement(s.SelectControl,{label:(0,t.__)("Zoom Viewer Position","cloudinary"),value:e.zoomProps_viewerPosition,options:L,onChange:e=>r({zoomProps_viewerPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"popup"!==e.zoomProps_type&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Zoom Trigger","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,E.map(t=>Gt.createElement(s.Button,{key:t.value+"-zoom-trigger",variant:"secondary",isSecondary:!0,isPressed:t.value===e.zoomProps_trigger,onClick:()=>r({zoomProps_trigger:t.value})},t.label)))))))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Carousel Parameters","cloudinary"),initialOpen:!1},Gt.createElement("p",null,(0,t.__)("Carousel Location","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,O.map(t=>Gt.createElement(s.Button,{key:t.value+"-carousel-location",variant:"secondary",isSecondary:!0,isPressed:t.value===e.carouselLocation,onClick:()=>r({carouselLocation:t.value})},t.label)))),Gt.createElement(s.RangeControl,{label:(0,t.__)("Carousel Offset","cloudinary"),value:e.carouselOffset,onChange:e=>r({carouselOffset:e}),min:0,max:100,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Carousel Style","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,j.map(t=>Gt.createElement(s.Button,{key:t.value+"-carousel-style",variant:"secondary",isSecondary:!0,isPressed:t.value===e.carouselStyle,onClick:()=>r({carouselStyle:t.value})},t.label)))),"thumbnails"===e.carouselStyle&&Gt.createElement(Gt.Fragment,null,Gt.createElement(s.RangeControl,{label:(0,t.__)("Width","cloudinary"),value:e.thumbnailProps_width,onChange:e=>r({thumbnailProps_width:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement(s.RangeControl,{label:(0,t.__)("Height","cloudinary"),value:e.thumbnailProps_height,onChange:e=>r({thumbnailProps_height:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Navigation Button Shape","cloudinary")),A.map(t=>Gt.createElement(R,{key:t.value+"-navigation-button-shape",value:t.value,onChange:e=>r({thumbnailProps_navigationShape:e}),icon:t.icon,current:e.thumbnailProps_navigationShape},t.label)),Gt.createElement("p",null,(0,t.__)("Selected Style","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,P.map(t=>Gt.createElement(s.Button,{key:t.value+"-selected-style",variant:"secondary",isSecondary:!0,isPressed:t.value===e.thumbnailProps_selectedStyle,onClick:()=>r({thumbnailProps_selectedStyle:t.value})},t.label)))),Gt.createElement(s.SelectControl,{label:(0,t.__)("Selected Border Position","cloudinary"),value:e.thumbnailProps_selectedBorderPosition,options:S,onChange:e=>r({thumbnailProps_selectedBorderPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement(s.RangeControl,{label:(0,t.__)("Selected Border Width","cloudinary"),value:e.thumbnailProps_selectedBorderWidth,onChange:e=>r({thumbnailProps_selectedBorderWidth:e}),min:0,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Media Shape Icon","cloudinary")),C.map(t=>Gt.createElement(R,{key:t.value+"-media",value:t.value,onChange:e=>r({thumbnailProps_mediaSymbolShape:e}),icon:t.icon,current:e.thumbnailProps_mediaSymbolShape},t.label))),"indicators"===e.carouselStyle&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Indicators Shape","cloudinary")),k.map(t=>Gt.createElement(R,{key:t.value+"-indicator",value:t.value,onChange:e=>r({indicatorProps_shape:e}),icon:t.icon,current:e.indicatorProps_shape},t.label)))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Additional Settings","cloudinary"),initialOpen:!1},Gt.createElement(s.TextareaControl,{label:(0,t.__)("Custom Settings","cloudinary"),help:(0,t.__)("Provide a JSON string of the settings you want to add and/or override.","cloudinary"),value:i,onChange:e=>{let t={};u(e);try{t=JSON.parse(e)}catch(e){}if("object"==typeof t){const e={...a};e.customSettings=t,r({...a,...e})}},__nextHasNoMarginBottom:!0})))};var Kt=r(6087);const Qt=new(o()())("_"),er=(0,t.__)("Drag images, upload new ones or select files from your library.","cloudinary"),tr=(e,t)=>({...e,container:"."+t,zoom:!1}),rr=({setAttributes:e,attributes:r,isSelected:n})=>{const[a,u]=(0,l.useState)(null),[d,f]=(0,l.useState)(!1),m=(0,l.useMemo)(()=>{if(0!==r.selectedImages.length)return r;const e={},{container:t,...n}=Qt.dot(CLD_GALLERY_CONFIG);return Object.keys(n).forEach(t=>{r[t]||(e[t]=n[t])}),{...r,...e}},[r]),v=(0,l.useMemo)(()=>r.selectedImages.length?r.selectedImages.map(({attachmentId:e})=>({id:e})):[],[r]);(0,l.useEffect)(()=>{if(a&&((({status:e,message:t,options:r={}})=>{(0,Z.dispatch)("core/notices").createNotice(e,t,{isDismissible:!0,...r})})({status:"error",message:a}),u(null)),r.selectedImages.length){let e;const{customSettings:t,...n}=(e=>{const t=new(o()())("_"),r=p()(e),{selectedImages:n,...a}=t.object(r,{});return a.mediaAssets=n,"classic"!==a?.displayProps?.mode?delete a.transition:delete a.displayProps.columns,"pad"!==a?.transformation_crop&&delete a.transformation_background,"pad"!==a?.transformation?.crop&&delete a.transformation.background,a?.themeProps?.primary&&(a.themeProps.primary=F(a?.themeProps?.primary)),a?.themeProps?.onPrimary&&(a.themeProps.onPrimary=F(a?.themeProps?.onPrimary)),a?.themeProps?.active&&(a.themeProps.active=F(a?.themeProps?.active)),a})(r);try{e=cloudinary.galleryWidget(tr({...n,...t},r.container))}catch{e=cloudinary.galleryWidget(tr(n,r.container))}return e.render(),f(!1),()=>e.destroy()}},[a,r,e]);const h=!!r.selectedImages.length;(0,l.useEffect)(()=>{r.container||e({container:`cld-gallery-${I(15)}`})},[r.container,e]),(0,l.useEffect)(()=>{e(m)},[m,e]);const y=(0,c.useBlockProps)();return Kt.createElement("div",y,Kt.createElement(Kt.Fragment,null,Kt.createElement("div",{className:r.container}),Kt.createElement("div",{className:"wp-block-cloudinary-gallery"},Kt.createElement(c.MediaPlaceholder,{labels:{title:!h&&(0,t.__)("Cloudinary Gallery","cloudinary"),instructions:!h&&er},icon:"format-gallery",disableMediaButtons:h&&!n,allowedTypes:g,addToGallery:h,isAppender:h,onSelect:r=>(async r=>{f(!0);try{const t=await i()({path:CLD_REST_ENDPOINT+"/image_data",method:"POST",data:{images:r}});e({selectedImages:t})}catch{f(!1),u((0,t.__)("Could not load selected images. Please try again.","cloudinary"))}})(r),value:v,multiple:!0},d&&Kt.createElement("div",{className:"loading-spinner-container"},Kt.createElement(s.Spinner,null))))),Kt.createElement(c.InspectorControls,null,Kt.createElement(Yt,{attributes:r,setAttributes:e})))};var nr=r(6087);const or=({attributes:e})=>nr.createElement("div",{className:e.container}),ar=JSON.parse('{"aspectRatio":{"type":"string"},"navigation":{"type":"string"},"zoom":{"type":"boolean"},"carouselLocation":{"type":"string"},"carouselOffset":{"type":"number"},"carouselStyle":{"type":"string"},"displayProps_mode":{"type":"string"},"displayProps_columns":{"type":"number"},"indicatorProps_shape":{"type":"string"},"themeProps_primary":{"type":"string"},"themeProps_onPrimary":{"type":"string"},"themeProps_active":{"type":"string"},"zoomProps_type":{"type":"string"},"zoomProps_viewerPosition":{"type":"string"},"zoomProps_trigger":{"type":"string"},"thumbnailProps_width":{"type":"number"},"thumbnailProps_height":{"type":"number"},"thumbnailProps_navigationShape":{"type":"string"},"thumbnailProps_selectedStyle":{"type":"string"},"thumbnailProps_selectedBorderPosition":{"type":"string"},"thumbnailProps_selectedBorderWidth":{"type":"number"},"thumbnailProps_mediaSymbolShape":{"type":"string"},"cloudName":{"type":"string"},"container":{"type":"string"},"selectedImages":{"type":"array","default":[]},"transformation_crop":{"type":"string","default":"pad"},"transformation_background":{"type":"string"},"customSettings":{"type":"string"}}');(0,n.registerBlockType)("cloudinary/gallery",{apiVersion:2,title:(0,t.__)("Cloudinary Gallery","cloudinary"),description:(0,t.__)("Add a gallery powered by the Cloudinary Gallery Widget to your post.","cloudinary"),category:"widgets",icon:"format-gallery",attributes:ar,edit:rr,save:or})})()})(); +(()=>{var e={5580(e,t,r){var n=r(6110)(r(9325),"DataView");e.exports=n},1549(e,t,r){var n=r(2032),o=r(3862),a=r(6721),i=r(2749),s=r(5749);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1}},1175(e,t,r){var n=r(6025);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},3040(e,t,r){var n=r(1549),o=r(79),a=r(8223);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||o),string:new n}}},7670(e,t,r){var n=r(2651);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},289(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).get(e)}},4509(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).has(e)}},2949(e,t,r){var n=r(2651);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},1042(e,t,r){var n=r(6110)(Object,"create");e.exports=n},3650(e,t,r){var n=r(4335)(Object.keys,Object);e.exports=n},181(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},6009(e,t,r){e=r.nmd(e);var n=r(4840),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s},9350(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335(e){e.exports=function(e,t){return function(r){return e(t(r))}}},9325(e,t,r){var n=r(4840),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},1420(e,t,r){var n=r(79);e.exports=function(){this.__data__=new n,this.size=0}},938(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},3605(e){e.exports=function(e){return this.__data__.get(e)}},9817(e){e.exports=function(e){return this.__data__.has(e)}},945(e,t,r){var n=r(79),o=r(8223),a=r(3661);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var i=r.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(i)}return r.set(e,t),this.size=r.size,this}},7473(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},8055(e,t,r){var n=r(9999);e.exports=function(e){return n(e,5)}},5288(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},2428(e,t,r){var n=r(7534),o=r(346),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return o(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449(e){var t=Array.isArray;e.exports=t},4894(e,t,r){var n=r(1882),o=r(294);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},3656(e,t,r){e=r.nmd(e);var n=r(9325),o=r(9935),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,s=i&&i.exports===a?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||o;e.exports=l},1882(e,t,r){var n=r(2552),o=r(3805);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730(e,t,r){var n=r(9172),o=r(7301),a=r(6009),i=a&&a.isMap,s=i?o(i):n;e.exports=s},3805(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346(e){e.exports=function(e){return null!=e&&"object"==typeof e}},8440(e,t,r){var n=r(6038),o=r(7301),a=r(6009),i=a&&a.isSet,s=i?o(i):n;e.exports=s},7167(e,t,r){var n=r(4901),o=r(7301),a=r(6009),i=a&&a.isTypedArray,s=i?o(i):n;e.exports=s},5950(e,t,r){var n=r(695),o=r(8984),a=r(4894);e.exports=function(e){return a(e)?n(e):o(e)}},7241(e,t,r){var n=r(695),o=r(2903),a=r(4894);e.exports=function(e){return a(e)?n(e,!0):o(e)}},3345(e){e.exports=function(){return[]}},9935(e){e.exports=function(){return!1}},6087(e){"use strict";e.exports=window.wp.element},6942(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e="",t=0;t{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.hasOwn(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.dn=e=>{var t=Object.getOwnPropertyDescriptor(e,"name");(!t||!t.writable&&t.configurable)&&Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{"use strict";var e=r.cw(e=>{function t(e,t){var r,n;if("function"==typeof t)void 0!==(n=t(e))&&(e=n);else if(Array.isArray(t))for(r=0;r=0&&(e=e.replace(/\[/g,t).replace(/]/g,""));var r=e.split(t);if(r.filter(s).length!==r.length)throw Error("Refusing to update blacklisted property "+e);return r}var c=Object.prototype.hasOwnProperty;function u(e,t,r,n){if(!(this instanceof u))return new u(e,t,r,n);void 0===t&&(t=!1),void 0===r&&(r=!0),void 0===n&&(n=!0),this.separator=e||".",this.override=t,this.useArray=r,this.useBrackets=n,this.keepArray=!1,this.cleanup=[]}var p=new u(".",!1,!0,!0);function d(e){return function(){return p[e].apply(p,arguments)}}u.prototype._fill=function(e,r,n,i){var s=e.shift();if(e.length>0){if(r[s]=r[s]||(this.useArray&&function(e){return/^\d+$/.test(e)}(e[0])?[]:{}),!o(r[s])){if(!this.override){if(!o(n)||!a(n))throw new Error("Trying to redefine `"+s+"` which is a "+typeof r[s]);return}r[s]={}}this._fill(e,r[s],n,i)}else{if(!this.override&&o(r[s])&&!a(r[s])){if(!o(n)||!a(n))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}r[s]=t(n,i)}},u.prototype.object=function(e,r){var n=this;return Object.keys(e).forEach(function(o){var a=void 0===r?null:r[o],i=l(o,n.separator).join(n.separator);-1!==i.indexOf(n.separator)?(n._fill(i.split(n.separator),e,e[o],a),delete e[o]):e[o]=t(e[o],a)}),e},u.prototype.str=function(e,r,n,o){var a=l(e,this.separator).join(this.separator);return-1!==e.indexOf(this.separator)?this._fill(a.split(this.separator),n,r,o):n[e]=t(r,o),n},u.prototype.pick=function(e,t,n,o){var a,i,s,c,u;for(i=l(e,this.separator),a=0;ad.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-round"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-round",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 Z M12,5 C8.13400675,5 5,8.13400675 5,12 C5,15.8659932 8.13400675,19 12,19 C15.8659932,19 19,15.8659932 19,12 C19,8.13400675 15.8659932,5 12,5 Z",id:"Combined-Shape"})))),m=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"ratio-square"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-square",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M3,3 L3,21 L21,21 L21,3 L3,3 Z M5,5 L5,19 L19,19 L19,5 L5,5 Z",id:"shape"})))),v=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-radius"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-radius",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M17,3 C19.209139,3 21,4.790861 21,7 L21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 L3,7 C3,4.790861 4.790861,3 7,3 L17,3 Z M17,5 L7,5 C5.9456382,5 5.08183488,5.81587779 5.00548574,6.85073766 L5,7 L5,17 C5,18.0543618 5.81587779,18.9181651 6.85073766,18.9945143 L7,19 L17,19 C18.0543618,19 18.9181651,18.1841222 18.9945143,17.1492623 L19,17 L19,7 C19,5.9456382 18.1841222,5.08183488 17.1492623,5.00548574 L17,5 Z",id:"Rectangle"})))),h=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-none"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-none",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M5,19 L5,21 L3,21 L3,19 L5,19 Z M21,19 L21,21 L19,21 L19,19 L21,19 Z M13,19 L13,21 L11,21 L11,19 L13,19 Z M9,19 L9,21 L7,21 L7,19 L9,19 Z M17,19 L17,21 L15,21 L15,19 L17,19 Z M21,15 L21,17 L19,17 L19,15 L21,15 Z M21,11 L21,13 L19,13 L19,11 L21,11 Z M5,11 L5,13 L3,13 L3,11 L5,11 Z M21,7 L21,9 L19,9 L19,7 L21,7 Z M5,7 L5,9 L3,9 L3,7 L5,7 Z M13,3 L13,5 L11,5 L11,3 L13,3 Z M9,3 L9,5 L7,5 L7,3 L9,3 Z M17,3 L17,5 L15,5 L15,3 L17,3 Z M21,3 L21,5 L19,5 L19,3 L21,3 Z M5,3 L5,5 L3,5 L3,3 L5,3 Z M3,15 L5,15 L5,17 L3,17 L3,15 Z",id:"Shape"})))),y=[{value:{type:"expanded",columns:1},icon:()=>d.createElement("svg",{width:"17px",height:"20px",viewBox:"0 0 17 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-modern"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-modern",transform:"translate(-2.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M2,10 L5,10 L5,7 L2,7 L2,10 Z M2,14 L5,14 L5,11 L2,11 L2,14 Z M2,6 L5,6 L5,3 L2,3 L2,6 Z M6,3 L6,17 L19,17 L19,3 L6,3 Z M8,5 L8,15 L17,15 L17,5 L8,5 Z M6,18 L6,23 L19,23 L19,18 L6,18 Z M8,20 L8,23 L17,23 L17,20 L8,20 Z",id:"shape"})))),label:(0,t.__)("Expanded - 1 Column","cloudinary")},{value:{type:"expanded",columns:2},icon:()=>d.createElement("svg",{width:"18px",height:"17px",viewBox:"0 0 18 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-grid-2-column"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-gird-2-col",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M11,12 L11,20 L3,20 L3,12 L11,12 Z M21,12 L21,20 L13,20 L13,12 L21,12 Z M9,14 L5,14 L5,18 L9,18 L9,14 Z M19,14 L15,14 L15,18 L19,18 L19,14 Z M11,3 L11,11 L3,11 L3,3 L11,3 Z M21,3 L21,11 L13,11 L13,3 L21,3 Z M9,5 L5,5 L5,9 L9,9 L9,5 Z M19,5 L15,5 L15,9 L19,9 L19,5 Z",id:"Shape"})))),label:(0,t.__)("Expanded - 2 Column","cloudinary")},{value:{type:"expanded",columns:3},icon:()=>d.createElement("svg",{width:"20px",height:"13px",viewBox:"0 0 20 13",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-grid-3-column"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-gird-3-col",transform:"translate(-2.000000, -5.000000)",fill:"#000000"},d.createElement("path",{d:"M8,12 L8,18 L2,18 L2,12 L8,12 Z M15,12 L15,18 L9,18 L9,12 L15,12 Z M22,12 L22,18 L16,18 L16,12 L22,12 Z M6,14 L4,14 L4,16 L6,16 L6,14 Z M13,14 L11,14 L11,16 L13,16 L13,14 Z M20,14 L18,14 L18,16 L20,16 L20,14 Z M8,5 L8,11 L2,11 L2,5 L8,5 Z M15,5 L15,11 L9,11 L9,5 L15,5 Z M22,5 L22,11 L16,11 L16,5 L22,5 Z M6,7 L4,7 L4,9 L6,9 L6,7 Z M13,7 L11,7 L11,9 L13,9 L13,7 Z M20,7 L18,7 L18,9 L20,9 L20,7 Z",id:"Combined-Shape"})))),label:(0,t.__)("Expanded - 3 Column","cloudinary")},{value:{type:"classic",columns:1},icon:()=>d.createElement("svg",{width:"17px",height:"14px",viewBox:"0 0 17 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-classic"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-classic",transform:"translate(-3.000000, -5.000000)",fill:"#000000"},d.createElement("path",{d:"M3,12 L6,12 L6,9 L3,9 L3,12 Z M3,16 L6,16 L6,13 L3,13 L3,16 Z M3,8 L6,8 L6,5 L3,5 L3,8 Z M7,5 L7,19 L20,19 L20,5 L7,5 Z M9,7 L9,17 L18,17 L18,7 L9,7 Z",id:"shape"})))),label:(0,t.__)("Classic","cloudinary")}],g=["image"],b=[{label:(0,t.__)("1:1","cloudinary"),value:"1:1"},{label:(0,t.__)("3:4","cloudinary"),value:"3:4"},{label:(0,t.__)("4:3","cloudinary"),value:"4:3"},{label:(0,t.__)("4:6","cloudinary"),value:"4:6"},{label:(0,t.__)("6:4","cloudinary"),value:"6:4"},{label:(0,t.__)("5:7","cloudinary"),value:"5:7"},{label:(0,t.__)("7:5","cloudinary"),value:"7:5"},{label:(0,t.__)("8:5","cloudinary"),value:"8:5"},{label:(0,t.__)("5:8","cloudinary"),value:"5:8"},{label:(0,t.__)("9:16","cloudinary"),value:"9:16"},{label:(0,t.__)("16:9","cloudinary"),value:"16:9"}],_=[{label:(0,t.__)("None","cloudinary"),value:"none"},{label:(0,t.__)("Fade","cloudinary"),value:"fade"},{label:(0,t.__)("Slide","cloudinary"),value:"slide"}],x=[{label:(0,t.__)("Always","cloudinary"),value:"always"},{label:(0,t.__)("None","cloudinary"),value:"none"},{label:(0,t.__)("MouseOver","cloudinary"),value:"mouseover"}],w=[{label:(0,t.__)("Inline","cloudinary"),value:"inline"},{label:(0,t.__)("Flyout","cloudinary"),value:"flyout"},{label:(0,t.__)("Popup","cloudinary"),value:"popup"}],L=[{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"}],E=[{label:(0,t.__)("Click","cloudinary"),value:"click"},{label:(0,t.__)("Hover","cloudinary"),value:"hover"}],O=[{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"},{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"}],j=[{label:(0,t.__)("Thumbnails","cloudinary"),value:"thumbnails"},{label:(0,t.__)("Indicators","cloudinary"),value:"indicators"},{label:(0,t.__)("None","cloudinary"),value:"none"}],A=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"none",icon:h,label:(0,t.__)("None","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")},{value:"rectangle",icon:()=>d.createElement("svg",{width:"14px",height:"20px",viewBox:"0 0 14 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"ratio-9-16"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"ratio/9-16",transform:"translate(-5.000000, -2.000000)",fill:"#000000"},d.createElement("path",{d:"M22,5.5 L22,18.5 L2,18.5 L2,5.5 L22,5.5 Z M20,7.5 L4,7.5 L4,16.5 L20,16.5 L20,7.5 Z",id:"Combined-Shape",transform:"translate(12.000000, 12.000000) rotate(-90.000000) translate(-12.000000, -12.000000) "})))),label:(0,t.__)("Rectangle","cloudinary")}],k=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")}],P=[{label:(0,t.__)("All","cloudinary"),value:"all"},{label:(0,t.__)("Border","cloudinary"),value:"border"},{label:(0,t.__)("Gradient","cloudinary"),value:"gradient"}],S=[{label:(0,t.__)("All","cloudinary"),value:"all"},{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Top-Bottom","cloudinary"),value:"top-bottom"},{label:(0,t.__)("Left-Right","cloudinary"),value:"left-right"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"}],C=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"none",icon:h,label:(0,t.__)("None","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")}],M=[{label:(0,t.__)("Pad","cloudinary"),value:"pad"},{label:(0,t.__)("Fill","cloudinary"),value:"fill"}],B=[{label:(0,t.__)("White padding","cloudinary"),value:"rgb:FFFFFF"},{label:(0,t.__)("Border color padding","cloudinary"),value:"auto"},{label:(0,t.__)("Predominant color padding","cloudinary"),value:"auto:predominant"},{label:(0,t.__)("Gradient fade padding","cloudinary"),value:"auto:predominant_gradient"}];var T=r(6942),D=r.n(T),N=r(6087);const R=({value:e,children:t,icon:r,onChange:n,current:o})=>{const a="object"==typeof e?JSON.stringify(e)===JSON.stringify(o):o===e;return N.createElement("button",{type:"button",onClick:()=>n(e),className:D()("radio-select",{"radio-select--active":a})},N.createElement(r,null),N.createElement("div",{className:"radio-select__label"},t))};r.dn(R);const Z=window.wp.data,z=e=>e<10?"0"+String(e):e.toString(16),I=e=>{const t=new Uint8Array((e||40)/2);return window.crypto.getRandomValues(t),Array.from(t,z).join("")},F=e=>{const t=/var\((.*)\)/g.exec(e);return t?getComputedStyle(document.documentElement).getPropertyValue(t[1]):e};function W(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function H(e){return e instanceof W(e).Element||e instanceof Element}function V(e){return e instanceof W(e).HTMLElement||e instanceof HTMLElement}function U(e){return"undefined"!=typeof ShadowRoot&&(e instanceof W(e).ShadowRoot||e instanceof ShadowRoot)}var q=Math.max,$=Math.min,G=Math.round;function X(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function J(){return!/^((?!chrome|android).)*safari/i.test(X())}function Y(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.getBoundingClientRect(),o=1,a=1;t&&V(e)&&(o=e.offsetWidth>0&&G(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&G(n.height)/e.offsetHeight||1);var i=(H(e)?W(e):window).visualViewport,s=!J()&&r,l=(n.left+(s&&i?i.offsetLeft:0))/o,c=(n.top+(s&&i?i.offsetTop:0))/a,u=n.width/o,p=n.height/a;return{width:u,height:p,top:c,right:l+u,bottom:c+p,left:l,x:l,y:c}}function K(e){var t=W(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Q(e){return e?(e.nodeName||"").toLowerCase():null}function ee(e){return((H(e)?e.ownerDocument:e.document)||window.document).documentElement}function te(e){return Y(ee(e)).left+K(e).scrollLeft}function re(e){return W(e).getComputedStyle(e)}function ne(e){var t=re(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function oe(e,t,r){void 0===r&&(r=!1);var n,o,a=V(t),i=V(t)&&function(e){var t=e.getBoundingClientRect(),r=G(t.width)/e.offsetWidth||1,n=G(t.height)/e.offsetHeight||1;return 1!==r||1!==n}(t),s=ee(t),l=Y(e,i,r),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(a||!a&&!r)&&(("body"!==Q(t)||ne(s))&&(c=(n=t)!==W(n)&&V(n)?{scrollLeft:(o=n).scrollLeft,scrollTop:o.scrollTop}:K(n)),V(t)?((u=Y(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=te(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function ae(e){var t=Y(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function ie(e){return"html"===Q(e)?e:e.assignedSlot||e.parentNode||(U(e)?e.host:null)||ee(e)}function se(e){return["html","body","#document"].indexOf(Q(e))>=0?e.ownerDocument.body:V(e)&&ne(e)?e:se(ie(e))}function le(e,t){var r;void 0===t&&(t=[]);var n=se(e),o=n===(null==(r=e.ownerDocument)?void 0:r.body),a=W(n),i=o?[a].concat(a.visualViewport||[],ne(n)?n:[]):n,s=t.concat(i);return o?s:s.concat(le(ie(i)))}function ce(e){return["table","td","th"].indexOf(Q(e))>=0}function ue(e){return V(e)&&"fixed"!==re(e).position?e.offsetParent:null}function pe(e){for(var t=W(e),r=ue(e);r&&ce(r)&&"static"===re(r).position;)r=ue(r);return r&&("html"===Q(r)||"body"===Q(r)&&"static"===re(r).position)?t:r||function(e){var t=/firefox/i.test(X());if(/Trident/i.test(X())&&V(e)&&"fixed"===re(e).position)return null;var r=ie(e);for(U(r)&&(r=r.host);V(r)&&["html","body"].indexOf(Q(r))<0;){var n=re(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(e)||t}var de="top",fe="bottom",me="right",ve="left",he="auto",ye=[de,fe,me,ve],ge="start",be="end",_e="viewport",xe="popper",we=ye.reduce(function(e,t){return e.concat([t+"-"+ge,t+"-"+be])},[]),Le=[].concat(ye,[he]).reduce(function(e,t){return e.concat([t,t+"-"+ge,t+"-"+be])},[]),Ee=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Oe(e){var t=new Map,r=new Set,n=[];function o(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!r.has(e)){var n=t.get(e);n&&o(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){r.has(e.name)||o(e)}),n}var je={placement:"bottom",modifiers:[],strategy:"absolute"};function Ae(){for(var e=arguments.length,t=new Array(e),r=0;r=0?"x":"y"}function Be(e){var t,r=e.reference,n=e.element,o=e.placement,a=o?Se(o):null,i=o?Ce(o):null,s=r.x+r.width/2-n.width/2,l=r.y+r.height/2-n.height/2;switch(a){case de:t={x:s,y:r.y-n.height};break;case fe:t={x:s,y:r.y+r.height};break;case me:t={x:r.x+r.width,y:l};break;case ve:t={x:r.x-n.width,y:l};break;default:t={x:r.x,y:r.y}}var c=a?Me(a):null;if(null!=c){var u="y"===c?"height":"width";switch(i){case ge:t[c]=t[c]-(r[u]/2-n[u]/2);break;case be:t[c]=t[c]+(r[u]/2-n[u]/2)}}return t}var Te={top:"auto",right:"auto",bottom:"auto",left:"auto"};function De(e){var t,r=e.popper,n=e.popperRect,o=e.placement,a=e.variation,i=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,p=e.isFixed,d=i.x,f=void 0===d?0:d,m=i.y,v=void 0===m?0:m,h="function"==typeof u?u({x:f,y:v}):{x:f,y:v};f=h.x,v=h.y;var y=i.hasOwnProperty("x"),g=i.hasOwnProperty("y"),b=ve,_=de,x=window;if(c){var w=pe(r),L="clientHeight",E="clientWidth";if(w===W(r)&&"static"!==re(w=ee(r)).position&&"absolute"===s&&(L="scrollHeight",E="scrollWidth"),o===de||(o===ve||o===me)&&a===be)_=fe,v-=(p&&w===x&&x.visualViewport?x.visualViewport.height:w[L])-n.height,v*=l?1:-1;if(o===ve||(o===de||o===fe)&&a===be)b=me,f-=(p&&w===x&&x.visualViewport?x.visualViewport.width:w[E])-n.width,f*=l?1:-1}var O,j=Object.assign({position:s},c&&Te),A=!0===u?function(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:G(r*o)/o||0,y:G(n*o)/o||0}}({x:f,y:v},W(r)):{x:f,y:v};return f=A.x,v=A.y,l?Object.assign({},j,((O={})[_]=g?"0":"",O[b]=y?"0":"",O.transform=(x.devicePixelRatio||1)<=1?"translate("+f+"px, "+v+"px)":"translate3d("+f+"px, "+v+"px, 0)",O)):Object.assign({},j,((t={})[_]=g?v+"px":"",t[b]=y?f+"px":"",t.transform="",t))}const Ne={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var r=t.styles[e]||{},n=t.attributes[e]||{},o=t.elements[e];V(o)&&Q(o)&&(Object.assign(o.style,r),Object.keys(n).forEach(function(e){var t=n[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],o=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce(function(e,t){return e[t]="",e},{});V(n)&&Q(n)&&(Object.assign(n.style,a),Object.keys(o).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};const Re={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.offset,a=void 0===o?[0,0]:o,i=Le.reduce(function(e,r){return e[r]=function(e,t,r){var n=Se(e),o=[ve,de].indexOf(n)>=0?-1:1,a="function"==typeof r?r(Object.assign({},t,{placement:e})):r,i=a[0],s=a[1];return i=i||0,s=(s||0)*o,[ve,me].indexOf(n)>=0?{x:s,y:i}:{x:i,y:s}}(r,t.rects,a),e},{}),s=i[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=i}};var Ze={left:"right",right:"left",bottom:"top",top:"bottom"};function ze(e){return e.replace(/left|right|bottom|top/g,function(e){return Ze[e]})}var Ie={start:"end",end:"start"};function Fe(e){return e.replace(/start|end/g,function(e){return Ie[e]})}function We(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&U(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function He(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ve(e,t,r){return t===_e?He(function(e,t){var r=W(e),n=ee(e),o=r.visualViewport,a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;var c=J();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s+te(e),y:l}}(e,r)):H(t)?function(e,t){var r=Y(e,!1,"fixed"===t);return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}(t,r):He(function(e){var t,r=ee(e),n=K(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=q(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=q(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+te(e),l=-n.scrollTop;return"rtl"===re(o||r).direction&&(s+=q(r.clientWidth,o?o.clientWidth:0)-a),{width:a,height:i,x:s,y:l}}(ee(e)))}function Ue(e,t,r,n){var o="clippingParents"===t?function(e){var t=le(ie(e)),r=["absolute","fixed"].indexOf(re(e).position)>=0&&V(e)?pe(e):e;return H(r)?t.filter(function(e){return H(e)&&We(e,r)&&"body"!==Q(e)}):[]}(e):[].concat(t),a=[].concat(o,[r]),i=a[0],s=a.reduce(function(t,r){var o=Ve(e,r,n);return t.top=q(o.top,t.top),t.right=$(o.right,t.right),t.bottom=$(o.bottom,t.bottom),t.left=q(o.left,t.left),t},Ve(e,i,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function qe(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function $e(e,t){return t.reduce(function(t,r){return t[r]=e,t},{})}function Ge(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=void 0===n?e.placement:n,a=r.strategy,i=void 0===a?e.strategy:a,s=r.boundary,l=void 0===s?"clippingParents":s,c=r.rootBoundary,u=void 0===c?_e:c,p=r.elementContext,d=void 0===p?xe:p,f=r.altBoundary,m=void 0!==f&&f,v=r.padding,h=void 0===v?0:v,y=qe("number"!=typeof h?h:$e(h,ye)),g=d===xe?"reference":xe,b=e.rects.popper,_=e.elements[m?g:d],x=Ue(H(_)?_:_.contextElement||ee(e.elements.popper),l,u,i),w=Y(e.elements.reference),L=Be({reference:w,element:b,strategy:"absolute",placement:o}),E=He(Object.assign({},b,L)),O=d===xe?E:w,j={top:x.top-O.top+y.top,bottom:O.bottom-x.bottom+y.bottom,left:x.left-O.left+y.left,right:O.right-x.right+y.right},A=e.modifiersData.offset;if(d===xe&&A){var k=A[o];Object.keys(j).forEach(function(e){var t=[me,fe].indexOf(e)>=0?1:-1,r=[de,fe].indexOf(e)>=0?"y":"x";j[e]+=k[r]*t})}return j}function Xe(e,t,r){return q(e,$(t,r))}const Je={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0!==i&&i,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,p=r.padding,d=r.tether,f=void 0===d||d,m=r.tetherOffset,v=void 0===m?0:m,h=Ge(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:u}),y=Se(t.placement),g=Ce(t.placement),b=!g,_=Me(y),x="x"===_?"y":"x",w=t.modifiersData.popperOffsets,L=t.rects.reference,E=t.rects.popper,O="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,j="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(w){if(a){var P,S="y"===_?de:ve,C="y"===_?fe:me,M="y"===_?"height":"width",B=w[_],T=B+h[S],D=B-h[C],N=f?-E[M]/2:0,R=g===ge?L[M]:E[M],Z=g===ge?-E[M]:-L[M],z=t.elements.arrow,I=f&&z?ae(z):{width:0,height:0},F=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},W=F[S],H=F[C],V=Xe(0,L[M],I[M]),U=b?L[M]/2-N-V-W-j.mainAxis:R-V-W-j.mainAxis,G=b?-L[M]/2+N+V+H+j.mainAxis:Z+V+H+j.mainAxis,X=t.elements.arrow&&pe(t.elements.arrow),J=X?"y"===_?X.clientTop||0:X.clientLeft||0:0,Y=null!=(P=null==A?void 0:A[_])?P:0,K=B+G-Y,Q=Xe(f?$(T,B+U-Y-J):T,B,f?q(D,K):D);w[_]=Q,k[_]=Q-B}if(s){var ee,te="x"===_?de:ve,re="x"===_?fe:me,ne=w[x],oe="y"===x?"height":"width",ie=ne+h[te],se=ne-h[re],le=-1!==[de,ve].indexOf(y),ce=null!=(ee=null==A?void 0:A[x])?ee:0,ue=le?ie:ne-L[oe]-E[oe]-ce+j.altAxis,he=le?ne+L[oe]+E[oe]-ce-j.altAxis:se,ye=f&&le?function(e,t,r){var n=Xe(e,t,r);return n>r?r:n}(ue,ne,he):Xe(f?ue:ie,ne,f?he:se);w[x]=ye,k[x]=ye-ne}t.modifiersData[n]=k}},requiresIfExists:["offset"]};const Ye={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state,n=e.name,o=e.options,a=r.elements.arrow,i=r.modifiersData.popperOffsets,s=Se(r.placement),l=Me(s),c=[ve,me].indexOf(s)>=0?"height":"width";if(a&&i){var u=function(e,t){return qe("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:$e(e,ye))}(o.padding,r),p=ae(a),d="y"===l?de:ve,f="y"===l?fe:me,m=r.rects.reference[c]+r.rects.reference[l]-i[l]-r.rects.popper[c],v=i[l]-r.rects.reference[l],h=pe(a),y=h?"y"===l?h.clientHeight||0:h.clientWidth||0:0,g=m/2-v/2,b=u[d],_=y-p[c]-u[f],x=y/2-p[c]/2+g,w=Xe(b,x,_),L=l;r.modifiersData[n]=((t={})[L]=w,t.centerOffset=w-x,t)}},effect:function(e){var t=e.state,r=e.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&We(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ke(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Qe(e){return[de,me,fe,ve].some(function(t){return e[t]>=0})}var et=ke({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,a=void 0===o||o,i=n.resize,s=void 0===i||i,l=W(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach(function(e){e.addEventListener("scroll",r.update,Pe)}),s&&l.addEventListener("resize",r.update,Pe),function(){a&&c.forEach(function(e){e.removeEventListener("scroll",r.update,Pe)}),s&&l.removeEventListener("resize",r.update,Pe)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,r=e.name;t.modifiersData[r]=Be({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=void 0===n||n,a=r.adaptive,i=void 0===a||a,s=r.roundOffsets,l=void 0===s||s,c={placement:Se(t.placement),variation:Ce(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,De(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,De(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Ne,Re,{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0===i||i,l=r.fallbackPlacements,c=r.padding,u=r.boundary,p=r.rootBoundary,d=r.altBoundary,f=r.flipVariations,m=void 0===f||f,v=r.allowedAutoPlacements,h=t.options.placement,y=Se(h),g=l||(y===h||!m?[ze(h)]:function(e){if(Se(e)===he)return[];var t=ze(e);return[Fe(e),t,Fe(t)]}(h)),b=[h].concat(g).reduce(function(e,r){return e.concat(Se(r)===he?function(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=r.boundary,a=r.rootBoundary,i=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,c=void 0===l?Le:l,u=Ce(n),p=u?s?we:we.filter(function(e){return Ce(e)===u}):ye,d=p.filter(function(e){return c.indexOf(e)>=0});0===d.length&&(d=p);var f=d.reduce(function(t,r){return t[r]=Ge(e,{placement:r,boundary:o,rootBoundary:a,padding:i})[Se(r)],t},{});return Object.keys(f).sort(function(e,t){return f[e]-f[t]})}(t,{placement:r,boundary:u,rootBoundary:p,padding:c,flipVariations:m,allowedAutoPlacements:v}):r)},[]),_=t.rects.reference,x=t.rects.popper,w=new Map,L=!0,E=b[0],O=0;O=0,S=P?"width":"height",C=Ge(t,{placement:j,boundary:u,rootBoundary:p,altBoundary:d,padding:c}),M=P?k?me:ve:k?fe:de;_[S]>x[S]&&(M=ze(M));var B=ze(M),T=[];if(a&&T.push(C[A]<=0),s&&T.push(C[M]<=0,C[B]<=0),T.every(function(e){return e})){E=j,L=!1;break}w.set(j,T)}if(L)for(var D=function(e){var t=b.find(function(t){var r=w.get(t);if(r)return r.slice(0,e).every(function(e){return e})});if(t)return E=t,"break"},N=m?3:1;N>0;N--){if("break"===D(N))break}t.placement!==E&&(t.modifiersData[n]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Je,Ye,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,a=t.modifiersData.preventOverflow,i=Ge(t,{elementContext:"reference"}),s=Ge(t,{altBoundary:!0}),l=Ke(i,n),c=Ke(s,o,a),u=Qe(l),p=Qe(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}}]}),tt="tippy-content",rt="tippy-backdrop",nt="tippy-arrow",ot="tippy-svg-arrow",at={passive:!0,capture:!0},it=function(){return document.body};function st(e,t,r){if(Array.isArray(e)){var n=e[t];return n??(Array.isArray(r)?r[t]:r)}return e}function lt(e,t){var r={}.toString.call(e);return 0===r.indexOf("[object")&&r.indexOf(t+"]")>-1}function ct(e,t){return"function"==typeof e?e.apply(void 0,t):e}function ut(e,t){return 0===t?e:function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)};var r}function pt(e){return[].concat(e)}function dt(e,t){-1===e.indexOf(t)&&e.push(t)}function ft(e){return e.split("-")[0]}function mt(e){return[].slice.call(e)}function vt(e){return Object.keys(e).reduce(function(t,r){return void 0!==e[r]&&(t[r]=e[r]),t},{})}function ht(){return document.createElement("div")}function yt(e){return["Element","Fragment"].some(function(t){return lt(e,t)})}function gt(e){return lt(e,"MouseEvent")}function bt(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function _t(e){return yt(e)?[e]:function(e){return lt(e,"NodeList")}(e)?mt(e):Array.isArray(e)?e:mt(document.querySelectorAll(e))}function xt(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function wt(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function Lt(e){var t,r=pt(e)[0];return null!=r&&null!=(t=r.ownerDocument)&&t.body?r.ownerDocument:document}function Et(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[n](t,r)})}function Ot(e,t){for(var r=t;r;){var n;if(e.contains(r))return!0;r=null==r.getRootNode||null==(n=r.getRootNode())?void 0:n.host}return!1}var jt={isTouch:!1},At=0;function kt(){jt.isTouch||(jt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Pt))}function Pt(){var e=performance.now();e-At<20&&(jt.isTouch=!1,document.removeEventListener("mousemove",Pt)),At=e}function St(){var e=document.activeElement;if(bt(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ct=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Mt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Bt=Object.assign({appendTo:it,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Mt,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Tt=Object.keys(Bt);function Dt(e){var t=(e.plugins||[]).reduce(function(t,r){var n,o=r.name,a=r.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(n=Bt[o])?n:a);return t},{});return Object.assign({},e,t)}function Nt(e,t){var r=Object.assign({},t,{content:ct(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Dt(Object.assign({},Bt,{plugins:t}))):Tt).reduce(function(t,r){var n=(e.getAttribute("data-tippy-"+r)||"").trim();if(!n)return t;if("content"===r)t[r]=n;else try{t[r]=JSON.parse(n)}catch(e){t[r]=n}return t},{})}(e,t.plugins));return r.aria=Object.assign({},Bt.aria,r.aria),r.aria={expanded:"auto"===r.aria.expanded?t.interactive:r.aria.expanded,content:"auto"===r.aria.content?t.interactive?null:"describedby":r.aria.content},r}function Rt(e,t){e.innerHTML=t}function Zt(e){var t=ht();return!0===e?t.className=nt:(t.className=ot,yt(e)?t.appendChild(e):Rt(t,e)),t}function zt(e,t){yt(t.content)?(Rt(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Rt(e,t.content):e.textContent=t.content)}function It(e){var t=e.firstElementChild,r=mt(t.children);return{box:t,content:r.find(function(e){return e.classList.contains(tt)}),arrow:r.find(function(e){return e.classList.contains(nt)||e.classList.contains(ot)}),backdrop:r.find(function(e){return e.classList.contains(rt)})}}function Ft(e){var t=ht(),r=ht();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=ht();function o(r,n){var o=It(t),a=o.box,i=o.content,s=o.arrow;n.theme?a.setAttribute("data-theme",n.theme):a.removeAttribute("data-theme"),"string"==typeof n.animation?a.setAttribute("data-animation",n.animation):a.removeAttribute("data-animation"),n.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?a.setAttribute("role",n.role):a.removeAttribute("role"),r.content===n.content&&r.allowHTML===n.allowHTML||zt(i,e.props),n.arrow?s?r.arrow!==n.arrow&&(a.removeChild(s),a.appendChild(Zt(n.arrow))):a.appendChild(Zt(n.arrow)):s&&a.removeChild(s)}return n.className=tt,n.setAttribute("data-state","hidden"),zt(n,e.props),t.appendChild(r),r.appendChild(n),o(e.props,e.props),{popper:t,onUpdate:o}}Ft.$$tippy=!0;var Wt=1,Ht=[],Vt=[];function Ut(e,t){var r,n,o,a,i,s,l,c,u=Nt(e,Object.assign({},Bt,Dt(vt(t)))),p=!1,d=!1,f=!1,m=!1,v=[],h=ut($,u.interactiveDebounce),y=Wt++,g=(c=u.plugins).filter(function(e,t){return c.indexOf(e)===t}),b={id:y,reference:e,popper:ht(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:g,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(n),cancelAnimationFrame(o)},setProps:function(t){0;if(b.state.isDestroyed)return;B("onBeforeUpdate",[b,t]),U();var r=b.props,n=Nt(e,Object.assign({},r,vt(t),{ignoreAttributes:!0}));b.props=n,V(),r.interactiveDebounce!==n.interactiveDebounce&&(N(),h=ut($,n.interactiveDebounce));r.triggerTarget&&!n.triggerTarget?pt(r.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):n.triggerTarget&&e.removeAttribute("aria-expanded");D(),M(),w&&w(r,n);b.popperInstance&&(Y(),Q().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}));B("onAfterUpdate",[b,t])},setContent:function(e){b.setProps({content:e})},show:function(){0;var e=b.state.isVisible,t=b.state.isDestroyed,r=!b.state.isEnabled,n=jt.isTouch&&!b.props.touch,o=st(b.props.duration,0,Bt.duration);if(e||t||r||n)return;if(k().hasAttribute("disabled"))return;if(B("onShow",[b],!1),!1===b.props.onShow(b))return;b.state.isVisible=!0,A()&&(x.style.visibility="visible");M(),I(),b.state.isMounted||(x.style.transition="none");if(A()){var a=S();xt([a.box,a.content],0)}s=function(){var e;if(b.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=b.props.moveTransition,A()&&b.props.animation){var t=S(),r=t.box,n=t.content;xt([r,n],o),wt([r,n],"visible")}T(),D(),dt(Vt,b),null==(e=b.popperInstance)||e.forceUpdate(),B("onMount",[b]),b.props.animation&&A()&&function(e,t){W(e,t)}(o,function(){b.state.isShown=!0,B("onShown",[b])})}},function(){var e,t=b.props.appendTo,r=k();e=b.props.interactive&&t===it||"parent"===t?r.parentNode:ct(t,[r]);e.contains(x)||e.appendChild(x);b.state.isMounted=!0,Y(),!1}()},hide:function(){0;var e=!b.state.isVisible,t=b.state.isDestroyed,r=!b.state.isEnabled,n=st(b.props.duration,1,Bt.duration);if(e||t||r)return;if(B("onHide",[b],!1),!1===b.props.onHide(b))return;b.state.isVisible=!1,b.state.isShown=!1,m=!1,p=!1,A()&&(x.style.visibility="hidden");if(N(),F(),M(!0),A()){var o=S(),a=o.box,i=o.content;b.props.animation&&(xt([a,i],n),wt([a,i],"hidden"))}T(),D(),b.props.animation?A()&&function(e,t){W(e,function(){!b.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()})}(n,b.unmount):b.unmount()},hideWithInteractivity:function(e){0;P().addEventListener("mousemove",h),dt(Ht,h),h(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){0;b.state.isVisible&&b.hide();if(!b.state.isMounted)return;K(),Q().forEach(function(e){e._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x);Vt=Vt.filter(function(e){return e!==b}),b.state.isMounted=!1,B("onHidden",[b])},destroy:function(){0;if(b.state.isDestroyed)return;b.clearDelayTimeouts(),b.unmount(),U(),delete e._tippy,b.state.isDestroyed=!0,B("onDestroy",[b])}};if(!u.render)return b;var _=u.render(b),x=_.popper,w=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+b.id,b.popper=x,e._tippy=b,x._tippy=b;var L=g.map(function(e){return e.fn(b)}),E=e.hasAttribute("aria-expanded");return V(),D(),M(),B("onCreate",[b]),u.showOnCreate&&ee(),x.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&P().addEventListener("mousemove",h)}),b;function O(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function j(){return"hold"===O()[0]}function A(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function k(){return l||e}function P(){var e=k().parentNode;return e?Lt(e):document}function S(){return It(x)}function C(e){return b.state.isMounted&&!b.state.isVisible||jt.isTouch||a&&"focus"===a.type?0:st(b.props.delay,e?0:1,Bt.delay)}function M(e){void 0===e&&(e=!1),x.style.pointerEvents=b.props.interactive&&!e?"":"none",x.style.zIndex=""+b.props.zIndex}function B(e,t,r){var n;(void 0===r&&(r=!0),L.forEach(function(r){r[e]&&r[e].apply(r,t)}),r)&&(n=b.props)[e].apply(n,t)}function T(){var t=b.props.aria;if(t.content){var r="aria-"+t.content,n=x.id;pt(b.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(r);if(b.state.isVisible)e.setAttribute(r,t?t+" "+n:n);else{var o=t&&t.replace(n,"").trim();o?e.setAttribute(r,o):e.removeAttribute(r)}})}}function D(){!E&&b.props.aria.expanded&&pt(b.props.triggerTarget||e).forEach(function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===k()?"true":"false"):e.removeAttribute("aria-expanded")})}function N(){P().removeEventListener("mousemove",h),Ht=Ht.filter(function(e){return e!==h})}function R(t){if(!jt.isTouch||!f&&"mousedown"!==t.type){var r=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!Ot(x,r)){if(pt(b.props.triggerTarget||e).some(function(e){return Ot(e,r)})){if(jt.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else B("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),d=!0,setTimeout(function(){d=!1}),b.state.isMounted||F())}}}function Z(){f=!0}function z(){f=!1}function I(){var e=P();e.addEventListener("mousedown",R,!0),e.addEventListener("touchend",R,at),e.addEventListener("touchstart",z,at),e.addEventListener("touchmove",Z,at)}function F(){var e=P();e.removeEventListener("mousedown",R,!0),e.removeEventListener("touchend",R,at),e.removeEventListener("touchstart",z,at),e.removeEventListener("touchmove",Z,at)}function W(e,t){var r=S().box;function n(e){e.target===r&&(Et(r,"remove",n),t())}if(0===e)return t();Et(r,"remove",i),Et(r,"add",n),i=n}function H(t,r,n){void 0===n&&(n=!1),pt(b.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,r,n),v.push({node:e,eventType:t,handler:r,options:n})})}function V(){var e;j()&&(H("touchstart",q,{passive:!0}),H("touchend",G,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach(function(e){if("manual"!==e)switch(H(e,q),e){case"mouseenter":H("mouseleave",G);break;case"focus":H(Ct?"focusout":"blur",X);break;case"focusin":H("focusout",X)}})}function U(){v.forEach(function(e){var t=e.node,r=e.eventType,n=e.handler,o=e.options;t.removeEventListener(r,n,o)}),v=[]}function q(e){var t,r=!1;if(b.state.isEnabled&&!J(e)&&!d){var n="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,D(),!b.state.isVisible&>(e)&&Ht.forEach(function(t){return t(e)}),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||p)&&!1!==b.props.hideOnClick&&b.state.isVisible?r=!0:ee(e),"click"===e.type&&(p=!r),r&&!n&&te(e)}}function $(e){var t=e.target,r=k().contains(t)||x.contains(t);if("mousemove"!==e.type||!r){var n=Q().concat(x).map(function(e){var t,r=null==(t=e._tippy.popperInstance)?void 0:t.state;return r?{popperRect:e.getBoundingClientRect(),popperState:r,props:u}:null}).filter(Boolean);(function(e,t){var r=t.clientX,n=t.clientY;return e.every(function(e){var t=e.popperRect,o=e.popperState,a=e.props.interactiveBorder,i=ft(o.placement),s=o.modifiersData.offset;if(!s)return!0;var l="bottom"===i?s.top.y:0,c="top"===i?s.bottom.y:0,u="right"===i?s.left.x:0,p="left"===i?s.right.x:0,d=t.top-n+l>a,f=n-t.bottom-c>a,m=t.left-r+u>a,v=r-t.right-p>a;return d||f||m||v})})(n,e)&&(N(),te(e))}}function G(e){J(e)||b.props.trigger.indexOf("click")>=0&&p||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function X(e){b.props.trigger.indexOf("focusin")<0&&e.target!==k()||b.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function J(e){return!!jt.isTouch&&j()!==e.type.indexOf("touch")>=0}function Y(){K();var t=b.props,r=t.popperOptions,n=t.placement,o=t.offset,a=t.getReferenceClientRect,i=t.moveTransition,l=A()?It(x).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||k()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(A()){var r=S().box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?r.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?r.setAttribute("data-"+e,""):r.removeAttribute("data-"+e)}),t.attributes.popper={}}}},p=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!i}},u];A()&&l&&p.push({name:"arrow",options:{element:l,padding:3}}),p.push.apply(p,(null==r?void 0:r.modifiers)||[]),b.popperInstance=et(c,x,Object.assign({},r,{placement:n,onFirstUpdate:s,modifiers:p}))}function K(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Q(){return mt(x.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&B("onTrigger",[b,e]),I();var t=C(!0),n=O(),o=n[0],a=n[1];jt.isTouch&&"hold"===o&&a&&(t=a),t?r=setTimeout(function(){b.show()},t):b.show()}function te(e){if(b.clearDelayTimeouts(),B("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=C(!1);t?n=setTimeout(function(){b.state.isVisible&&b.hide()},t):o=requestAnimationFrame(function(){b.hide()})}}else F()}}function qt(e,t){void 0===t&&(t={});var r=Bt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",kt,at),window.addEventListener("blur",St);var n=Object.assign({},t,{plugins:r}),o=_t(e).reduce(function(e,t){var r=t&&Ut(t,n);return r&&e.push(r),e},[]);return yt(e)?o[0]:o}qt.defaultProps=Bt,qt.setDefaultProps=function(e){Object.keys(e).forEach(function(t){Bt[t]=e[t]})},qt.currentInput=jt;Object.assign({},Ne,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}});qt.setDefaultProps({render:Ft});const $t=qt;var Gt=r(6087);const Xt=({children:e,value:t})=>Gt.createElement("div",{className:"colorpalette-color-label"},Gt.createElement("span",null,e),Gt.createElement("span",{className:"component-color-indicator","aria-label":`Color: ${t}`,style:{background:t}})),Jt=new(o()())("_"),Yt=({attributes:e,setAttributes:r,colors:n})=>{const o=p()(e),a=Jt.object(o),[i,u]=(0,l.useState)(a.customSettings);e.transformation_crop||(e.transformation_crop="pad",e.transformation_background="rgb:FFFFFF"),"fill"===e.transformation_crop&&delete e.transformation_background;const d=(e,t)=>{const n={[t]:F(e)};r(n)},f=(e=>{const[t,r]=(0,l.useState)(null),n=(0,l.useCallback)(e=>r(e),[]);return(0,l.useEffect)(()=>{if(!t)return;const r=$t(t,{content:e});return()=>{r?.destroy()}},[t,e]),n})((0,t.__)("How to resize or crop images to fit the gallery. Pad adds padding around the image using the specified padding style. Fill crops the image from the center so it fills as much of the available space as possible.","cloudinary"));return Gt.createElement(Gt.Fragment,null,Gt.createElement(s.PanelBody,{title:(0,t.__)("Layout","cloudinary")},y.map(t=>Gt.createElement(R,{key:`${t.value.type}-${t.value.columns}-layout`,value:t.value,onChange:e=>{r({displayProps_mode:e.type,displayProps_columns:e.columns||1})},icon:t.icon,current:{type:e.displayProps_mode,columns:e.displayProps_columns||1}},t.label))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Color Palette","cloudinary"),initialOpen:!1},Gt.createElement(Xt,{value:e.themeProps_primary},(0,t.__)("Primary","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_primary,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_primary")}),Gt.createElement(Xt,{value:e.themeProps_onPrimary},(0,t.__)("On Primary","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_onPrimary,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_onPrimary")}),Gt.createElement(Xt,{value:e.themeProps_active},(0,t.__)("Active","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_active,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_active")})),"classic"===e.displayProps_mode&&Gt.createElement(s.PanelBody,{title:(0,t.__)("Fade Transition","cloudinary"),initialOpen:!1},Gt.createElement(s.SelectControl,{value:e.transition,options:_,onChange:e=>r({transition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),Gt.createElement(s.PanelBody,{title:(0,t.__)("Main Viewer Parameters","cloudinary"),initialOpen:!1},Gt.createElement(s.SelectControl,{label:(0,t.__)("Aspect Ratio","cloudinary"),value:e.aspectRatio,options:b,onChange:e=>r({aspectRatio:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,Gt.createElement("div",{className:"cld-ui-title"},(0,t.__)("Resize/Crop Mode","cloudinary"),Gt.createElement("span",{className:"dashicons dashicons-info cld-tooltip",ref:f})),Gt.createElement(s.ButtonGroup,null,M.map(t=>Gt.createElement(s.Button,{key:t.value+"-look-and-feel",variant:"secondary",isSecondary:!0,isPressed:t.value===e.transformation_crop,onClick:()=>r({transformation_crop:t.value,transformation_background:null})},t.label)))),"pad"===e.transformation_crop&&Gt.createElement(s.SelectControl,{label:(0,t.__)("Pad style","cloudinary"),value:e.transformation_background,options:B,onChange:e=>{r({transformation_background:e})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Navigation","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,x.map(t=>Gt.createElement(s.Button,{key:t.value+"-navigation",variant:"secondary",isSecondary:!0,isPressed:t.value===e.navigation,onClick:()=>r({navigation:t.value})},t.label)))),Gt.createElement("div",{style:{marginTop:"30px"}},Gt.createElement(s.ToggleControl,{label:(0,t.__)("Show Zoom","cloudinary"),checked:e.zoom,onChange:()=>r({zoom:!e.zoom}),__nextHasNoMarginBottom:!0}),e.zoom&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Zoom Type","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,w.map(t=>Gt.createElement(s.Button,{key:t.value+"-zoom-type",variant:"secondary",isSecondary:!0,isPressed:t.value===e.zoomProps_type,onClick:()=>r({zoomProps_type:t.value})},t.label)))),"flyout"===e.zoomProps_type&&Gt.createElement(s.SelectControl,{label:(0,t.__)("Zoom Viewer Position","cloudinary"),value:e.zoomProps_viewerPosition,options:L,onChange:e=>r({zoomProps_viewerPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"popup"!==e.zoomProps_type&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Zoom Trigger","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,E.map(t=>Gt.createElement(s.Button,{key:t.value+"-zoom-trigger",variant:"secondary",isSecondary:!0,isPressed:t.value===e.zoomProps_trigger,onClick:()=>r({zoomProps_trigger:t.value})},t.label)))))))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Carousel Parameters","cloudinary"),initialOpen:!1},Gt.createElement("p",null,(0,t.__)("Carousel Location","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,O.map(t=>Gt.createElement(s.Button,{key:t.value+"-carousel-location",variant:"secondary",isSecondary:!0,isPressed:t.value===e.carouselLocation,onClick:()=>r({carouselLocation:t.value})},t.label)))),Gt.createElement(s.RangeControl,{label:(0,t.__)("Carousel Offset","cloudinary"),value:e.carouselOffset,onChange:e=>r({carouselOffset:e}),min:0,max:100,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Carousel Style","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,j.map(t=>Gt.createElement(s.Button,{key:t.value+"-carousel-style",variant:"secondary",isSecondary:!0,isPressed:t.value===e.carouselStyle,onClick:()=>r({carouselStyle:t.value})},t.label)))),"thumbnails"===e.carouselStyle&&Gt.createElement(Gt.Fragment,null,Gt.createElement(s.RangeControl,{label:(0,t.__)("Width","cloudinary"),value:e.thumbnailProps_width,onChange:e=>r({thumbnailProps_width:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement(s.RangeControl,{label:(0,t.__)("Height","cloudinary"),value:e.thumbnailProps_height,onChange:e=>r({thumbnailProps_height:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Navigation Button Shape","cloudinary")),A.map(t=>Gt.createElement(R,{key:t.value+"-navigation-button-shape",value:t.value,onChange:e=>r({thumbnailProps_navigationShape:e}),icon:t.icon,current:e.thumbnailProps_navigationShape},t.label)),Gt.createElement("p",null,(0,t.__)("Selected Style","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,P.map(t=>Gt.createElement(s.Button,{key:t.value+"-selected-style",variant:"secondary",isSecondary:!0,isPressed:t.value===e.thumbnailProps_selectedStyle,onClick:()=>r({thumbnailProps_selectedStyle:t.value})},t.label)))),Gt.createElement(s.SelectControl,{label:(0,t.__)("Selected Border Position","cloudinary"),value:e.thumbnailProps_selectedBorderPosition,options:S,onChange:e=>r({thumbnailProps_selectedBorderPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement(s.RangeControl,{label:(0,t.__)("Selected Border Width","cloudinary"),value:e.thumbnailProps_selectedBorderWidth,onChange:e=>r({thumbnailProps_selectedBorderWidth:e}),min:0,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Media Shape Icon","cloudinary")),C.map(t=>Gt.createElement(R,{key:t.value+"-media",value:t.value,onChange:e=>r({thumbnailProps_mediaSymbolShape:e}),icon:t.icon,current:e.thumbnailProps_mediaSymbolShape},t.label))),"indicators"===e.carouselStyle&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Indicators Shape","cloudinary")),k.map(t=>Gt.createElement(R,{key:t.value+"-indicator",value:t.value,onChange:e=>r({indicatorProps_shape:e}),icon:t.icon,current:e.indicatorProps_shape},t.label)))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Additional Settings","cloudinary"),initialOpen:!1},Gt.createElement(s.TextareaControl,{label:(0,t.__)("Custom Settings","cloudinary"),help:(0,t.__)("Provide a JSON string of the settings you want to add and/or override.","cloudinary"),value:i,onChange:e=>{let t={};u(e);try{t=JSON.parse(e)}catch(e){}if("object"==typeof t){const e={...a};e.customSettings=t,r({...a,...e})}},__nextHasNoMarginBottom:!0})))};var Kt=r(6087);const Qt=new(o()())("_"),er=(0,t.__)("Drag images, upload new ones or select files from your library.","cloudinary"),tr=(e,t)=>({...e,container:"."+t,zoom:!1}),rr=({setAttributes:e,attributes:r,isSelected:n})=>{const[a,u]=(0,l.useState)(null),[d,f]=(0,l.useState)(!1),m=(0,l.useMemo)(()=>{if(0!==r.selectedImages.length)return r;const e={},{container:t,...n}=Qt.dot(CLD_GALLERY_CONFIG);return Object.keys(n).forEach(t=>{r[t]||(e[t]=n[t])}),{...r,...e}},[r]),v=(0,l.useMemo)(()=>r.selectedImages.length?r.selectedImages.map(({attachmentId:e})=>({id:e})):[],[r]);(0,l.useEffect)(()=>{if(a&&((({status:e,message:t,options:r={}})=>{(0,Z.dispatch)("core/notices").createNotice(e,t,{isDismissible:!0,...r})})({status:"error",message:a}),u(null)),r.selectedImages.length){let e;const{customSettings:t,...n}=(e=>{const t=new(o()())("_"),r=p()(e),{selectedImages:n,...a}=t.object(r,{});return a.mediaAssets=n,"classic"!==a?.displayProps?.mode?delete a.transition:delete a.displayProps.columns,"pad"!==a?.transformation_crop&&delete a.transformation_background,"pad"!==a?.transformation?.crop&&delete a.transformation.background,a?.themeProps?.primary&&(a.themeProps.primary=F(a?.themeProps?.primary)),a?.themeProps?.onPrimary&&(a.themeProps.onPrimary=F(a?.themeProps?.onPrimary)),a?.themeProps?.active&&(a.themeProps.active=F(a?.themeProps?.active)),a})(r);try{e=cloudinary.galleryWidget(tr({...n,...t},r.container))}catch{e=cloudinary.galleryWidget(tr(n,r.container))}return e.render(),f(!1),()=>e.destroy()}},[a,r,e]);const h=!!r.selectedImages.length;(0,l.useEffect)(()=>{r.container||e({container:`cld-gallery-${I(15)}`})},[r.container,e]),(0,l.useEffect)(()=>{e(m)},[m,e]);const y=(0,c.useBlockProps)();return Kt.createElement("div",y,Kt.createElement(Kt.Fragment,null,Kt.createElement("div",{className:r.container}),Kt.createElement("div",{className:"wp-block-cloudinary-gallery"},Kt.createElement(c.MediaPlaceholder,{labels:{title:!h&&(0,t.__)("Cloudinary Gallery","cloudinary"),instructions:!h&&er},icon:"format-gallery",disableMediaButtons:h&&!n,allowedTypes:g,addToGallery:h,isAppender:h,onSelect:r=>(async r=>{f(!0);try{const t=await i()({path:CLD_REST_ENDPOINT+"/image_data",method:"POST",data:{images:r}});e({selectedImages:t})}catch{f(!1),u((0,t.__)("Could not load selected images. Please try again.","cloudinary"))}})(r),value:v,multiple:!0},d&&Kt.createElement("div",{className:"loading-spinner-container"},Kt.createElement(s.Spinner,null))))),Kt.createElement(c.InspectorControls,null,Kt.createElement(Yt,{attributes:r,setAttributes:e})))};var nr=r(6087);const or=({attributes:e})=>nr.createElement("div",{className:e.container}),ar=JSON.parse('{"aspectRatio":{"type":"string"},"navigation":{"type":"string"},"zoom":{"type":"boolean"},"carouselLocation":{"type":"string"},"carouselOffset":{"type":"number"},"carouselStyle":{"type":"string"},"displayProps_mode":{"type":"string"},"displayProps_columns":{"type":"number"},"indicatorProps_shape":{"type":"string"},"themeProps_primary":{"type":"string"},"themeProps_onPrimary":{"type":"string"},"themeProps_active":{"type":"string"},"zoomProps_type":{"type":"string"},"zoomProps_viewerPosition":{"type":"string"},"zoomProps_trigger":{"type":"string"},"thumbnailProps_width":{"type":"number"},"thumbnailProps_height":{"type":"number"},"thumbnailProps_navigationShape":{"type":"string"},"thumbnailProps_selectedStyle":{"type":"string"},"thumbnailProps_selectedBorderPosition":{"type":"string"},"thumbnailProps_selectedBorderWidth":{"type":"number"},"thumbnailProps_mediaSymbolShape":{"type":"string"},"cloudName":{"type":"string"},"container":{"type":"string"},"selectedImages":{"type":"array","default":[]},"transformation_crop":{"type":"string","default":"pad"},"transformation_background":{"type":"string"},"customSettings":{"type":"string"}}');(0,n.registerBlockType)("cloudinary/gallery",{apiVersion:2,title:(0,t.__)("Cloudinary Gallery","cloudinary"),description:(0,t.__)("Add a gallery powered by the Cloudinary Gallery Widget to your post.","cloudinary"),category:"widgets",icon:"format-gallery",attributes:ar,edit:rr,save:or})})()})(); //# sourceMappingURL=gallery-block.js.map \ No newline at end of file diff --git a/js/gallery-init.asset.php b/js/gallery-init.asset.php index 0725cd4df..17d3c3d42 100644 --- a/js/gallery-init.asset.php +++ b/js/gallery-init.asset.php @@ -1 +1,6 @@ - array(), 'version' => '746e6463d7d00962313d'); + array( + + ), + 'version' => '746e6463d7d00962313d' +); diff --git a/js/gallery.asset.php b/js/gallery.asset.php index 96358c2de..049f43eee 100644 --- a/js/gallery.asset.php +++ b/js/gallery.asset.php @@ -1 +1,11 @@ - array('wp-block-editor', 'wp-components', 'wp-components/build-style/style.css', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'dd272475a4c14b284cf4'); + array( + 'wp-block-editor', + 'wp-components', + 'wp-components/build-style/style.css', + 'wp-data', + 'wp-element', + 'wp-i18n' + ), + 'version' => '156851c22c2575a2142f' +); diff --git a/js/gallery.js b/js/gallery.js index 2c56bd535..ef4a2ce39 100644 --- a/js/gallery.js +++ b/js/gallery.js @@ -1,2 +1,2 @@ -(()=>{var e={5580(e,t,r){var n=r(6110)(r(9325),"DataView");e.exports=n},1549(e,t,r){var n=r(2032),o=r(3862),a=r(6721),i=r(2749),s=r(5749);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1}},1175(e,t,r){var n=r(6025);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},3040(e,t,r){var n=r(1549),o=r(79),a=r(8223);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||o),string:new n}}},7670(e,t,r){var n=r(2651);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},289(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).get(e)}},4509(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).has(e)}},2949(e,t,r){var n=r(2651);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},1042(e,t,r){var n=r(6110)(Object,"create");e.exports=n},3650(e,t,r){var n=r(4335)(Object.keys,Object);e.exports=n},181(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},6009(e,t,r){e=r.nmd(e);var n=r(4840),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s},9350(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335(e){e.exports=function(e,t){return function(r){return e(t(r))}}},9325(e,t,r){var n=r(4840),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},1420(e,t,r){var n=r(79);e.exports=function(){this.__data__=new n,this.size=0}},938(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},3605(e){e.exports=function(e){return this.__data__.get(e)}},9817(e){e.exports=function(e){return this.__data__.has(e)}},945(e,t,r){var n=r(79),o=r(8223),a=r(3661);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var i=r.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(i)}return r.set(e,t),this.size=r.size,this}},7473(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},8055(e,t,r){var n=r(9999);e.exports=function(e){return n(e,5)}},5288(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},2428(e,t,r){var n=r(7534),o=r(346),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return o(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449(e){var t=Array.isArray;e.exports=t},4894(e,t,r){var n=r(1882),o=r(294);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},3656(e,t,r){e=r.nmd(e);var n=r(9325),o=r(9935),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,s=i&&i.exports===a?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||o;e.exports=l},1882(e,t,r){var n=r(2552),o=r(3805);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730(e,t,r){var n=r(9172),o=r(7301),a=r(6009),i=a&&a.isMap,s=i?o(i):n;e.exports=s},3805(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346(e){e.exports=function(e){return null!=e&&"object"==typeof e}},8440(e,t,r){var n=r(6038),o=r(7301),a=r(6009),i=a&&a.isSet,s=i?o(i):n;e.exports=s},7167(e,t,r){var n=r(4901),o=r(7301),a=r(6009),i=a&&a.isTypedArray,s=i?o(i):n;e.exports=s},5950(e,t,r){var n=r(695),o=r(8984),a=r(4894);e.exports=function(e){return a(e)?n(e):o(e)}},7241(e,t,r){var n=r(695),o=r(2903),a=r(4894);e.exports=function(e){return a(e)?n(e,!0):o(e)}},3345(e){e.exports=function(){return[]}},9935(e){e.exports=function(){return!1}},6087(e){"use strict";e.exports=window.wp.element},6942(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e="",t=0;t{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.hasOwn(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.dn=e=>{var t=Object.getOwnPropertyDescriptor(e,"name");(!t||!t.writable&&t.configurable)&&Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{"use strict";var e=r.cw(function(e,t){function r(e,t){var r,n;if("function"==typeof t)void 0!==(n=t(e))&&(e=n);else if(Array.isArray(t))for(r=0;r=0&&(e=e.replace(/\[/g,t).replace(/]/g,""));var r=e.split(t);if(r.filter(l).length!==r.length)throw Error("Refusing to update blacklisted property "+e);return r}var u=Object.prototype.hasOwnProperty;function p(e,t,r,n){if(!(this instanceof p))return new p(e,t,r,n);void 0===t&&(t=!1),void 0===r&&(r=!0),void 0===n&&(n=!0),this.separator=e||".",this.override=t,this.useArray=r,this.useBrackets=n,this.keepArray=!1,this.cleanup=[]}var d=new p(".",!1,!0,!0);function f(e){return function(){return d[e].apply(d,arguments)}}p.prototype._fill=function(e,t,n,o){var s=e.shift();if(e.length>0){if(t[s]=t[s]||(this.useArray&&function(e){return/^\d+$/.test(e)}(e[0])?[]:{}),!a(t[s])){if(!this.override){if(!a(n)||!i(n))throw new Error("Trying to redefine `"+s+"` which is a "+typeof t[s]);return}t[s]={}}this._fill(e,t[s],n,o)}else{if(!this.override&&a(t[s])&&!i(t[s])){if(!a(n)||!i(n))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}t[s]=r(n,o)}},p.prototype.object=function(e,t){var n=this;return Object.keys(e).forEach(function(o){var a=void 0===t?null:t[o],i=c(o,n.separator).join(n.separator);-1!==i.indexOf(n.separator)?(n._fill(i.split(n.separator),e,e[o],a),delete e[o]):e[o]=r(e[o],a)}),e},p.prototype.str=function(e,t,n,o){var a=c(e,this.separator).join(this.separator);return-1!==e.indexOf(this.separator)?this._fill(a.split(this.separator),n,t,o):n[e]=r(t,o),n},p.prototype.pick=function(e,t,r,o){var a,i,s,l,u;for(i=c(e,this.separator),a=0;ac.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"shape-round"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"widgets/shape-round",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},c.createElement("path",{d:"M12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 Z M12,5 C8.13400675,5 5,8.13400675 5,12 C5,15.8659932 8.13400675,19 12,19 C15.8659932,19 19,15.8659932 19,12 C19,8.13400675 15.8659932,5 12,5 Z",id:"Combined-Shape"})))),p=()=>c.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"ratio-square"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"widgets/shape-square",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},c.createElement("path",{d:"M3,3 L3,21 L21,21 L21,3 L3,3 Z M5,5 L5,19 L19,19 L19,5 L5,5 Z",id:"shape"})))),d=()=>c.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"shape-radius"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"widgets/shape-radius",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},c.createElement("path",{d:"M17,3 C19.209139,3 21,4.790861 21,7 L21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 L3,7 C3,4.790861 4.790861,3 7,3 L17,3 Z M17,5 L7,5 C5.9456382,5 5.08183488,5.81587779 5.00548574,6.85073766 L5,7 L5,17 C5,18.0543618 5.81587779,18.9181651 6.85073766,18.9945143 L7,19 L17,19 C18.0543618,19 18.9181651,18.1841222 18.9945143,17.1492623 L19,17 L19,7 C19,5.9456382 18.1841222,5.08183488 17.1492623,5.00548574 L17,5 Z",id:"Rectangle"})))),f=()=>c.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"shape-none"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"widgets/shape-none",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},c.createElement("path",{d:"M5,19 L5,21 L3,21 L3,19 L5,19 Z M21,19 L21,21 L19,21 L19,19 L21,19 Z M13,19 L13,21 L11,21 L11,19 L13,19 Z M9,19 L9,21 L7,21 L7,19 L9,19 Z M17,19 L17,21 L15,21 L15,19 L17,19 Z M21,15 L21,17 L19,17 L19,15 L21,15 Z M21,11 L21,13 L19,13 L19,11 L21,11 Z M5,11 L5,13 L3,13 L3,11 L5,11 Z M21,7 L21,9 L19,9 L19,7 L21,7 Z M5,7 L5,9 L3,9 L3,7 L5,7 Z M13,3 L13,5 L11,5 L11,3 L13,3 Z M9,3 L9,5 L7,5 L7,3 L9,3 Z M17,3 L17,5 L15,5 L15,3 L17,3 Z M21,3 L21,5 L19,5 L19,3 L21,3 Z M5,3 L5,5 L3,5 L3,3 L5,3 Z M3,15 L5,15 L5,17 L3,17 L3,15 Z",id:"Shape"})))),v=[{value:{type:"expanded",columns:1},icon:()=>c.createElement("svg",{width:"17px",height:"20px",viewBox:"0 0 17 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"layout-modern"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"widgets/layout-modern",transform:"translate(-2.000000, -3.000000)",fill:"#000000"},c.createElement("path",{d:"M2,10 L5,10 L5,7 L2,7 L2,10 Z M2,14 L5,14 L5,11 L2,11 L2,14 Z M2,6 L5,6 L5,3 L2,3 L2,6 Z M6,3 L6,17 L19,17 L19,3 L6,3 Z M8,5 L8,15 L17,15 L17,5 L8,5 Z M6,18 L6,23 L19,23 L19,18 L6,18 Z M8,20 L8,23 L17,23 L17,20 L8,20 Z",id:"shape"})))),label:(0,i.__)("Expanded - 1 Column","cloudinary")},{value:{type:"expanded",columns:2},icon:()=>c.createElement("svg",{width:"18px",height:"17px",viewBox:"0 0 18 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"layout-grid-2-column"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"widgets/layout-gird-2-col",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},c.createElement("path",{d:"M11,12 L11,20 L3,20 L3,12 L11,12 Z M21,12 L21,20 L13,20 L13,12 L21,12 Z M9,14 L5,14 L5,18 L9,18 L9,14 Z M19,14 L15,14 L15,18 L19,18 L19,14 Z M11,3 L11,11 L3,11 L3,3 L11,3 Z M21,3 L21,11 L13,11 L13,3 L21,3 Z M9,5 L5,5 L5,9 L9,9 L9,5 Z M19,5 L15,5 L15,9 L19,9 L19,5 Z",id:"Shape"})))),label:(0,i.__)("Expanded - 2 Column","cloudinary")},{value:{type:"expanded",columns:3},icon:()=>c.createElement("svg",{width:"20px",height:"13px",viewBox:"0 0 20 13",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"layout-grid-3-column"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"widgets/layout-gird-3-col",transform:"translate(-2.000000, -5.000000)",fill:"#000000"},c.createElement("path",{d:"M8,12 L8,18 L2,18 L2,12 L8,12 Z M15,12 L15,18 L9,18 L9,12 L15,12 Z M22,12 L22,18 L16,18 L16,12 L22,12 Z M6,14 L4,14 L4,16 L6,16 L6,14 Z M13,14 L11,14 L11,16 L13,16 L13,14 Z M20,14 L18,14 L18,16 L20,16 L20,14 Z M8,5 L8,11 L2,11 L2,5 L8,5 Z M15,5 L15,11 L9,11 L9,5 L15,5 Z M22,5 L22,11 L16,11 L16,5 L22,5 Z M6,7 L4,7 L4,9 L6,9 L6,7 Z M13,7 L11,7 L11,9 L13,9 L13,7 Z M20,7 L18,7 L18,9 L20,9 L20,7 Z",id:"Combined-Shape"})))),label:(0,i.__)("Expanded - 3 Column","cloudinary")},{value:{type:"classic",columns:1},icon:()=>c.createElement("svg",{width:"17px",height:"14px",viewBox:"0 0 17 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"layout-classic"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"widgets/layout-classic",transform:"translate(-3.000000, -5.000000)",fill:"#000000"},c.createElement("path",{d:"M3,12 L6,12 L6,9 L3,9 L3,12 Z M3,16 L6,16 L6,13 L3,13 L3,16 Z M3,8 L6,8 L6,5 L3,5 L3,8 Z M7,5 L7,19 L20,19 L20,5 L7,5 Z M9,7 L9,17 L18,17 L18,7 L9,7 Z",id:"shape"})))),label:(0,i.__)("Classic","cloudinary")}],m=[{label:(0,i.__)("1:1","cloudinary"),value:"1:1"},{label:(0,i.__)("3:4","cloudinary"),value:"3:4"},{label:(0,i.__)("4:3","cloudinary"),value:"4:3"},{label:(0,i.__)("4:6","cloudinary"),value:"4:6"},{label:(0,i.__)("6:4","cloudinary"),value:"6:4"},{label:(0,i.__)("5:7","cloudinary"),value:"5:7"},{label:(0,i.__)("7:5","cloudinary"),value:"7:5"},{label:(0,i.__)("8:5","cloudinary"),value:"8:5"},{label:(0,i.__)("5:8","cloudinary"),value:"5:8"},{label:(0,i.__)("9:16","cloudinary"),value:"9:16"},{label:(0,i.__)("16:9","cloudinary"),value:"16:9"}],h=[{label:(0,i.__)("None","cloudinary"),value:"none"},{label:(0,i.__)("Fade","cloudinary"),value:"fade"},{label:(0,i.__)("Slide","cloudinary"),value:"slide"}],y=[{label:(0,i.__)("Always","cloudinary"),value:"always"},{label:(0,i.__)("None","cloudinary"),value:"none"},{label:(0,i.__)("MouseOver","cloudinary"),value:"mouseover"}],b=[{label:(0,i.__)("Inline","cloudinary"),value:"inline"},{label:(0,i.__)("Flyout","cloudinary"),value:"flyout"},{label:(0,i.__)("Popup","cloudinary"),value:"popup"}],g=[{label:(0,i.__)("Top","cloudinary"),value:"top"},{label:(0,i.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,i.__)("Left","cloudinary"),value:"left"},{label:(0,i.__)("Right","cloudinary"),value:"right"}],_=[{label:(0,i.__)("Click","cloudinary"),value:"click"},{label:(0,i.__)("Hover","cloudinary"),value:"hover"}],x=[{label:(0,i.__)("Left","cloudinary"),value:"left"},{label:(0,i.__)("Right","cloudinary"),value:"right"},{label:(0,i.__)("Top","cloudinary"),value:"top"},{label:(0,i.__)("Bottom","cloudinary"),value:"bottom"}],w=[{label:(0,i.__)("Thumbnails","cloudinary"),value:"thumbnails"},{label:(0,i.__)("Indicators","cloudinary"),value:"indicators"},{label:(0,i.__)("None","cloudinary"),value:"none"}],L=[{value:"round",icon:u,label:(0,i.__)("Round","cloudinary")},{value:"radius",icon:d,label:(0,i.__)("Radius","cloudinary")},{value:"none",icon:f,label:(0,i.__)("None","cloudinary")},{value:"square",icon:p,label:(0,i.__)("Square","cloudinary")},{value:"rectangle",icon:()=>c.createElement("svg",{width:"14px",height:"20px",viewBox:"0 0 14 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"ratio-9-16"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"ratio/9-16",transform:"translate(-5.000000, -2.000000)",fill:"#000000"},c.createElement("path",{d:"M22,5.5 L22,18.5 L2,18.5 L2,5.5 L22,5.5 Z M20,7.5 L4,7.5 L4,16.5 L20,16.5 L20,7.5 Z",id:"Combined-Shape",transform:"translate(12.000000, 12.000000) rotate(-90.000000) translate(-12.000000, -12.000000) "})))),label:(0,i.__)("Rectangle","cloudinary")}],E=[{value:"round",icon:u,label:(0,i.__)("Round","cloudinary")},{value:"radius",icon:d,label:(0,i.__)("Radius","cloudinary")},{value:"square",icon:p,label:(0,i.__)("Square","cloudinary")}],O=[{label:(0,i.__)("All","cloudinary"),value:"all"},{label:(0,i.__)("Border","cloudinary"),value:"border"},{label:(0,i.__)("Gradient","cloudinary"),value:"gradient"}],j=[{label:(0,i.__)("All","cloudinary"),value:"all"},{label:(0,i.__)("Top","cloudinary"),value:"top"},{label:(0,i.__)("Top-Bottom","cloudinary"),value:"top-bottom"},{label:(0,i.__)("Left-Right","cloudinary"),value:"left-right"},{label:(0,i.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,i.__)("Left","cloudinary"),value:"left"},{label:(0,i.__)("Right","cloudinary"),value:"right"}],k=[{value:"round",icon:u,label:(0,i.__)("Round","cloudinary")},{value:"radius",icon:d,label:(0,i.__)("Radius","cloudinary")},{value:"none",icon:f,label:(0,i.__)("None","cloudinary")},{value:"square",icon:p,label:(0,i.__)("Square","cloudinary")}],A=[{label:(0,i.__)("Pad","cloudinary"),value:"pad"},{label:(0,i.__)("Fill","cloudinary"),value:"fill"}],P=[{label:(0,i.__)("White padding","cloudinary"),value:"rgb:FFFFFF"},{label:(0,i.__)("Border color padding","cloudinary"),value:"auto"},{label:(0,i.__)("Predominant color padding","cloudinary"),value:"auto:predominant"},{label:(0,i.__)("Gradient fade padding","cloudinary"),value:"auto:predominant_gradient"}];var S=r(6942),C=r.n(S),M=r(6087);const B=({value:e,children:t,icon:r,onChange:n,current:o})=>{const a="object"==typeof e?JSON.stringify(e)===JSON.stringify(o):o===e;return M.createElement("button",{type:"button",onClick:()=>n(e),className:C()("radio-select",{"radio-select--active":a})},M.createElement(r,null),M.createElement("div",{className:"radio-select__label"},t))};r.dn(B);window.wp.data;const T=e=>{const t=/var\((.*)\)/g.exec(e);return t?getComputedStyle(document.documentElement).getPropertyValue(t[1]):e};function D(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function N(e){return e instanceof D(e).Element||e instanceof Element}function R(e){return e instanceof D(e).HTMLElement||e instanceof HTMLElement}function Z(e){return"undefined"!=typeof ShadowRoot&&(e instanceof D(e).ShadowRoot||e instanceof ShadowRoot)}var z=Math.max,F=Math.min,W=Math.round;function H(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function I(){return!/^((?!chrome|android).)*safari/i.test(H())}function V(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.getBoundingClientRect(),o=1,a=1;t&&R(e)&&(o=e.offsetWidth>0&&W(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&W(n.height)/e.offsetHeight||1);var i=(N(e)?D(e):window).visualViewport,s=!I()&&r,l=(n.left+(s&&i?i.offsetLeft:0))/o,c=(n.top+(s&&i?i.offsetTop:0))/a,u=n.width/o,p=n.height/a;return{width:u,height:p,top:c,right:l+u,bottom:c+p,left:l,x:l,y:c}}function U(e){var t=D(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function q(e){return e?(e.nodeName||"").toLowerCase():null}function $(e){return((N(e)?e.ownerDocument:e.document)||window.document).documentElement}function G(e){return V($(e)).left+U(e).scrollLeft}function X(e){return D(e).getComputedStyle(e)}function J(e){var t=X(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function Y(e,t,r){void 0===r&&(r=!1);var n,o,a=R(t),i=R(t)&&function(e){var t=e.getBoundingClientRect(),r=W(t.width)/e.offsetWidth||1,n=W(t.height)/e.offsetHeight||1;return 1!==r||1!==n}(t),s=$(t),l=V(e,i,r),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(a||!a&&!r)&&(("body"!==q(t)||J(s))&&(c=(n=t)!==D(n)&&R(n)?{scrollLeft:(o=n).scrollLeft,scrollTop:o.scrollTop}:U(n)),R(t)?((u=V(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=G(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function K(e){var t=V(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function Q(e){return"html"===q(e)?e:e.assignedSlot||e.parentNode||(Z(e)?e.host:null)||$(e)}function ee(e){return["html","body","#document"].indexOf(q(e))>=0?e.ownerDocument.body:R(e)&&J(e)?e:ee(Q(e))}function te(e,t){var r;void 0===t&&(t=[]);var n=ee(e),o=n===(null==(r=e.ownerDocument)?void 0:r.body),a=D(n),i=o?[a].concat(a.visualViewport||[],J(n)?n:[]):n,s=t.concat(i);return o?s:s.concat(te(Q(i)))}function re(e){return["table","td","th"].indexOf(q(e))>=0}function ne(e){return R(e)&&"fixed"!==X(e).position?e.offsetParent:null}function oe(e){for(var t=D(e),r=ne(e);r&&re(r)&&"static"===X(r).position;)r=ne(r);return r&&("html"===q(r)||"body"===q(r)&&"static"===X(r).position)?t:r||function(e){var t=/firefox/i.test(H());if(/Trident/i.test(H())&&R(e)&&"fixed"===X(e).position)return null;var r=Q(e);for(Z(r)&&(r=r.host);R(r)&&["html","body"].indexOf(q(r))<0;){var n=X(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(e)||t}var ae="top",ie="bottom",se="right",le="left",ce="auto",ue=[ae,ie,se,le],pe="start",de="end",fe="viewport",ve="popper",me=ue.reduce(function(e,t){return e.concat([t+"-"+pe,t+"-"+de])},[]),he=[].concat(ue,[ce]).reduce(function(e,t){return e.concat([t,t+"-"+pe,t+"-"+de])},[]),ye=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function be(e){var t=new Map,r=new Set,n=[];function o(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!r.has(e)){var n=t.get(e);n&&o(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){r.has(e.name)||o(e)}),n}var ge={placement:"bottom",modifiers:[],strategy:"absolute"};function _e(){for(var e=arguments.length,t=new Array(e),r=0;r=0?"x":"y"}function je(e){var t,r=e.reference,n=e.element,o=e.placement,a=o?Le(o):null,i=o?Ee(o):null,s=r.x+r.width/2-n.width/2,l=r.y+r.height/2-n.height/2;switch(a){case ae:t={x:s,y:r.y-n.height};break;case ie:t={x:s,y:r.y+r.height};break;case se:t={x:r.x+r.width,y:l};break;case le:t={x:r.x-n.width,y:l};break;default:t={x:r.x,y:r.y}}var c=a?Oe(a):null;if(null!=c){var u="y"===c?"height":"width";switch(i){case pe:t[c]=t[c]-(r[u]/2-n[u]/2);break;case de:t[c]=t[c]+(r[u]/2-n[u]/2)}}return t}var ke={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ae(e){var t,r=e.popper,n=e.popperRect,o=e.placement,a=e.variation,i=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,p=e.isFixed,d=i.x,f=void 0===d?0:d,v=i.y,m=void 0===v?0:v,h="function"==typeof u?u({x:f,y:m}):{x:f,y:m};f=h.x,m=h.y;var y=i.hasOwnProperty("x"),b=i.hasOwnProperty("y"),g=le,_=ae,x=window;if(c){var w=oe(r),L="clientHeight",E="clientWidth";if(w===D(r)&&"static"!==X(w=$(r)).position&&"absolute"===s&&(L="scrollHeight",E="scrollWidth"),o===ae||(o===le||o===se)&&a===de)_=ie,m-=(p&&w===x&&x.visualViewport?x.visualViewport.height:w[L])-n.height,m*=l?1:-1;if(o===le||(o===ae||o===ie)&&a===de)g=se,f-=(p&&w===x&&x.visualViewport?x.visualViewport.width:w[E])-n.width,f*=l?1:-1}var O,j=Object.assign({position:s},c&&ke),k=!0===u?function(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:W(r*o)/o||0,y:W(n*o)/o||0}}({x:f,y:m},D(r)):{x:f,y:m};return f=k.x,m=k.y,l?Object.assign({},j,((O={})[_]=b?"0":"",O[g]=y?"0":"",O.transform=(x.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",O)):Object.assign({},j,((t={})[_]=b?m+"px":"",t[g]=y?f+"px":"",t.transform="",t))}const Pe={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var r=t.styles[e]||{},n=t.attributes[e]||{},o=t.elements[e];R(o)&&q(o)&&(Object.assign(o.style,r),Object.keys(n).forEach(function(e){var t=n[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],o=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce(function(e,t){return e[t]="",e},{});R(n)&&q(n)&&(Object.assign(n.style,a),Object.keys(o).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};const Se={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.offset,a=void 0===o?[0,0]:o,i=he.reduce(function(e,r){return e[r]=function(e,t,r){var n=Le(e),o=[le,ae].indexOf(n)>=0?-1:1,a="function"==typeof r?r(Object.assign({},t,{placement:e})):r,i=a[0],s=a[1];return i=i||0,s=(s||0)*o,[le,se].indexOf(n)>=0?{x:s,y:i}:{x:i,y:s}}(r,t.rects,a),e},{}),s=i[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=i}};var Ce={left:"right",right:"left",bottom:"top",top:"bottom"};function Me(e){return e.replace(/left|right|bottom|top/g,function(e){return Ce[e]})}var Be={start:"end",end:"start"};function Te(e){return e.replace(/start|end/g,function(e){return Be[e]})}function De(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Z(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ne(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Re(e,t,r){return t===fe?Ne(function(e,t){var r=D(e),n=$(e),o=r.visualViewport,a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;var c=I();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s+G(e),y:l}}(e,r)):N(t)?function(e,t){var r=V(e,!1,"fixed"===t);return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}(t,r):Ne(function(e){var t,r=$(e),n=U(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=z(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=z(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+G(e),l=-n.scrollTop;return"rtl"===X(o||r).direction&&(s+=z(r.clientWidth,o?o.clientWidth:0)-a),{width:a,height:i,x:s,y:l}}($(e)))}function Ze(e,t,r,n){var o="clippingParents"===t?function(e){var t=te(Q(e)),r=["absolute","fixed"].indexOf(X(e).position)>=0&&R(e)?oe(e):e;return N(r)?t.filter(function(e){return N(e)&&De(e,r)&&"body"!==q(e)}):[]}(e):[].concat(t),a=[].concat(o,[r]),i=a[0],s=a.reduce(function(t,r){var o=Re(e,r,n);return t.top=z(o.top,t.top),t.right=F(o.right,t.right),t.bottom=F(o.bottom,t.bottom),t.left=z(o.left,t.left),t},Re(e,i,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function ze(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Fe(e,t){return t.reduce(function(t,r){return t[r]=e,t},{})}function We(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=void 0===n?e.placement:n,a=r.strategy,i=void 0===a?e.strategy:a,s=r.boundary,l=void 0===s?"clippingParents":s,c=r.rootBoundary,u=void 0===c?fe:c,p=r.elementContext,d=void 0===p?ve:p,f=r.altBoundary,v=void 0!==f&&f,m=r.padding,h=void 0===m?0:m,y=ze("number"!=typeof h?h:Fe(h,ue)),b=d===ve?"reference":ve,g=e.rects.popper,_=e.elements[v?b:d],x=Ze(N(_)?_:_.contextElement||$(e.elements.popper),l,u,i),w=V(e.elements.reference),L=je({reference:w,element:g,strategy:"absolute",placement:o}),E=Ne(Object.assign({},g,L)),O=d===ve?E:w,j={top:x.top-O.top+y.top,bottom:O.bottom-x.bottom+y.bottom,left:x.left-O.left+y.left,right:O.right-x.right+y.right},k=e.modifiersData.offset;if(d===ve&&k){var A=k[o];Object.keys(j).forEach(function(e){var t=[se,ie].indexOf(e)>=0?1:-1,r=[ae,ie].indexOf(e)>=0?"y":"x";j[e]+=A[r]*t})}return j}function He(e,t,r){return z(e,F(t,r))}const Ie={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0!==i&&i,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,p=r.padding,d=r.tether,f=void 0===d||d,v=r.tetherOffset,m=void 0===v?0:v,h=We(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:u}),y=Le(t.placement),b=Ee(t.placement),g=!b,_=Oe(y),x="x"===_?"y":"x",w=t.modifiersData.popperOffsets,L=t.rects.reference,E=t.rects.popper,O="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,j="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),k=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,A={x:0,y:0};if(w){if(a){var P,S="y"===_?ae:le,C="y"===_?ie:se,M="y"===_?"height":"width",B=w[_],T=B+h[S],D=B-h[C],N=f?-E[M]/2:0,R=b===pe?L[M]:E[M],Z=b===pe?-E[M]:-L[M],W=t.elements.arrow,H=f&&W?K(W):{width:0,height:0},I=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=I[S],U=I[C],q=He(0,L[M],H[M]),$=g?L[M]/2-N-q-V-j.mainAxis:R-q-V-j.mainAxis,G=g?-L[M]/2+N+q+U+j.mainAxis:Z+q+U+j.mainAxis,X=t.elements.arrow&&oe(t.elements.arrow),J=X?"y"===_?X.clientTop||0:X.clientLeft||0:0,Y=null!=(P=null==k?void 0:k[_])?P:0,Q=B+G-Y,ee=He(f?F(T,B+$-Y-J):T,B,f?z(D,Q):D);w[_]=ee,A[_]=ee-B}if(s){var te,re="x"===_?ae:le,ne="x"===_?ie:se,ce=w[x],ue="y"===x?"height":"width",de=ce+h[re],fe=ce-h[ne],ve=-1!==[ae,le].indexOf(y),me=null!=(te=null==k?void 0:k[x])?te:0,he=ve?de:ce-L[ue]-E[ue]-me+j.altAxis,ye=ve?ce+L[ue]+E[ue]-me-j.altAxis:fe,be=f&&ve?function(e,t,r){var n=He(e,t,r);return n>r?r:n}(he,ce,ye):He(f?he:de,ce,f?ye:fe);w[x]=be,A[x]=be-ce}t.modifiersData[n]=A}},requiresIfExists:["offset"]};const Ve={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state,n=e.name,o=e.options,a=r.elements.arrow,i=r.modifiersData.popperOffsets,s=Le(r.placement),l=Oe(s),c=[le,se].indexOf(s)>=0?"height":"width";if(a&&i){var u=function(e,t){return ze("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Fe(e,ue))}(o.padding,r),p=K(a),d="y"===l?ae:le,f="y"===l?ie:se,v=r.rects.reference[c]+r.rects.reference[l]-i[l]-r.rects.popper[c],m=i[l]-r.rects.reference[l],h=oe(a),y=h?"y"===l?h.clientHeight||0:h.clientWidth||0:0,b=v/2-m/2,g=u[d],_=y-p[c]-u[f],x=y/2-p[c]/2+b,w=He(g,x,_),L=l;r.modifiersData[n]=((t={})[L]=w,t.centerOffset=w-x,t)}},effect:function(e){var t=e.state,r=e.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&De(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ue(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function qe(e){return[ae,se,ie,le].some(function(t){return e[t]>=0})}var $e=xe({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,a=void 0===o||o,i=n.resize,s=void 0===i||i,l=D(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach(function(e){e.addEventListener("scroll",r.update,we)}),s&&l.addEventListener("resize",r.update,we),function(){a&&c.forEach(function(e){e.removeEventListener("scroll",r.update,we)}),s&&l.removeEventListener("resize",r.update,we)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,r=e.name;t.modifiersData[r]=je({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=void 0===n||n,a=r.adaptive,i=void 0===a||a,s=r.roundOffsets,l=void 0===s||s,c={placement:Le(t.placement),variation:Ee(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Ae(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ae(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Pe,Se,{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0===i||i,l=r.fallbackPlacements,c=r.padding,u=r.boundary,p=r.rootBoundary,d=r.altBoundary,f=r.flipVariations,v=void 0===f||f,m=r.allowedAutoPlacements,h=t.options.placement,y=Le(h),b=l||(y===h||!v?[Me(h)]:function(e){if(Le(e)===ce)return[];var t=Me(e);return[Te(e),t,Te(t)]}(h)),g=[h].concat(b).reduce(function(e,r){return e.concat(Le(r)===ce?function(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=r.boundary,a=r.rootBoundary,i=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,c=void 0===l?he:l,u=Ee(n),p=u?s?me:me.filter(function(e){return Ee(e)===u}):ue,d=p.filter(function(e){return c.indexOf(e)>=0});0===d.length&&(d=p);var f=d.reduce(function(t,r){return t[r]=We(e,{placement:r,boundary:o,rootBoundary:a,padding:i})[Le(r)],t},{});return Object.keys(f).sort(function(e,t){return f[e]-f[t]})}(t,{placement:r,boundary:u,rootBoundary:p,padding:c,flipVariations:v,allowedAutoPlacements:m}):r)},[]),_=t.rects.reference,x=t.rects.popper,w=new Map,L=!0,E=g[0],O=0;O=0,S=P?"width":"height",C=We(t,{placement:j,boundary:u,rootBoundary:p,altBoundary:d,padding:c}),M=P?A?se:le:A?ie:ae;_[S]>x[S]&&(M=Me(M));var B=Me(M),T=[];if(a&&T.push(C[k]<=0),s&&T.push(C[M]<=0,C[B]<=0),T.every(function(e){return e})){E=j,L=!1;break}w.set(j,T)}if(L)for(var D=function(e){var t=g.find(function(t){var r=w.get(t);if(r)return r.slice(0,e).every(function(e){return e})});if(t)return E=t,"break"},N=v?3:1;N>0;N--){if("break"===D(N))break}t.placement!==E&&(t.modifiersData[n]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Ie,Ve,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,a=t.modifiersData.preventOverflow,i=We(t,{elementContext:"reference"}),s=We(t,{altBoundary:!0}),l=Ue(i,n),c=Ue(s,o,a),u=qe(l),p=qe(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}}]}),Ge="tippy-content",Xe="tippy-backdrop",Je="tippy-arrow",Ye="tippy-svg-arrow",Ke={passive:!0,capture:!0},Qe=function(){return document.body};function et(e,t,r){if(Array.isArray(e)){var n=e[t];return n??(Array.isArray(r)?r[t]:r)}return e}function tt(e,t){var r={}.toString.call(e);return 0===r.indexOf("[object")&&r.indexOf(t+"]")>-1}function rt(e,t){return"function"==typeof e?e.apply(void 0,t):e}function nt(e,t){return 0===t?e:function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)};var r}function ot(e){return[].concat(e)}function at(e,t){-1===e.indexOf(t)&&e.push(t)}function it(e){return e.split("-")[0]}function st(e){return[].slice.call(e)}function lt(e){return Object.keys(e).reduce(function(t,r){return void 0!==e[r]&&(t[r]=e[r]),t},{})}function ct(){return document.createElement("div")}function ut(e){return["Element","Fragment"].some(function(t){return tt(e,t)})}function pt(e){return tt(e,"MouseEvent")}function dt(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function ft(e){return ut(e)?[e]:function(e){return tt(e,"NodeList")}(e)?st(e):Array.isArray(e)?e:st(document.querySelectorAll(e))}function vt(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function mt(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function ht(e){var t,r=ot(e)[0];return null!=r&&null!=(t=r.ownerDocument)&&t.body?r.ownerDocument:document}function yt(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[n](t,r)})}function bt(e,t){for(var r=t;r;){var n;if(e.contains(r))return!0;r=null==r.getRootNode||null==(n=r.getRootNode())?void 0:n.host}return!1}var gt={isTouch:!1},_t=0;function xt(){gt.isTouch||(gt.isTouch=!0,window.performance&&document.addEventListener("mousemove",wt))}function wt(){var e=performance.now();e-_t<20&&(gt.isTouch=!1,document.removeEventListener("mousemove",wt)),_t=e}function Lt(){var e=document.activeElement;if(dt(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Et=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Ot={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},jt=Object.assign({appendTo:Qe,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Ot,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),kt=Object.keys(jt);function At(e){var t=(e.plugins||[]).reduce(function(t,r){var n,o=r.name,a=r.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(n=jt[o])?n:a);return t},{});return Object.assign({},e,t)}function Pt(e,t){var r=Object.assign({},t,{content:rt(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(At(Object.assign({},jt,{plugins:t}))):kt).reduce(function(t,r){var n=(e.getAttribute("data-tippy-"+r)||"").trim();if(!n)return t;if("content"===r)t[r]=n;else try{t[r]=JSON.parse(n)}catch(e){t[r]=n}return t},{})}(e,t.plugins));return r.aria=Object.assign({},jt.aria,r.aria),r.aria={expanded:"auto"===r.aria.expanded?t.interactive:r.aria.expanded,content:"auto"===r.aria.content?t.interactive?null:"describedby":r.aria.content},r}function St(e,t){e.innerHTML=t}function Ct(e){var t=ct();return!0===e?t.className=Je:(t.className=Ye,ut(e)?t.appendChild(e):St(t,e)),t}function Mt(e,t){ut(t.content)?(St(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?St(e,t.content):e.textContent=t.content)}function Bt(e){var t=e.firstElementChild,r=st(t.children);return{box:t,content:r.find(function(e){return e.classList.contains(Ge)}),arrow:r.find(function(e){return e.classList.contains(Je)||e.classList.contains(Ye)}),backdrop:r.find(function(e){return e.classList.contains(Xe)})}}function Tt(e){var t=ct(),r=ct();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=ct();function o(r,n){var o=Bt(t),a=o.box,i=o.content,s=o.arrow;n.theme?a.setAttribute("data-theme",n.theme):a.removeAttribute("data-theme"),"string"==typeof n.animation?a.setAttribute("data-animation",n.animation):a.removeAttribute("data-animation"),n.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?a.setAttribute("role",n.role):a.removeAttribute("role"),r.content===n.content&&r.allowHTML===n.allowHTML||Mt(i,e.props),n.arrow?s?r.arrow!==n.arrow&&(a.removeChild(s),a.appendChild(Ct(n.arrow))):a.appendChild(Ct(n.arrow)):s&&a.removeChild(s)}return n.className=Ge,n.setAttribute("data-state","hidden"),Mt(n,e.props),t.appendChild(r),r.appendChild(n),o(e.props,e.props),{popper:t,onUpdate:o}}Tt.$$tippy=!0;var Dt=1,Nt=[],Rt=[];function Zt(e,t){var r,n,o,a,i,s,l,c,u=Pt(e,Object.assign({},jt,At(lt(t)))),p=!1,d=!1,f=!1,v=!1,m=[],h=nt($,u.interactiveDebounce),y=Dt++,b=(c=u.plugins).filter(function(e,t){return c.indexOf(e)===t}),g={id:y,reference:e,popper:ct(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(n),cancelAnimationFrame(o)},setProps:function(t){0;if(g.state.isDestroyed)return;B("onBeforeUpdate",[g,t]),U();var r=g.props,n=Pt(e,Object.assign({},r,lt(t),{ignoreAttributes:!0}));g.props=n,V(),r.interactiveDebounce!==n.interactiveDebounce&&(N(),h=nt($,n.interactiveDebounce));r.triggerTarget&&!n.triggerTarget?ot(r.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):n.triggerTarget&&e.removeAttribute("aria-expanded");D(),M(),w&&w(r,n);g.popperInstance&&(Y(),Q().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}));B("onAfterUpdate",[g,t])},setContent:function(e){g.setProps({content:e})},show:function(){0;var e=g.state.isVisible,t=g.state.isDestroyed,r=!g.state.isEnabled,n=gt.isTouch&&!g.props.touch,o=et(g.props.duration,0,jt.duration);if(e||t||r||n)return;if(A().hasAttribute("disabled"))return;if(B("onShow",[g],!1),!1===g.props.onShow(g))return;g.state.isVisible=!0,k()&&(x.style.visibility="visible");M(),F(),g.state.isMounted||(x.style.transition="none");if(k()){var a=S();vt([a.box,a.content],0)}s=function(){var e;if(g.state.isVisible&&!v){if(v=!0,x.offsetHeight,x.style.transition=g.props.moveTransition,k()&&g.props.animation){var t=S(),r=t.box,n=t.content;vt([r,n],o),mt([r,n],"visible")}T(),D(),at(Rt,g),null==(e=g.popperInstance)||e.forceUpdate(),B("onMount",[g]),g.props.animation&&k()&&function(e,t){H(e,t)}(o,function(){g.state.isShown=!0,B("onShown",[g])})}},function(){var e,t=g.props.appendTo,r=A();e=g.props.interactive&&t===Qe||"parent"===t?r.parentNode:rt(t,[r]);e.contains(x)||e.appendChild(x);g.state.isMounted=!0,Y(),!1}()},hide:function(){0;var e=!g.state.isVisible,t=g.state.isDestroyed,r=!g.state.isEnabled,n=et(g.props.duration,1,jt.duration);if(e||t||r)return;if(B("onHide",[g],!1),!1===g.props.onHide(g))return;g.state.isVisible=!1,g.state.isShown=!1,v=!1,p=!1,k()&&(x.style.visibility="hidden");if(N(),W(),M(!0),k()){var o=S(),a=o.box,i=o.content;g.props.animation&&(vt([a,i],n),mt([a,i],"hidden"))}T(),D(),g.props.animation?k()&&function(e,t){H(e,function(){!g.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()})}(n,g.unmount):g.unmount()},hideWithInteractivity:function(e){0;P().addEventListener("mousemove",h),at(Nt,h),h(e)},enable:function(){g.state.isEnabled=!0},disable:function(){g.hide(),g.state.isEnabled=!1},unmount:function(){0;g.state.isVisible&&g.hide();if(!g.state.isMounted)return;K(),Q().forEach(function(e){e._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x);Rt=Rt.filter(function(e){return e!==g}),g.state.isMounted=!1,B("onHidden",[g])},destroy:function(){0;if(g.state.isDestroyed)return;g.clearDelayTimeouts(),g.unmount(),U(),delete e._tippy,g.state.isDestroyed=!0,B("onDestroy",[g])}};if(!u.render)return g;var _=u.render(g),x=_.popper,w=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+g.id,g.popper=x,e._tippy=g,x._tippy=g;var L=b.map(function(e){return e.fn(g)}),E=e.hasAttribute("aria-expanded");return V(),D(),M(),B("onCreate",[g]),u.showOnCreate&&ee(),x.addEventListener("mouseenter",function(){g.props.interactive&&g.state.isVisible&&g.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){g.props.interactive&&g.props.trigger.indexOf("mouseenter")>=0&&P().addEventListener("mousemove",h)}),g;function O(){var e=g.props.touch;return Array.isArray(e)?e:[e,0]}function j(){return"hold"===O()[0]}function k(){var e;return!(null==(e=g.props.render)||!e.$$tippy)}function A(){return l||e}function P(){var e=A().parentNode;return e?ht(e):document}function S(){return Bt(x)}function C(e){return g.state.isMounted&&!g.state.isVisible||gt.isTouch||a&&"focus"===a.type?0:et(g.props.delay,e?0:1,jt.delay)}function M(e){void 0===e&&(e=!1),x.style.pointerEvents=g.props.interactive&&!e?"":"none",x.style.zIndex=""+g.props.zIndex}function B(e,t,r){var n;(void 0===r&&(r=!0),L.forEach(function(r){r[e]&&r[e].apply(r,t)}),r)&&(n=g.props)[e].apply(n,t)}function T(){var t=g.props.aria;if(t.content){var r="aria-"+t.content,n=x.id;ot(g.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(r);if(g.state.isVisible)e.setAttribute(r,t?t+" "+n:n);else{var o=t&&t.replace(n,"").trim();o?e.setAttribute(r,o):e.removeAttribute(r)}})}}function D(){!E&&g.props.aria.expanded&&ot(g.props.triggerTarget||e).forEach(function(e){g.props.interactive?e.setAttribute("aria-expanded",g.state.isVisible&&e===A()?"true":"false"):e.removeAttribute("aria-expanded")})}function N(){P().removeEventListener("mousemove",h),Nt=Nt.filter(function(e){return e!==h})}function R(t){if(!gt.isTouch||!f&&"mousedown"!==t.type){var r=t.composedPath&&t.composedPath()[0]||t.target;if(!g.props.interactive||!bt(x,r)){if(ot(g.props.triggerTarget||e).some(function(e){return bt(e,r)})){if(gt.isTouch)return;if(g.state.isVisible&&g.props.trigger.indexOf("click")>=0)return}else B("onClickOutside",[g,t]);!0===g.props.hideOnClick&&(g.clearDelayTimeouts(),g.hide(),d=!0,setTimeout(function(){d=!1}),g.state.isMounted||W())}}}function Z(){f=!0}function z(){f=!1}function F(){var e=P();e.addEventListener("mousedown",R,!0),e.addEventListener("touchend",R,Ke),e.addEventListener("touchstart",z,Ke),e.addEventListener("touchmove",Z,Ke)}function W(){var e=P();e.removeEventListener("mousedown",R,!0),e.removeEventListener("touchend",R,Ke),e.removeEventListener("touchstart",z,Ke),e.removeEventListener("touchmove",Z,Ke)}function H(e,t){var r=S().box;function n(e){e.target===r&&(yt(r,"remove",n),t())}if(0===e)return t();yt(r,"remove",i),yt(r,"add",n),i=n}function I(t,r,n){void 0===n&&(n=!1),ot(g.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,r,n),m.push({node:e,eventType:t,handler:r,options:n})})}function V(){var e;j()&&(I("touchstart",q,{passive:!0}),I("touchend",G,{passive:!0})),(e=g.props.trigger,e.split(/\s+/).filter(Boolean)).forEach(function(e){if("manual"!==e)switch(I(e,q),e){case"mouseenter":I("mouseleave",G);break;case"focus":I(Et?"focusout":"blur",X);break;case"focusin":I("focusout",X)}})}function U(){m.forEach(function(e){var t=e.node,r=e.eventType,n=e.handler,o=e.options;t.removeEventListener(r,n,o)}),m=[]}function q(e){var t,r=!1;if(g.state.isEnabled&&!J(e)&&!d){var n="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,D(),!g.state.isVisible&&pt(e)&&Nt.forEach(function(t){return t(e)}),"click"===e.type&&(g.props.trigger.indexOf("mouseenter")<0||p)&&!1!==g.props.hideOnClick&&g.state.isVisible?r=!0:ee(e),"click"===e.type&&(p=!r),r&&!n&&te(e)}}function $(e){var t=e.target,r=A().contains(t)||x.contains(t);if("mousemove"!==e.type||!r){var n=Q().concat(x).map(function(e){var t,r=null==(t=e._tippy.popperInstance)?void 0:t.state;return r?{popperRect:e.getBoundingClientRect(),popperState:r,props:u}:null}).filter(Boolean);(function(e,t){var r=t.clientX,n=t.clientY;return e.every(function(e){var t=e.popperRect,o=e.popperState,a=e.props.interactiveBorder,i=it(o.placement),s=o.modifiersData.offset;if(!s)return!0;var l="bottom"===i?s.top.y:0,c="top"===i?s.bottom.y:0,u="right"===i?s.left.x:0,p="left"===i?s.right.x:0,d=t.top-n+l>a,f=n-t.bottom-c>a,v=t.left-r+u>a,m=r-t.right-p>a;return d||f||v||m})})(n,e)&&(N(),te(e))}}function G(e){J(e)||g.props.trigger.indexOf("click")>=0&&p||(g.props.interactive?g.hideWithInteractivity(e):te(e))}function X(e){g.props.trigger.indexOf("focusin")<0&&e.target!==A()||g.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function J(e){return!!gt.isTouch&&j()!==e.type.indexOf("touch")>=0}function Y(){K();var t=g.props,r=t.popperOptions,n=t.placement,o=t.offset,a=t.getReferenceClientRect,i=t.moveTransition,l=k()?Bt(x).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||A()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(k()){var r=S().box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?r.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?r.setAttribute("data-"+e,""):r.removeAttribute("data-"+e)}),t.attributes.popper={}}}},p=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!i}},u];k()&&l&&p.push({name:"arrow",options:{element:l,padding:3}}),p.push.apply(p,(null==r?void 0:r.modifiers)||[]),g.popperInstance=$e(c,x,Object.assign({},r,{placement:n,onFirstUpdate:s,modifiers:p}))}function K(){g.popperInstance&&(g.popperInstance.destroy(),g.popperInstance=null)}function Q(){return st(x.querySelectorAll("[data-tippy-root]"))}function ee(e){g.clearDelayTimeouts(),e&&B("onTrigger",[g,e]),F();var t=C(!0),n=O(),o=n[0],a=n[1];gt.isTouch&&"hold"===o&&a&&(t=a),t?r=setTimeout(function(){g.show()},t):g.show()}function te(e){if(g.clearDelayTimeouts(),B("onUntrigger",[g,e]),g.state.isVisible){if(!(g.props.trigger.indexOf("mouseenter")>=0&&g.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=C(!1);t?n=setTimeout(function(){g.state.isVisible&&g.hide()},t):o=requestAnimationFrame(function(){g.hide()})}}else W()}}function zt(e,t){void 0===t&&(t={});var r=jt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",xt,Ke),window.addEventListener("blur",Lt);var n=Object.assign({},t,{plugins:r}),o=ft(e).reduce(function(e,t){var r=t&&Zt(t,n);return r&&e.push(r),e},[]);return ut(e)?o[0]:o}zt.defaultProps=jt,zt.setDefaultProps=function(e){Object.keys(e).forEach(function(t){jt[t]=e[t]})},zt.currentInput=gt;Object.assign({},Pe,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}});zt.setDefaultProps({render:Tt});const Ft=zt;var Wt=r(6087);const Ht=({children:e,value:t})=>Wt.createElement("div",{className:"colorpalette-color-label"},Wt.createElement("span",null,e),Wt.createElement("span",{className:"component-color-indicator","aria-label":`Color: ${t}`,style:{background:t}})),It=new(t()())("_"),Vt=({attributes:e,setAttributes:t,colors:r})=>{const o=a()(e),c=It.object(o),[u,p]=(0,n.useState)(c.customSettings);e.transformation_crop||(e.transformation_crop="pad",e.transformation_background="rgb:FFFFFF"),"fill"===e.transformation_crop&&delete e.transformation_background;const d=(e,r)=>{const n={[r]:T(e)};t(n)},f=(e=>{const[t,r]=(0,n.useState)(null),o=(0,n.useCallback)(e=>r(e),[]);return(0,n.useEffect)(()=>{if(!t)return;const r=Ft(t,{content:e});return()=>{r?.destroy()}},[t,e]),o})((0,i.__)("How to resize or crop images to fit the gallery. Pad adds padding around the image using the specified padding style. Fill crops the image from the center so it fills as much of the available space as possible.","cloudinary"));return Wt.createElement(Wt.Fragment,null,Wt.createElement(s.PanelBody,{title:(0,i.__)("Layout","cloudinary")},v.map(r=>Wt.createElement(B,{key:`${r.value.type}-${r.value.columns}-layout`,value:r.value,onChange:e=>{t({displayProps_mode:e.type,displayProps_columns:e.columns||1})},icon:r.icon,current:{type:e.displayProps_mode,columns:e.displayProps_columns||1}},r.label))),Wt.createElement(s.PanelBody,{title:(0,i.__)("Color Palette","cloudinary"),initialOpen:!1},Wt.createElement(Ht,{value:e.themeProps_primary},(0,i.__)("Primary","cloudinary")),Wt.createElement(l.ColorPalette,{value:e.themeProps_primary,colors:r,disableCustomColors:!1,onChange:e=>d(e,"themeProps_primary")}),Wt.createElement(Ht,{value:e.themeProps_onPrimary},(0,i.__)("On Primary","cloudinary")),Wt.createElement(l.ColorPalette,{value:e.themeProps_onPrimary,colors:r,disableCustomColors:!1,onChange:e=>d(e,"themeProps_onPrimary")}),Wt.createElement(Ht,{value:e.themeProps_active},(0,i.__)("Active","cloudinary")),Wt.createElement(l.ColorPalette,{value:e.themeProps_active,colors:r,disableCustomColors:!1,onChange:e=>d(e,"themeProps_active")})),"classic"===e.displayProps_mode&&Wt.createElement(s.PanelBody,{title:(0,i.__)("Fade Transition","cloudinary"),initialOpen:!1},Wt.createElement(s.SelectControl,{value:e.transition,options:h,onChange:e=>t({transition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),Wt.createElement(s.PanelBody,{title:(0,i.__)("Main Viewer Parameters","cloudinary"),initialOpen:!1},Wt.createElement(s.SelectControl,{label:(0,i.__)("Aspect Ratio","cloudinary"),value:e.aspectRatio,options:m,onChange:e=>t({aspectRatio:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Wt.createElement("p",null,Wt.createElement("div",{className:"cld-ui-title"},(0,i.__)("Resize/Crop Mode","cloudinary"),Wt.createElement("span",{className:"dashicons dashicons-info cld-tooltip",ref:f})),Wt.createElement(s.ButtonGroup,null,A.map(r=>Wt.createElement(s.Button,{key:r.value+"-look-and-feel",variant:"secondary",isSecondary:!0,isPressed:r.value===e.transformation_crop,onClick:()=>t({transformation_crop:r.value,transformation_background:null})},r.label)))),"pad"===e.transformation_crop&&Wt.createElement(s.SelectControl,{label:(0,i.__)("Pad style","cloudinary"),value:e.transformation_background,options:P,onChange:e=>{t({transformation_background:e})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Wt.createElement("p",null,(0,i.__)("Navigation","cloudinary")),Wt.createElement("p",null,Wt.createElement(s.ButtonGroup,null,y.map(r=>Wt.createElement(s.Button,{key:r.value+"-navigation",variant:"secondary",isSecondary:!0,isPressed:r.value===e.navigation,onClick:()=>t({navigation:r.value})},r.label)))),Wt.createElement("div",{style:{marginTop:"30px"}},Wt.createElement(s.ToggleControl,{label:(0,i.__)("Show Zoom","cloudinary"),checked:e.zoom,onChange:()=>t({zoom:!e.zoom}),__nextHasNoMarginBottom:!0}),e.zoom&&Wt.createElement(Wt.Fragment,null,Wt.createElement("p",null,(0,i.__)("Zoom Type","cloudinary")),Wt.createElement("p",null,Wt.createElement(s.ButtonGroup,null,b.map(r=>Wt.createElement(s.Button,{key:r.value+"-zoom-type",variant:"secondary",isSecondary:!0,isPressed:r.value===e.zoomProps_type,onClick:()=>t({zoomProps_type:r.value})},r.label)))),"flyout"===e.zoomProps_type&&Wt.createElement(s.SelectControl,{label:(0,i.__)("Zoom Viewer Position","cloudinary"),value:e.zoomProps_viewerPosition,options:g,onChange:e=>t({zoomProps_viewerPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"popup"!==e.zoomProps_type&&Wt.createElement(Wt.Fragment,null,Wt.createElement("p",null,(0,i.__)("Zoom Trigger","cloudinary")),Wt.createElement("p",null,Wt.createElement(s.ButtonGroup,null,_.map(r=>Wt.createElement(s.Button,{key:r.value+"-zoom-trigger",variant:"secondary",isSecondary:!0,isPressed:r.value===e.zoomProps_trigger,onClick:()=>t({zoomProps_trigger:r.value})},r.label)))))))),Wt.createElement(s.PanelBody,{title:(0,i.__)("Carousel Parameters","cloudinary"),initialOpen:!1},Wt.createElement("p",null,(0,i.__)("Carousel Location","cloudinary")),Wt.createElement("p",null,Wt.createElement(s.ButtonGroup,null,x.map(r=>Wt.createElement(s.Button,{key:r.value+"-carousel-location",variant:"secondary",isSecondary:!0,isPressed:r.value===e.carouselLocation,onClick:()=>t({carouselLocation:r.value})},r.label)))),Wt.createElement(s.RangeControl,{label:(0,i.__)("Carousel Offset","cloudinary"),value:e.carouselOffset,onChange:e=>t({carouselOffset:e}),min:0,max:100,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Wt.createElement("p",null,(0,i.__)("Carousel Style","cloudinary")),Wt.createElement("p",null,Wt.createElement(s.ButtonGroup,null,w.map(r=>Wt.createElement(s.Button,{key:r.value+"-carousel-style",variant:"secondary",isSecondary:!0,isPressed:r.value===e.carouselStyle,onClick:()=>t({carouselStyle:r.value})},r.label)))),"thumbnails"===e.carouselStyle&&Wt.createElement(Wt.Fragment,null,Wt.createElement(s.RangeControl,{label:(0,i.__)("Width","cloudinary"),value:e.thumbnailProps_width,onChange:e=>t({thumbnailProps_width:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Wt.createElement(s.RangeControl,{label:(0,i.__)("Height","cloudinary"),value:e.thumbnailProps_height,onChange:e=>t({thumbnailProps_height:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Wt.createElement("p",null,(0,i.__)("Navigation Button Shape","cloudinary")),L.map(r=>Wt.createElement(B,{key:r.value+"-navigation-button-shape",value:r.value,onChange:e=>t({thumbnailProps_navigationShape:e}),icon:r.icon,current:e.thumbnailProps_navigationShape},r.label)),Wt.createElement("p",null,(0,i.__)("Selected Style","cloudinary")),Wt.createElement("p",null,Wt.createElement(s.ButtonGroup,null,O.map(r=>Wt.createElement(s.Button,{key:r.value+"-selected-style",variant:"secondary",isSecondary:!0,isPressed:r.value===e.thumbnailProps_selectedStyle,onClick:()=>t({thumbnailProps_selectedStyle:r.value})},r.label)))),Wt.createElement(s.SelectControl,{label:(0,i.__)("Selected Border Position","cloudinary"),value:e.thumbnailProps_selectedBorderPosition,options:j,onChange:e=>t({thumbnailProps_selectedBorderPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Wt.createElement(s.RangeControl,{label:(0,i.__)("Selected Border Width","cloudinary"),value:e.thumbnailProps_selectedBorderWidth,onChange:e=>t({thumbnailProps_selectedBorderWidth:e}),min:0,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Wt.createElement("p",null,(0,i.__)("Media Shape Icon","cloudinary")),k.map(r=>Wt.createElement(B,{key:r.value+"-media",value:r.value,onChange:e=>t({thumbnailProps_mediaSymbolShape:e}),icon:r.icon,current:e.thumbnailProps_mediaSymbolShape},r.label))),"indicators"===e.carouselStyle&&Wt.createElement(Wt.Fragment,null,Wt.createElement("p",null,(0,i.__)("Indicators Shape","cloudinary")),E.map(r=>Wt.createElement(B,{key:r.value+"-indicator",value:r.value,onChange:e=>t({indicatorProps_shape:e}),icon:r.icon,current:e.indicatorProps_shape},r.label)))),Wt.createElement(s.PanelBody,{title:(0,i.__)("Additional Settings","cloudinary"),initialOpen:!1},Wt.createElement(s.TextareaControl,{label:(0,i.__)("Custom Settings","cloudinary"),help:(0,i.__)("Provide a JSON string of the settings you want to add and/or override.","cloudinary"),value:u,onChange:e=>{let r={};p(e);try{r=JSON.parse(e)}catch(e){}if("object"==typeof r){const e={...c};e.customSettings=r,t({...c,...e})}},__nextHasNoMarginBottom:!0})))};var Ut=r(6087);const{cloudName:qt,mediaAssets:$t,...Gt}=(e=>{const t={};return Object.keys(e).forEach(r=>{t[r]={type:typeof e[r],default:e[r]}}),t})(new(t()())("_").dot(CLD_GALLERY_CONFIG)),Xt={};Object.keys(Gt).forEach(e=>{Xt[e]=Gt[e]?.default});const Jt=e=>({cloudName:"demo",...e,mediaAssets:[{tag:"shoes_product_gallery_demo",mediaType:"image"}],container:".gallery-preview"}),Yt=document.querySelector("#cloudinary-settings-page form");void 0!==Yt&&Yt.addEventListener("submit",function(e){(!e.submitter.name||e.submitter.name&&"cld_submission"!==e.submitter.name)&&e.preventDefault()});const Kt=()=>{const[e,r]=(0,n.useState)(Xt),o=CLD_THEME_COLORS.map(e=>({...e,color:T(e.color)})).filter(e=>0!==e.color.length);return(0,n.useEffect)(()=>{let r,n;const o=(e=>{const r=new(t()())("_"),n=a()(e),{selectedImages:o,...i}=r.object(n,{});return i.mediaAssets=o,"classic"!==i?.displayProps?.mode?delete i.transition:delete i.displayProps.columns,"pad"!==i?.transformation_crop&&delete i.transformation_background,"pad"!==i?.transformation?.crop&&delete i.transformation.background,i?.themeProps?.primary&&(i.themeProps.primary=T(i?.themeProps?.primary)),i?.themeProps?.onPrimary&&(i.themeProps.onPrimary=T(i?.themeProps?.onPrimary)),i?.themeProps?.active&&(i.themeProps.active=T(i?.themeProps?.active)),i})(e),{customSettings:i,...s}=o;try{try{n=JSON.parse(i)}catch{n=i}r=cloudinary.galleryWidget(Jt({...s,...n}))}catch{r=cloudinary.galleryWidget(Jt(s))}r.render();const l=document.getElementById("gallery_settings_input");return l&&(l.value=JSON.stringify(o)),()=>r.destroy()}),Ut.createElement("div",{className:"cld-gallery-settings-container"},Ut.createElement("div",{className:"cld-gallery-settings"},Ut.createElement("div",{className:"interface-interface-skeleton__sidebar cld-gallery-settings__column"},Ut.createElement("div",{className:"interface-complementary-area edit-post-sidebar"},Ut.createElement("div",{className:"components-panel"},Ut.createElement("div",{className:"block-editor-block-inspector"},Ut.createElement(Vt,{attributes:e,setAttributes:t=>{r({...e,...t})},colors:o}))))),Ut.createElement("div",{className:"gallery-preview cld-gallery-settings__column"})))},Qt=document.getElementById("app_gallery_gallery_config");n.createRoot?(0,n.createRoot)(Qt).render(Ut.createElement(Kt,null)):(0,n.render)(Ut.createElement(Kt,null),Qt)})()})(); +(()=>{var e={5580(e,t,r){var n=r(6110)(r(9325),"DataView");e.exports=n},1549(e,t,r){var n=r(2032),o=r(3862),a=r(6721),i=r(2749),s=r(5749);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1}},1175(e,t,r){var n=r(6025);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},3040(e,t,r){var n=r(1549),o=r(79),a=r(8223);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||o),string:new n}}},7670(e,t,r){var n=r(2651);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},289(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).get(e)}},4509(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).has(e)}},2949(e,t,r){var n=r(2651);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},1042(e,t,r){var n=r(6110)(Object,"create");e.exports=n},3650(e,t,r){var n=r(4335)(Object.keys,Object);e.exports=n},181(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},6009(e,t,r){e=r.nmd(e);var n=r(4840),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s},9350(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335(e){e.exports=function(e,t){return function(r){return e(t(r))}}},9325(e,t,r){var n=r(4840),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},1420(e,t,r){var n=r(79);e.exports=function(){this.__data__=new n,this.size=0}},938(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},3605(e){e.exports=function(e){return this.__data__.get(e)}},9817(e){e.exports=function(e){return this.__data__.has(e)}},945(e,t,r){var n=r(79),o=r(8223),a=r(3661);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var i=r.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(i)}return r.set(e,t),this.size=r.size,this}},7473(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},8055(e,t,r){var n=r(9999);e.exports=function(e){return n(e,5)}},5288(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},2428(e,t,r){var n=r(7534),o=r(346),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return o(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449(e){var t=Array.isArray;e.exports=t},4894(e,t,r){var n=r(1882),o=r(294);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},3656(e,t,r){e=r.nmd(e);var n=r(9325),o=r(9935),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,s=i&&i.exports===a?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||o;e.exports=l},1882(e,t,r){var n=r(2552),o=r(3805);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730(e,t,r){var n=r(9172),o=r(7301),a=r(6009),i=a&&a.isMap,s=i?o(i):n;e.exports=s},3805(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346(e){e.exports=function(e){return null!=e&&"object"==typeof e}},8440(e,t,r){var n=r(6038),o=r(7301),a=r(6009),i=a&&a.isSet,s=i?o(i):n;e.exports=s},7167(e,t,r){var n=r(4901),o=r(7301),a=r(6009),i=a&&a.isTypedArray,s=i?o(i):n;e.exports=s},5950(e,t,r){var n=r(695),o=r(8984),a=r(4894);e.exports=function(e){return a(e)?n(e):o(e)}},7241(e,t,r){var n=r(695),o=r(2903),a=r(4894);e.exports=function(e){return a(e)?n(e,!0):o(e)}},3345(e){e.exports=function(){return[]}},9935(e){e.exports=function(){return!1}},6087(e){"use strict";e.exports=window.wp.element},6942(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e="",t=0;t{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.hasOwn(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.dn=e=>{var t=Object.getOwnPropertyDescriptor(e,"name");(!t||!t.writable&&t.configurable)&&Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{"use strict";var e=r.cw(e=>{function t(e,t){var r,n;if("function"==typeof t)void 0!==(n=t(e))&&(e=n);else if(Array.isArray(t))for(r=0;r=0&&(e=e.replace(/\[/g,t).replace(/]/g,""));var r=e.split(t);if(r.filter(s).length!==r.length)throw Error("Refusing to update blacklisted property "+e);return r}var c=Object.prototype.hasOwnProperty;function u(e,t,r,n){if(!(this instanceof u))return new u(e,t,r,n);void 0===t&&(t=!1),void 0===r&&(r=!0),void 0===n&&(n=!0),this.separator=e||".",this.override=t,this.useArray=r,this.useBrackets=n,this.keepArray=!1,this.cleanup=[]}var p=new u(".",!1,!0,!0);function d(e){return function(){return p[e].apply(p,arguments)}}u.prototype._fill=function(e,r,n,i){var s=e.shift();if(e.length>0){if(r[s]=r[s]||(this.useArray&&function(e){return/^\d+$/.test(e)}(e[0])?[]:{}),!o(r[s])){if(!this.override){if(!o(n)||!a(n))throw new Error("Trying to redefine `"+s+"` which is a "+typeof r[s]);return}r[s]={}}this._fill(e,r[s],n,i)}else{if(!this.override&&o(r[s])&&!a(r[s])){if(!o(n)||!a(n))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}r[s]=t(n,i)}},u.prototype.object=function(e,r){var n=this;return Object.keys(e).forEach(function(o){var a=void 0===r?null:r[o],i=l(o,n.separator).join(n.separator);-1!==i.indexOf(n.separator)?(n._fill(i.split(n.separator),e,e[o],a),delete e[o]):e[o]=t(e[o],a)}),e},u.prototype.str=function(e,r,n,o){var a=l(e,this.separator).join(this.separator);return-1!==e.indexOf(this.separator)?this._fill(a.split(this.separator),n,r,o):n[e]=t(r,o),n},u.prototype.pick=function(e,t,n,o){var a,i,s,c,u;for(i=l(e,this.separator),a=0;ac.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"shape-round"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"widgets/shape-round",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},c.createElement("path",{d:"M12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 Z M12,5 C8.13400675,5 5,8.13400675 5,12 C5,15.8659932 8.13400675,19 12,19 C15.8659932,19 19,15.8659932 19,12 C19,8.13400675 15.8659932,5 12,5 Z",id:"Combined-Shape"})))),p=()=>c.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"ratio-square"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"widgets/shape-square",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},c.createElement("path",{d:"M3,3 L3,21 L21,21 L21,3 L3,3 Z M5,5 L5,19 L19,19 L19,5 L5,5 Z",id:"shape"})))),d=()=>c.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"shape-radius"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"widgets/shape-radius",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},c.createElement("path",{d:"M17,3 C19.209139,3 21,4.790861 21,7 L21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 L3,7 C3,4.790861 4.790861,3 7,3 L17,3 Z M17,5 L7,5 C5.9456382,5 5.08183488,5.81587779 5.00548574,6.85073766 L5,7 L5,17 C5,18.0543618 5.81587779,18.9181651 6.85073766,18.9945143 L7,19 L17,19 C18.0543618,19 18.9181651,18.1841222 18.9945143,17.1492623 L19,17 L19,7 C19,5.9456382 18.1841222,5.08183488 17.1492623,5.00548574 L17,5 Z",id:"Rectangle"})))),f=()=>c.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"shape-none"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"widgets/shape-none",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},c.createElement("path",{d:"M5,19 L5,21 L3,21 L3,19 L5,19 Z M21,19 L21,21 L19,21 L19,19 L21,19 Z M13,19 L13,21 L11,21 L11,19 L13,19 Z M9,19 L9,21 L7,21 L7,19 L9,19 Z M17,19 L17,21 L15,21 L15,19 L17,19 Z M21,15 L21,17 L19,17 L19,15 L21,15 Z M21,11 L21,13 L19,13 L19,11 L21,11 Z M5,11 L5,13 L3,13 L3,11 L5,11 Z M21,7 L21,9 L19,9 L19,7 L21,7 Z M5,7 L5,9 L3,9 L3,7 L5,7 Z M13,3 L13,5 L11,5 L11,3 L13,3 Z M9,3 L9,5 L7,5 L7,3 L9,3 Z M17,3 L17,5 L15,5 L15,3 L17,3 Z M21,3 L21,5 L19,5 L19,3 L21,3 Z M5,3 L5,5 L3,5 L3,3 L5,3 Z M3,15 L5,15 L5,17 L3,17 L3,15 Z",id:"Shape"})))),v=[{value:{type:"expanded",columns:1},icon:()=>c.createElement("svg",{width:"17px",height:"20px",viewBox:"0 0 17 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"layout-modern"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"widgets/layout-modern",transform:"translate(-2.000000, -3.000000)",fill:"#000000"},c.createElement("path",{d:"M2,10 L5,10 L5,7 L2,7 L2,10 Z M2,14 L5,14 L5,11 L2,11 L2,14 Z M2,6 L5,6 L5,3 L2,3 L2,6 Z M6,3 L6,17 L19,17 L19,3 L6,3 Z M8,5 L8,15 L17,15 L17,5 L8,5 Z M6,18 L6,23 L19,23 L19,18 L6,18 Z M8,20 L8,23 L17,23 L17,20 L8,20 Z",id:"shape"})))),label:(0,i.__)("Expanded - 1 Column","cloudinary")},{value:{type:"expanded",columns:2},icon:()=>c.createElement("svg",{width:"18px",height:"17px",viewBox:"0 0 18 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"layout-grid-2-column"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"widgets/layout-gird-2-col",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},c.createElement("path",{d:"M11,12 L11,20 L3,20 L3,12 L11,12 Z M21,12 L21,20 L13,20 L13,12 L21,12 Z M9,14 L5,14 L5,18 L9,18 L9,14 Z M19,14 L15,14 L15,18 L19,18 L19,14 Z M11,3 L11,11 L3,11 L3,3 L11,3 Z M21,3 L21,11 L13,11 L13,3 L21,3 Z M9,5 L5,5 L5,9 L9,9 L9,5 Z M19,5 L15,5 L15,9 L19,9 L19,5 Z",id:"Shape"})))),label:(0,i.__)("Expanded - 2 Column","cloudinary")},{value:{type:"expanded",columns:3},icon:()=>c.createElement("svg",{width:"20px",height:"13px",viewBox:"0 0 20 13",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"layout-grid-3-column"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"widgets/layout-gird-3-col",transform:"translate(-2.000000, -5.000000)",fill:"#000000"},c.createElement("path",{d:"M8,12 L8,18 L2,18 L2,12 L8,12 Z M15,12 L15,18 L9,18 L9,12 L15,12 Z M22,12 L22,18 L16,18 L16,12 L22,12 Z M6,14 L4,14 L4,16 L6,16 L6,14 Z M13,14 L11,14 L11,16 L13,16 L13,14 Z M20,14 L18,14 L18,16 L20,16 L20,14 Z M8,5 L8,11 L2,11 L2,5 L8,5 Z M15,5 L15,11 L9,11 L9,5 L15,5 Z M22,5 L22,11 L16,11 L16,5 L22,5 Z M6,7 L4,7 L4,9 L6,9 L6,7 Z M13,7 L11,7 L11,9 L13,9 L13,7 Z M20,7 L18,7 L18,9 L20,9 L20,7 Z",id:"Combined-Shape"})))),label:(0,i.__)("Expanded - 3 Column","cloudinary")},{value:{type:"classic",columns:1},icon:()=>c.createElement("svg",{width:"17px",height:"14px",viewBox:"0 0 17 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"layout-classic"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"widgets/layout-classic",transform:"translate(-3.000000, -5.000000)",fill:"#000000"},c.createElement("path",{d:"M3,12 L6,12 L6,9 L3,9 L3,12 Z M3,16 L6,16 L6,13 L3,13 L3,16 Z M3,8 L6,8 L6,5 L3,5 L3,8 Z M7,5 L7,19 L20,19 L20,5 L7,5 Z M9,7 L9,17 L18,17 L18,7 L9,7 Z",id:"shape"})))),label:(0,i.__)("Classic","cloudinary")}],m=[{label:(0,i.__)("1:1","cloudinary"),value:"1:1"},{label:(0,i.__)("3:4","cloudinary"),value:"3:4"},{label:(0,i.__)("4:3","cloudinary"),value:"4:3"},{label:(0,i.__)("4:6","cloudinary"),value:"4:6"},{label:(0,i.__)("6:4","cloudinary"),value:"6:4"},{label:(0,i.__)("5:7","cloudinary"),value:"5:7"},{label:(0,i.__)("7:5","cloudinary"),value:"7:5"},{label:(0,i.__)("8:5","cloudinary"),value:"8:5"},{label:(0,i.__)("5:8","cloudinary"),value:"5:8"},{label:(0,i.__)("9:16","cloudinary"),value:"9:16"},{label:(0,i.__)("16:9","cloudinary"),value:"16:9"}],h=[{label:(0,i.__)("None","cloudinary"),value:"none"},{label:(0,i.__)("Fade","cloudinary"),value:"fade"},{label:(0,i.__)("Slide","cloudinary"),value:"slide"}],y=[{label:(0,i.__)("Always","cloudinary"),value:"always"},{label:(0,i.__)("None","cloudinary"),value:"none"},{label:(0,i.__)("MouseOver","cloudinary"),value:"mouseover"}],b=[{label:(0,i.__)("Inline","cloudinary"),value:"inline"},{label:(0,i.__)("Flyout","cloudinary"),value:"flyout"},{label:(0,i.__)("Popup","cloudinary"),value:"popup"}],g=[{label:(0,i.__)("Top","cloudinary"),value:"top"},{label:(0,i.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,i.__)("Left","cloudinary"),value:"left"},{label:(0,i.__)("Right","cloudinary"),value:"right"}],_=[{label:(0,i.__)("Click","cloudinary"),value:"click"},{label:(0,i.__)("Hover","cloudinary"),value:"hover"}],x=[{label:(0,i.__)("Left","cloudinary"),value:"left"},{label:(0,i.__)("Right","cloudinary"),value:"right"},{label:(0,i.__)("Top","cloudinary"),value:"top"},{label:(0,i.__)("Bottom","cloudinary"),value:"bottom"}],w=[{label:(0,i.__)("Thumbnails","cloudinary"),value:"thumbnails"},{label:(0,i.__)("Indicators","cloudinary"),value:"indicators"},{label:(0,i.__)("None","cloudinary"),value:"none"}],L=[{value:"round",icon:u,label:(0,i.__)("Round","cloudinary")},{value:"radius",icon:d,label:(0,i.__)("Radius","cloudinary")},{value:"none",icon:f,label:(0,i.__)("None","cloudinary")},{value:"square",icon:p,label:(0,i.__)("Square","cloudinary")},{value:"rectangle",icon:()=>c.createElement("svg",{width:"14px",height:"20px",viewBox:"0 0 14 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},c.createElement("title",null,"ratio-9-16"),c.createElement("desc",null,"Created with Sketch."),c.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c.createElement("g",{id:"ratio/9-16",transform:"translate(-5.000000, -2.000000)",fill:"#000000"},c.createElement("path",{d:"M22,5.5 L22,18.5 L2,18.5 L2,5.5 L22,5.5 Z M20,7.5 L4,7.5 L4,16.5 L20,16.5 L20,7.5 Z",id:"Combined-Shape",transform:"translate(12.000000, 12.000000) rotate(-90.000000) translate(-12.000000, -12.000000) "})))),label:(0,i.__)("Rectangle","cloudinary")}],E=[{value:"round",icon:u,label:(0,i.__)("Round","cloudinary")},{value:"radius",icon:d,label:(0,i.__)("Radius","cloudinary")},{value:"square",icon:p,label:(0,i.__)("Square","cloudinary")}],O=[{label:(0,i.__)("All","cloudinary"),value:"all"},{label:(0,i.__)("Border","cloudinary"),value:"border"},{label:(0,i.__)("Gradient","cloudinary"),value:"gradient"}],j=[{label:(0,i.__)("All","cloudinary"),value:"all"},{label:(0,i.__)("Top","cloudinary"),value:"top"},{label:(0,i.__)("Top-Bottom","cloudinary"),value:"top-bottom"},{label:(0,i.__)("Left-Right","cloudinary"),value:"left-right"},{label:(0,i.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,i.__)("Left","cloudinary"),value:"left"},{label:(0,i.__)("Right","cloudinary"),value:"right"}],k=[{value:"round",icon:u,label:(0,i.__)("Round","cloudinary")},{value:"radius",icon:d,label:(0,i.__)("Radius","cloudinary")},{value:"none",icon:f,label:(0,i.__)("None","cloudinary")},{value:"square",icon:p,label:(0,i.__)("Square","cloudinary")}],A=[{label:(0,i.__)("Pad","cloudinary"),value:"pad"},{label:(0,i.__)("Fill","cloudinary"),value:"fill"}],P=[{label:(0,i.__)("White padding","cloudinary"),value:"rgb:FFFFFF"},{label:(0,i.__)("Border color padding","cloudinary"),value:"auto"},{label:(0,i.__)("Predominant color padding","cloudinary"),value:"auto:predominant"},{label:(0,i.__)("Gradient fade padding","cloudinary"),value:"auto:predominant_gradient"}];var S=r(6942),C=r.n(S),M=r(6087);const B=({value:e,children:t,icon:r,onChange:n,current:o})=>{const a="object"==typeof e?JSON.stringify(e)===JSON.stringify(o):o===e;return M.createElement("button",{type:"button",onClick:()=>n(e),className:C()("radio-select",{"radio-select--active":a})},M.createElement(r,null),M.createElement("div",{className:"radio-select__label"},t))};r.dn(B);window.wp.data;const T=e=>{const t=/var\((.*)\)/g.exec(e);return t?getComputedStyle(document.documentElement).getPropertyValue(t[1]):e};function D(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function N(e){return e instanceof D(e).Element||e instanceof Element}function R(e){return e instanceof D(e).HTMLElement||e instanceof HTMLElement}function Z(e){return"undefined"!=typeof ShadowRoot&&(e instanceof D(e).ShadowRoot||e instanceof ShadowRoot)}var z=Math.max,F=Math.min,W=Math.round;function H(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function I(){return!/^((?!chrome|android).)*safari/i.test(H())}function V(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.getBoundingClientRect(),o=1,a=1;t&&R(e)&&(o=e.offsetWidth>0&&W(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&W(n.height)/e.offsetHeight||1);var i=(N(e)?D(e):window).visualViewport,s=!I()&&r,l=(n.left+(s&&i?i.offsetLeft:0))/o,c=(n.top+(s&&i?i.offsetTop:0))/a,u=n.width/o,p=n.height/a;return{width:u,height:p,top:c,right:l+u,bottom:c+p,left:l,x:l,y:c}}function U(e){var t=D(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function q(e){return e?(e.nodeName||"").toLowerCase():null}function $(e){return((N(e)?e.ownerDocument:e.document)||window.document).documentElement}function G(e){return V($(e)).left+U(e).scrollLeft}function X(e){return D(e).getComputedStyle(e)}function J(e){var t=X(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function Y(e,t,r){void 0===r&&(r=!1);var n,o,a=R(t),i=R(t)&&function(e){var t=e.getBoundingClientRect(),r=W(t.width)/e.offsetWidth||1,n=W(t.height)/e.offsetHeight||1;return 1!==r||1!==n}(t),s=$(t),l=V(e,i,r),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(a||!a&&!r)&&(("body"!==q(t)||J(s))&&(c=(n=t)!==D(n)&&R(n)?{scrollLeft:(o=n).scrollLeft,scrollTop:o.scrollTop}:U(n)),R(t)?((u=V(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=G(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function K(e){var t=V(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function Q(e){return"html"===q(e)?e:e.assignedSlot||e.parentNode||(Z(e)?e.host:null)||$(e)}function ee(e){return["html","body","#document"].indexOf(q(e))>=0?e.ownerDocument.body:R(e)&&J(e)?e:ee(Q(e))}function te(e,t){var r;void 0===t&&(t=[]);var n=ee(e),o=n===(null==(r=e.ownerDocument)?void 0:r.body),a=D(n),i=o?[a].concat(a.visualViewport||[],J(n)?n:[]):n,s=t.concat(i);return o?s:s.concat(te(Q(i)))}function re(e){return["table","td","th"].indexOf(q(e))>=0}function ne(e){return R(e)&&"fixed"!==X(e).position?e.offsetParent:null}function oe(e){for(var t=D(e),r=ne(e);r&&re(r)&&"static"===X(r).position;)r=ne(r);return r&&("html"===q(r)||"body"===q(r)&&"static"===X(r).position)?t:r||function(e){var t=/firefox/i.test(H());if(/Trident/i.test(H())&&R(e)&&"fixed"===X(e).position)return null;var r=Q(e);for(Z(r)&&(r=r.host);R(r)&&["html","body"].indexOf(q(r))<0;){var n=X(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(e)||t}var ae="top",ie="bottom",se="right",le="left",ce="auto",ue=[ae,ie,se,le],pe="start",de="end",fe="viewport",ve="popper",me=ue.reduce(function(e,t){return e.concat([t+"-"+pe,t+"-"+de])},[]),he=[].concat(ue,[ce]).reduce(function(e,t){return e.concat([t,t+"-"+pe,t+"-"+de])},[]),ye=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function be(e){var t=new Map,r=new Set,n=[];function o(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!r.has(e)){var n=t.get(e);n&&o(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){r.has(e.name)||o(e)}),n}var ge={placement:"bottom",modifiers:[],strategy:"absolute"};function _e(){for(var e=arguments.length,t=new Array(e),r=0;r=0?"x":"y"}function je(e){var t,r=e.reference,n=e.element,o=e.placement,a=o?Le(o):null,i=o?Ee(o):null,s=r.x+r.width/2-n.width/2,l=r.y+r.height/2-n.height/2;switch(a){case ae:t={x:s,y:r.y-n.height};break;case ie:t={x:s,y:r.y+r.height};break;case se:t={x:r.x+r.width,y:l};break;case le:t={x:r.x-n.width,y:l};break;default:t={x:r.x,y:r.y}}var c=a?Oe(a):null;if(null!=c){var u="y"===c?"height":"width";switch(i){case pe:t[c]=t[c]-(r[u]/2-n[u]/2);break;case de:t[c]=t[c]+(r[u]/2-n[u]/2)}}return t}var ke={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ae(e){var t,r=e.popper,n=e.popperRect,o=e.placement,a=e.variation,i=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,p=e.isFixed,d=i.x,f=void 0===d?0:d,v=i.y,m=void 0===v?0:v,h="function"==typeof u?u({x:f,y:m}):{x:f,y:m};f=h.x,m=h.y;var y=i.hasOwnProperty("x"),b=i.hasOwnProperty("y"),g=le,_=ae,x=window;if(c){var w=oe(r),L="clientHeight",E="clientWidth";if(w===D(r)&&"static"!==X(w=$(r)).position&&"absolute"===s&&(L="scrollHeight",E="scrollWidth"),o===ae||(o===le||o===se)&&a===de)_=ie,m-=(p&&w===x&&x.visualViewport?x.visualViewport.height:w[L])-n.height,m*=l?1:-1;if(o===le||(o===ae||o===ie)&&a===de)g=se,f-=(p&&w===x&&x.visualViewport?x.visualViewport.width:w[E])-n.width,f*=l?1:-1}var O,j=Object.assign({position:s},c&&ke),k=!0===u?function(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:W(r*o)/o||0,y:W(n*o)/o||0}}({x:f,y:m},D(r)):{x:f,y:m};return f=k.x,m=k.y,l?Object.assign({},j,((O={})[_]=b?"0":"",O[g]=y?"0":"",O.transform=(x.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",O)):Object.assign({},j,((t={})[_]=b?m+"px":"",t[g]=y?f+"px":"",t.transform="",t))}const Pe={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var r=t.styles[e]||{},n=t.attributes[e]||{},o=t.elements[e];R(o)&&q(o)&&(Object.assign(o.style,r),Object.keys(n).forEach(function(e){var t=n[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],o=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce(function(e,t){return e[t]="",e},{});R(n)&&q(n)&&(Object.assign(n.style,a),Object.keys(o).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};const Se={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.offset,a=void 0===o?[0,0]:o,i=he.reduce(function(e,r){return e[r]=function(e,t,r){var n=Le(e),o=[le,ae].indexOf(n)>=0?-1:1,a="function"==typeof r?r(Object.assign({},t,{placement:e})):r,i=a[0],s=a[1];return i=i||0,s=(s||0)*o,[le,se].indexOf(n)>=0?{x:s,y:i}:{x:i,y:s}}(r,t.rects,a),e},{}),s=i[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=i}};var Ce={left:"right",right:"left",bottom:"top",top:"bottom"};function Me(e){return e.replace(/left|right|bottom|top/g,function(e){return Ce[e]})}var Be={start:"end",end:"start"};function Te(e){return e.replace(/start|end/g,function(e){return Be[e]})}function De(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Z(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ne(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Re(e,t,r){return t===fe?Ne(function(e,t){var r=D(e),n=$(e),o=r.visualViewport,a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;var c=I();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s+G(e),y:l}}(e,r)):N(t)?function(e,t){var r=V(e,!1,"fixed"===t);return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}(t,r):Ne(function(e){var t,r=$(e),n=U(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=z(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=z(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+G(e),l=-n.scrollTop;return"rtl"===X(o||r).direction&&(s+=z(r.clientWidth,o?o.clientWidth:0)-a),{width:a,height:i,x:s,y:l}}($(e)))}function Ze(e,t,r,n){var o="clippingParents"===t?function(e){var t=te(Q(e)),r=["absolute","fixed"].indexOf(X(e).position)>=0&&R(e)?oe(e):e;return N(r)?t.filter(function(e){return N(e)&&De(e,r)&&"body"!==q(e)}):[]}(e):[].concat(t),a=[].concat(o,[r]),i=a[0],s=a.reduce(function(t,r){var o=Re(e,r,n);return t.top=z(o.top,t.top),t.right=F(o.right,t.right),t.bottom=F(o.bottom,t.bottom),t.left=z(o.left,t.left),t},Re(e,i,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function ze(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Fe(e,t){return t.reduce(function(t,r){return t[r]=e,t},{})}function We(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=void 0===n?e.placement:n,a=r.strategy,i=void 0===a?e.strategy:a,s=r.boundary,l=void 0===s?"clippingParents":s,c=r.rootBoundary,u=void 0===c?fe:c,p=r.elementContext,d=void 0===p?ve:p,f=r.altBoundary,v=void 0!==f&&f,m=r.padding,h=void 0===m?0:m,y=ze("number"!=typeof h?h:Fe(h,ue)),b=d===ve?"reference":ve,g=e.rects.popper,_=e.elements[v?b:d],x=Ze(N(_)?_:_.contextElement||$(e.elements.popper),l,u,i),w=V(e.elements.reference),L=je({reference:w,element:g,strategy:"absolute",placement:o}),E=Ne(Object.assign({},g,L)),O=d===ve?E:w,j={top:x.top-O.top+y.top,bottom:O.bottom-x.bottom+y.bottom,left:x.left-O.left+y.left,right:O.right-x.right+y.right},k=e.modifiersData.offset;if(d===ve&&k){var A=k[o];Object.keys(j).forEach(function(e){var t=[se,ie].indexOf(e)>=0?1:-1,r=[ae,ie].indexOf(e)>=0?"y":"x";j[e]+=A[r]*t})}return j}function He(e,t,r){return z(e,F(t,r))}const Ie={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0!==i&&i,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,p=r.padding,d=r.tether,f=void 0===d||d,v=r.tetherOffset,m=void 0===v?0:v,h=We(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:u}),y=Le(t.placement),b=Ee(t.placement),g=!b,_=Oe(y),x="x"===_?"y":"x",w=t.modifiersData.popperOffsets,L=t.rects.reference,E=t.rects.popper,O="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,j="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),k=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,A={x:0,y:0};if(w){if(a){var P,S="y"===_?ae:le,C="y"===_?ie:se,M="y"===_?"height":"width",B=w[_],T=B+h[S],D=B-h[C],N=f?-E[M]/2:0,R=b===pe?L[M]:E[M],Z=b===pe?-E[M]:-L[M],W=t.elements.arrow,H=f&&W?K(W):{width:0,height:0},I=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=I[S],U=I[C],q=He(0,L[M],H[M]),$=g?L[M]/2-N-q-V-j.mainAxis:R-q-V-j.mainAxis,G=g?-L[M]/2+N+q+U+j.mainAxis:Z+q+U+j.mainAxis,X=t.elements.arrow&&oe(t.elements.arrow),J=X?"y"===_?X.clientTop||0:X.clientLeft||0:0,Y=null!=(P=null==k?void 0:k[_])?P:0,Q=B+G-Y,ee=He(f?F(T,B+$-Y-J):T,B,f?z(D,Q):D);w[_]=ee,A[_]=ee-B}if(s){var te,re="x"===_?ae:le,ne="x"===_?ie:se,ce=w[x],ue="y"===x?"height":"width",de=ce+h[re],fe=ce-h[ne],ve=-1!==[ae,le].indexOf(y),me=null!=(te=null==k?void 0:k[x])?te:0,he=ve?de:ce-L[ue]-E[ue]-me+j.altAxis,ye=ve?ce+L[ue]+E[ue]-me-j.altAxis:fe,be=f&&ve?function(e,t,r){var n=He(e,t,r);return n>r?r:n}(he,ce,ye):He(f?he:de,ce,f?ye:fe);w[x]=be,A[x]=be-ce}t.modifiersData[n]=A}},requiresIfExists:["offset"]};const Ve={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state,n=e.name,o=e.options,a=r.elements.arrow,i=r.modifiersData.popperOffsets,s=Le(r.placement),l=Oe(s),c=[le,se].indexOf(s)>=0?"height":"width";if(a&&i){var u=function(e,t){return ze("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Fe(e,ue))}(o.padding,r),p=K(a),d="y"===l?ae:le,f="y"===l?ie:se,v=r.rects.reference[c]+r.rects.reference[l]-i[l]-r.rects.popper[c],m=i[l]-r.rects.reference[l],h=oe(a),y=h?"y"===l?h.clientHeight||0:h.clientWidth||0:0,b=v/2-m/2,g=u[d],_=y-p[c]-u[f],x=y/2-p[c]/2+b,w=He(g,x,_),L=l;r.modifiersData[n]=((t={})[L]=w,t.centerOffset=w-x,t)}},effect:function(e){var t=e.state,r=e.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&De(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ue(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function qe(e){return[ae,se,ie,le].some(function(t){return e[t]>=0})}var $e=xe({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,a=void 0===o||o,i=n.resize,s=void 0===i||i,l=D(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach(function(e){e.addEventListener("scroll",r.update,we)}),s&&l.addEventListener("resize",r.update,we),function(){a&&c.forEach(function(e){e.removeEventListener("scroll",r.update,we)}),s&&l.removeEventListener("resize",r.update,we)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,r=e.name;t.modifiersData[r]=je({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=void 0===n||n,a=r.adaptive,i=void 0===a||a,s=r.roundOffsets,l=void 0===s||s,c={placement:Le(t.placement),variation:Ee(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Ae(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ae(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Pe,Se,{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0===i||i,l=r.fallbackPlacements,c=r.padding,u=r.boundary,p=r.rootBoundary,d=r.altBoundary,f=r.flipVariations,v=void 0===f||f,m=r.allowedAutoPlacements,h=t.options.placement,y=Le(h),b=l||(y===h||!v?[Me(h)]:function(e){if(Le(e)===ce)return[];var t=Me(e);return[Te(e),t,Te(t)]}(h)),g=[h].concat(b).reduce(function(e,r){return e.concat(Le(r)===ce?function(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=r.boundary,a=r.rootBoundary,i=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,c=void 0===l?he:l,u=Ee(n),p=u?s?me:me.filter(function(e){return Ee(e)===u}):ue,d=p.filter(function(e){return c.indexOf(e)>=0});0===d.length&&(d=p);var f=d.reduce(function(t,r){return t[r]=We(e,{placement:r,boundary:o,rootBoundary:a,padding:i})[Le(r)],t},{});return Object.keys(f).sort(function(e,t){return f[e]-f[t]})}(t,{placement:r,boundary:u,rootBoundary:p,padding:c,flipVariations:v,allowedAutoPlacements:m}):r)},[]),_=t.rects.reference,x=t.rects.popper,w=new Map,L=!0,E=g[0],O=0;O=0,S=P?"width":"height",C=We(t,{placement:j,boundary:u,rootBoundary:p,altBoundary:d,padding:c}),M=P?A?se:le:A?ie:ae;_[S]>x[S]&&(M=Me(M));var B=Me(M),T=[];if(a&&T.push(C[k]<=0),s&&T.push(C[M]<=0,C[B]<=0),T.every(function(e){return e})){E=j,L=!1;break}w.set(j,T)}if(L)for(var D=function(e){var t=g.find(function(t){var r=w.get(t);if(r)return r.slice(0,e).every(function(e){return e})});if(t)return E=t,"break"},N=v?3:1;N>0;N--){if("break"===D(N))break}t.placement!==E&&(t.modifiersData[n]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Ie,Ve,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,a=t.modifiersData.preventOverflow,i=We(t,{elementContext:"reference"}),s=We(t,{altBoundary:!0}),l=Ue(i,n),c=Ue(s,o,a),u=qe(l),p=qe(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}}]}),Ge="tippy-content",Xe="tippy-backdrop",Je="tippy-arrow",Ye="tippy-svg-arrow",Ke={passive:!0,capture:!0},Qe=function(){return document.body};function et(e,t,r){if(Array.isArray(e)){var n=e[t];return n??(Array.isArray(r)?r[t]:r)}return e}function tt(e,t){var r={}.toString.call(e);return 0===r.indexOf("[object")&&r.indexOf(t+"]")>-1}function rt(e,t){return"function"==typeof e?e.apply(void 0,t):e}function nt(e,t){return 0===t?e:function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)};var r}function ot(e){return[].concat(e)}function at(e,t){-1===e.indexOf(t)&&e.push(t)}function it(e){return e.split("-")[0]}function st(e){return[].slice.call(e)}function lt(e){return Object.keys(e).reduce(function(t,r){return void 0!==e[r]&&(t[r]=e[r]),t},{})}function ct(){return document.createElement("div")}function ut(e){return["Element","Fragment"].some(function(t){return tt(e,t)})}function pt(e){return tt(e,"MouseEvent")}function dt(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function ft(e){return ut(e)?[e]:function(e){return tt(e,"NodeList")}(e)?st(e):Array.isArray(e)?e:st(document.querySelectorAll(e))}function vt(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function mt(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function ht(e){var t,r=ot(e)[0];return null!=r&&null!=(t=r.ownerDocument)&&t.body?r.ownerDocument:document}function yt(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[n](t,r)})}function bt(e,t){for(var r=t;r;){var n;if(e.contains(r))return!0;r=null==r.getRootNode||null==(n=r.getRootNode())?void 0:n.host}return!1}var gt={isTouch:!1},_t=0;function xt(){gt.isTouch||(gt.isTouch=!0,window.performance&&document.addEventListener("mousemove",wt))}function wt(){var e=performance.now();e-_t<20&&(gt.isTouch=!1,document.removeEventListener("mousemove",wt)),_t=e}function Lt(){var e=document.activeElement;if(dt(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Et=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Ot={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},jt=Object.assign({appendTo:Qe,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Ot,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),kt=Object.keys(jt);function At(e){var t=(e.plugins||[]).reduce(function(t,r){var n,o=r.name,a=r.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(n=jt[o])?n:a);return t},{});return Object.assign({},e,t)}function Pt(e,t){var r=Object.assign({},t,{content:rt(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(At(Object.assign({},jt,{plugins:t}))):kt).reduce(function(t,r){var n=(e.getAttribute("data-tippy-"+r)||"").trim();if(!n)return t;if("content"===r)t[r]=n;else try{t[r]=JSON.parse(n)}catch(e){t[r]=n}return t},{})}(e,t.plugins));return r.aria=Object.assign({},jt.aria,r.aria),r.aria={expanded:"auto"===r.aria.expanded?t.interactive:r.aria.expanded,content:"auto"===r.aria.content?t.interactive?null:"describedby":r.aria.content},r}function St(e,t){e.innerHTML=t}function Ct(e){var t=ct();return!0===e?t.className=Je:(t.className=Ye,ut(e)?t.appendChild(e):St(t,e)),t}function Mt(e,t){ut(t.content)?(St(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?St(e,t.content):e.textContent=t.content)}function Bt(e){var t=e.firstElementChild,r=st(t.children);return{box:t,content:r.find(function(e){return e.classList.contains(Ge)}),arrow:r.find(function(e){return e.classList.contains(Je)||e.classList.contains(Ye)}),backdrop:r.find(function(e){return e.classList.contains(Xe)})}}function Tt(e){var t=ct(),r=ct();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=ct();function o(r,n){var o=Bt(t),a=o.box,i=o.content,s=o.arrow;n.theme?a.setAttribute("data-theme",n.theme):a.removeAttribute("data-theme"),"string"==typeof n.animation?a.setAttribute("data-animation",n.animation):a.removeAttribute("data-animation"),n.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?a.setAttribute("role",n.role):a.removeAttribute("role"),r.content===n.content&&r.allowHTML===n.allowHTML||Mt(i,e.props),n.arrow?s?r.arrow!==n.arrow&&(a.removeChild(s),a.appendChild(Ct(n.arrow))):a.appendChild(Ct(n.arrow)):s&&a.removeChild(s)}return n.className=Ge,n.setAttribute("data-state","hidden"),Mt(n,e.props),t.appendChild(r),r.appendChild(n),o(e.props,e.props),{popper:t,onUpdate:o}}Tt.$$tippy=!0;var Dt=1,Nt=[],Rt=[];function Zt(e,t){var r,n,o,a,i,s,l,c,u=Pt(e,Object.assign({},jt,At(lt(t)))),p=!1,d=!1,f=!1,v=!1,m=[],h=nt($,u.interactiveDebounce),y=Dt++,b=(c=u.plugins).filter(function(e,t){return c.indexOf(e)===t}),g={id:y,reference:e,popper:ct(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(n),cancelAnimationFrame(o)},setProps:function(t){0;if(g.state.isDestroyed)return;B("onBeforeUpdate",[g,t]),U();var r=g.props,n=Pt(e,Object.assign({},r,lt(t),{ignoreAttributes:!0}));g.props=n,V(),r.interactiveDebounce!==n.interactiveDebounce&&(N(),h=nt($,n.interactiveDebounce));r.triggerTarget&&!n.triggerTarget?ot(r.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):n.triggerTarget&&e.removeAttribute("aria-expanded");D(),M(),w&&w(r,n);g.popperInstance&&(Y(),Q().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}));B("onAfterUpdate",[g,t])},setContent:function(e){g.setProps({content:e})},show:function(){0;var e=g.state.isVisible,t=g.state.isDestroyed,r=!g.state.isEnabled,n=gt.isTouch&&!g.props.touch,o=et(g.props.duration,0,jt.duration);if(e||t||r||n)return;if(A().hasAttribute("disabled"))return;if(B("onShow",[g],!1),!1===g.props.onShow(g))return;g.state.isVisible=!0,k()&&(x.style.visibility="visible");M(),F(),g.state.isMounted||(x.style.transition="none");if(k()){var a=S();vt([a.box,a.content],0)}s=function(){var e;if(g.state.isVisible&&!v){if(v=!0,x.offsetHeight,x.style.transition=g.props.moveTransition,k()&&g.props.animation){var t=S(),r=t.box,n=t.content;vt([r,n],o),mt([r,n],"visible")}T(),D(),at(Rt,g),null==(e=g.popperInstance)||e.forceUpdate(),B("onMount",[g]),g.props.animation&&k()&&function(e,t){H(e,t)}(o,function(){g.state.isShown=!0,B("onShown",[g])})}},function(){var e,t=g.props.appendTo,r=A();e=g.props.interactive&&t===Qe||"parent"===t?r.parentNode:rt(t,[r]);e.contains(x)||e.appendChild(x);g.state.isMounted=!0,Y(),!1}()},hide:function(){0;var e=!g.state.isVisible,t=g.state.isDestroyed,r=!g.state.isEnabled,n=et(g.props.duration,1,jt.duration);if(e||t||r)return;if(B("onHide",[g],!1),!1===g.props.onHide(g))return;g.state.isVisible=!1,g.state.isShown=!1,v=!1,p=!1,k()&&(x.style.visibility="hidden");if(N(),W(),M(!0),k()){var o=S(),a=o.box,i=o.content;g.props.animation&&(vt([a,i],n),mt([a,i],"hidden"))}T(),D(),g.props.animation?k()&&function(e,t){H(e,function(){!g.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()})}(n,g.unmount):g.unmount()},hideWithInteractivity:function(e){0;P().addEventListener("mousemove",h),at(Nt,h),h(e)},enable:function(){g.state.isEnabled=!0},disable:function(){g.hide(),g.state.isEnabled=!1},unmount:function(){0;g.state.isVisible&&g.hide();if(!g.state.isMounted)return;K(),Q().forEach(function(e){e._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x);Rt=Rt.filter(function(e){return e!==g}),g.state.isMounted=!1,B("onHidden",[g])},destroy:function(){0;if(g.state.isDestroyed)return;g.clearDelayTimeouts(),g.unmount(),U(),delete e._tippy,g.state.isDestroyed=!0,B("onDestroy",[g])}};if(!u.render)return g;var _=u.render(g),x=_.popper,w=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+g.id,g.popper=x,e._tippy=g,x._tippy=g;var L=b.map(function(e){return e.fn(g)}),E=e.hasAttribute("aria-expanded");return V(),D(),M(),B("onCreate",[g]),u.showOnCreate&&ee(),x.addEventListener("mouseenter",function(){g.props.interactive&&g.state.isVisible&&g.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){g.props.interactive&&g.props.trigger.indexOf("mouseenter")>=0&&P().addEventListener("mousemove",h)}),g;function O(){var e=g.props.touch;return Array.isArray(e)?e:[e,0]}function j(){return"hold"===O()[0]}function k(){var e;return!(null==(e=g.props.render)||!e.$$tippy)}function A(){return l||e}function P(){var e=A().parentNode;return e?ht(e):document}function S(){return Bt(x)}function C(e){return g.state.isMounted&&!g.state.isVisible||gt.isTouch||a&&"focus"===a.type?0:et(g.props.delay,e?0:1,jt.delay)}function M(e){void 0===e&&(e=!1),x.style.pointerEvents=g.props.interactive&&!e?"":"none",x.style.zIndex=""+g.props.zIndex}function B(e,t,r){var n;(void 0===r&&(r=!0),L.forEach(function(r){r[e]&&r[e].apply(r,t)}),r)&&(n=g.props)[e].apply(n,t)}function T(){var t=g.props.aria;if(t.content){var r="aria-"+t.content,n=x.id;ot(g.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(r);if(g.state.isVisible)e.setAttribute(r,t?t+" "+n:n);else{var o=t&&t.replace(n,"").trim();o?e.setAttribute(r,o):e.removeAttribute(r)}})}}function D(){!E&&g.props.aria.expanded&&ot(g.props.triggerTarget||e).forEach(function(e){g.props.interactive?e.setAttribute("aria-expanded",g.state.isVisible&&e===A()?"true":"false"):e.removeAttribute("aria-expanded")})}function N(){P().removeEventListener("mousemove",h),Nt=Nt.filter(function(e){return e!==h})}function R(t){if(!gt.isTouch||!f&&"mousedown"!==t.type){var r=t.composedPath&&t.composedPath()[0]||t.target;if(!g.props.interactive||!bt(x,r)){if(ot(g.props.triggerTarget||e).some(function(e){return bt(e,r)})){if(gt.isTouch)return;if(g.state.isVisible&&g.props.trigger.indexOf("click")>=0)return}else B("onClickOutside",[g,t]);!0===g.props.hideOnClick&&(g.clearDelayTimeouts(),g.hide(),d=!0,setTimeout(function(){d=!1}),g.state.isMounted||W())}}}function Z(){f=!0}function z(){f=!1}function F(){var e=P();e.addEventListener("mousedown",R,!0),e.addEventListener("touchend",R,Ke),e.addEventListener("touchstart",z,Ke),e.addEventListener("touchmove",Z,Ke)}function W(){var e=P();e.removeEventListener("mousedown",R,!0),e.removeEventListener("touchend",R,Ke),e.removeEventListener("touchstart",z,Ke),e.removeEventListener("touchmove",Z,Ke)}function H(e,t){var r=S().box;function n(e){e.target===r&&(yt(r,"remove",n),t())}if(0===e)return t();yt(r,"remove",i),yt(r,"add",n),i=n}function I(t,r,n){void 0===n&&(n=!1),ot(g.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,r,n),m.push({node:e,eventType:t,handler:r,options:n})})}function V(){var e;j()&&(I("touchstart",q,{passive:!0}),I("touchend",G,{passive:!0})),(e=g.props.trigger,e.split(/\s+/).filter(Boolean)).forEach(function(e){if("manual"!==e)switch(I(e,q),e){case"mouseenter":I("mouseleave",G);break;case"focus":I(Et?"focusout":"blur",X);break;case"focusin":I("focusout",X)}})}function U(){m.forEach(function(e){var t=e.node,r=e.eventType,n=e.handler,o=e.options;t.removeEventListener(r,n,o)}),m=[]}function q(e){var t,r=!1;if(g.state.isEnabled&&!J(e)&&!d){var n="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,D(),!g.state.isVisible&&pt(e)&&Nt.forEach(function(t){return t(e)}),"click"===e.type&&(g.props.trigger.indexOf("mouseenter")<0||p)&&!1!==g.props.hideOnClick&&g.state.isVisible?r=!0:ee(e),"click"===e.type&&(p=!r),r&&!n&&te(e)}}function $(e){var t=e.target,r=A().contains(t)||x.contains(t);if("mousemove"!==e.type||!r){var n=Q().concat(x).map(function(e){var t,r=null==(t=e._tippy.popperInstance)?void 0:t.state;return r?{popperRect:e.getBoundingClientRect(),popperState:r,props:u}:null}).filter(Boolean);(function(e,t){var r=t.clientX,n=t.clientY;return e.every(function(e){var t=e.popperRect,o=e.popperState,a=e.props.interactiveBorder,i=it(o.placement),s=o.modifiersData.offset;if(!s)return!0;var l="bottom"===i?s.top.y:0,c="top"===i?s.bottom.y:0,u="right"===i?s.left.x:0,p="left"===i?s.right.x:0,d=t.top-n+l>a,f=n-t.bottom-c>a,v=t.left-r+u>a,m=r-t.right-p>a;return d||f||v||m})})(n,e)&&(N(),te(e))}}function G(e){J(e)||g.props.trigger.indexOf("click")>=0&&p||(g.props.interactive?g.hideWithInteractivity(e):te(e))}function X(e){g.props.trigger.indexOf("focusin")<0&&e.target!==A()||g.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function J(e){return!!gt.isTouch&&j()!==e.type.indexOf("touch")>=0}function Y(){K();var t=g.props,r=t.popperOptions,n=t.placement,o=t.offset,a=t.getReferenceClientRect,i=t.moveTransition,l=k()?Bt(x).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||A()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(k()){var r=S().box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?r.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?r.setAttribute("data-"+e,""):r.removeAttribute("data-"+e)}),t.attributes.popper={}}}},p=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!i}},u];k()&&l&&p.push({name:"arrow",options:{element:l,padding:3}}),p.push.apply(p,(null==r?void 0:r.modifiers)||[]),g.popperInstance=$e(c,x,Object.assign({},r,{placement:n,onFirstUpdate:s,modifiers:p}))}function K(){g.popperInstance&&(g.popperInstance.destroy(),g.popperInstance=null)}function Q(){return st(x.querySelectorAll("[data-tippy-root]"))}function ee(e){g.clearDelayTimeouts(),e&&B("onTrigger",[g,e]),F();var t=C(!0),n=O(),o=n[0],a=n[1];gt.isTouch&&"hold"===o&&a&&(t=a),t?r=setTimeout(function(){g.show()},t):g.show()}function te(e){if(g.clearDelayTimeouts(),B("onUntrigger",[g,e]),g.state.isVisible){if(!(g.props.trigger.indexOf("mouseenter")>=0&&g.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=C(!1);t?n=setTimeout(function(){g.state.isVisible&&g.hide()},t):o=requestAnimationFrame(function(){g.hide()})}}else W()}}function zt(e,t){void 0===t&&(t={});var r=jt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",xt,Ke),window.addEventListener("blur",Lt);var n=Object.assign({},t,{plugins:r}),o=ft(e).reduce(function(e,t){var r=t&&Zt(t,n);return r&&e.push(r),e},[]);return ut(e)?o[0]:o}zt.defaultProps=jt,zt.setDefaultProps=function(e){Object.keys(e).forEach(function(t){jt[t]=e[t]})},zt.currentInput=gt;Object.assign({},Pe,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}});zt.setDefaultProps({render:Tt});const Ft=zt;var Wt=r(6087);const Ht=({children:e,value:t})=>Wt.createElement("div",{className:"colorpalette-color-label"},Wt.createElement("span",null,e),Wt.createElement("span",{className:"component-color-indicator","aria-label":`Color: ${t}`,style:{background:t}})),It=new(t()())("_"),Vt=({attributes:e,setAttributes:t,colors:r})=>{const o=a()(e),c=It.object(o),[u,p]=(0,n.useState)(c.customSettings);e.transformation_crop||(e.transformation_crop="pad",e.transformation_background="rgb:FFFFFF"),"fill"===e.transformation_crop&&delete e.transformation_background;const d=(e,r)=>{const n={[r]:T(e)};t(n)},f=(e=>{const[t,r]=(0,n.useState)(null),o=(0,n.useCallback)(e=>r(e),[]);return(0,n.useEffect)(()=>{if(!t)return;const r=Ft(t,{content:e});return()=>{r?.destroy()}},[t,e]),o})((0,i.__)("How to resize or crop images to fit the gallery. Pad adds padding around the image using the specified padding style. Fill crops the image from the center so it fills as much of the available space as possible.","cloudinary"));return Wt.createElement(Wt.Fragment,null,Wt.createElement(s.PanelBody,{title:(0,i.__)("Layout","cloudinary")},v.map(r=>Wt.createElement(B,{key:`${r.value.type}-${r.value.columns}-layout`,value:r.value,onChange:e=>{t({displayProps_mode:e.type,displayProps_columns:e.columns||1})},icon:r.icon,current:{type:e.displayProps_mode,columns:e.displayProps_columns||1}},r.label))),Wt.createElement(s.PanelBody,{title:(0,i.__)("Color Palette","cloudinary"),initialOpen:!1},Wt.createElement(Ht,{value:e.themeProps_primary},(0,i.__)("Primary","cloudinary")),Wt.createElement(l.ColorPalette,{value:e.themeProps_primary,colors:r,disableCustomColors:!1,onChange:e=>d(e,"themeProps_primary")}),Wt.createElement(Ht,{value:e.themeProps_onPrimary},(0,i.__)("On Primary","cloudinary")),Wt.createElement(l.ColorPalette,{value:e.themeProps_onPrimary,colors:r,disableCustomColors:!1,onChange:e=>d(e,"themeProps_onPrimary")}),Wt.createElement(Ht,{value:e.themeProps_active},(0,i.__)("Active","cloudinary")),Wt.createElement(l.ColorPalette,{value:e.themeProps_active,colors:r,disableCustomColors:!1,onChange:e=>d(e,"themeProps_active")})),"classic"===e.displayProps_mode&&Wt.createElement(s.PanelBody,{title:(0,i.__)("Fade Transition","cloudinary"),initialOpen:!1},Wt.createElement(s.SelectControl,{value:e.transition,options:h,onChange:e=>t({transition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),Wt.createElement(s.PanelBody,{title:(0,i.__)("Main Viewer Parameters","cloudinary"),initialOpen:!1},Wt.createElement(s.SelectControl,{label:(0,i.__)("Aspect Ratio","cloudinary"),value:e.aspectRatio,options:m,onChange:e=>t({aspectRatio:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Wt.createElement("p",null,Wt.createElement("div",{className:"cld-ui-title"},(0,i.__)("Resize/Crop Mode","cloudinary"),Wt.createElement("span",{className:"dashicons dashicons-info cld-tooltip",ref:f})),Wt.createElement(s.ButtonGroup,null,A.map(r=>Wt.createElement(s.Button,{key:r.value+"-look-and-feel",variant:"secondary",isSecondary:!0,isPressed:r.value===e.transformation_crop,onClick:()=>t({transformation_crop:r.value,transformation_background:null})},r.label)))),"pad"===e.transformation_crop&&Wt.createElement(s.SelectControl,{label:(0,i.__)("Pad style","cloudinary"),value:e.transformation_background,options:P,onChange:e=>{t({transformation_background:e})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Wt.createElement("p",null,(0,i.__)("Navigation","cloudinary")),Wt.createElement("p",null,Wt.createElement(s.ButtonGroup,null,y.map(r=>Wt.createElement(s.Button,{key:r.value+"-navigation",variant:"secondary",isSecondary:!0,isPressed:r.value===e.navigation,onClick:()=>t({navigation:r.value})},r.label)))),Wt.createElement("div",{style:{marginTop:"30px"}},Wt.createElement(s.ToggleControl,{label:(0,i.__)("Show Zoom","cloudinary"),checked:e.zoom,onChange:()=>t({zoom:!e.zoom}),__nextHasNoMarginBottom:!0}),e.zoom&&Wt.createElement(Wt.Fragment,null,Wt.createElement("p",null,(0,i.__)("Zoom Type","cloudinary")),Wt.createElement("p",null,Wt.createElement(s.ButtonGroup,null,b.map(r=>Wt.createElement(s.Button,{key:r.value+"-zoom-type",variant:"secondary",isSecondary:!0,isPressed:r.value===e.zoomProps_type,onClick:()=>t({zoomProps_type:r.value})},r.label)))),"flyout"===e.zoomProps_type&&Wt.createElement(s.SelectControl,{label:(0,i.__)("Zoom Viewer Position","cloudinary"),value:e.zoomProps_viewerPosition,options:g,onChange:e=>t({zoomProps_viewerPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"popup"!==e.zoomProps_type&&Wt.createElement(Wt.Fragment,null,Wt.createElement("p",null,(0,i.__)("Zoom Trigger","cloudinary")),Wt.createElement("p",null,Wt.createElement(s.ButtonGroup,null,_.map(r=>Wt.createElement(s.Button,{key:r.value+"-zoom-trigger",variant:"secondary",isSecondary:!0,isPressed:r.value===e.zoomProps_trigger,onClick:()=>t({zoomProps_trigger:r.value})},r.label)))))))),Wt.createElement(s.PanelBody,{title:(0,i.__)("Carousel Parameters","cloudinary"),initialOpen:!1},Wt.createElement("p",null,(0,i.__)("Carousel Location","cloudinary")),Wt.createElement("p",null,Wt.createElement(s.ButtonGroup,null,x.map(r=>Wt.createElement(s.Button,{key:r.value+"-carousel-location",variant:"secondary",isSecondary:!0,isPressed:r.value===e.carouselLocation,onClick:()=>t({carouselLocation:r.value})},r.label)))),Wt.createElement(s.RangeControl,{label:(0,i.__)("Carousel Offset","cloudinary"),value:e.carouselOffset,onChange:e=>t({carouselOffset:e}),min:0,max:100,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Wt.createElement("p",null,(0,i.__)("Carousel Style","cloudinary")),Wt.createElement("p",null,Wt.createElement(s.ButtonGroup,null,w.map(r=>Wt.createElement(s.Button,{key:r.value+"-carousel-style",variant:"secondary",isSecondary:!0,isPressed:r.value===e.carouselStyle,onClick:()=>t({carouselStyle:r.value})},r.label)))),"thumbnails"===e.carouselStyle&&Wt.createElement(Wt.Fragment,null,Wt.createElement(s.RangeControl,{label:(0,i.__)("Width","cloudinary"),value:e.thumbnailProps_width,onChange:e=>t({thumbnailProps_width:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Wt.createElement(s.RangeControl,{label:(0,i.__)("Height","cloudinary"),value:e.thumbnailProps_height,onChange:e=>t({thumbnailProps_height:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Wt.createElement("p",null,(0,i.__)("Navigation Button Shape","cloudinary")),L.map(r=>Wt.createElement(B,{key:r.value+"-navigation-button-shape",value:r.value,onChange:e=>t({thumbnailProps_navigationShape:e}),icon:r.icon,current:e.thumbnailProps_navigationShape},r.label)),Wt.createElement("p",null,(0,i.__)("Selected Style","cloudinary")),Wt.createElement("p",null,Wt.createElement(s.ButtonGroup,null,O.map(r=>Wt.createElement(s.Button,{key:r.value+"-selected-style",variant:"secondary",isSecondary:!0,isPressed:r.value===e.thumbnailProps_selectedStyle,onClick:()=>t({thumbnailProps_selectedStyle:r.value})},r.label)))),Wt.createElement(s.SelectControl,{label:(0,i.__)("Selected Border Position","cloudinary"),value:e.thumbnailProps_selectedBorderPosition,options:j,onChange:e=>t({thumbnailProps_selectedBorderPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Wt.createElement(s.RangeControl,{label:(0,i.__)("Selected Border Width","cloudinary"),value:e.thumbnailProps_selectedBorderWidth,onChange:e=>t({thumbnailProps_selectedBorderWidth:e}),min:0,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Wt.createElement("p",null,(0,i.__)("Media Shape Icon","cloudinary")),k.map(r=>Wt.createElement(B,{key:r.value+"-media",value:r.value,onChange:e=>t({thumbnailProps_mediaSymbolShape:e}),icon:r.icon,current:e.thumbnailProps_mediaSymbolShape},r.label))),"indicators"===e.carouselStyle&&Wt.createElement(Wt.Fragment,null,Wt.createElement("p",null,(0,i.__)("Indicators Shape","cloudinary")),E.map(r=>Wt.createElement(B,{key:r.value+"-indicator",value:r.value,onChange:e=>t({indicatorProps_shape:e}),icon:r.icon,current:e.indicatorProps_shape},r.label)))),Wt.createElement(s.PanelBody,{title:(0,i.__)("Additional Settings","cloudinary"),initialOpen:!1},Wt.createElement(s.TextareaControl,{label:(0,i.__)("Custom Settings","cloudinary"),help:(0,i.__)("Provide a JSON string of the settings you want to add and/or override.","cloudinary"),value:u,onChange:e=>{let r={};p(e);try{r=JSON.parse(e)}catch(e){}if("object"==typeof r){const e={...c};e.customSettings=r,t({...c,...e})}},__nextHasNoMarginBottom:!0})))};var Ut=r(6087);const{cloudName:qt,mediaAssets:$t,...Gt}=(e=>{const t={};return Object.keys(e).forEach(r=>{t[r]={type:typeof e[r],default:e[r]}}),t})(new(t()())("_").dot(CLD_GALLERY_CONFIG)),Xt={};Object.keys(Gt).forEach(e=>{Xt[e]=Gt[e]?.default});const Jt=e=>({cloudName:"demo",...e,mediaAssets:[{tag:"shoes_product_gallery_demo",mediaType:"image"}],container:".gallery-preview"}),Yt=document.querySelector("#cloudinary-settings-page form");void 0!==Yt&&Yt.addEventListener("submit",function(e){(!e.submitter.name||e.submitter.name&&"cld_submission"!==e.submitter.name)&&e.preventDefault()});const Kt=()=>{const[e,r]=(0,n.useState)(Xt),o=CLD_THEME_COLORS.map(e=>({...e,color:T(e.color)})).filter(e=>0!==e.color.length);return(0,n.useEffect)(()=>{let r,n;const o=(e=>{const r=new(t()())("_"),n=a()(e),{selectedImages:o,...i}=r.object(n,{});return i.mediaAssets=o,"classic"!==i?.displayProps?.mode?delete i.transition:delete i.displayProps.columns,"pad"!==i?.transformation_crop&&delete i.transformation_background,"pad"!==i?.transformation?.crop&&delete i.transformation.background,i?.themeProps?.primary&&(i.themeProps.primary=T(i?.themeProps?.primary)),i?.themeProps?.onPrimary&&(i.themeProps.onPrimary=T(i?.themeProps?.onPrimary)),i?.themeProps?.active&&(i.themeProps.active=T(i?.themeProps?.active)),i})(e),{customSettings:i,...s}=o;try{try{n=JSON.parse(i)}catch{n=i}r=cloudinary.galleryWidget(Jt({...s,...n}))}catch{r=cloudinary.galleryWidget(Jt(s))}r.render();const l=document.getElementById("gallery_settings_input");return l&&(l.value=JSON.stringify(o)),()=>r.destroy()}),Ut.createElement("div",{className:"cld-gallery-settings-container"},Ut.createElement("div",{className:"cld-gallery-settings"},Ut.createElement("div",{className:"interface-interface-skeleton__sidebar cld-gallery-settings__column"},Ut.createElement("div",{className:"interface-complementary-area edit-post-sidebar"},Ut.createElement("div",{className:"components-panel"},Ut.createElement("div",{className:"block-editor-block-inspector"},Ut.createElement(Vt,{attributes:e,setAttributes:t=>{r({...e,...t})},colors:o}))))),Ut.createElement("div",{className:"gallery-preview cld-gallery-settings__column"})))},Qt=document.getElementById("app_gallery_gallery_config");n.createRoot?(0,n.createRoot)(Qt).render(Ut.createElement(Kt,null)):(0,n.render)(Ut.createElement(Kt,null),Qt)})()})(); //# sourceMappingURL=gallery.js.map \ No newline at end of file diff --git a/js/inline-loader.asset.php b/js/inline-loader.asset.php index 0e7de71fd..a95318ae6 100644 --- a/js/inline-loader.asset.php +++ b/js/inline-loader.asset.php @@ -1 +1,6 @@ - array(), 'version' => '628a48b80bb52b9b0738'); + array( + + ), + 'version' => '628a48b80bb52b9b0738' +); diff --git a/js/lazy-load.asset.php b/js/lazy-load.asset.php index abdfbb939..63f154eef 100644 --- a/js/lazy-load.asset.php +++ b/js/lazy-load.asset.php @@ -1 +1,6 @@ - array(), 'version' => 'f9ca20744898bd9abaec'); + array( + + ), + 'version' => 'f9ca20744898bd9abaec' +); diff --git a/js/media-modal.asset.php b/js/media-modal.asset.php index a0f87d7f3..2329c9903 100644 --- a/js/media-modal.asset.php +++ b/js/media-modal.asset.php @@ -1 +1,6 @@ - array(), 'version' => 'cffc26ed672e922e6588'); + array( + + ), + 'version' => 'cffc26ed672e922e6588' +); diff --git a/js/syntax-highlight.js b/js/syntax-highlight.js index da9fd03cf..43e25e532 100644 --- a/js/syntax-highlight.js +++ b/js/syntax-highlight.js @@ -1,2 +1,2 @@ -(()=>{"use strict";const t=1024;let e=0;class i{constructor(t,e){this.from=t,this.to=e}}class s{constructor(t={}){this.id=e++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof t&&(t=o.match(t)),e=>{let i=t(e);return void 0===i?null:[this,i]}}}s.closedBy=new s({deserialize:t=>t.split(" ")}),s.openedBy=new s({deserialize:t=>t.split(" ")}),s.group=new s({deserialize:t=>t.split(" ")}),s.isolate=new s({deserialize:t=>{if(t&&"rtl"!=t&&"ltr"!=t&&"auto"!=t)throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),s.contextHash=new s({perNode:!0}),s.lookAhead=new s({perNode:!0}),s.mounted=new s({perNode:!0});class n{constructor(t,e,i,s=!1){this.tree=t,this.overlay=e,this.parser=i,this.bracketed=s}static get(t){return t&&t.props&&t.props[s.mounted.id]}}const r=Object.create(null);class o{constructor(t,e,i,s=0){this.name=t,this.props=e,this.id=i,this.flags=s}static define(t){let e=t.props&&t.props.length?Object.create(null):r,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),s=new o(t.name||"",e,t.id,i);if(t.props)for(let i of t.props)if(Array.isArray(i)||(i=i(s)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[i[0].id]=i[1]}return s}prop(t){return this.props[t.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(t){if("string"==typeof t){if(this.name==t)return!0;let e=this.prop(s.group);return!!e&&e.indexOf(t)>-1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let s of i.split(" "))e[s]=t[i];return t=>{for(let i=t.prop(s.group),n=-1;n<(i?i.length:0);n++){let s=e[n<0?t.name:i[n]];if(s)return s}}}}o.none=new o("",Object.create(null),0,8);class l{constructor(t){this.types=t;for(let e=0;e=e){let n=new v(o.tree,o.overlay[0].from+t.from,-1,t);(r||(r=[s])).push(m(n,e,i,!1))}}return r?k(r):s}(this,t,e)}iterate(t){let{enter:e,leave:i,from:s=0,to:n=this.length}=t,r=t.mode||0,o=(r&c.IncludeAnonymous)>0;for(let t=this.cursor(r|c.IncludeAnonymous);;){let r=!1;if(t.from<=n&&t.to>=s&&(!o&&t.type.isAnonymous||!1!==e(t))){if(t.firstChild())continue;r=!0}for(;r&&i&&(o||!t.type.isAnonymous)&&i(t),!t.nextSibling();){if(!t.parent())return;r=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:T(o.none,this.children,this.positions,0,this.children.length,0,this.length,(t,e,i)=>new u(this.type,t,e,i,this.propValues),t.makeTree||((t,e,i)=>new u(o.none,t,e,i)))}static build(e){return function(e){var i;let{buffer:n,nodeSet:r,maxBufferLength:o=t,reused:l=[],minRepeatType:a=r.types.length}=e,h=Array.isArray(n)?new f(n,n.length):n,c=r.types,p=0,m=0;function g(t,e,i,s,n,u){let{id:f,start:S,end:C,size:A}=h,M=m,O=p;if(A<0){if(h.next(),-1==A){let e=l[f];return i.push(e),void s.push(S-t)}if(-3==A)return void(p=f);if(-4==A)return void(m=f);throw new RangeError(`Unrecognized record size: ${A}`)}let D,R,P=c[f],B=S-t;if(C-S<=o&&(R=x(h.pos-e,n))){let e=new Uint16Array(R.size-R.skip),i=h.pos-R.size,s=e.length;for(;h.pos>i;)s=k(R.start,e,s);D=new d(e,C-R.start,r),B=R.start-t}else{let t=h.pos-A;h.next();let e=[],i=[],s=f>=a?f:-1,n=0,r=C;for(;h.pos>t;)s>=0&&h.id==s&&h.size>=0?(h.end<=r-o&&(b(e,i,S,n,h.end,r,s,M,O),n=e.length,r=h.end),h.next()):u>2500?v(S,t,e,i):g(S,t,e,i,s,u+1);if(s>=0&&n>0&&n-1&&n>0){let t=w(P,O);D=T(P,e,i,0,e.length,0,C-S,t,t)}else D=y(P,e,i,C-S,M-C,O)}i.push(D),s.push(B)}function v(t,e,i,s){let n=[],l=0,a=-1;for(;h.pos>e;){let{id:t,start:e,end:i,size:s}=h;if(s>4)h.next();else{if(a>-1&&e=0;t-=3)e[i++]=n[t],e[i++]=n[t+1]-o,e[i++]=n[t+2]-o,e[i++]=i;i.push(new d(e,n[2]-o,r)),s.push(o-t)}}function w(t,e){return(i,n,r)=>{let o,l,a=0,h=i.length-1;if(h>=0&&(o=i[h])instanceof u){if(!h&&o.type==t&&o.length==r)return o;(l=o.prop(s.lookAhead))&&(a=n[h]+o.length+l)}return y(t,i,n,r,a,e)}}function b(t,e,i,s,n,o,l,a,h){let c=[],u=[];for(;t.length>s;)c.push(t.pop()),u.push(e.pop()+i-n);t.push(y(r.types[l],c,u,o-n,a-o,h)),e.push(n-i)}function y(t,e,i,n,r,o,l){if(o){let t=[s.contextHash,o];l=l?[t].concat(l):[t]}if(r>25){let t=[s.lookAhead,r];l=l?[t].concat(l):[t]}return new u(t,e,i,n,l)}function x(t,e){let i=h.fork(),s=0,n=0,r=0,l=i.end-o,c={size:0,start:0,skip:0};t:for(let o=i.pos-t;i.pos>o;){let t=i.size;if(i.id==e&&t>=0){c.size=s,c.start=n,c.skip=r,r+=4,s+=4,i.next();continue}let h=i.pos-t;if(t<0||h=a?4:0,f=i.start;for(i.next();i.pos>h;){if(i.size<0){if(-3!=i.size&&-4!=i.size)break t;u+=4}else i.id>=a&&(u+=4);i.next()}n=f,s+=t,r+=u}return(e<0||s==t)&&(c.size=s,c.start=n,c.skip=r),c.size>4?c:void 0}function k(t,e,i){let{id:s,start:n,end:r,size:o}=h;if(h.next(),o>=0&&s4){let s=h.pos-(o-4);for(;h.pos>s;)i=k(t,e,i)}e[--i]=l,e[--i]=r-t,e[--i]=n-t,e[--i]=s}else-3==o?p=s:-4==o&&(m=s);return i}let S=[],C=[];for(;h.pos>0;)g(e.start||0,e.bufferStart||0,S,C,-1,0);let A=null!==(i=e.length)&&void 0!==i?i:S.length?C[0]+S[0].length:0;return new u(c[e.topID],S.reverse(),C.reverse(),A)}(e)}}u.empty=new u(o.none,[],[],0);class f{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new f(this.buffer,this.index)}}class d{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return o.none}toString(){let t=[];for(let e=0;e0));l=r[l+3]);return o}slice(t,e,i){let s=this.buffer,n=new Uint16Array(e-t),r=0;for(let o=t,l=0;o=e&&ie;case 1:return i<=e&&s>e;case 2:return s>e;case 4:return!0}}function m(t,e,i,s){for(var n;t.from==t.to||(i<1?t.from>=e:t.from>e)||(i>-1?t.to<=e:t.to0?l.length:-1;t!=h;t+=e){let h,f=l[t],m=a[t]+o.from;if(r&c.EnterBracketed&&f instanceof u&&(h=n.get(f))&&!h.overlay&&h.bracketed&&i>=m&&i<=m+f.length||p(s,i,m,m+f.length))if(f instanceof d){if(r&c.ExcludeBuffers)continue;let n=f.findChild(0,f.buffer.length,e,i-m,s);if(n>-1)return new x(new y(o,f,t,m),null,n)}else if(r&c.IncludeAnonymous||!f.type.isAnonymous||A(f)){let l;if(!(r&c.IgnoreMounts)&&(l=n.get(f))&&!l.overlay)return new v(l.tree,m,t,o);let a=new v(f,m,t,o);return r&c.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(e<0?f.children.length-1:0,e,i,s,r)}}if(r&c.IncludeAnonymous||!o.type.isAnonymous)return null;if(t=o.index>=0?o.index+e:e<0?-1:o._parent._tree.children.length,o=o._parent,!o)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,e,i=0){let s;if(!(i&c.IgnoreOverlays)&&(s=n.get(this._tree))&&s.overlay){let n=t-this.from,r=i&c.EnterBracketed&&s.bracketed;for(let{from:t,to:i}of s.overlay)if((e>0||r?t<=n:t=n:i>n))return new v(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function w(t,e,i,s){let n=t.cursor(),r=[];if(!n.firstChild())return r;if(null!=i)for(let t=!1;!t;)if(t=n.type.is(i),!n.nextSibling())return r;for(;;){if(null!=s&&n.type.is(s))return r;if(n.type.is(e)&&r.push(n.node),!n.nextSibling())return null==s?r:[]}}function b(t,e,i=e.length-1){for(let s=t;i>=0;s=s.parent){if(!s)return!1;if(!s.type.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}class y{constructor(t,e,i,s){this.parent=t,this.buffer=e,this.index=i,this.start=s}}class x extends g{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:s}=this.context,n=s.findChild(this.index+4,s.buffer[this.index+3],t,e-this.context.start,i);return n<0?null:new x(this.context,this,n)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,e,i=0){if(i&c.ExcludeBuffers)return null;let{buffer:s}=this.context,n=s.findChild(this.index+4,s.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return n<0?null:new x(this.context,this,n)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new x(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new x(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,s=this.index+4,n=i.buffer[this.index+3];if(n>s){let r=i.buffer[this.index+1];t.push(i.slice(s,n,r)),e.push(0)}return new u(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function k(t){if(!t.length)return null;let e=0,i=t[0];for(let s=1;si.from||n.to0){if(this.index-1)for(let s=e+t,n=t<0?-1:i._tree.children.length;s!=n;s+=t){let t=i._tree.children[s];if(this.mode&c.IncludeAnonymous||t instanceof d||!t.type.isAnonymous||A(t))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to=0;){for(let r=t;r;r=r._parent)if(r.index==s){if(s==this.index)return r;e=r,i=n+1;break t}s=this.stack[--n]}for(let t=i;t=0;n--){if(n<0)return b(this._tree,t,s);let r=i[e.buffer[this.stack[n]]];if(!r.isAnonymous){if(t[s]&&t[s]!=r.name)return!1;s--}}return!0}}function A(t){return t.children.some(t=>t instanceof d||!t.type.isAnonymous||A(t))}const M=new WeakMap;function O(t,e){if(!t.isAnonymous||e instanceof d||e.type!=t)return 1;let i=M.get(e);if(null==i){i=1;for(let s of e.children){if(s.type!=t||!(s instanceof u)){i=1;break}i+=O(t,s)}M.set(e,i)}return i}function T(t,e,i,s,n,r,o,l,a){let h=0;for(let i=s;i=c)break;p+=e}if(h==n+1){if(p>c){let t=i[n];e(t.children,t.positions,0,t.children.length,s[n]+l);continue}u.push(i[n])}else{let e=s[h-1]+i[h-1].length-d;u.push(T(t,i,s,n,h,d,e,null,a))}f.push(d+l-r)}}(e,i,s,n,0),(l||a)(u,f,o)}class D{constructor(t,e,i,s,n=!1,r=!1){this.from=t,this.to=e,this.tree=i,this.offset=s,this.open=(n?1:0)|(r?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(t,e=[],i=!1){let s=[new D(0,t.length,t,0,!1,i)];for(let i of e)i.to>t.length&&s.push(i);return s}static applyChanges(t,e,i=128){if(!e.length)return t;let s=[],n=1,r=t.length?t[0]:null;for(let o=0,l=0,a=0;;o++){let h=o=i)for(;r&&r.from=e.from||c<=e.to||a){let t=Math.max(e.from,l)-a,i=Math.min(e.to,c)-a;e=t>=i?null:new D(t,i,e.tree,e.offset+a,o>0,!!h)}if(e&&s.push(e),r.to>c)break;r=nnew i(t.from,t.to)):[new i(0,0)]:[new i(0,t.length)],this.createParse(t,e||[],s)}parse(t,e,i){let s=this.startParse(t,e,i);for(;;){let t=s.advance();if(t)return t}}}class P{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}new s({perNode:!0});class B{constructor(t,e,i,s,n,r,o,l,a,h=0,c){this.p=t,this.stack=e,this.state=i,this.reducePos=s,this.pos=n,this.score=r,this.buffer=o,this.bufferBase=l,this.curContext=a,this.lookAhead=h,this.parent=c}toString(){return`[${this.stack.filter((t,e)=>e%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,i=0){let s=t.parser.context;return new B(t,[],e,i,i,0,[],0,s?new E(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let i=t>>19,s=65535&t,{parser:n}=this.p,r=this.reducePos=2e3&&!(null===(e=this.p.parser.nodeSet.types[s])||void 0===e?void 0:e.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(s,a)}storeNode(t,e,i,s=4,n=!1){if(0==t&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==this.buffer[t-4]&&this.buffer[t-1]>-1){if(e==i)return;if(this.buffer[t-2]>=e)return void(this.buffer[t-2]=i)}}if(n&&this.pos!=i){let n=this.buffer.length;if(n>0&&(0!=this.buffer[n-4]||this.buffer[n-1]<0)){let t=!1;for(let e=n;e>0&&this.buffer[e-2]>i;e-=4)if(this.buffer[e-1]>=0){t=!0;break}if(t)for(;n>0&&this.buffer[n-2]>i;)this.buffer[n]=this.buffer[n-4],this.buffer[n+1]=this.buffer[n-3],this.buffer[n+2]=this.buffer[n-2],this.buffer[n+3]=this.buffer[n-1],n-=4,s>4&&(s-=4)}this.buffer[n]=t,this.buffer[n+1]=e,this.buffer[n+2]=i,this.buffer[n+3]=s}else this.buffer.push(t,e,i,s)}shift(t,e,i,s){if(131072&t)this.pushState(65535&t,this.pos);else if(262144&t)this.pos=s,this.shiftContext(e,i),e<=this.p.parser.maxNode&&this.buffer.push(e,i,s,4);else{let n=t,{parser:r}=this.p;this.pos=s;let o=r.stateFlag(n,1);!o&&(s>i||e<=r.maxNode)&&(this.reducePos=s),this.pushState(n,o?i:Math.min(i,this.reducePos)),this.shiftContext(e,i),e<=r.maxNode&&this.buffer.push(e,i,s,4)}}apply(t,e,i,s){65536&t?this.reduce(t):this.shift(t,e,i,s)}useNode(t,e){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let s=this.pos;this.reducePos=this.pos=s+t.length,this.pushState(e,s),this.buffer.push(i,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(e&&0==t.buffer[e-4]&&(e-=4);e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let i=t.buffer.slice(e),s=t.bufferBase+e;for(;t&&s==t.bufferBase;)t=t.parent;return new B(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,s,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,i?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new L(this);;){let i=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(0==i)return!1;if(!(65536&i))return!0;e.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let i=[];for(let s,n=0;n1&e&&t==s)||i.push(e[t],s)}e=i}let i=[];for(let t=0;t>19,s=65535&e,n=this.stack.length-3*i;if(n<0||t.getGoto(this.stack[n],s,!1)<0){let t=this.findForcedReduction();if(null==t)return!1;e=t}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}findForcedReduction(){let{parser:t}=this.p,e=[],i=(s,n)=>{if(!e.includes(s))return e.push(s),t.allActions(s,e=>{if(393216&e);else if(65536&e){let i=(e>>19)-n;if(i>1){let s=65535&e,n=this.stack.length-3*i;if(n>=0&&t.getGoto(this.stack[n],s,!1)>=0)return i<<19|65536|s}}else{let t=i(e,n+1);if(null!=t)return t}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:t}=this.p;return 65535==t.data[t.stateSlot(this.state,1)]&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;e0&&this.emitLookAhead()}}class E{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}class L{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=65535&t,i=t>>19;0==i?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(i-1);let s=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=s}}class N{constructor(t,e,i){this.stack=t,this.pos=e,this.index=i,this.buffer=t.buffer,0==this.index&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new N(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;null!=t&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new N(this.stack,this.pos,this.index)}}function I(t,e=Uint16Array){if("string"!=typeof t)return t;let i=null;for(let s=0,n=0;s=92&&e--,e>=34&&e--;let n=e-32;if(n>=46&&(n-=46,i=!0),r+=n,i)break;r*=46}i?i[n++]=r:i=new e(r)}return i}class W{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const H=new W;class V{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=H,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let i=this.range,s=this.rangeIndex,n=this.pos+t;for(;ni.to:n>=i.to;){if(s==this.ranges.length-1)return null;let t=this.ranges[++s];n+=t.from-i.to,i=t}return n}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,e.from);return this.end}peek(t){let e,i,s=this.chunkOff+t;if(s>=0&&s=this.chunk2Pos&&es.to&&(this.chunk2=this.chunk2.slice(0,s.to-e)),i=this.chunk2.charCodeAt(0)}}return e>=this.token.lookAhead&&(this.token.lookAhead=e+1),i}acceptToken(t,e=0){let i=e?this.resolveOffset(e,-1):this.pos;if(null==i||i=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=H,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let i="";for(let s of this.ranges){if(s.from>=e)break;s.to>t&&(i+=this.input.read(Math.max(s.from,t),Math.min(s.to,e)))}return i}}class F{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:i}=e.p;z(this.data,t,e,this.id,i.data,i.tokenPrecTable)}}F.prototype.contextual=F.prototype.fallback=F.prototype.extend=!1;F.prototype.fallback=F.prototype.extend=!1;function z(t,e,i,s,n,r){let o=0,l=1<0){let i=t[s];if(a.allows(i)&&(-1==e.token.value||e.token.value==i||_(i,e.token.value,n,r))){e.acceptToken(i);break}}let s=e.next,h=0,c=t[o+2];if(!(e.next<0&&c>h&&65535==t[i+3*c-3])){for(;h>1,r=i+n+(n<<1),l=t[r],a=t[r+1]||65536;if(s=a)){o=t[r+2],e.advance();continue t}h=n+1}}break}o=t[i+3*c-1]}}function q(t,e,i){for(let s,n=e;65535!=(s=t[n]);n++)if(s==i)return n-e;return-1}function _(t,e,i,s){let n=q(i,s,e);return n<0||q(i,s,t)e)&&!s.type.isError)return i<0?Math.max(0,Math.min(s.to-1,e-25)):Math.min(t.length,Math.max(s.from+1,e+25));if(i<0?s.prevSibling():s.nextSibling())break;if(!s.parent())return i<0?0:t.length}}class U{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?K(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?K(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=o,null;if(r instanceof u){if(o==t){if(o=Math.max(this.safeFrom,t)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[e]++,this.nextStart=o+r.length}}}class Y{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(t=>new W)}getActions(t){let e=0,i=null,{parser:s}=t.p,{tokenizers:n}=s,r=s.stateSlot(t.state,3),o=t.curContext?t.curContext.hash:0,l=0;for(let s=0;sh.end+25&&(l=Math.max(h.lookAhead,l)),0!=h.value)){let s=e;if(h.extended>-1&&(e=this.addActions(t,h.extended,h.end,e)),e=this.addActions(t,h.value,h.end,e),!a.extend&&(i=h,e>s))break}}for(;this.actions.length>e;)this.actions.pop();return l&&t.setLookAhead(l),i||t.pos!=this.stream.end||(i=new W,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,e=this.addActions(t,i.value,i.end,e)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new W,{pos:i,p:s}=t;return e.start=i,e.end=Math.min(i+1,s.stream.end),e.value=i==s.stream.end?s.parser.eofTerm:0,e}updateCachedToken(t,e,i){let s=this.stream.clipPos(i.pos);if(e.token(this.stream.reset(s,t),i),t.value>-1){let{parser:e}=i.p;for(let s=0;s=0&&i.p.parser.dialect.allows(n>>1)){1&n?t.extended=n>>1:t.value=n>>1;break}}}else t.value=0,t.end=this.stream.clipPos(s+1)}putAction(t,e,i,s){for(let e=0;e4*t.bufferLength?new U(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t,e,i=this.stacks,s=this.minStackPos,n=this.stacks=[];if(this.bigReductionCount>300&&1==i.length){let[t]=i;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let r=0;rs)n.push(o);else{if(this.advanceStack(o,n,i))continue;{t||(t=[],e=[]),t.push(o);let i=this.tokens.getMainToken(o);e.push(i.value,i.end)}}break}}if(!n.length){let e=t&&function(t){let e=null;for(let i of t){let t=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=t&&i.pos>t)&&i.p.parser.stateFlag(i.state,2)&&(!e||e.scorethis.stoppedAt?t[0]:this.runRecovery(t,e,n);if(i)return $&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let t=1==this.recovering?1:3*this.recovering;if(n.length>t)for(n.sort((t,e)=>e.score-t.score);n.length>t;)n.pop();n.some(t=>t.reducePos>s)&&this.recovering--}else if(n.length>1){t:for(let t=0;t500&&s.buffer.length>500){if(!((e.score-s.score||e.buffer.length-s.buffer.length)>0)){n.splice(t--,1);continue t}n.splice(i--,1)}}}n.length>12&&(n.sort((t,e)=>e.score-t.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let t=1;t ":"";if(null!=this.stoppedAt&&n>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let e=t.curContext&&t.curContext.tracker.strict,i=e?t.curContext.hash:0;for(let l=this.fragments.nodeAt(n);l;){let n=this.parser.nodeSet.types[l.type.id]==l.type?r.getGoto(t.state,l.type.id):-1;if(n>-1&&l.length&&(!e||(l.prop(s.contextHash)||0)==i))return t.useNode(l,n),$&&console.log(o+this.stackID(t)+` (via reuse of ${r.getName(l.type.id)})`),!0;if(!(l instanceof u)||0==l.children.length||l.positions[0]>0)break;let a=l.children[0];if(!(a instanceof u&&0==l.positions[0]))break;l=a}}let l=r.stateSlot(t.state,4);if(l>0)return t.reduce(l),$&&console.log(o+this.stackID(t)+` (via always-reduce ${r.getName(65535&l)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let a=this.tokens.getActions(t);for(let s=0;sn?e.push(f):i.push(f)}return!1}advanceFully(t,e){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return G(t,e),!0}}runRecovery(t,e,i){let s=null,n=!1;for(let r=0;r ":"";if(o.deadEnd){if(n)continue;if(n=!0,o.restart(),$&&console.log(h+this.stackID(o)+" (restarted)"),this.advanceFully(o,i))continue}let c=o.split(),u=h;for(let t=0;t<10&&c.forceReduce();t++){if($&&console.log(u+this.stackID(c)+" (via force-reduce)"),this.advanceFully(c,i))break;$&&(u=this.stackID(c)+" -> ")}for(let t of o.recoverByInsert(l))$&&console.log(h+this.stackID(t)+" (via recover-insert)"),this.advanceFully(t,i);this.stream.end>o.pos?(a==o.pos&&(a++,l=0),o.recoverByDelete(l,a),$&&console.log(h+this.stackID(o)+` (via recover-delete ${this.parser.getName(l)})`),G(o,i)):(!s||s.scoret.topRules[e][1]),n=[];for(let t=0;t=0)r(s,t,e[i++]);else{let n=e[i+-s];for(let o=-s;o>0;o--)r(e[i++],t,n);i++}}}this.nodeSet=new l(e.map((e,s)=>o.define({name:s>=this.minRepeatTerm?void 0:e,id:s,props:n[s],top:i.indexOf(s)>-1,error:0==s,skipped:t.skippedNodes&&t.skippedNodes.indexOf(s)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=1024;let a=I(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let t=0;t"number"==typeof t?new F(a,t):t),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,i){let s=new Q(this,t,e,i);for(let n of this.wrappers)s=n(s,t,e,i);return s}getGoto(t,e,i=!1){let s=this.goto;if(e>=s[0])return-1;for(let n=s[e+1];;){let e=s[n++],r=1&e,o=s[n++];if(r&&i)return o;for(let i=n+(e>>1);n0}validAction(t,e){return!!this.allActions(t,t=>t==e||null)}allActions(t,e){let i=this.stateSlot(t,4),s=i?e(i):void 0;for(let i=this.stateSlot(t,1);null==s;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=Z(this.data,i+2)}s=e(Z(this.data,i+1))}return s}nextStates(t){let e=[];for(let i=this.stateSlot(t,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=Z(this.data,i+2)}if(!(1&this.data[i+2])){let t=this.data[i+1];e.some((e,i)=>1&i&&e==t)||e.push(this.data[i],t)}}return e}configure(t){let e=Object.assign(Object.create(J.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=i}return t.tokenizers&&(e.tokenizers=this.tokenizers.map(e=>{let i=t.tokenizers.find(t=>t.from==e);return i?i.to:e})),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map((i,s)=>{let n=t.specializers.find(t=>t.from==i.external);if(!n)return i;let r=Object.assign(Object.assign({},i),{external:n.to});return e.specializers[s]=tt(r),r})),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),null!=t.strict&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),null!=t.bufferLength&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return null==e?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),i=e.map(()=>!1);if(t)for(let s of t.split(" ")){let t=e.indexOf(s);t>=0&&(i[t]=!0)}let s=null;for(let t=0;tt.external(i,s)<<1|e}return t.get}let et=0;class it{constructor(t,e,i,s){this.name=t,this.set=e,this.base=i,this.modified=s,this.id=et++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let i="string"==typeof t?t:"?";if(t instanceof it&&(e=t),null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let s=new it(i,[],null,[]);if(s.set.push(s),e)for(let t of e.set)s.set.push(t);return s}static defineModifier(t){let e=new nt(t);return t=>t.modified.indexOf(e)>-1?t:nt.get(t.base||t,t.modified.concat(e).sort((t,e)=>t.id-e.id))}}let st=0;class nt{constructor(t){this.name=t,this.instances=[],this.id=st++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find(i=>{return i.base==t&&(s=e,n=i.modified,s.length==n.length&&s.every((t,e)=>t==n[e]));var s,n});if(i)return i;let s=[],n=new it(t.name,s,t,e);for(let t of e)t.instances.push(n);let r=function(t){let e=[[]];for(let i=0;ie.length-t.length)}(e);for(let e of t.set)if(!e.modified.length)for(let t of r)s.push(nt.get(e,t));return n}}function rt(t){let e=Object.create(null);for(let i in t){let s=t[i];Array.isArray(s)||(s=[s]);for(let t of i.split(" "))if(t){let i=[],n=2,r=t;for(let e=0;;){if("..."==r&&e>0&&e+3==t.length){n=1;break}let s=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(r);if(!s)throw new RangeError("Invalid path: "+t);if(i.push("*"==s[0]?"":'"'==s[0][0]?JSON.parse(s[0]):s[0]),e+=s[0].length,e==t.length)break;let o=t[e++];if(e==t.length&&"!"==o){n=0;break}if("/"!=o)throw new RangeError("Invalid path: "+t);r=t.slice(e)}let o=i.length-1,l=i[o];if(!l)throw new RangeError("Invalid path: "+t);let a=new lt(s,n,o>0?i.slice(0,o):null);e[l]=a.sort(e[l])}}return ot.add(e)}const ot=new s({combine(t,e){let i,s,n;for(;t||e;){if(!t||e&&t.depth>=e.depth?(n=e,e=e.next):(n=t,t=t.next),i&&i.mode==n.mode&&!n.context&&!i.context)continue;let r=new lt(n.tags,n.mode,n.context);i?i.next=r:s=r,i=r}return s}});class lt{constructor(t,e,i,s){this.tags=t,this.mode=e,this.context=i,this.next=s}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(t){return!t||t.depth{let e=n;for(let s of t)for(let t of s.set){let s=i[t.id];if(s){e=e?e+" "+s:s;break}}return e},scope:s}}function ht(t,e,i,s=0,n=t.length){let r=new ct(s,Array.isArray(e)?e:[e],i);r.highlightRange(t.cursor(),s,n,"",r.highlighters),r.flush(n)}lt.empty=new lt([],2,null);class ct{constructor(t,e,i){this.at=t,this.highlighters=e,this.span=i,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,i,n,r){let{type:o,from:l,to:a}=t;if(l>=i||a<=e)return;o.isTop&&(r=this.highlighters.filter(t=>!t.scope||t.scope(o)));let h=n,c=function(t){let e=t.type.prop(ot);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}(t)||lt.empty,u=function(t,e){let i=null;for(let s of t){let t=s.style(e);t&&(i=i?i+" "+t:t)}return i}(r,c.tags);if(u&&(h&&(h+=" "),h+=u,1==c.mode&&(n+=(n?" ":"")+u)),this.startSpan(Math.max(e,l),h),c.opaque)return;let f=t.tree&&t.tree.prop(s.mounted);if(f&&f.overlay){let s=t.node.enter(f.overlay[0].from+l,1),o=this.highlighters.filter(t=>!t.scope||t.scope(f.tree.type)),c=t.firstChild();for(let u=0,d=l;;u++){let p=u=m)&&t.nextSibling()););if(!p||m>i)break;d=p.to+l,d>e&&(this.highlightRange(s.cursor(),Math.max(e,p.from+l),Math.min(i,d),"",o),this.startSpan(Math.min(i,d),h))}c&&t.parent()}else if(t.firstChild()){f&&(n="");do{if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,n,r),this.startSpan(Math.min(i,t.to),h)}}while(t.nextSibling());t.parent()}}}const ut=it.define,ft=ut(),dt=ut(),pt=ut(dt),mt=ut(dt),gt=ut(),vt=ut(gt),wt=ut(gt),bt=ut(),yt=ut(bt),xt=ut(),kt=ut(),St=ut(),Ct=ut(St),At=ut(),Mt={comment:ft,lineComment:ut(ft),blockComment:ut(ft),docComment:ut(ft),name:dt,variableName:ut(dt),typeName:pt,tagName:ut(pt),propertyName:mt,attributeName:ut(mt),className:ut(dt),labelName:ut(dt),namespace:ut(dt),macroName:ut(dt),literal:gt,string:vt,docString:ut(vt),character:ut(vt),attributeValue:ut(vt),number:wt,integer:ut(wt),float:ut(wt),bool:ut(gt),regexp:ut(gt),escape:ut(gt),color:ut(gt),url:ut(gt),keyword:xt,self:ut(xt),null:ut(xt),atom:ut(xt),unit:ut(xt),modifier:ut(xt),operatorKeyword:ut(xt),controlKeyword:ut(xt),definitionKeyword:ut(xt),moduleKeyword:ut(xt),operator:kt,derefOperator:ut(kt),arithmeticOperator:ut(kt),logicOperator:ut(kt),bitwiseOperator:ut(kt),compareOperator:ut(kt),updateOperator:ut(kt),definitionOperator:ut(kt),typeOperator:ut(kt),controlOperator:ut(kt),punctuation:St,separator:ut(St),bracket:Ct,angleBracket:ut(Ct),squareBracket:ut(Ct),paren:ut(Ct),brace:ut(Ct),content:bt,heading:yt,heading1:ut(yt),heading2:ut(yt),heading3:ut(yt),heading4:ut(yt),heading5:ut(yt),heading6:ut(yt),contentSeparator:ut(bt),list:ut(bt),quote:ut(bt),emphasis:ut(bt),strong:ut(bt),link:ut(bt),monospace:ut(bt),strikethrough:ut(bt),inserted:ut(),deleted:ut(),changed:ut(),invalid:ut(),meta:At,documentMeta:ut(At),annotation:ut(At),processingInstruction:ut(At),definition:it.defineModifier("definition"),constant:it.defineModifier("constant"),function:it.defineModifier("function"),standard:it.defineModifier("standard"),local:it.defineModifier("local"),special:it.defineModifier("special")};for(let t in Mt){let e=Mt[t];e instanceof it&&(e.name=t)}at([{tag:Mt.link,class:"tok-link"},{tag:Mt.heading,class:"tok-heading"},{tag:Mt.emphasis,class:"tok-emphasis"},{tag:Mt.strong,class:"tok-strong"},{tag:Mt.keyword,class:"tok-keyword"},{tag:Mt.atom,class:"tok-atom"},{tag:Mt.bool,class:"tok-bool"},{tag:Mt.url,class:"tok-url"},{tag:Mt.labelName,class:"tok-labelName"},{tag:Mt.inserted,class:"tok-inserted"},{tag:Mt.deleted,class:"tok-deleted"},{tag:Mt.literal,class:"tok-literal"},{tag:Mt.string,class:"tok-string"},{tag:Mt.number,class:"tok-number"},{tag:[Mt.regexp,Mt.escape,Mt.special(Mt.string)],class:"tok-string2"},{tag:Mt.variableName,class:"tok-variableName"},{tag:Mt.local(Mt.variableName),class:"tok-variableName tok-local"},{tag:Mt.definition(Mt.variableName),class:"tok-variableName tok-definition"},{tag:Mt.special(Mt.variableName),class:"tok-variableName2"},{tag:Mt.definition(Mt.propertyName),class:"tok-propertyName tok-definition"},{tag:Mt.typeName,class:"tok-typeName"},{tag:Mt.namespace,class:"tok-namespace"},{tag:Mt.className,class:"tok-className"},{tag:Mt.macroName,class:"tok-macroName"},{tag:Mt.propertyName,class:"tok-propertyName"},{tag:Mt.operator,class:"tok-operator"},{tag:Mt.comment,class:"tok-comment"},{tag:Mt.meta,class:"tok-meta"},{tag:Mt.invalid,class:"tok-invalid"},{tag:Mt.punctuation,class:"tok-punctuation"}]);const Ot=rt({String:Mt.string,Number:Mt.number,"True False":Mt.bool,PropertyName:Mt.propertyName,Null:Mt.null,", :":Mt.separator,"[ ]":Mt.squareBracket,"{ }":Mt.brace}),Tt=J.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[Ot],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});let Dt=[],Rt=[];function Pt(t){if(t<768)return!1;for(let e=0,i=Dt.length;;){let s=e+i>>1;if(t=Rt[s]))return!0;e=s+1}if(e==i)return!1}}function Bt(t){return t>=127462&&t<=127487}(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let e=0,i=0;e=0&&Bt(It(t,s));)i++,s-=2;if(i%2==0)break;e+=2}}}return e}function Nt(t,e,i){for(;e>0;){let s=Lt(t,e-2,i);if(s=56320&&t<57344}function Ht(t){return t>=55296&&t<56320}function Vt(t){return t<65536?1:2}class Ft{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=Qt(this,t,e);let s=[];return this.decompose(0,t,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(e,this.length,s,1),qt.from(s,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=Qt(this,t,e);let i=[];return this.decompose(t,e,i,0),qt.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),s=new jt(this),n=new jt(t);for(let t=e,r=e;;){if(s.next(t),n.next(t),t=0,s.lineBreak!=n.lineBreak||s.done!=n.done||s.value!=n.value)return!1;if(r+=s.value.length,s.done||r>=i)return!0}}iter(t=1){return new jt(this,t)}iterRange(t,e=this.length){return new Kt(this,t,e)}iterLines(t,e){let i;if(null==t)i=this.iter();else{null==e&&(e=this.lines+1);let s=this.line(t).from;i=this.iterRange(s,Math.max(s,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new Ut(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new zt(t):qt.from(zt.split(t,[])):Ft.empty}}class zt extends Ft{constructor(t,e=function(t){let e=-1;for(let i of t)e+=i.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,s){for(let n=0;;n++){let r=this.text[n],o=s+r.length;if((e?i:o)>=t)return new Yt(s,o,i,r);s=o+1,i++}}decompose(t,e,i,s){let n=t<=0&&e>=this.length?this:new zt($t(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&s){let t=i.pop(),e=_t(n.text,t.text.slice(),0,n.length);if(e.length<=32)i.push(new zt(e,t.length+n.length));else{let t=e.length>>1;i.push(new zt(e.slice(0,t)),new zt(e.slice(t)))}}else i.push(n)}replace(t,e,i){if(!(i instanceof zt))return super.replace(t,e,i);[t,e]=Qt(this,t,e);let s=_t(this.text,_t(i.text,$t(this.text,0,t)),e),n=this.length+i.length-(e-t);return s.length<=32?new zt(s,n):qt.from(zt.split(s,[]),n)}sliceString(t,e=this.length,i="\n"){[t,e]=Qt(this,t,e);let s="";for(let n=0,r=0;n<=e&&rt&&r&&(s+=i),tn&&(s+=o.slice(Math.max(0,t-n),e-n)),n=l+1}return s}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],s=-1;for(let n of t)i.push(n),s+=n.length+1,32==i.length&&(e.push(new zt(i,s)),i=[],s=-1);return s>-1&&e.push(new zt(i,s)),e}}class qt extends Ft{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let e of t)this.lines+=e.lines}lineInner(t,e,i,s){for(let n=0;;n++){let r=this.children[n],o=s+r.length,l=i+r.lines-1;if((e?l:o)>=t)return r.lineInner(t,e,i,s);s=o+1,i=l+1}}decompose(t,e,i,s){for(let n=0,r=0;r<=e&&n=r){let n=s&((r<=t?1:0)|(l>=e?2:0));r>=t&&l<=e&&!n?i.push(o):o.decompose(t-r,e-r,i,n)}r=l+1}}replace(t,e,i){if([t,e]=Qt(this,t,e),i.lines=n&&e<=o){let l=r.replace(t-n,e-n,i),a=this.lines-r.lines+l.lines;if(l.lines>4&&l.lines>a>>6){let n=this.children.slice();return n[s]=l,new qt(n,this.length-(e-t)+i.length)}return super.replace(n,o,l)}n=o+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i="\n"){[t,e]=Qt(this,t,e);let s="";for(let n=0,r=0;nt&&n&&(s+=i),tr&&(s+=o.sliceString(t-r,e-r,i)),r=l+1}return s}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof qt))return 0;let i=0,[s,n,r,o]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;s+=e,n+=e){if(s==r||n==o)return i;let l=this.children[s],a=t.children[n];if(l!=a)return i+l.scanIdentical(a,e);i+=l.length+1}}static from(t,e=t.reduce((t,e)=>t+e.length+1,-1)){let i=0;for(let e of t)i+=e.lines;if(i<32){let i=[];for(let e of t)e.flatten(i);return new zt(i,e)}let s=Math.max(32,i>>5),n=s<<1,r=s>>1,o=[],l=0,a=-1,h=[];function c(t){let e;if(t.lines>n&&t instanceof qt)for(let e of t.children)c(e);else t.lines>r&&(l>r||!l)?(u(),o.push(t)):t instanceof zt&&l&&(e=h[h.length-1])instanceof zt&&t.lines+e.lines<=32?(l+=t.lines,a+=t.length+1,h[h.length-1]=new zt(e.text.concat(t.text),e.length+1+t.length)):(l+t.lines>s&&u(),l+=t.lines,a+=t.length+1,h.push(t))}function u(){0!=l&&(o.push(1==h.length?h[0]:qt.from(h,a)),a=-1,l=h.length=0)}for(let e of t)c(e);return u(),1==o.length?o[0]:new qt(o,e)}}function _t(t,e,i=0,s=1e9){for(let n=0,r=0,o=!0;r=i&&(a>s&&(l=l.slice(0,s-n)),n0?1:(t instanceof zt?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],n=this.offsets[i],r=n>>1,o=s instanceof zt?s.text.length:s.children.length;if(r==(e>0?o:0)){if(0==i)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&n)==(e>0?0:1)){if(this.offsets[i]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(s instanceof zt){let n=s.text[r+(e<0?-1:0)];if(this.offsets[i]+=e,n.length>Math.max(0,t))return this.value=0==t?n:e>0?n.slice(t):n.slice(0,n.length-t),this;t-=n.length}else{let n=s.children[r+(e<0?-1:0)];t>n.length?(t-=n.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(n),this.offsets.push(e>0?1:(n instanceof zt?n.text.length:n.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class Kt{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new jt(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:s}=this.cursor.next(t);return this.pos+=(s.length+t)*e,this.value=s.length<=i?s:e<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class Ut{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:s}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(Ft.prototype[Symbol.iterator]=function(){return this.iter()},jt.prototype[Symbol.iterator]=Kt.prototype[Symbol.iterator]=Ut.prototype[Symbol.iterator]=function(){return this});class Yt{constructor(t,e,i,s){this.from=t,this.to=e,this.number=i,this.text=s}get length(){return this.to-this.from}}function Qt(t,e,i){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,i))]}function Gt(t,e,i=!0,s=!0){return Et(t,e,i,s)}function Xt(t,e){let i=t.charCodeAt(e);if(!(s=i,s>=55296&&s<56320&&e+1!=t.length))return i;var s;let n=t.charCodeAt(e+1);return function(t){return t>=56320&&t<57344}(n)?n-56320+(i-55296<<10)+65536:i}function Jt(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function Zt(t){return t<65536?1:2}const te=/\r\n?|\n/;var ee=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(ee||(ee={}));class ie{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;et)return n+(t-s);n+=o}else{if(i!=ee.Simple&&a>=t&&(i==ee.TrackDel&&st||i==ee.TrackBefore&&st))return null;if(a>t||a==t&&e<0&&!o)return t==s||e<0?n:n+l;n+=l}s=a}if(t>s)throw new RangeError(`Position ${t} is out of range for changeset of length ${s}`);return n}touchesRange(t,e=t){for(let i=0,s=0;i=0&&s<=e&&n>=t)return!(se)||"cover";s=n}return!1}toString(){let t="";for(let e=0;e=0?":"+s:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(t=>"number"!=typeof t))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ie(t)}static create(t){return new ie(t)}}class se extends ie{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return oe(this,(e,i,s,n,r)=>t=t.replace(s,s+(i-e),r),!1),t}mapDesc(t,e=!1){return le(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let s=0,n=0;s=0){e[s]=o,e[s+1]=r;let l=s>>1;for(;i.length0&&re(i,e,n.text),n.forward(t),o+=t}let a=t[r++];for(;o>1].toJSON()))}return t}static of(t,e,i){let s=[],n=[],r=0,o=null;function l(t=!1){if(!t&&!s.length)return;ro||t<0||o>e)throw new RangeError(`Invalid change range ${t} to ${o} (in doc of length ${e})`);let c=h?"string"==typeof h?Ft.of(h.split(i||te)):h:Ft.empty,u=c.length;if(t==o&&0==u)return;tr&&ne(s,t-r,-1),ne(s,o-t,u),re(n,s,c),r=o}}(t),l(!o),o}static empty(t){return new se(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let s=0;se&&"string"!=typeof t))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==n.length)e.push(n[0],0);else{for(;i.length=0&&i<=0&&i==t[n+1]?t[n]+=e:n>=0&&0==e&&0==t[n]?t[n+1]+=i:s?(t[n]+=e,t[n+1]+=i):t.push(e,i)}function re(t,e,i){if(0==i.length)return;let s=e.length-2>>1;if(s>1])),!(i||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],a=t.sections[o++];e(n,h,r,c,u),n=h,r=c}}}function le(t,e,i,s=!1){let n=[],r=s?[]:null,o=new he(t),l=new he(e);for(let t=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(-1==o.ins&&-1==l.ins){let t=Math.min(o.len,l.len);ne(n,t,-1),o.forward(t),l.forward(t)}else if(l.ins>=0&&(o.ins<0||t==o.i||0==o.off&&(l.len=0&&t=0)){if(o.done&&l.done)return r?se.createSet(n,r):ie.create(n);throw new Error("Mismatched change set lengths")}{let e=0,i=o.len;for(;i;)if(-1==l.ins){let t=Math.min(i,l.len);e+=t,i-=t,l.forward(t)}else{if(!(0==l.ins&&l.lene||o.ins>=0&&o.len>e)&&(t||s.length>i),r.forward2(e),o.forward(e)}}else ne(s,0,o.ins,t),n&&re(n,s,o.text),o.next()}}class he{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return e>=t.length?Ft.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?Ft.empty:e[i].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class ce{constructor(t,e,i,s){this.from=t,this.to=e,this.flags=i,this.goalColumn=s}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get undirectional(){return(64&this.flags)>0}get bidiLevel(){let t=7&this.flags;return 7==t?null:t}map(t,e=-1){let i,s;return this.empty?i=s=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),s=t.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new ce(i,s,this.flags,this.goalColumn)}extend(t,e=t,i=0){if(t<=this.anchor&&e>=this.anchor)return ue.range(t,e,void 0,void 0,i);let s=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return ue.range(this.anchor,s,void 0,void 0,i)}eq(t,e=!1){return!(this.anchor!=t.anchor||this.head!=t.head||this.goalColumn!=t.goalColumn||e&&this.empty&&this.assoc!=t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return ue.range(t.anchor,t.head)}static create(t,e,i,s){return new ce(t,e,i,s)}}class ue{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:ue.create(this.ranges.map(i=>i.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ue(t.ranges.map(t=>ce.fromJSON(t)),t.main)}static single(t,e=t){return new ue([ue.range(t,e)],0)}static create(t,e=0){if(0==t.length)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;st.from-e.from),e=t.indexOf(i);for(let i=1;is.head?ue.range(o,r):ue.range(r,o))}}return new ue(t,e)}}function fe(t,e){for(let i of t.ranges)if(i.to>e)throw new RangeError("Selection points outside of document")}let de=0;class pe{constructor(t,e,i,s,n){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=s,this.id=de++,this.default=t([]),this.extensions="function"==typeof n?n(this):n}get reader(){return this}static define(t={}){return new pe(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:me),!!t.static,t.enables)}of(t){return new ge([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new ge(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new ge(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],i=>e(i.field(t)))}}function me(t,e){return t==e||t.length==e.length&&t.every((t,i)=>t===e[i])}class ge{constructor(t,e,i,s){this.dependencies=t,this.facet=e,this.type=i,this.value=s,this.id=de++}dynamicSlot(t){var e;let i=this.value,s=this.facet.compareInput,n=this.id,r=t[n]>>1,o=2==this.type,l=!1,a=!1,h=[];for(let i of this.dependencies)"doc"==i?l=!0:"selection"==i?a=!0:1&(null!==(e=t[i.id])&&void 0!==e?e:1)||h.push(t[i.id]);return{create:t=>(t.values[r]=i(t),1),update(t,e){if(l&&e.docChanged||a&&(e.docChanged||e.selection)||we(t,h)){let e=i(t);if(o?!ve(e,t.values[r],s):!s(e,t.values[r]))return t.values[r]=e,1}return 0},reconfigure:(t,e)=>{let l,a=e.config.address[n];if(null!=a){let n=Ee(e,a);if(this.dependencies.every(i=>i instanceof pe?e.facet(i)===t.facet(i):!(i instanceof xe)||e.field(i,!1)==t.field(i,!1))||(o?ve(l=i(t),n,s):s(l=i(t),n)))return t.values[r]=n,0}else l=i(t);return t.values[r]=l,1}}}get extension(){return this}}function ve(t,e,i){if(t.length!=e.length)return!1;for(let s=0;st[e.id]),n=i.map(t=>t.type),r=s.filter(t=>!(1&t)),o=t[e.id]>>1;function l(t){let i=[];for(let e=0;et===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(ye).find(t=>t.field==this);return((null==e?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:t=>(t.values[e]=this.create(t),1),update:(t,i)=>{let s=t.values[e],n=this.updateF(s,i);return this.compareF(s,n)?0:(t.values[e]=n,1)},reconfigure:(t,i)=>{let s,n=t.facet(ye),r=i.facet(ye);return(s=n.find(t=>t.field==this))&&s!=r.find(t=>t.field==this)?(t.values[e]=s.create(t),1):null!=i.config.address[this.id]?(t.values[e]=i.field(this),0):(t.values[e]=this.create(t),1)}}}init(t){return[this,ye.of({field:this,create:t})]}get extension(){return this}}const ke=4,Se=3,Ce=2,Ae=1;function Me(t){return e=>new Te(e,t)}const Oe={highest:Me(0),high:Me(Ae),default:Me(Ce),low:Me(Se),lowest:Me(ke)};class Te{constructor(t,e){this.inner=t,this.prec=e}get extension(){return this}}class De{of(t){return new Re(this,t)}reconfigure(t){return De.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class Re{constructor(t,e){this.compartment=t,this.inner=e}get extension(){return this}}class Pe{constructor(t,e,i,s,n,r){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=s,this.staticValues=n,this.facets=r,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,e,i){let s=[],n=Object.create(null),r=new Map;for(let i of function(t,e,i){let s=[[],[],[],[],[]],n=new Map;function r(t,o){let l=n.get(t);if(null!=l){if(l<=o)return;let e=s[l].indexOf(t);e>-1&&s[l].splice(e,1),t instanceof Re&&i.delete(t.compartment)}if(n.set(t,o),Array.isArray(t))for(let e of t)r(e,o);else if(t instanceof Re){if(i.has(t.compartment))throw new RangeError("Duplicate use of compartment in extensions");let s=e.get(t.compartment)||t.inner;i.set(t.compartment,s),r(s,o)}else if(t instanceof Te)r(t.inner,t.prec);else if(t instanceof xe)s[o].push(t),t.provides&&r(t.provides,o);else if(t instanceof ge)s[o].push(t),t.facet.extensions&&r(t.facet.extensions,Ce);else{let e=t.extension;if(!e)throw new Error(`Unrecognized extension value in extension set (${t}).`);if(e==t)throw new Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(e,o)}}return r(t,Ce),s.reduce((t,e)=>t.concat(e))}(t,e,r))i instanceof xe?s.push(i):(n[i.facet.id]||(n[i.facet.id]=[])).push(i);let o=Object.create(null),l=[],a=[];for(let t of s)o[t.id]=a.length<<1,a.push(e=>t.slot(e));let h=null==i?void 0:i.config.facets;for(let t in n){let e=n[t],s=e[0].facet,r=h&&h[t]||[];if(e.every(t=>0==t.type))if(o[s.id]=l.length<<1|1,me(r,e))l.push(i.facet(s));else{let t=s.combine(e.map(t=>t.value));l.push(i&&s.compare(t,i.facet(s))?i.facet(s):t)}else{for(let t of e)0==t.type?(o[t.id]=l.length<<1|1,l.push(t.value)):(o[t.id]=a.length<<1,a.push(e=>t.dynamicSlot(e)));o[s.id]=a.length<<1,a.push(t=>be(t,s,e))}}let c=a.map(t=>t(o));return new Pe(t,r,c,o,l,n)}}function Be(t,e){if(1&e)return 2;let i=e>>1,s=t.status[i];if(4==s)throw new Error("Cyclic dependency between fields and/or facets");if(2&s)return s;t.status[i]=4;let n=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|n}function Ee(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}const Le=pe.define(),Ne=pe.define({combine:t=>t.some(t=>t),static:!0}),Ie=pe.define({combine:t=>t.length?t[0]:void 0,static:!0}),We=pe.define(),He=pe.define(),Ve=pe.define(),Fe=pe.define({combine:t=>!!t.length&&t[0]});class ze{constructor(t,e){this.type=t,this.value=e}static define(){return new qe}}class qe{of(t){return new ze(this,t)}}class _e{constructor(t){this.map=t}of(t){return new $e(this,t)}}class $e{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new $e(this.type,e)}is(t){return this.type==t}static define(t={}){return new _e(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let s of t){let t=s.map(e);t&&i.push(t)}return i}}$e.reconfigure=$e.define(),$e.appendConfig=$e.define();class je{constructor(t,e,i,s,n,r){this.startState=t,this.changes=e,this.selection=i,this.effects=s,this.annotations=n,this.scrollIntoView=r,this._doc=null,this._state=null,i&&fe(i,e.newLength),n.some(t=>t.type==je.time)||(this.annotations=n.concat(je.time.of(Date.now())))}static create(t,e,i,s,n,r){return new je(t,e,i,s,n,r)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(je.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function Ke(t,e){let i=[];for(let s=0,n=0;;){let r,o;if(s=t[s]))r=t[s++],o=t[s++];else{if(!(n=0;n--){let r=i[n](t);r&&Object.keys(r).length&&(s=Ue(s,Ye(e,r,t.changes.newLength),!0))}return s==t?t:je.create(e,t.changes,t.selection,s.effects,s.annotations,s.scrollIntoView)}(i?function(t){let e=t.startState,i=!0;for(let s of e.facet(We)){let e=s(t);if(!1===e){i=!1;break}Array.isArray(e)&&(i=!0===i?e:Ke(i,e))}if(!0!==i){let s,n;if(!1===i)n=t.changes.invertedDesc,s=se.empty(e.doc.length);else{let e=t.changes.filter(i);s=e.changes,n=e.filtered.mapDesc(e.changes).invertedDesc}t=je.create(e,s,t.selection&&t.selection.map(n),$e.mapEffects(t.effects,n),t.annotations,t.scrollIntoView)}let s=e.facet(He);for(let i=s.length-1;i>=0;i--){let n=s[i](t);t=n instanceof je?n:Array.isArray(n)&&1==n.length&&n[0]instanceof je?n[0]:Qe(e,Xe(n),!1)}return t}(n):n)}je.time=ze.define(),je.userEvent=ze.define(),je.addToHistory=ze.define(),je.remote=ze.define();const Ge=[];function Xe(t){return null==t?Ge:Array.isArray(t)?t:[t]}var Je=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Je||(Je={}));const Ze=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ti;try{ti=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(t){}function ei(t){return e=>{if(!/\S/.test(e))return Je.Space;if(function(t){if(ti)return ti.test(t);for(let e=0;e"€"&&(i.toUpperCase()!=i.toLowerCase()||Ze.test(i)))return!0}return!1}(e))return Je.Word;for(let i=0;i-1)return Je.Word;return Je.Other}}class ii{constructor(t,e,i,s,n,r){this.config=t,this.doc=e,this.selection=i,this.values=s,this.status=t.statusTemplate.slice(),this.computeSlot=n,r&&(r._state=this);for(let t=0;tn.set(e,t)),i=null),n.set(e.value.compartment,e.value.extension)):e.is($e.reconfigure)?(i=null,s=e.value):e.is($e.appendConfig)&&(i=null,s=Xe(s).concat(e.value));if(i)e=t.startState.values.slice();else{i=Pe.resolve(s,n,this),e=new ii(i,this.doc,this.selection,i.dynamicSlots.map(()=>null),(t,e)=>e.reconfigure(t,this),null).values}let r=t.startState.facet(Ne)?t.newSelection:t.newSelection.asSingle();new ii(i,t.newDoc,r,e,(e,i)=>i.update(e,t),t)}replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:ue.cursor(e.from+t.length)}))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),s=this.changes(i.changes),n=[i.range],r=Xe(i.effects);for(let i=1;in.spec.fromJSON(r,t)))}return ii.create({doc:t.doc,selection:ue.fromJSON(t.selection),extensions:e.extensions?s.concat([e.extensions]):s})}static create(t={}){let e=Pe.resolve(t.extensions||[],new Map),i=t.doc instanceof Ft?t.doc:Ft.of((t.doc||"").split(e.staticFacet(ii.lineSeparator)||te)),s=t.selection?t.selection instanceof ue?t.selection:ue.single(t.selection.anchor,t.selection.head):ue.single(0);return fe(s,i.length),e.staticFacet(Ne)||(s=s.asSingle()),new ii(e,i,s,e.dynamicSlots.map(()=>null),(t,e)=>e.create(t),null)}get tabSize(){return this.facet(ii.tabSize)}get lineBreak(){return this.facet(ii.lineSeparator)||"\n"}get readOnly(){return this.facet(Fe)}phrase(t,...e){for(let e of this.facet(ii.phrases))if(Object.prototype.hasOwnProperty.call(e,t)){t=e[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,(t,i)=>{if("$"==i)return"$";let s=+(i||1);return!s||s>e.length?t:e[s-1]})),t}languageDataAt(t,e,i=-1){let s=[];for(let n of this.facet(Le))for(let r of n(this,e,i))Object.prototype.hasOwnProperty.call(r,t)&&s.push(r[t]);return s}charCategorizer(t){let e=this.languageDataAt("wordChars",t);return ei(e.length?e[0]:"")}wordAt(t){let{text:e,from:i,length:s}=this.doc.lineAt(t),n=this.charCategorizer(t),r=t-i,o=t-i;for(;r>0;){let t=Gt(e,r,!1);if(n(e.slice(t,r))!=Je.Word)break;r=t}for(;ot.length?t[0]:4}),ii.lineSeparator=Ie,ii.readOnly=Fe,ii.phrases=pe.define({compare(t,e){let i=Object.keys(t),s=Object.keys(e);return i.length==s.length&&i.every(i=>t[i]==e[i])}}),ii.languageData=Le,ii.changeFilter=We,ii.transactionFilter=He,ii.transactionExtender=Ve,De.reconfigure=$e.define();class ni{eq(t){return this==t}range(t,e=t){return oi.create(t,e,this)}}function ri(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}ni.prototype.startSide=ni.prototype.endSide=0,ni.prototype.point=!1,ni.prototype.mapMode=ee.TrackDel;class oi{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(t,e,i){return new oi(t,e,i)}}function li(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class ai{constructor(t,e,i,s){this.from=t,this.to=e,this.value=i,this.maxPoint=s}get length(){return ci(this.to)}findIndex(t,e,i,s=0){let n=i?this.to:this.from;for(let r=s,o=n.length;;){if(r==o)return r;let s=r+o>>1,l=n[s]-t||(i?this.value[s].endSide:this.value[s].startSide)-e;if(s==r)return l>=0?r:o;l>=0?o=s:r=s+1}}between(t,e,i,s){for(let n=this.findIndex(e,-1e9,!0),r=this.findIndex(i,1e9,!1,n);nf||u==f&&d.startSide>0&&d.endSide<=0)continue;if(!((f-u||d.endSide-d.startSide)<0))if(a<0&&(a=u),d.point&&(h=Math.max(h,f-u)),(u-i||d.startSide-s)>=0)r.push(d),o.push(u-a),l.push(f-a),i=f,s=d.endSide;else{if(u==f)for(let t=r.length;t>0;t--){if((u-(l[t-1]+a)||d.startSide-r[t-1].endSide)>=0){r.splice(t,0,d),o.splice(t,0,u-a),l.splice(t,0,f-a);continue t}if((u-(o[t-1]+a)||d.endSide-r[t-1].startSide)>0)break}n(u,f,d)}}return{mapped:r.length?new ai(o,l,r,h):null,pos:a}}}class hi{constructor(t,e,i,s){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=s}static create(t,e,i,s){return new hi(t,e,i,s)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:i=!1,filterFrom:s=0,filterTo:n=this.length}=t,r=t.filter;if(0==e.length&&!r)return this;if(i&&(e=e.slice().sort(li)),this.isEmpty)return e.length?hi.of(e):this;let o=new di(this,null,-1).goto(0),l=0,a=[],h=new ui;for(;o.value||l=0){let t=e[l++];h.addInner(t.from,t.to,t.value,!1)||a.push(t)}else 1==o.rangeIndex&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||no.to||n{e||(e=new ui),e.addRange(t,i,s,!1)};for(let e=0;e=n&&t<=n+r.length&&!1===r.between(n,t-n,e-n,i))return}this.nextLayer.between(t,e,i)}}iter(t=0){return pi.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return pi.from(t).goto(e)}static compare(t,e,i,s,n=-1){let r=t.filter(t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=n),o=e.filter(t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=n),l=fi(r,o,i),a=new gi(r,l,n),h=new gi(o,l,n);i.iterGaps((t,e,i)=>vi(a,t,h,e,i,s)),i.empty&&0==i.length&&vi(a,0,h,0,0,s)}static eq(t,e,i=0,s){null==s&&(s=999999999);let n=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0),r=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0);if(n.length!=r.length)return!1;if(!n.length)return!0;let o=fi(n,r),l=new gi(n,o,0).goto(i),a=new gi(r,o,0).goto(i);for(;;){if(l.to!=a.to||!wi(l.active,a.active)||l.point&&(!a.point||!ri(l.point,a.point)))return!1;if(l.to>s)return!0;l.next(),a.next()}}static spans(t,e,i,s,n=-1){let r=new gi(t,null,n).goto(e),o=e,l=r.openStart;for(;;){let t=Math.min(r.to,i);if(r.point){let i=r.activeForPoint(r.to),n=r.pointFromo&&(s.span(o,t,r.active,l),l=r.openEnd(t));if(r.to>i)return l+(r.point&&r.to>i?1:0);o=r.to,r.next()}}static of(t,e=!1){let i=new ui;for(let s of t instanceof oi?[t]:e?function(t){if(t.length>1)for(let e=t[0],i=1;i0)return t.slice().sort(li);e=s}return t}(t):t)i.add(s.from,s.to,s.value);return i.finish()}static join(t){if(!t.length)return hi.empty;let e=ci(t);for(let i=t.length-2;i>=0;i--)for(let s=t[i];s!=hi.empty;s=s.nextLayer)e=new hi(s.chunkPos,s.chunk,e,Math.max(s.maxPoint,e.maxPoint));return e}}function ci(t){return t[t.length-1]}hi.empty=new hi([],[],null,-1),hi.empty.nextLayer=hi.empty;class ui{finishChunk(t){this.chunks.push(new ai(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,i){this.addRange(t,e,i,!0)}addRange(t,e,i,s){this.addInner(t,e,i,s)||(this.nextLayer||(this.nextLayer=new ui)).addRange(t,e,i,s)}addInner(t,e,i,s){let n=t-this.lastTo||i.startSide-this.last.endSide;if(s&&n<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(n<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(hi.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;let e=hi.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function fi(t,e,i){let s=new Map;for(let e of t)for(let t=0;t=this.minPoint)break}}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new di(r,e,i,n));return 1==s.length?s[0]:new pi(s)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let i of this.heap)i.goto(t,e);for(let t=this.heap.length>>1;t>=0;t--)mi(this.heap,t);return this.next(),this}forward(t,e){for(let i of this.heap)i.forward(t,e);for(let t=this.heap.length>>1;t>=0;t--)mi(this.heap,t);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),mi(this.heap,0)}}}function mi(t,e){for(let i=t[e];;){let s=1+(e<<1);if(s>=t.length)break;let n=t[s];if(s+1=0&&(n=t[s+1],s++),i.compare(n)<0)break;t[s]=i,t[e]=n,e=s}}class gi{constructor(t,e,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=pi.from(t,e,i)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){bi(this.active,t),bi(this.activeTo,t),bi(this.activeRank,t),this.minActive=xi(this.active,this.activeTo)}addActive(t){let e=0,{value:i,to:s,rank:n}=this.cursor;for(;e0;)e++;yi(this.active,e,i),yi(this.activeTo,e,s),yi(this.activeRank,e,n),t&&yi(t,e,this.cursor.from),this.minActive=xi(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>t){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&bi(i,s)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let t=this.cursor.value;if(t.point){if(!(e&&this.cursor.to==this.to&&this.cursor.from=0&&i[e]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&e.push(this.active[i]);return e.reverse()}openEnd(t){let e=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)e++;return e}}function vi(t,e,i,s,n,r){t.goto(e),i.goto(s);let o=s+n,l=s,a=s-e,h=!!r.boundChange;for(let e=!1;;){let s=t.to+a-i.to,n=s||t.endSide-i.endSide,c=n<0?t.to+a:i.to,u=Math.min(c,o);if(t.point||i.point?(t.point&&i.point&&ri(t.point,i.point)&&wi(t.activeForPoint(t.to),i.activeForPoint(i.to))||r.comparePoint(l,u,t.point,i.point),e=!1):(e&&r.boundChange(l),u>l&&!wi(t.active,i.active)&&r.compareRange(l,u,t.active,i.active),h&&uo)break;l=c,n<=0&&t.next(),n>=0&&i.next()}}function wi(t,e){if(t.length!=e.length)return!1;for(let i=0;i=e;i--)t[i+1]=t[i];t[e]=i}function xi(t,e){let i=-1,s=1e9;for(let n=0;n=e)return s;if(s==t.length)break;n+=9==t.charCodeAt(s)?i-n%i:1,s=Gt(t,s)}return!0===s?-1:t.length}const Ci="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),Ai="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),Mi="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class Oi{constructor(t,e){this.rules=[];let{finish:i}=e||{};function s(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}function n(t,e,r,o){let l=[],a=/^@(\w+)\b/.exec(t[0]),h=a&&"keyframes"==a[1];if(a&&null==e)return r.push(t[0]+";");for(let i in e){let o=e[i];if(/&/.test(i))n(i.split(/,\s*/).map(e=>t.map(t=>e.replace(/&/,t))).reduce((t,e)=>t.concat(e)),o,r);else if(o&&"object"==typeof o){if(!a)throw new RangeError("The value of a property ("+i+") should be a primitive value.");n(s(i),o,l,h)}else null!=o&&l.push(i.replace(/_.*/,"").replace(/[A-Z]/g,t=>"-"+t.toLowerCase())+": "+o+";")}(l.length||h)&&r.push((!i||a||o?t:t.map(i)).join(", ")+" {"+l.join(" ")+"}")}for(let e in t)n(s(e),t[e],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=Mi[Ci]||1;return Mi[Ci]=t+1,"ͼ"+t.toString(36)}static mount(t,e,i){let s=t[Ai],n=i&&i.nonce;s?n&&s.setNonce(n):s=new Di(t,n),s.mount(Array.isArray(e)?e:[e],t)}}let Ti=new Map;class Di{constructor(t,e){let i=t.ownerDocument||t,s=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&s.CSSStyleSheet){let e=Ti.get(i);if(e)return t[Ai]=e;this.sheet=new s.CSSStyleSheet,Ti.set(i,this)}else this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[Ai]=this}mount(t,e){let i=this.sheet,s=0,n=0;for(let e=0;e-1&&(this.modules.splice(o,1),n--,o=-1),-1==o){if(this.modules.splice(n++,0,r),i)for(let t=0;t",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Bi="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Ei="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Li=0;Li<10;Li++)Ri[48+Li]=Ri[96+Li]=String(Li);for(Li=1;Li<=24;Li++)Ri[Li+111]="F"+Li;for(Li=65;Li<=90;Li++)Ri[Li]=String.fromCharCode(Li+32),Pi[Li]=String.fromCharCode(Li);for(var Ni in Ri)Pi.hasOwnProperty(Ni)||(Pi[Ni]=Ri[Ni]);function Ii(){var t=arguments[0];"string"==typeof t&&(t=document.createElement(t));var e=1,i=arguments[1];if(i&&"object"==typeof i&&null==i.nodeType&&!Array.isArray(i)){for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)){var n=i[s];"string"==typeof n?t.setAttribute(s,n):null!=n&&(t[s]=n)}e++}for(;e2);var Qi={mac:Yi||/Mac/.test(Hi.platform),windows:/Win/.test(Hi.platform),linux:/Linux|X11/.test(Hi.platform),ie:_i,ie_version:zi?Vi.documentMode||6:qi?+qi[1]:Fi?+Fi[1]:0,gecko:$i,gecko_version:$i?+(/Firefox\/(\d+)/.exec(Hi.userAgent)||[0,0])[1]:0,chrome:!!ji,chrome_version:ji?+ji[1]:0,ios:Yi,android:/Android\b/.test(Hi.userAgent),webkit:Ki,webkit_version:Ki?+(/\bAppleWebKit\/(\d+)/.exec(Hi.userAgent)||[0,0])[1]:0,safari:Ui,safari_version:Ui?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Hi.userAgent)||[0,0])[1]:0,tabSize:null!=Vi.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function Gi(t,e){for(let i in t)"class"==i&&e.class?e.class+=" "+t.class:"style"==i&&e.style?e.style+=";"+t.style:e[i]=t[i];return e}const Xi=Object.create(null);function Ji(t,e,i){if(t==e)return!0;t||(t=Xi),e||(e=Xi);let s=Object.keys(t),n=Object.keys(e);if(s.length-(i&&s.indexOf(i)>-1?1:0)!=n.length-(i&&n.indexOf(i)>-1?1:0))return!1;for(let r of s)if(r!=i&&(-1==n.indexOf(r)||t[r]!==e[r]))return!1;return!0}function Zi(t,e,i){let s=!1;if(e)for(let n in e)i&&n in i||(s=!0,"style"==n?t.style.cssText="":t.removeAttribute(n));if(i)for(let n in i)e&&e[n]==i[n]||(s=!0,"style"==n?t.style.cssText=i[n]:t.setAttribute(n,i[n]));return s}function ts(t){let e=Object.create(null);for(let i=0;i0?3e8:-4e8:e>0?1e8:-1e8,new os(t,e,e,i,t.widget||null,!1)}static replace(t){let e,i,s=!!t.block;if(t.isBlockGap)e=-5e8,i=4e8;else{let{start:n,end:r}=ls(t,s);e=(n?s?-3e8:-1:5e8)-1,i=1+(r?s?2e8:1:-6e8)}return new os(t,e,i,s,t.widget||null,!0)}static line(t){return new rs(t)}static set(t,e=!1){return hi.of(t,e)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}ss.none=hi.empty;class ns extends ss{constructor(t){let{start:e,end:i}=ls(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?Gi(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||Xi}eq(t){return this==t||t instanceof ns&&this.tagName==t.tagName&&Ji(this.attrs,t.attrs)}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}ns.prototype.point=!1;class rs extends ss{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof rs&&this.spec.class==t.spec.class&&Ji(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}rs.prototype.mapMode=ee.TrackBefore,rs.prototype.point=!0;class os extends ss{constructor(t,e,i,s,n,r){super(e,i,n,t),this.block=s,this.isReplace=r,this.mapMode=s?e<=0?ee.TrackBefore:ee.TrackAfter:ee.TrackDel}get type(){return this.startSide!=this.endSide?is.WidgetRange:this.startSide<=0?is.WidgetBefore:is.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof os&&(e=this.widget,i=t.widget,e==i||!!(e&&i&&e.compare(i)))&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide;var e,i}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}function ls(t,e=!1){let{inclusiveStart:i,inclusiveEnd:s}=t;return null==i&&(i=t.inclusive),null==s&&(s=t.inclusive),{start:null!=i?i:e,end:null!=s?s:e}}function as(t,e,i,s=0){let n=i.length-1;n>=0&&i[n]+s>=t?i[n]=Math.max(i[n],e):i.push(t,e)}os.prototype.point=!0;class hs extends ni{constructor(t,e,i){super(),this.tagName=t,this.attributes=e,this.rank=i}eq(t){return t==this||t instanceof hs&&this.tagName==t.tagName&&Ji(this.attributes,t.attributes)}static create(t){return new hs(t.tagName,t.attributes||Xi,null==t.rank?50:Math.max(0,Math.min(t.rank,100)))}static set(t,e=!1){return hi.of(t,e)}}function cs(t){let e;return e=11==t.nodeType?t.getSelection?t:t.ownerDocument:t,e.getSelection()}function us(t,e){return!!e&&(t==e||t.contains(1!=e.nodeType?e.parentNode:e))}function fs(t,e){if(!e.anchorNode)return!1;try{return us(t,e.anchorNode)}catch(t){return!1}}function ds(t){return 3==t.nodeType?Os(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[]}function ps(t,e,i,s){return!!i&&(vs(t,e,i,s,-1)||vs(t,e,i,s,1))}function ms(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function gs(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function vs(t,e,i,s,n){for(;;){if(t==i&&e==s)return!0;if(e==(n<0?0:ws(t))){if("DIV"==t.nodeName)return!1;let i=t.parentNode;if(!i||1!=i.nodeType)return!1;e=ms(t)+(n<0?0:1),t=i}else{if(1!=t.nodeType)return!1;if(1==(t=t.childNodes[e+(n<0?-1:0)]).nodeType&&"false"==t.contentEditable)return!1;e=n<0?ws(t):0}}}function ws(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function bs(t,e){let i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom}}function ys(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function xs(t,e){let i=e.width/t.offsetWidth,s=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(s>.995&&s<1.005||!isFinite(s)||Math.abs(e.height-t.offsetHeight)<1)&&(s=1),{scaleX:i,scaleY:s}}function ks(t,e=!0){let i=t.ownerDocument,s=null,n=null;for(let r=t.parentNode;r&&(r!=i.body&&(e&&!s||!n));)if(1==r.nodeType)!n&&r.scrollHeight>r.clientHeight&&(n=r),e&&!s&&r.scrollWidth>r.clientWidth&&(s=r),r=r.assignedSlot||r.parentNode;else{if(11!=r.nodeType)break;r=r.host}return{x:s,y:n}}hs.prototype.startSide=hs.prototype.endSide=-1;class Ss{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?ws(e):0),i,Math.min(t.focusOffset,i?ws(i):0))}set(t,e,i,s){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=s}}let Cs,As=null;function Ms(t){if(t.setActive)return t.setActive();if(As)return t.focus(As);let e=[];for(let i=t;i&&(e.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(t.focus(null==As?{get preventScroll(){return As={preventScroll:!0},!0}}:void 0),!As){As=!1;for(let t=0;tMath.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function Rs(t,e){for(let i=t,s=e;;){if(3==i.nodeType&&s>0)return{node:i,offset:s};if(1==i.nodeType&&s>0){if("false"==i.contentEditable)return null;i=i.childNodes[s-1],s=ws(i)}else{if(!i.parentNode||gs(i))return null;s=ms(i),i=i.parentNode}}}function Ps(t,e){for(let i=t,s=e;;){if(3==i.nodeType&&s=26&&(As=!1);class Bs{constructor(t,e,i=!0){this.node=t,this.offset=e,this.precise=i}static before(t,e){return new Bs(t.parentNode,ms(t),e)}static after(t,e){return new Bs(t.parentNode,ms(t)+1,e)}}var Es=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(Es||(Es={}));const Ls=Es.LTR,Ns=Es.RTL;function Is(t){let e=[];for(let i=0;i=e){if(o.level==i)return r;(n<0||(0!=s?s<0?o.frome:t[n].level>o.level))&&(n=r)}}if(n<0)throw new RangeError("Index out of range");return n}}function $s(t,e){if(t.length!=e.length)return!1;for(let i=0;ia&&o.push(new _s(a,p.from,f)),Us(t,p.direction==Ls!=!(f%2)?s+1:s,n,p.inner,p.from,p.to,o),a=p.to}d=p.to}else{if(d==i||(e?js[d]!=l:js[d]==l))break;d++}u?Ks(t,a,d,s+1,n,u,o):ae;){let i=!0,c=!1;if(!h||a>r[h-1].to){let t=js[a-1];t!=l&&(i=!1,c=16==t)}let u=i||1!=l?null:[],f=i?s:s+1,d=a;t:for(;;)if(h&&d==r[h-1].to){if(c)break t;let p=r[--h];if(!i)for(let t=p.from,i=h;;){if(t==e)break t;if(!i||r[i-1].to!=t){if(js[t-1]==l)break t;break}t=r[--i].from}if(u)u.push(p);else{p.to=0;t-=3)if(Fs[t+1]==-i){let e=Fs[t+2],i=2&e?n:4&e?1&e?r:n:0;i&&(js[o]=js[Fs[t]]=i),l=t;break}}else{if(189==Fs.length)break;Fs[l++]=o,Fs[l++]=e,Fs[l++]=a}else if(2==(s=js[o])||1==s){let t=s==n;a=t?0:1;for(let e=l-3;e>=0;e-=3){let i=Fs[e+2];if(2&i)break;if(t)Fs[e+2]|=2;else{if(4&i)break;Fs[e+2]|=4}}}}}(t,n,r,s,l),function(t,e,i,s){for(let n=0,r=s;n<=i.length;n++){let o=n?i[n-1].to:t,l=na;)e==r&&(e=i[--s].from,r=s?i[s-1].to:t),js[--e]=c;a=o}else r=o,a++}}}(n,r,s,l),Ks(t,n,r,e,i,s,o)}function Ys(t,e,i){if(!t)return[new _s(0,0,e==Ns?1:0)];if(e==Ls&&!i.length&&!qs.test(t))return Qs(t.length);if(i.length)for(;t.length>js.length;)js[js.length]=256;let s=[],n=e==Ls?0:1;return Us(t,n,n,i,0,t.length,s),s}function Qs(t){return[new _s(0,t,0)]}let Gs="";function Xs(t,e,i,s,n){var r;let o=s.head-t.from,l=_s.find(e,o,null!==(r=s.bidiLevel)&&void 0!==r?r:-1,s.assoc),a=e[l],h=a.side(n,i);if(o==h){let t=l+=n?1:-1;if(t<0||t>=e.length)return null;a=e[l=t],o=a.side(!n,i),h=a.side(n,i)}let c=Gt(t.text,o,a.forward(n,i));(ca.to)&&(c=h),Gs=t.text.slice(Math.min(o,c),Math.max(o,c));let u=l==(n?e.length-1:0)?null:e[l+(n?1:-1)];return u&&c==h&&u.level+(n?0:1)t.some(t=>t)}),cn=pe.define({combine:t=>t.some(t=>t)}),un=pe.define();class fn{constructor(t,e,i,s,n,r=!1){this.range=t,this.y=e,this.x=i,this.yMargin=s,this.xMargin=n,this.isSnapshot=r}map(t){return t.empty?this:new fn(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new fn(ue.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const dn=$e.define({map:(t,e)=>t.map(e)}),pn=$e.define();function mn(t,e,i){let s=t.facet(sn);s.length?s[0](e):window.onerror&&window.onerror(String(e),i,void 0,void 0,e)||(i?console.error(i+":",e):console.error(e))}const gn=pe.define({combine:t=>!t.length||t[0]});let vn=0;const wn=pe.define({combine:t=>t.filter((e,i)=>{for(let s=0;s{let e=[];return r&&e.push(Sn.of(e=>{let i=e.plugin(t);return i?r(i):ss.none})),n&&e.push(n(t)),e})}static fromClass(t,e){return bn.define((e,i)=>new t(e,i),e)}}class yn{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(e){if(mn(t.state,e,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(t){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(e){mn(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy()}catch(e){mn(t.state,e,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const xn=pe.define(),kn=pe.define(),Sn=pe.define(),Cn=pe.define(),An=pe.define(),Mn=pe.define(),On=pe.define();function Tn(t,e){let i=t.state.facet(On);if(!i.length)return i;let s=i.map(e=>e instanceof Function?e(t):e),n=[];return hi.spans(s,e.from,e.to,{point(){},span(t,i,s,r){let o=t-e.from,l=i-e.from,a=n;for(let t=s.length-1;t>=0;t--,r--){let i,n=s[t].spec.bidiIsolate;if(null==n&&(n=Js(e.text,o,l)),r>0&&a.length&&(i=a[a.length-1]).to==o&&i.direction==n)i.to=l,a=i.inner;else{let t={from:o,to:l,direction:n,inner:[]};a.push(t),a=t.inner}}}}),n}const Dn=pe.define();function Rn(t){let e=0,i=0,s=0,n=0;for(let r of t.state.facet(Dn)){let o=r(t);o&&(null!=o.left&&(e=Math.max(e,o.left)),null!=o.right&&(i=Math.max(i,o.right)),null!=o.top&&(s=Math.max(s,o.top)),null!=o.bottom&&(n=Math.max(n,o.bottom)))}return{left:e,right:i,top:s,bottom:n}}const Pn=pe.define();class Bn{constructor(t,e,i,s){this.fromA=t,this.toA=e,this.fromB=i,this.toB=s}join(t){return new Bn(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let s=t[e-1];if(!(s.fromA>i.toA)){if(s.toAs.push(new Bn(t,e,i,n))),this.changedRanges=s}static create(t,e,i){return new En(t,e,i)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}const Ln=[];class Nn{constructor(t,e,i=0){this.dom=t,this.length=e,this.flags=i,this.parent=null,t.cmTile=this}get breakAfter(){return 1&this.flags}get children(){return Ln}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,4&this.flags){this.flags&=-5;let t=this.domAttrs;t&&function(t,e){for(let i=t.attributes.length-1;i>=0;i--){let s=t.attributes[i].name;null==e[s]&&t.removeAttribute(s)}for(let i in e){let s=e[i];"style"==i?t.style.cssText=s:t.getAttribute(i)!=s&&t.setAttribute(i,s)}}(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,e=this.posAtStart){let i=e;for(let e of this.children){if(e==t)return i;i+=e.length+e.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,e){return null}domPosFor(t,e){let i=ms(this.dom),s=this.length?t>0:e>0;return new Bs(this.parent.dom,i+(s?1:0),0==t||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&2&this.parent.flags&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof Hn)return t;return null}static get(t){return t.cmTile}}class In extends Nn{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(2&this.flags)return;super.sync(t);let e,i=this.dom,s=null,n=(null==t?void 0:t.node)==i?t:null,r=0;for(let o of this.children){if(o.sync(t),r+=o.length+o.breakAfter,e=s?s.nextSibling:i.firstChild,n&&e!=o.dom&&(n.written=!0),o.dom.parentNode==i)for(;e&&e!=o.dom;)e=Wn(e);else i.insertBefore(o.dom,e);s=o.dom}for(e=s?s.nextSibling:i.firstChild,n&&e&&(n.written=!0);e;)e=Wn(e);this.length=r}}function Wn(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Hn extends In{constructor(t,e){super(e),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let e=Nn.get(t);if(e&&this.owns(e))return e;t=t.parentNode}}blockTiles(t){for(let e=[],i=this,s=0,n=0;;)if(s==i.children.length){if(!e.length)return;i=i.parent,i.breakAfter&&n++,s=e.pop()}else{let r=i.children[s++];if(r instanceof Vn)e.push(s),i=r,s=0;else{let e=n+r.length,i=t(r,n);if(void 0!==i)return i;n=e+r.breakAfter}}}resolveBlock(t,e){let i,s,n=-1,r=-1;if(this.blockTiles((o,l)=>{let a=l+o.length;if(t>=l&&t<=a){if(o.isWidget()&&e>=-1&&e<=1){if(32&o.flags)return!0;16&o.flags&&(i=void 0)}(lt||t==l&&(e>1?o.length:o.covers(-1)))&&(!s||!o.isWidget()&&s.isWidget())&&(s=o,r=t-l)}}),!i&&!s)throw new Error("No tile at position "+t);return i&&e<0||!s?{tile:i,offset:n}:{tile:s,offset:r}}}class Vn extends In{constructor(t,e){super(t),this.wrapper=e}isBlock(){return!0}covers(t){return!!this.children.length&&(t<0?this.children[0].covers(-1):this.lastChild.covers(1))}get domAttrs(){return this.wrapper.attributes}static of(t,e){let i=new Vn(e||document.createElement(t.tagName),t);return e||(i.flags|=4),i}}class Fn extends In{constructor(t,e){super(t),this.attrs=e}isLine(){return!0}static start(t,e,i){let s=new Fn(e||document.createElement("div"),t);return e&&i||(s.flags|=4),s}get domAttrs(){return this.attrs}resolveInline(t,e,i){let s=null,n=-1,r=null,o=-1;!function t(l,a){for(let h=0,c=0;h=a&&(u.isComposite()?t(u,a-c):(!r||r.isHidden&&(e>0||i&&zn(r,u)))&&(f>a||32&u.flags)?(r=u,o=a-c):(ci&&(t=i);let s=t,n=t,r=0;0==t&&e<0||t==i&&e>=0?Qi.chrome||Qi.gecko||(t?(s--,r=1):n=0)?0:o.length-1];return Qi.safari&&!r&&0==l.width&&(l=Array.prototype.find.call(o,t=>t.width)||l),r?bs(l,r<0):l||null}static of(t,e){let i=new _n(e||document.createTextNode(t),t);return e||(i.flags|=2),i}}class $n extends Nn{constructor(t,e,i,s){super(t,e,s),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return!(48&this.flags)&&(this.flags&(t<0?64:128))>0}coordsIn(t,e){return this.coordsInWidget(t,e,!1)}coordsInWidget(t,e,i){let s=this.widget.coordsAt(this.dom,t,e);if(s)return s;if(i)return bs(this.dom.getBoundingClientRect(),this.length?0==t:e<=0);{let e=this.dom.getClientRects(),i=null;if(!e.length)return null;let s=!!(16&this.flags)||!(32&this.flags)&&t>0;for(let n=s?e.length-1:0;i=e[n],!(t>0?0==n:n==e.length-1||i.top0;)if(s.isComposite())if(r){if(!t)break;i&&i.break(),t--,r=!1}else if(n==s.children.length){if(!t&&!o.length)break;i&&i.leave(s),r=!!s.breakAfter,({tile:s,index:n}=o.pop()),n++}else{let l=s.children[n],a=l.breakAfter;!(e>0?l.length<=t:l.length=0;t--){let i=e.marks[t],n=s.lastChild;if(n instanceof qn&&n.mark.eq(i.mark))n.dom!=i.dom&&n.setDOM(er(i.dom)),s=n;else{if(this.cache.reused.get(i)){let t=Nn.get(i.dom);t&&t.setDOM(er(i.dom))}let t=qn.of(i.mark,i.dom);s.append(t),s=t}this.cache.reused.set(i,2)}let n=Nn.get(t.text);n&&this.cache.reused.set(n,2);let r=new _n(t.text,t.text.nodeValue);r.flags|=8,this.pos=t.range.toB,s.append(r)}addInlineWidget(t,e,i){let s=this.afterWidget&&48&t.flags&&(48&this.afterWidget.flags)==(48&t.flags);s||this.flushBuffer();let n=this.ensureMarks(e,i);s||16&t.flags||n.append(this.getBuffer(1)),n.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,e,i){this.flushBuffer(),this.ensureMarks(e,i).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){(this.afterWidget||this.lastBlock).length+=t,this.pos+=t}addLineStart(t,e){var i;t||(t=tr);let s=Fn.start(t,e||(null===(i=this.cache.find(Fn))||void 0===i?void 0:i.dom),!!e);this.getBlockPos().append(this.lastBlock=this.curLine=s)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,e){var i;let s=this.curLine;for(let n=t.length-1;n>=0;n--){let r,o=t[n];if(e>0&&(r=s.lastChild)&&r instanceof qn&&r.mark.eq(o))s=r,e--;else{let t=qn.of(o,null===(i=this.cache.find(qn,t=>t.mark.eq(o)))||void 0===i?void 0:i.dom);s.append(t),s=t,e=0}}return s}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;t&&Zn(this.curLine,!1)&&("BR"==t.dom.nodeName||!t.isWidget()||Qi.ios&&Zn(this.curLine,!0))||this.curLine.append(this.cache.findWidget(sr,0,32)||new $n(sr.toDOM(),0,sr,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to=this.pos){let e=102*t.rank+t.value.rank,i=new Un(t.from,t.to,t.value,e),s=this.wrappers.length;for(;s>0&&(this.wrappers[s-1].rank-i.rank||this.wrappers[s-1].to-i.to)<0;)s--;this.wrappers.splice(s,0,i)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let e=this.root;for(let i of this.wrappers){let s=e.lastChild;if(i.fromt.wrapper.eq(i.wrapper)))||void 0===t?void 0:t.dom);e.append(s),e=s}}return e}blockPosCovered(){let t=this.lastBlock;return null!=t&&!t.breakAfter&&(!t.isWidget()||(160&t.flags)>0)}getBuffer(t){let e=2|(t<0?16:32),i=this.cache.find(jn,void 0,1);return i&&(i.flags=e),i||new jn(e)}flushBuffer(){!this.afterWidget||32&this.afterWidget.flags||(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class Qn{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:e,lineBreak:i,done:s}=this.cursor.next(this.skipCount);if(this.skipCount=0,s)throw new Error("Ran out of text content when drawing inline views");this.text=e;let n=this.textOff=Math.min(t,e.length);return i?null:e.slice(0,n)}let e=Math.min(this.text.length,this.textOff+t),i=this.text.slice(this.textOff,e);return this.textOff=e,i}}const Gn=[$n,Fn,_n,qn,jn,Vn,Hn];for(let t=0;t[]),this.index=Gn.map(()=>0),this.reused=new Map}add(t){let e=t.constructor.bucket,i=this.buckets[e];i.length<6?i.push(t):i[this.index[e]=(this.index[e]+1)%6]=t}find(t,e,i=2){let s=t.bucket,n=this.buckets[s],r=this.index[s];for(let t=n.length-1;t>=0;t--){let o=(t+r)%n.length,l=n[o];if((!e||e(l))&&!this.reused.has(l))return n.splice(o,1),o{if(this.cache.add(t),t.isComposite())return!1},enter:t=>this.cache.add(t),leave:()=>{},break:()=>{}}}run(t,e){let i=e&&this.getCompositionContext(e.text);for(let s=0,n=0,r=0;;){let o=rs){let t=l-s;this.preserve(t,!r,!o),s=l,n+=t}if(!o)break;e&&o.fromA<=e.range.fromA&&o.toA>=e.range.toA?(this.forward(o.fromA,e.range.fromA,e.range.fromA1;i--){let s=i==t.parents.length?t.tile:t.parents[i].tile;s instanceof qn&&e.push(s.mark)}return e}(this.old),n=this.openMarks;this.old.advance(t,i?1:-1,{skip:(t,e,i)=>{if(t.isWidget())if(this.openWidget)this.builder.continueWidget(i-e);else{let r=i>0||e{t.isLine()?this.builder.addLineStart(t.attrs,this.cache.maybeReuse(t)):(this.cache.add(t),t instanceof qn&&s.unshift(t.mark)),this.openWidget=!1},leave:t=>{t.isLine()?s.length&&(s.length=n=0):t instanceof qn&&(s.shift(),n=Math.min(n,s.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,e){let i=null,s=this.builder,n=0,r=hi.spans(this.decorations,t,e,{point:(t,e,r,o,l,a)=>{if(r instanceof os){if(this.disallowBlockEffectsFor[a]){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.view.state.doc.lineAt(t).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(n=o.length,l>o.length)s.continueWidget(e-t);else{let n=r.widget||(r.block?ir.block:ir.inline),a=function(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;t.block&&(e|=256);return e}(r),h=this.cache.findWidget(n,e-t,a)||$n.of(n,this.view,e-t,a);r.block?(r.startSide>0&&s.addLineStartIfNotCovered(i),s.addBlockWidget(h)):(s.ensureLine(i),s.addInlineWidget(h,o,l))}i=null}else i=function(t,e){let i=e.spec.attributes,s=e.spec.class;if(!i&&!s)return t;t||(t={class:"cm-line"});i&&Gi(i,t);s&&(t.class+=" "+s);return t}(i,r);e>t&&this.text.skip(e-t)},span:(t,e,n,r)=>{for(let o=t;on,this.openMarks=r}forward(t,e,i=1){e-t<=10?this.old.advance(e-t,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(e-t-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(t){let e=[],i=null;for(let s=t.parentNode;;s=s.parentNode){let t=Nn.get(s);if(s==this.view.contentDOM)break;t instanceof qn?e.push(t):(null==t?void 0:t.isLine())?i=t:t instanceof Vn||("DIV"!=s.nodeName||i||s==this.view.contentDOM?i||e.push(qn.of(new ns({tagName:s.nodeName.toLowerCase(),attributes:ts(s)}),s)):i=new Fn(s,tr))}return{line:i,marks:e}}}function Zn(t,e){let i=t=>{for(let s of t.children)if((e?s.isText():s.length)||i(s))return!0;return!1};return i(t)}const tr={class:"cm-line"};function er(t){let e=Nn.get(t);return e&&e.setDOM(t.cloneNode()),t}class ir extends es{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}ir.inline=new ir("span"),ir.block=new ir("div");const sr=new class extends es{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class nr{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=ss.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Hn(t,t.contentDOM),this.updateInner([new Bn(0,0,0,t.state.doc.length)],null)}update(t){var e;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:t,toA:e})=>ethis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(e=this.domChanged)||void 0===e?void 0:e.newSel)?s=this.domChanged.newSel.head:function(t,e){let i=!1;e&&t.iterChangedRanges((t,s)=>{te.from&&(i=!0)});return i}(t.changes,this.hasComposition)||t.selectionSet||(s=t.state.selection.main.head));let n=s>-1?function(t,e,i){let s=or(t,i);if(!s)return null;let{node:n,from:r,to:o}=s,l=n.nodeValue;if(/[\n\r]/.test(l))return null;if(t.state.doc.sliceString(s.from,s.to)!=l)return null;let a=e.invertedDesc;return{range:new Bn(a.mapPos(r),a.mapPos(o),r,o),text:n}}(this.view,t.changes,s):null;if(this.domChanged=null,this.hasComposition){let{from:e,to:s}=this.hasComposition;i=new Bn(e,s,t.changes.mapPos(e,-1),t.changes.mapPos(s,1)).addToSet(i.slice())}this.hasComposition=n?{from:n.range.fromB,to:n.range.toB}:null,(Qi.ie||Qi.chrome)&&!n&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let r=this.decorations,o=this.blockWrappers;this.updateDeco();let l=function(t,e,i){let s=new lr;return hi.compare(t,e,i,s),s.changes}(r,this.decorations,t.changes);l.length&&(i=Bn.extendWithRanges(i,l));let a=function(t,e,i){let s=new ar;return hi.compare(t,e,i,s),s.changes}(o,this.blockWrappers,t.changes);return a.length&&(i=Bn.extendWithRanges(i,a)),n&&!i.some(t=>t.fromA<=n.range.fromA&&t.toA>=n.range.toA)&&(i=n.range.addToSet(i.slice())),!(2&this.tile.flags&&0==i.length)&&(this.updateInner(i,n),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(e||t.length){let i=this.tile,s=new Jn(this.view,i,this.blockWrappers,this.decorations,this.dynamicDecorationMap);e&&Nn.get(e.text)&&s.cache.reused.set(Nn.get(e.text),2),this.tile=s.run(t,e),rr(i,s.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=Qi.chrome||Qi.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),!s||!s.written&&i.selectionRange.focusNode==s.node&&this.tile.dom.contains(s.node)||(this.forceSelection=!0),this.tile.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to-1)&&fs(i,this.view.observer.selectionRange)&&!(s&&i.contains(s));if(!(n||e||r))return;let o=this.forceSelection;this.forceSelection=!1;let l,a,h=this.view.state.selection.main;if(h.empty?a=l=this.inlineDOMNearPos(h.anchor,h.assoc||1):(a=this.inlineDOMNearPos(h.head,h.head==h.from?1:-1),l=this.inlineDOMNearPos(h.anchor,h.anchor==h.from?1:-1)),Qi.gecko&&h.empty&&!this.hasComposition&&(1==(c=l).node.nodeType&&c.node.firstChild&&(0==c.offset||"false"==c.node.childNodes[c.offset-1].contentEditable)&&(c.offset==c.node.childNodes.length||"false"==c.node.childNodes[c.offset].contentEditable))){let t=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(t,l.node.childNodes[l.offset]||null)),l=a=new Bs(t,0),o=!0}var c;let u=this.view.observer.selectionRange;!o&&u.focusNode&&(ps(l.node,l.offset,u.anchorNode,u.anchorOffset)&&ps(a.node,a.offset,u.focusNode,u.focusOffset)||this.suppressWidgetCursorChange(u,h))||(this.view.observer.ignore(()=>{Qi.android&&Qi.chrome&&i.contains(u.focusNode)&&function(t,e){for(let i=t;i&&i!=e;i=i.assignedSlot||i.parentNode)if(1==i.nodeType&&"false"==i.contentEditable)return!0;return!1}(u.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let t=cs(this.view.root);if(t)if(h.empty){if(Qi.gecko){let t=(e=l.node,n=l.offset,1!=e.nodeType?0:(n&&"false"==e.childNodes[n-1].contentEditable?1:0)|(nh.head&&([l,a]=[a,l]),e.setEnd(a.node,a.offset),e.setStart(l.node,l.offset),t.removeAllRanges(),t.addRange(e)}else;var e,n;r&&this.view.root.activeElement==i&&(i.blur(),s&&s.focus())}),this.view.observer.setSelectionRange(l,a)),this.impreciseAnchor=l.precise?null:new Bs(u.anchorNode,u.anchorOffset),this.impreciseHead=a.precise?null:new Bs(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&ps(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,i=cs(t.root),{anchorNode:s,anchorOffset:n}=t.observer.selectionRange;if(!(i&&e.empty&&e.assoc&&i.modify))return;let r=this.lineAt(e.head,e.assoc);if(!r)return;let o=r.posAtStart;if(e.head==o||e.head==o+r.length)return;let l=this.coordsAt(e.head,-1),a=this.coordsAt(e.head,1);if(!l||!a||l.bottom>a.top)return;let h=this.domAtPos(e.head+e.assoc,e.assoc);i.collapse(h.node,h.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let c=t.observer.selectionRange;t.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=e.from&&i.collapse(s,n)}posFromDOM(t,e){let i=this.tile.nearest(t);if(!i)return 2&this.tile.dom.compareDocumentPosition(t)?0:this.view.state.doc.length;let s=i.posAtStart;if(!i.isComposite())return i.isText()?t==i.dom?s+e:s+(e?i.length:0):s;{let n;if(t==i.dom)n=i.dom.childNodes[e];else{let s=0==ws(t)?0:0==e?-1:1;for(;;){let e=t.parentNode;if(e==i.dom)break;0==s&&e.firstChild!=e.lastChild&&(s=t==e.firstChild?-1:1),t=e}n=s<0?t:t.nextSibling}if(n==i.dom.firstChild)return s;for(;n&&!Nn.get(n);)n=n.nextSibling;if(!n)return s+i.length;for(let t=0,e=s;;t++){let s=i.children[t];if(s.dom==n)return e;e+=s.length+s.breakAfter}}}domAtPos(t,e){let{tile:i,offset:s}=this.tile.resolveBlock(t,e);return i.isWidget()?i.domPosFor(t,e):i.domIn(s,e)}inlineDOMNearPos(t,e){let i,s,n=-1,r=!1,o=-1,l=!1;return this.tile.blockTiles((e,a)=>{if(e.isWidget()){if(32&e.flags&&a>=t)return!0;16&e.flags&&(r=!0)}else{let h=a+e.length;if(a<=t&&(i=e,n=t-a,r=h=t&&!s&&(s=e,o=t-a,l=a>t),a>t&&s)return!0}}),i||s?(r&&s?i=null:l&&i&&(s=null),i&&e<0||!s?i.domIn(n,e):s.domIn(o,e)):this.domAtPos(t,e)}coordsAt(t,e){let{tile:i,offset:s}=this.tile.resolveBlock(t,e);return i.isWidget()?i.widget instanceof hr?null:i.coordsInWidget(s,e,!0):i.coordsIn(s,e)}lineAt(t,e){let{tile:i}=this.tile.resolveBlock(t,e);return i.isLine()?i:null}coordsForChar(t){let{tile:e,offset:i}=this.tile.resolveBlock(t,1);if(!e.isLine())return null;return function t(e,i){if(e.isComposite())for(let s of e.children){if(s.length>=i){let e=t(s,i);if(e)return e}if((i-=s.length)<0)break}else if(e.isText()&&iMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,l=this.view.textDirection==Es.LTR,a=0,h=(t,c,u)=>{for(let f=0;fs);f++){let s=t.children[f],d=c+s.length,p=s.dom.getBoundingClientRect(),{height:m}=p;if(u&&!f&&(a+=p.top-u.top),s instanceof Vn)d>i&&h(s,c,p);else if(c>=i&&(a>0&&e.push(-a),e.push(m+a),a=0,r)){let t=s.dom.lastChild,e=t?ds(t):[];if(e.length){let t=e[e.length-1],i=l?t.right-p.left:p.right-t.left;i>o&&(o=i,this.minWidth=n,this.minWidthFrom=c,this.minWidthTo=d)}}u&&f==t.children.length-1&&(a+=u.bottom-p.bottom),c=d+s.breakAfter}};return h(this.tile,0,null),e}textDirectionAt(t){let{tile:e}=this.tile.resolveBlock(t,1);return"rtl"==getComputedStyle(e.dom).direction?Es.RTL:Es.LTR}measureTextSize(){let t=this.tile.blockTiles(t=>{if(t.isLine()&&t.children.length&&t.length<=20){let e,i=0;for(let s of t.children){if(!s.isText()||/[^ -~]/.test(s.text))return;let t=ds(s.dom);if(1!=t.length)return;i+=t[0].width,e=t[0].height}if(i)return{lineHeight:t.dom.getBoundingClientRect().height,charWidth:i/t.length,textHeight:e}}});if(t)return t;let e,i,s,n=document.createElement("div");return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let t=ds(n.firstChild)[0];e=n.getBoundingClientRect().height,i=t&&t.width?t.width/27:7,s=t&&t.height?t.height:e,n.remove()}),{lineHeight:e,charWidth:i,textHeight:s}}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,s=0;;s++){let n=s==e.viewports.length?null:e.viewports[s],r=n?n.from-1:this.view.state.doc.length;if(r>i){let s=(e.lineBlockAt(r).bottom-e.lineBlockAt(i).top)/this.view.scaleY;t.push(ss.replace({widget:new hr(s),block:!0,inclusive:!0,isBlockGap:!0}).range(i,r))}if(!n)break;i=n.to+1}return ss.set(t)}updateDeco(){let t=1,e=this.view.state.facet(Sn).map(e=>(this.dynamicDecorationMap[t++]="function"==typeof e)?e(this.view):e),i=!1,s=this.view.state.facet(An).map((t,e)=>{let s="function"==typeof t;return s&&(i=!0),s?t(this.view):t});for(s.length&&(this.dynamicDecorationMap[t++]=i,e.push(hi.join(s))),this.decorations=[this.editContextFormatting,...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];t"function"==typeof t?t(this.view):t)}scrollIntoView(t){var e;if(t.isSnapshot){let e=this.view.viewState.lineBlockAt(t.range.head);return this.view.scrollDOM.scrollTop=e.top-t.yMargin,void(this.view.scrollDOM.scrollLeft=t.xMargin)}for(let e of this.view.state.facet(un))try{if(e(this.view,t.range,t))return!0}catch(t){mn(this.view.state,t,"scroll handler")}let i,{range:s}=t,n=this.coordsAt(s.head,null!==(e=s.assoc)&&void 0!==e?e:s.empty?0:s.head>s.anchor?-1:1);if(!n)return;!s.empty&&(i=this.coordsAt(s.anchor,s.anchor>s.head?-1:1))&&(n={left:Math.min(n.left,i.left),top:Math.min(n.top,i.top),right:Math.max(n.right,i.right),bottom:Math.max(n.bottom,i.bottom)});let r=Rn(this.view),o={left:n.left-r.left,top:n.top-r.top,right:n.right+r.right,bottom:n.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;if(function(t,e,i,s,n,r,o,l){let a=t.ownerDocument,h=a.defaultView||window;for(let c=t,u=!1;c&&!u;)if(1==c.nodeType){let t,f=c==a.body,d=1,p=1;if(f)t=ys(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(u=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let e=c.getBoundingClientRect();({scaleX:d,scaleY:p}=xs(c,e)),t={left:e.left,right:e.left+c.clientWidth*d,top:e.top,bottom:e.top+c.clientHeight*p}}let m=0,g=0;if("nearest"==n)e.top0&&e.bottom>t.bottom+g&&(g=e.bottom-t.bottom+o)):e.bottom>t.bottom-o&&(g=e.bottom-t.bottom+o,i<0&&e.top-g0&&e.right>t.right+m&&(m=e.right-t.right+r)):e.right>t.right-r&&(m=e.right-t.right+r,i<0&&e.leftt.bottom||e.leftt.right)&&(e={left:Math.max(e.left,t.left),right:Math.min(e.right,t.right),top:Math.max(e.top,t.top),bottom:Math.min(e.bottom,t.bottom)}),c=c.assignedSlot||c.parentNode}else{if(11!=c.nodeType)break;c=c.host}}(this.view.scrollDOM,o,s.head1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottomt.isWidget()||t.children.some(e);return e(this.tile.resolveBlock(t,1).tile)}destroy(){rr(this.tile)}}function rr(t,e){let i=null==e?void 0:e.get(t);if(1!=i){null==i&&t.destroy();for(let i of t.children)rr(i,e)}}function or(t,e){let i=t.observer.selectionRange;if(!i.focusNode)return null;let s=Rs(i.focusNode,i.focusOffset),n=Ps(i.focusNode,i.focusOffset),r=s||n;if(n&&s&&n.node!=s.node){let e=Nn.get(n.node);if(!e||e.isText()&&e.text!=n.node.nodeValue)r=n;else if(t.docView.lastCompositionAfterCursor){let t=Nn.get(s.node);!t||t.isText()&&t.text!=s.node.nodeValue||(r=n)}}if(t.docView.lastCompositionAfterCursor=r!=s,!r)return null;let o=e-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}let lr=class{constructor(){this.changes=[]}compareRange(t,e){as(t,e,this.changes)}comparePoint(t,e){as(t,e,this.changes)}boundChange(t){as(t,t,this.changes)}};class ar{constructor(){this.changes=[]}compareRange(t,e){as(t,e,this.changes)}comparePoint(){}boundChange(t){as(t,t,this.changes)}}class hr extends es{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function cr(t,e,i){let s=t.lineBlockAt(e);if(Array.isArray(s.type)){let t;for(let n of s.type){if(n.from>e)break;if(!(n.toe)return n;t&&(n.type!=is.Text||t.type==n.type&&!(i<0?n.frome))||(t=n)}}return t||s}return s}function ur(t,e,i,s){let n=t.state.doc.lineAt(e.head),r=t.bidiSpans(n),o=t.textDirectionAt(n.from);for(let l=e,a=null;;){let e=Xs(n,r,o,l,i),h=Gs;if(!e){if(n.number==(i?t.state.doc.lines:1))return l;h="\n",n=t.state.doc.line(n.number+(i?1:-1)),r=t.bidiSpans(n),e=t.visualLineSide(n,!i)}if(a){if(!a(h))return l}else{if(!s)return e;a=s(h)}l=e}}function fr(t,e,i){for(;;){let s=0;for(let n of t)n.between(e-1,e+1,(t,n,r)=>{if(e>t&&ee(t)),i.from,e.head>i.from?-1:1);return s==i.from?i:ue.cursor(s,st.viewState.docHeight)return new mr(t.state.doc.length,-1);if(n=t.elementAtHeight(h),null==s)break;if(n.type==is.Text){if(s<0?n.tot.viewport.to)break;let e=t.docView.coordsAt(s<0?n.from:n.to,s>0?-1:1);if(e&&(s<0?e.top<=h+o:e.bottom>=h+o))break}let e=t.viewState.heightOracle.textHeight/2;h=s>0?n.bottom+e:n.top-e}if(t.viewport.from>=n.to||t.viewport.to<=n.from){if(i)return null;if(n.type==is.Text){let e=function(t,e,i,s,n){let r=Math.round((s-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&i.height>1.5*t.defaultLineHeight){let e=t.viewState.heightOracle.textHeight;r+=Math.floor((n-i.top-.5*(t.defaultLineHeight-e))/e)*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(i.from,i.to);return i.from+Si(o,r,t.state.tabSize)}(t,r,n,l,a);return new mr(e,e==n.from?1:-1)}}if(n.type!=is.Text)return h<(n.top+n.bottom)/2?new mr(n.from,1):new mr(n.to,-1);let c=t.docView.lineAt(n.from,2);return c&&c.length==n.length||(c=t.docView.lineAt(n.from,-2)),new vr(t,l,a,t.textDirectionAt(n.from)).scanTile(c,n.from)}class vr{constructor(t,e,i,s){this.view=t,this.x=e,this.y=i,this.baseDir=s,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+s.from>1;e:if(a.has(f)){let t=o+Math.floor(Math.random()*i);for(let e=0;e1)){if(i.bottomthis.y)(!n||n.top>i.top)&&(n=i),a=-1;else{let t=i.left>this.x?this.x-i.left:i.right(i+i+o)/3)return this.y=s.bottom-1,this.scan(t,e,!0);if(n&&n.top<(i+o+o)/3)return this.y=n.top+1,this.scan(t,e,!0)}let f=(h?this.dirAt(t[c],1):this.baseDir)==Es.LTR;return{i:c,after:this.x>(r.left+r.right)/2==f}}scanText(t,e){let i=[];for(let s=0;s{let n=i[s]-e,r=i[s+1]-e;return Os(t.dom,n,r).getClientRects()});return s.after?new mr(i[s.i+1],-1):new mr(i[s.i],1)}scanTile(t,e){if(!t.length)return new mr(e,1);if(1==t.children.length){let i=t.children[0];if(i.isText())return this.scanText(i,e);if(i.isComposite())return this.scanTile(i,e)}let i=[e];for(let s=0,n=e;s{let i=t.children[e];return 48&i.flags?null:(1==i.dom.nodeType?i.dom:Os(i.dom,0,i.length)).getClientRects()}),n=t.children[s.i],r=i[s.i];return n.isText()?this.scanText(n,r):n.isComposite()?this.scanTile(n,r):s.after?new mr(i[s.i+1],-1):new mr(r,1)}}const wr="￿";class br{constructor(t,e){this.points=t,this.view=e,this.text="",this.lineSeparator=e.state.facet(ii.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=wr}readRange(t,e){if(!t)return this;let i=t.parentNode;for(let s=t;;){this.findPointBefore(i,s);let t=this.text.length;this.readNode(s);let n=Nn.get(s),r=s.nextSibling;if(r==e){(null==n?void 0:n.breakAfter)&&!r&&i!=this.view.contentDOM&&this.lineBreak();break}let o=Nn.get(r);(n&&o?n.breakAfter:(n?n.breakAfter:gs(s))||gs(r)&&("BR"!=s.nodeName||(null==n?void 0:n.isWidget()))&&this.text.length>t)&&!xr(r,e)&&this.lineBreak(),s=r}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let n,r=-1,o=1;if(this.lineSeparator?(r=e.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(n=s.exec(e))&&(r=n.index,o=n[0].length),this.append(e.slice(i,r<0?e.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let e of this.points)e.node==t&&e.pos>this.text.length&&(e.pos-=o-1);i=r+o}}readNode(t){let e=Nn.get(t),i=e&&e.overrideDOMText;if(null!=i){this.findPointInside(t,i.length);for(let t=i.iter();!t.next().done;)t.lineBreak?this.lineBreak():this.append(t.value)}else 3==t.nodeType?this.readTextNode(t):"BR"==t.nodeName?t.nextSibling&&this.lineBreak():1==t.nodeType&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(3==t.nodeType?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(yr(t,i.node,i.offset)?e:0))}}function yr(t,e,i){for(;;){if(!e||i-1;let{impreciseHead:n,impreciseAnchor:r}=t.docView,o=t.state.selection;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=Cr(t.docView.tile,e,i,0))){let e=n||r?[]:function(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:s,focusNode:n,focusOffset:r}=t.observer.selectionRange;i&&(e.push(new kr(i,s)),n==i&&r==s||e.push(new kr(n,r)));return e}(t),i=new br(e,t);i.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=i.text,this.newSel=function(t,e){if(0==t.length)return null;let i=t[0].pos,s=2==t.length?t[1].pos:i;return i>-1&&s>-1?ue.single(i+e,s+e):null}(e,this.bounds.from)}else{let e=t.observer.selectionRange,i=n&&n.node==e.focusNode&&n.offset==e.focusOffset||!us(t.contentDOM,e.focusNode)?o.main.head:t.docView.posFromDOM(e.focusNode,e.focusOffset),s=r&&r.node==e.anchorNode&&r.offset==e.anchorOffset||!us(t.contentDOM,e.anchorNode)?o.main.anchor:t.docView.posFromDOM(e.anchorNode,e.anchorOffset),l=t.viewport;if((Qi.ios||Qi.chrome)&&o.main.empty&&i!=s&&(l.from>0||l.to-1&&o.ranges.length>1)this.newSel=o.replaceRange(ue.range(s,i));else if(t.lineWrapping&&s==i&&(!o.main.empty||o.main.head!=i)&&t.inputState.lastTouchTime>Date.now()-100){let e=t.coordsAtPos(i,-1),s=0;e&&(s=t.inputState.lastTouchY<=e.bottom?-1:1),this.newSel=ue.create([ue.cursor(i,s)])}else this.newSel=ue.single(s,i)}}}function Cr(t,e,i,s){if(t.isComposite()){let n=-1,r=-1,o=-1,l=-1;for(let a=0,h=s,c=s;ai)return Cr(s,e,i,h);if(u>=e&&-1==n&&(n=a,r=h),h>i&&s.dom.parentNode==t.dom){o=a,l=c;break}c=u,h=u+s.breakAfter}return{from:r,to:l<0?s+t.length:l,startDOM:(n?t.children[n-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o=0?t.children[o].dom:null}}return t.isText()?{from:s,to:s+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function Ar(t,e){let i,{newSel:s}=e,{state:n}=t,r=n.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:t,to:s}=e.bounds,l=r.from,a=null;(8===o||Qi.android&&e.text.length=t&&r.to<=s&&(e.typeOver||u!=e.text)&&u.slice(0,r.from-t)==e.text.slice(0,r.from-t)&&u.slice(r.to-t)==e.text.slice(h=e.text.length-(u.length-(r.to-t)))?i={from:r.from,to:r.to,insert:Ft.of(e.text.slice(r.from-t,h).split(wr))}:(c=Or(u,e.text,l-t,a))&&(Qi.chrome&&13==o&&c.toB==c.from+2&&e.text.slice(c.from,c.toB)==wr+wr&&c.toB--,i={from:t+c.from,to:t+c.toA,insert:Ft.of(e.text.slice(c.from,c.toB).split(wr))})}else s&&(!t.hasFocus&&n.facet(gn)||Tr(s,r))&&(s=null);if(!i&&!s)return!1;if((Qi.mac||Qi.android)&&i&&i.from==i.to&&i.from==r.head-1&&/^\. ?$/.test(i.insert.toString())&&"off"==t.contentDOM.getAttribute("autocorrect")?(s&&2==i.insert.length&&(s=ue.single(s.main.anchor-1,s.main.head-1)),i={from:i.from,to:i.to,insert:Ft.of([i.insert.toString().replace("."," ")])}):n.doc.lineAt(r.from).toDate.now()-50?i={from:r.from,to:r.to,insert:n.toText(t.inputState.insertingText)}:Qi.chrome&&i&&i.from==i.to&&i.from==r.head&&"\n "==i.insert.toString()&&t.lineWrapping&&(s&&(s=ue.single(s.main.anchor-1,s.main.head-1)),i={from:r.from,to:r.to,insert:Ft.of([" "])}),i)return Mr(t,i,s,o);if(s&&!Tr(s,r)){let e=!1,i="select";return t.inputState.lastSelectionTime>Date.now()-50&&("select"==t.inputState.lastSelectionOrigin&&(e=!0),i=t.inputState.lastSelectionOrigin,"select.pointer"==i&&(s=dr(n.facet(Mn).map(e=>e(t)),s))),t.dispatch({selection:s,scrollIntoView:e,userEvent:i}),!0}return!1}function Mr(t,e,i,s=-1){if(Qi.ios&&t.inputState.flushIOSKey(e))return!0;let n=t.state.selection.main;if(Qi.android&&(e.to==n.to&&(e.from==n.from||e.from==n.from-1&&" "==t.state.sliceDoc(e.from,n.from))&&1==e.insert.length&&2==e.insert.lines&&Ts(t.contentDOM,"Enter",13)||(e.from==n.from-1&&e.to==n.to&&0==e.insert.length||8==s&&e.insert.lengthn.head)&&Ts(t.contentDOM,"Backspace",8)||e.from==n.from&&e.to==n.to+1&&0==e.insert.length&&Ts(t.contentDOM,"Delete",46)))return!0;let r,o=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let l=()=>r||(r=function(t,e,i){let s,n=t.state,r=n.selection.main,o=-1;if(e.from==e.to&&e.fromr.to){let i=e.frome(t)),s,i);e.from==l&&(o=l)}if(o>-1)s={changes:e,selection:ue.cursor(e.from+e.insert.length,-1)};else if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let i=r.frome.to?n.sliceDoc(e.to,r.to):"";s=n.replaceSelection(t.state.toText(i+e.insert.sliceString(0,void 0,t.state.lineBreak)+o))}else{let o=n.changes(e),l=i&&i.main.to<=o.newLength?i.main:void 0;if(n.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=r.to+10&&e.to>=r.to-10){let a,h=t.state.sliceDoc(e.from,e.to),c=i&&or(t,i.main.head);if(c){let t=e.insert.length-(e.to-e.from);a={from:c.from,to:c.to-t}}else a=t.state.doc.lineAt(r.head);let u=r.to-e.to;s=n.changeByRange(i=>{if(i.from==r.from&&i.to==r.to)return{changes:o,range:l||i.map(o)};let s=i.to-u,c=s-h.length;if(t.state.sliceDoc(c,s)!=h||s>=a.from&&c<=a.to)return{range:i};let f=n.changes({from:c,to:s,insert:e.insert}),d=i.to-r.to;return{changes:f,range:l?ue.range(Math.max(0,l.anchor+d),Math.max(0,l.head+d)):i.map(f)}})}else s={changes:o,selection:l&&n.selection.replaceRange(l)}}let l="input.type";(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1));return n.update(s,{userEvent:l,scrollIntoView:!0})}(t,e,i));return t.state.facet(rn).some(i=>i(t,e.from,e.to,o,l))||t.dispatch(l()),!0}function Or(t,e,i,s){let n=Math.min(t.length,e.length),r=0;for(;r0&&l>0&&t.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if("end"==s){i-=o+Math.max(0,r-Math.min(o,l))-r}if(o=o?r-i:0,l=r+(l-o),o=r}else if(l=l?r-i:0,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function Tr(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class Dr{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,Qi.safari&&t.contentDOM.addEventListener("input",()=>null),Qi.gecko&&function(t){Zr.has(t)||(Zr.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}(t.contentDOM.ownerDocument)}handleEvent(t){(function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let i,s=e.target;s!=t.contentDOM;s=s.parentNode)if(!s||11==s.nodeType||(i=Nn.get(s))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0})(this.view,t)&&!this.ignoreDuringComposition(t)&&("keydown"==t.type&&this.keydown(t)||(0!=this.view.updateState?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t)))}runHandlers(t,e){let i=this.handlers[t];if(i){for(let t of i.observers)t(this.view,e);for(let t of i.handlers){if(e.defaultPrevented)break;if(t(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=Pr(t),i=this.handlers,s=this.view.contentDOM;for(let t in e)if("scroll"!=t){let n=!e[t].handlers.length,r=i[t];r&&n!=!r.handlers.length&&(s.removeEventListener(t,this.handleEvent),r=null),r||s.addEventListener(t,this.handleEvent,{passive:n})}for(let t in i)"scroll"==t||e[t]||s.removeEventListener(t,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=t.keyCode&&Lr.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),Qi.android&&Qi.chrome&&!t.synthetic&&(13==t.keyCode||8==t.keyCode))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let e;return!Qi.ios||t.synthetic||t.altKey||t.metaKey||t.shiftKey||!((e=Br.find(e=>e.keyCode==t.keyCode))&&!t.ctrlKey||Er.indexOf(t.key)>-1&&t.ctrlKey)?(229!=t.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=e||t,setTimeout(()=>this.flushIOSKey(),250),!0)}flushIOSKey(t){let e=this.pendingIOSKey;return!!e&&(!("Enter"==e.key&&t&&t.from0||!!(Qi.safari&&!Qi.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Rr(t,e){return(i,s)=>{try{return e.call(t,s,i)}catch(t){mn(i.state,t)}}}function Pr(t){let e=Object.create(null);function i(t){return e[t]||(e[t]={observers:[],handlers:[]})}for(let e of t){let t=e.spec,s=t&&t.plugin.domEventHandlers,n=t&&t.plugin.domEventObservers;if(s)for(let t in s){let n=s[t];n&&i(t).handlers.push(Rr(e.value,n))}if(n)for(let t in n){let s=n[t];s&&i(t).observers.push(Rr(e.value,s))}}for(let t in Wr)i(t).handlers.push(Wr[t]);for(let t in Hr)i(t).observers.push(Hr[t]);return e}const Br=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Er="dthko",Lr=[16,17,18,20,91,92,224,225];function Nr(t){return.7*Math.max(0,t)+8}class Ir{constructor(t,e,i,s){this.view=t,this.startEvent=e,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=ks(t.contentDOM),this.atoms=t.state.facet(Mn).map(e=>e(t));let n=t.contentDOM.ownerDocument;n.addEventListener("mousemove",this.move=this.move.bind(this)),n.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(ii.allowMultipleSelections)&&function(t,e){let i=t.state.facet(Zs);return i.length?i[0](e):Qi.mac?e.metaKey:e.ctrlKey}(t,e),this.dragging=!(!function(t,e){let{main:i}=t.state.selection;if(i.empty)return!1;let s=cs(t.root);if(!s||0==s.rangeCount)return!0;let n=s.getRangeAt(0).getClientRects();for(let t=0;t=e.clientX&&i.top<=e.clientY&&i.bottom>=e.clientY)return!0}return!1}(t,e)||1!=Ur(e))&&null}start(t){!1===this.dragging&&this.select(t)}move(t){if(0==t.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(e=this.startEvent,i=t,Math.max(Math.abs(e.clientX-i.clientX),Math.abs(e.clientY-i.clientY))<10))return;var e,i;this.select(this.lastEvent=t);let s=0,n=0,r=0,o=0,l=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:l}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:a}=this.scrollParents.y.getBoundingClientRect());let h=Rn(this.view);t.clientX-h.left<=r+6?s=-Nr(r-t.clientX):t.clientX+h.right>=l-6&&(s=Nr(t.clientX-l)),t.clientY-h.top<=o+6?n=-Nr(o-t.clientY):t.clientY+h.bottom>=a-6&&(n=Nr(t.clientY-a)),this.setScrollSpeed(s,n)}up(t){null==this.dragging&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:e}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),!1===this.dragging&&this.select(this.lastEvent)}select(t){let{view:e}=this,i=dr(this.atoms,this.style.get(t,this.extend,this.multiple));!this.mustSelect&&i.eq(e.state.selection,!1===this.dragging)||this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}const Wr=Object.create(null),Hr=Object.create(null),Vr=Qi.ie&&Qi.ie_version<15||Qi.ios&&Qi.webkit_version<604;function Fr(t,e,i){for(let s of t.facet(e))i=s(i,t);return i}function zr(t,e){e=Fr(t.state,ln,e);let i,{state:s}=t,n=1,r=s.toText(e),o=r.lines==s.selection.ranges.length;if(null!=Qr&&s.selection.ranges.every(t=>t.empty)&&Qr==r.toString()){let t=-1;i=s.changeByRange(i=>{let l=s.doc.lineAt(i.from);if(l.from==t)return{range:i};t=l.from;let a=s.toText((o?r.line(n++).text:e)+s.lineBreak);return{changes:{from:l.from,insert:a},range:ue.cursor(i.from+a.length)}})}else i=o?s.changeByRange(t=>{let e=r.line(n++);return{changes:{from:t.from,to:t.to,insert:e.text},range:ue.cursor(t.from+e.length)}}):s.replaceSelection(r);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}function qr(t,e,i,s){if(1==s)return ue.cursor(e,i);if(2==s)return function(t,e,i=1){let s=t.charCategorizer(e),n=t.doc.lineAt(e),r=e-n.from;if(0==n.length)return ue.cursor(e);0==r?i=1:r==n.length&&(i=-1);let o=r,l=r;i<0?o=Gt(n.text,r,!1):l=Gt(n.text,r);let a=s(n.text.slice(o,l));for(;o>0;){let t=Gt(n.text,o,!1);if(s(n.text.slice(t,o))!=a)break;o=t}for(;l{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft},Hr.wheel=Hr.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()},Wr.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),27==e.keyCode&&0!=t.inputState.tabFocusMode&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),Hr.touchstart=(t,e)=>{let i=t.inputState,s=e.targetTouches[0];i.lastTouchTime=Date.now(),s&&(i.lastTouchX=s.clientX,i.lastTouchY=s.clientY),i.setSelectionOrigin("select.pointer")},Hr.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},Wr.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let i=null;for(let s of t.state.facet(en))if(i=s(t,e),i)break;if(i||0!=e.button||(i=function(t,e){let i=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),s=Ur(e),n=t.state.selection;return{update(t){t.docChanged&&(i.pos=t.changes.mapPos(i.pos),n=n.map(t.changes))},get(e,r,o){let l,a=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),h=qr(t,a.pos,a.assoc,s);if(i.pos!=a.pos&&!r){let e=qr(t,i.pos,i.assoc,s),n=Math.min(e.from,h.from),r=Math.max(e.to,h.to);h=n1&&(l=function(t,e){for(let i=0;i=e)return ue.create(t.ranges.slice(0,i).concat(t.ranges.slice(i+1)),t.mainIndex==i?0:t.mainIndex-(t.mainIndex>i?1:0))}return null}(n,a.pos))?l:o?n.addRange(h):ue.create([h])}}}(t,e)),i){let s=!t.hasFocus;t.inputState.startMouseSelection(new Ir(t,e,i,s)),s&&t.observer.ignore(()=>{Ms(t.contentDOM);let e=t.root.activeElement;e&&!e.contains(t.contentDOM)&&e.blur()});let n=t.inputState.mouseSelection;if(n)return n.start(e),!1===n.dragging}else t.inputState.setSelectionOrigin("select.pointer");return!1};const _r=Qi.ie&&Qi.ie_version<=11;let $r=null,jr=0,Kr=0;function Ur(t){if(!_r)return t.detail;let e=$r,i=Kr;return $r=t,Kr=Date.now(),jr=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(jr+1)%3:1}function Yr(t,e,i,s){if(!(i=Fr(t.state,ln,i)))return;let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=t.inputState,o=s&&r&&function(t,e){let i=t.state.facet(tn);return i.length?i[0](e):Qi.mac?!e.altKey:!e.ctrlKey}(t,e)?{from:r.from,to:r.to}:null,l={from:n,insert:i},a=t.state.changes(o?[o,l]:l);t.focus(),t.dispatch({changes:a,selection:{anchor:a.mapPos(n,-1),head:a.mapPos(n,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Wr.dragstart=(t,e)=>{let{selection:{main:i}}=t.state;if(e.target.draggable){let s=t.docView.tile.nearest(e.target);if(s&&s.isWidget()){let t=s.posAtStart,e=t+s.length;(t>=i.to||e<=i.from)&&(i=ue.range(t,e))}}let{inputState:s}=t;return s.mouseSelection&&(s.mouseSelection.dragging=!0),s.draggedContent=i,e.dataTransfer&&(e.dataTransfer.setData("Text",Fr(t.state,an,t.state.sliceDoc(i.from,i.to))),e.dataTransfer.effectAllowed="copyMove"),!1},Wr.dragend=t=>(t.inputState.draggedContent=null,!1),Wr.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let i=e.dataTransfer.files;if(i&&i.length){let s=Array(i.length),n=0,r=()=>{++n==i.length&&Yr(t,e,s.filter(t=>null!=t).join(t.state.lineBreak),!1)};for(let t=0;t{/[\x00-\x08\x0e-\x1f]{2}/.test(e.result)||(s[t]=e.result),r()},e.readAsText(i[t])}return!0}{let i=e.dataTransfer.getData("Text");if(i)return Yr(t,e,i,!0),!0}return!1},Wr.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let i=Vr?null:e.clipboardData;return i?(zr(t,i.getData("text/plain")||i.getData("text/uri-list")),!0):(function(t){let e=t.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout(()=>{t.focus(),i.remove(),zr(t,i.value)},50)}(t),!1)};let Qr=null;Wr.copy=Wr.cut=(t,e)=>{if(!fs(t.contentDOM,t.observer.selectionRange))return!1;let{text:i,ranges:s,linewise:n}=function(t){let e=[],i=[],s=!1;for(let s of t.selection.ranges)s.empty||(e.push(t.sliceDoc(s.from,s.to)),i.push(s));if(!e.length){let n=-1;for(let{from:s}of t.selection.ranges){let r=t.doc.lineAt(s);r.number>n&&(e.push(r.text),i.push({from:r.from,to:Math.min(t.doc.length,r.to+1)})),n=r.number}s=!0}return{text:Fr(t,an,e.join(t.lineBreak)),ranges:i,linewise:s}}(t.state);if(!i&&!n)return!1;Qr=n?i:null,"cut"!=e.type||t.state.readOnly||t.dispatch({changes:s,scrollIntoView:!0,userEvent:"delete.cut"});let r=Vr?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",i),!0):(function(t,e){let i=t.dom.parentNode;if(!i)return;let s=i.appendChild(document.createElement("textarea"));s.style.cssText="position: fixed; left: -10000px; top: 10px",s.value=e,s.focus(),s.selectionEnd=e.length,s.selectionStart=0,setTimeout(()=>{s.remove(),t.focus()},50)}(t,i),!1)};const Gr=ze.define();function Xr(t,e){let i=[];for(let s of t.facet(on)){let n=s(t,e);n&&i.push(n)}return i.length?t.update({effects:i,annotations:Gr.of(!0)}):null}function Jr(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let i=Xr(t.state,e);i?t.dispatch(i):t.update([])}},10)}Hr.focus=t=>{t.inputState.lastFocusTime=Date.now(),t.scrollDOM.scrollTop||!t.inputState.lastScrollTop&&!t.inputState.lastScrollLeft||(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),Jr(t)},Hr.blur=t=>{t.observer.clearSelectionRange(),Jr(t)},Hr.compositionstart=Hr.compositionupdate=t=>{t.observer.editContext||(null==t.inputState.compositionFirstChange&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},Hr.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Qi.chrome&&Qi.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))},Hr.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},Wr.beforeinput=(t,e)=>{var i,s;if("insertText"!=e.inputType&&"insertCompositionText"!=e.inputType||(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),"insertReplacementText"==e.inputType&&t.observer.editContext){let s=null===(i=e.dataTransfer)||void 0===i?void 0:i.getData("text/plain"),n=e.getTargetRanges();if(s&&n.length){let e=n[0],i=t.posAtDOM(e.startContainer,e.startOffset),r=t.posAtDOM(e.endContainer,e.endOffset);return Mr(t,{from:i,to:r,insert:t.state.toText(s)},null),!0}}let n;if(Qi.chrome&&Qi.android&&(n=Br.find(t=>t.inputType==e.inputType))&&(t.observer.delayAndroidKey(n.key,n.keyCode),"Backspace"==n.key||"Delete"==n.key)){let e=(null===(s=window.visualViewport)||void 0===s?void 0:s.height)||0;setTimeout(()=>{var i;((null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0)>e+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Qi.ios&&"deleteContentForward"==e.inputType&&t.observer.flushSoon(),Qi.safari&&"insertText"==e.inputType&&t.inputState.composing>=0&&setTimeout(()=>Hr.compositionend(t,e),20),!1};const Zr=new Set;const to=["pre-wrap","normal","pre-line","break-spaces"];let eo=!1;function io(){eo=!1}class so{constructor(t){this.lineWrapping=t,this.doc=Ft.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){if(!this.lineWrapping)return this.lineHeight;return(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return to.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i-1,l=Math.abs(e-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=e,this.charWidth=i,this.textHeight=s,this.lineLength=n,l){this.heightSamples={};for(let t=0;t0}set outdated(t){this.flags=(t?2:0)|-3&this.flags}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>lo&&(eo=!0),this.height=t)}replace(t,e,i){return ao.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,s){let n=this,r=i.doc;for(let o=s.length-1;o>=0;o--){let{fromA:l,toA:a,fromB:h,toB:c}=s[o],u=n.lineAt(l,oo.ByPosNoHeight,i.setDoc(e),0,0),f=u.to>=a?u:n.lineAt(a,oo.ByPosNoHeight,i,0,0);for(c+=f.to-a,a=f.to;o>0&&u.from<=s[o-1].toA;)l=s[o-1].fromA,h=s[o-1].fromB,o--,l2*n){let n=t[e-1];n.break?t.splice(--e,1,n.left,null,n.right):t.splice(--e,1,n.left,n.right),i+=1+n.break,s-=n.size}else{if(!(n>2*s))break;{let e=t[i];e.break?t.splice(i,1,e.left,null,e.right):t.splice(i,1,e.left,e.right),i+=2+e.break,n-=e.size}}else if(s=n&&r(this.lineAt(0,oo.ByPos,i,s,n))}setMeasuredHeight(t){let e=t.heights[t.index++];e<0?(this.spaceAbove=-e,e=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(e)}updateHeight(t,e=0,i=!1,s){return s&&s.from<=e&&s.more&&this.setMeasuredHeight(s),this.outdated=!1,this}toString(){return`block(${this.length})`}}class fo extends uo{constructor(t,e,i){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(t,e){return new ro(e,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,e,i){let s=i[0];return 1==i.length&&(s instanceof fo||s instanceof po&&4&s.flags)&&Math.abs(this.length-s.length)<10?(s instanceof po?s=new fo(s.length,this.height,this.spaceAbove):s.height=this.height,this.outdated||(s.outdated=!1),s):ao.of(i)}updateHeight(t,e=0,i=!1,s){return s&&s.from<=e&&s.more?this.setMeasuredHeight(s):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class po extends ao{constructor(t){super(t,0)}heightMetrics(t,e){let i,s=t.doc.lineAt(e).number,n=t.doc.lineAt(e+this.length).number,r=n-s+1,o=0;if(t.lineWrapping){let e=Math.min(this.height,t.lineHeight*r);i=e/r,this.length>r+1&&(o=(this.height-e)/(this.length-r-1))}else i=this.height/r;return{firstLine:s,lastLine:n,perLine:i,perChar:o}}blockAt(t,e,i,s){let{firstLine:n,lastLine:r,perLine:o,perChar:l}=this.heightMetrics(e,s);if(e.lineWrapping){let n=s+(t0){let t=i[i.length-1];t instanceof po?i[i.length-1]=new po(t.length+s):i.push(null,new po(s-1))}if(t>0){let e=i[0];e instanceof po?i[0]=new po(t+e.length):i.unshift(new po(t-1),null)}return ao.of(i)}decomposeLeft(t,e){e.push(new po(t-1),null)}decomposeRight(t,e){e.push(null,new po(this.length-t-1))}updateHeight(t,e=0,i=!1,s){let n=e+this.length;if(s&&s.from<=e+this.length&&s.more){let i=[],r=Math.max(e,s.from),o=-1;for(s.from>e&&i.push(new po(s.from-e-1).updateHeight(t,e));r<=n&&s.more;){let e=t.doc.lineAt(r).length;i.length&&i.push(null);let n=s.heights[s.index++],l=0;n<0&&(l=-n,n=s.heights[s.index++]),-1==o?o=n:Math.abs(n-o)>=lo&&(o=-2);let a=new fo(e,n,l);a.outdated=!1,i.push(a),r+=e+1}r<=n&&i.push(null,new po(n-r).updateHeight(t,r));let l=ao.of(i);return(o<0||Math.abs(l.height-this.height)>=lo||Math.abs(o-this.heightMetrics(t,e).perLine)>=lo)&&(eo=!0),ho(this,l)}return(i||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class mo extends ao{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return 1&this.flags}blockAt(t,e,i,s){let n=i+this.left.height;return to))return a;let h=e==oo.ByPosNoHeight?oo.ByPosNoHeight:oo.ByPos;return l?a.join(this.right.lineAt(o,h,i,r,o)):this.left.lineAt(o,h,i,s,n).join(a)}forEachLine(t,e,i,s,n,r){let o=s+this.left.height,l=n+this.left.length+this.break;if(this.break)t=l&&this.right.forEachLine(t,e,i,o,l,r);else{let a=this.lineAt(l,oo.ByPos,i,s,n);t=t&&a.from<=e&&r(a),e>a.to&&this.right.forEachLine(a.to+1,e,i,o,l,r)}}replace(t,e,i){let s=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-s,e-s,i));let n=[];t>0&&this.decomposeLeft(t,n);let r=n.length;for(let t of i)n.push(t);if(t>0&&go(n,r-1),e=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,s=i+this.break;if(t>=s)return this.right.decomposeRight(t-s,e);t2*e.size||e.size>2*t.size?ao.of(this.break?[t,null,e]:[t,e]):(this.left=ho(this.left,t),this.right=ho(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,s){let{left:n,right:r}=this,o=e+n.length+this.break,l=null;return s&&s.from<=e+n.length&&s.more?l=n=n.updateHeight(t,e,i,s):n.updateHeight(t,e,i),s&&s.from<=o+r.length&&s.more?l=r=r.updateHeight(t,o,i,s):r.updateHeight(t,o,i),l?this.balanced(n,r):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function go(t,e){let i,s;null==t[e]&&(i=t[e-1])instanceof po&&(s=t[e+1])instanceof po&&t.splice(e-1,3,new po(i.length+1+s.length))}class vo{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let t=Math.min(e,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof fo?i.length+=t-this.pos:(t>this.pos||!this.isCovered)&&this.nodes.push(new fo(t-this.pos,-1,0)),this.writtenTo=t,e>t&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t=5)&&this.addLineDeco(s,n,r)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTot&&this.nodes.push(new fo(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,e){let i=new po(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof fo)return t;let e=new fo(0,-1,0);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,t),s.breaks+=e,this.writtenTo=this.pos=this.pos+i}finish(t){let e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof fo||this.isCovered?(this.writtenToi.clientHeight||i.scrollWidth>i.clientWidth)&&"visible"!=s.overflow){let s=i.getBoundingClientRect();r=Math.max(r,s.left),o=Math.min(o,s.right),l=Math.max(l,s.top),a=Math.min(e==t.parentNode?n.innerHeight:a,s.bottom)}e="absolute"==s.position||"fixed"==s.position?i.offsetParent:i.parentNode}else{if(11!=e.nodeType)break;e=e.host}return{left:r-i.left,right:Math.max(r,o)-i.left,top:l-(i.top+e),bottom:Math.max(l,a)-(i.top+e)}}function yo(t,e){let i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)}}class xo{constructor(t,e,i,s){this.from=t,this.to=e,this.size=i,this.displaySize=s}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;i"function"!=typeof t&&"cm-lineWrapping"==t.class);this.heightOracle=new so(i),this.stateDeco=To(e),this.heightMap=ao.empty().applyChanges(this.stateDeco,Ft.empty,this.heightOracle.setDoc(e.doc),[new Bn(0,0,0,e.doc.length)]);for(let t=0;t<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());t++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=ss.set(this.lineGaps.map(t=>t.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let s=i?e.head:e.anchor;if(!t.some(({from:t,to:e})=>s>=t&&s<=e)){let{from:e,to:i}=this.lineBlockAt(s);t.push(new Co(e,i))}}return this.viewports=t.sort((t,e)=>t.from-e.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?Oo:new Do(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(Ro(t,this.scaler))})}update(t,e=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=To(this.state);let s=t.changedRanges,n=Bn.extendWithRanges(s,function(t,e,i){let s=new wo;return hi.compare(t,e,i,s,0),s.changes}(i,this.stateDeco,t?t.changes:se.empty(this.state.doc.length))),r=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);io(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),n),(this.heightMap.height!=r||eo)&&(t.flags|=2),o?(this.scrollAnchorPos=t.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=r);let l=n.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,e));let a=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,t.flags|=this.updateForViewport(),(a||!t.changes.empty||2&t.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(cn)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,e=t.contentDOM,i=window.getComputedStyle(e),s=this.heightOracle,n=i.whiteSpace;this.defaultTextDirection="rtl"==i.direction?Es.RTL:Es.LTR;let r=this.heightOracle.mustRefreshForWrapping(n)||"refresh"===this.mustMeasureContent,o=e.getBoundingClientRect(),l=r||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let a=0,h=0;if(o.width&&o.height){let{scaleX:t,scaleY:i}=xs(e,o);(t>.005&&Math.abs(this.scaleX-t)>.005||i>.005&&Math.abs(this.scaleY-i)>.005)&&(this.scaleX=t,this.scaleY=i,a|=16,r=l=!0)}let c=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;this.paddingTop==c&&this.paddingBottom==u||(this.paddingTop=c,this.paddingBottom=u,a|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(s.lineWrapping&&(l=!0),this.editorWidth=t.scrollDOM.clientWidth,a|=16);let f=ks(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let d=this.getScrollOffset();this.scrollOffset!=d&&(this.scrollAnchorHeight=-1,this.scrollOffset=d),this.scrolledToBottom=Ds(this.scrollParent||t.win);let p=(this.printing?yo:bo)(e,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(l=!0)),!this.inView&&!this.scrollTarget&&!function(t){let e=t.getBoundingClientRect(),i=t.ownerDocument.defaultView||window;return e.left0&&e.top0}(t.dom))return 0;let w=o.width;if(this.contentDOMWidth==w&&this.editorHeight==t.scrollDOM.clientHeight||(this.contentDOMWidth=o.width,this.editorHeight=t.scrollDOM.clientHeight,a|=16),l){let e=t.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(e)&&(r=!0),r||s.lineWrapping&&Math.abs(w-this.contentDOMWidth)>s.charWidth){let{lineHeight:i,charWidth:o,textHeight:l}=t.docView.measureTextSize();r=i>0&&s.refresh(n,i,o,l,Math.max(5,w/o),e),r&&(t.docView.minWidth=0,a|=16)}m>0&&g>0?h=Math.max(m,g):m<0&&g<0&&(h=Math.min(m,g)),io();for(let i of this.viewports){let n=i.from==this.viewport.from?e:t.docView.measureVisibleLineHeights(i);this.heightMap=(r?ao.empty().applyChanges(this.stateDeco,Ft.empty,this.heightOracle,[new Bn(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(s,0,r,new no(i.from,n))}eo&&(a|=2)}let b=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return b&&(2&a&&(a|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),a|=this.updateForViewport()),(2&a||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(r?[]:this.lineGaps,t)),a|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),a}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),s=this.heightMap,n=this.heightOracle,{visibleTop:r,visibleBottom:o}=this,l=new Co(s.lineAt(r-1e3*i,oo.ByHeight,n,0,0).from,s.lineAt(o+1e3*(1-i),oo.ByHeight,n,0,0).to);if(e){let{head:t}=e.range;if(tl.to){let i,r=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),o=s.lineAt(t,oo.ByPos,n,0,0);i="center"==e.y?(o.top+o.bottom)/2-r/2:"start"==e.y||"nearest"==e.y&&t=o+Math.max(10,Math.min(i,250)))&&s>r-2e3&&n>1,r=s<<1;if(this.defaultTextDirection!=Es.LTR&&!i)return[];let o=[],l=(s,r,a,h)=>{if(r-ss&&tt.from>=a.from&&t.to<=a.to&&Math.abs(t.from-s)t.frome));if(!f){if(rt.from<=r&&t.to>=r)){let t=e.moveToLineBoundary(ue.cursor(r),!1,!0).head;t>s&&(r=t)}let t=this.gapSize(a,s,r,h);f=new xo(s,r,t,i||t<2e6?t:2e6)}o.push(f)},a=e=>{if(e.lengthn&&(s.push({from:n,to:t}),r+=t-n),n=e}},20),n2e6)for(let i of t)i.from>=e.from&&i.frome.from&&l(e.from,o,e,n),at.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let i=[];hi.spans(e,this.viewport.from,this.viewport.to,{span(t,e){i.push({from:t,to:e})},point(){}},20);let s=0;if(i.length!=this.visibleRanges.length)s=12;else for(let e=0;e=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(e=>e.from<=t&&e.to>=t)||Ro(this.heightMap.lineAt(t,oo.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(e=>e.top<=t&&e.bottom>=t)||Ro(this.heightMap.lineAt(this.scaler.fromDOM(t),oo.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return Ro(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Co{constructor(t,e){this.from=t,this.to=e}}function Ao({total:t,ranges:e},i){if(i<=0)return e[0].from;if(i>=1)return e[e.length-1].to;let s=Math.floor(t*i);for(let t=0;;t++){let{from:i,to:n}=e[t],r=n-i;if(s<=r)return i+s;s-=r}}function Mo(t,e){let i=0;for(let{from:s,to:n}of t.ranges){if(e<=n){i+=e-s;break}i+=n-s}return i/t.total}const Oo={toDOM:t=>t,fromDOM:t=>t,scale:1,eq(t){return t==this}};function To(t){let e=t.facet(Sn).filter(t=>"function"!=typeof t),i=t.facet(An).filter(t=>"function"!=typeof t);return i.length&&e.push(hi.join(i)),e}class Do{constructor(t,e,i){let s=0,n=0,r=0;this.viewports=i.map(({from:i,to:n})=>{let r=e.lineAt(i,oo.ByPos,t,0,0).top,o=e.lineAt(n,oo.ByPos,t,0,0).bottom;return s+=o-r,{from:i,to:n,top:r,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(e.height-s);for(let t of this.viewports)t.domTop=r+(t.top-n)*this.scale,r=t.domBottom=t.domTop+(t.bottom-t.top),n=t.bottom}toDOM(t){for(let e=0,i=0,s=0;;e++){let n=ee.from==t.viewports[i].from&&e.to==t.viewports[i].to))}}function Ro(t,e){if(1==e.scale)return t;let i=e.toDOM(t.top),s=e.toDOM(t.bottom);return new ro(t.from,t.length,i,s-i,Array.isArray(t._content)?t._content.map(t=>Ro(t,e)):t._content)}const Po=pe.define({combine:t=>t.join(" ")}),Bo=pe.define({combine:t=>t.indexOf(!0)>-1}),Eo=Oi.newName(),Lo=Oi.newName(),No=Oi.newName(),Io={"&light":"."+Lo,"&dark":"."+No};function Wo(t,e,i){return new Oi(e,{finish:e=>/&/.test(e)?e.replace(/&\w*/,e=>{if("&"==e)return t;if(!i||!i[e])throw new RangeError(`Unsupported selector: ${e}`);return i[e]}):t+" "+e})}const Ho=Wo("."+Eo,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Io),Vo={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Fo=Qi.ie&&Qi.ie_version<=11;class zo{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new Ss,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(e=>{for(let t of e)this.queue.push(t);(Qi.ie&&Qi.ie_version<=11||Qi.ios&&t.composing)&&e.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),!window.EditContext||!Qi.android||!1===t.constructor.EDIT_CONTEXT||Qi.chrome&&Qi.chrome_version<126||(this.editContext=new $o(t),t.state.facet(gn)&&(t.contentDOM.editContext=this.editContext.editContext)),Fo&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(()=>{var t;(null===(t=this.view.docView)||void 0===t?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){("change"!=t.type&&t.type||t.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((e,i)=>e!=t[i]))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(gn)?i.root.activeElement!=this.dom:!fs(this.dom,s))return;let n=s.anchorNode&&i.docView.tile.nearest(s.anchorNode);n&&n.isWidget()&&n.widget.ignoreEvent(t)?e||(this.selectionChanged=!1):(Qi.ie&&Qi.ie_version<=11||Qi.android&&Qi.chrome)&&!i.state.selection.main.empty&&s.focusNode&&ps(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=cs(t.root);if(!e)return!1;let i=Qi.safari&&11==t.root.nodeType&&t.root.activeElement==this.dom&&function(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return _o(t,i)}let i=null;function s(t){t.preventDefault(),t.stopImmediatePropagation(),i=t.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",s,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",s,!0),i?_o(t,i):null}(this.view,e)||e;if(!i||this.selectionRange.eq(i))return!1;let s=fs(this.dom,i);return s&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let t=this.delayedAndroidKey;if(t){this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=t.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&t.force&&Ts(this.dom,t.key,t.keyCode)}};this.flushingAndroidKey=this.view.win.requestAnimationFrame(t)}this.delayedAndroidKey&&"Enter"!=t||(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,i=-1,s=!1;for(let n of t){let t=this.readMutation(n);t&&(t.typeOver&&(s=!0),-1==e?({from:e,to:i}=t):(e=Math.min(t.from,e),i=Math.max(t.to,i)))}return{from:e,to:i,typeOver:s}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),s=this.selectionChanged&&fs(this.dom,this.selectionRange);if(t<0&&!s)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let n=new Sr(this.view,t,e,i);return this.view.docView.domChanged={newSel:n.newSel?n.newSel.main:null},n}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let i=this.view.state,s=Ar(this.view,e);return this.view.state==i&&(e.domChanged||e.newSel&&!Tr(this.view.state.selection,e.newSel.main))&&this.view.update([]),s}readMutation(t){let e=this.view.docView.tile.nearest(t.target);if(!e||e.isWidget())return null;if(e.markDirty("attributes"==t.type),"childList"==t.type){let i=qo(e,t.previousSibling||t.target.previousSibling,-1),s=qo(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:s?e.posBefore(s):e.posAtEnd,typeOver:!1}}return"characterData"==t.type?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(gn)!=t.state.facet(gn)&&(t.view.contentDOM.editContext=t.state.facet(gn)?this.editContext.editContext:null))}destroy(){var t,e,i;this.stop(),null===(t=this.intersection)||void 0===t||t.disconnect(),null===(e=this.gapIntersection)||void 0===e||e.disconnect(),null===(i=this.resizeScroll)||void 0===i||i.disconnect();for(let t of this.scrollTargets)t.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function qo(t,e,i){for(;e;){let s=Nn.get(e);if(s&&s.parent==t)return s;let n=e.parentNode;e=n!=t.dom?n:i>0?e.nextSibling:e.previousSibling}return null}function _o(t,e){let i=e.startContainer,s=e.startOffset,n=e.endContainer,r=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return ps(o.node,o.offset,n,r)&&([i,s,n,r]=[n,r,i,s]),{anchorNode:i,anchorOffset:s,focusNode:n,focusOffset:r}}class $o{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let s=t.state.selection.main,{anchor:n,head:r}=s,o=this.toEditorPos(i.updateRangeStart),l=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:o,drifted:!1});let a=l-o>i.text.length;o==this.from&&nthis.to&&(l=n);let h=Or(t.state.sliceDoc(o,l),i.text,(a?s.from:s.to)-o,a?"end":null);if(!h){let e=ue.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));return void(Tr(e,s)||t.dispatch({selection:e,userEvent:"select"}))}let c={from:h.from+o,to:h.toA+o,insert:Ft.of(i.text.slice(h.from,h.toB).split("\n"))};if((Qi.mac||Qi.android)&&c.from==r-1&&/^\. ?$/.test(i.text)&&"off"==t.contentDOM.getAttribute("autocorrect")&&(c={from:o,to:l,insert:Ft.of([i.text.replace("."," ")])}),this.pendingContextChange=c,!t.state.readOnly){let e=this.to-this.from+(c.to-c.from+c.insert.length);Mr(t,c,ue.single(this.toEditorPos(i.selectionStart,e),this.toEditorPos(i.selectionEnd,e)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),c.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(e.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(e.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let s=[],n=null;for(let e=this.toEditorPos(i.rangeStart),r=this.toEditorPos(i.rangeEnd);e{let i=[];for(let t of e.getTextFormats()){let e=t.underlineStyle,s=t.underlineThickness;if(!/none/i.test(e)&&!/none/i.test(s)){let n=this.toEditorPos(t.rangeStart),r=this.toEditorPos(t.rangeEnd);if(n{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:e}=this.composing;this.composing=null,e&&this.reset(t.state)}};for(let t in this.handlers)e.addEventListener(t,this.handlers[t]);this.measureReq={read:t=>{this.editContext.updateControlBounds(t.contentDOM.getBoundingClientRect());let e=cs(t.root);e&&e.rangeCount&&this.editContext.updateSelectionBounds(e.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,i=!1,s=this.pendingContextChange;return t.changes.iterChanges((n,r,o,l,a)=>{if(i)return;let h=a.length-(r-n);if(s&&r>=s.to){if(s.from==n&&s.to==r&&s.insert.eq(a))return s=this.pendingContextChange=null,e+=h,void(this.to+=h);s=null,this.revertPending(t.state)}if(n+=e,(r+=e)<=this.from)this.from+=h,this.to+=h;else if(nthis.to||this.to-this.from+a.length>3e4)return void(i=!0);this.editContext.updateText(this.toContextPos(n),this.toContextPos(r),a.toString()),this.to+=h}e+=h}),s&&!i&&this.revertPending(t.state),!i}update(t){let e=this.pendingContextChange,i=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some(t=>!t.isUserEvent("input.type")&&t.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):this.applyEdits(t)&&this.rangeIsValid(t.state)?(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state):(this.pendingContextChange=null,this.reset(t.state)),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),s=this.toContextPos(e.head);this.editContext.selectionStart==i&&this.editContext.selectionEnd==s||this.editContext.updateSelection(i,s)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to3e4)}toEditorPos(t,e=this.to-this.from){t=Math.min(t,e);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let e=this.composing;return e&&e.drifted?e.contextBase+(t-e.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class jo{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var e;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(t=>t.forEach(t=>i(t,this)))||(t=>this.update(t)),this.dispatch=this.dispatch.bind(this),this._root=t.root||function(t){for(;t;){if(t&&(9==t.nodeType||11==t.nodeType&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}(t.parent)||document,this.viewState=new So(this,t.state||ii.create(t)),t.scrollTo&&t.scrollTo.is(dn)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(wn).map(t=>new yn(t));for(let t of this.plugins)t.update(this);this.observer=new zo(this),this.inputState=new Dr(this),this.inputState.ensureHandlers(this.plugins),this.docView=new nr(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(e=document.fonts)||void 0===e?void 0:e.ready)&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let e=1==t.length&&t[0]instanceof je?t:1==t.length&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e,i=!1,s=!1,n=this.state;for(let e of t){if(e.startState!=n)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");n=e.state}if(this.destroyed)return void(this.viewState.state=n);let r=this.hasFocus,o=0,l=null;t.some(t=>t.annotation(Gr))?(this.inputState.notifiedFocused=r,o=1):r!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=r,l=Xr(n,r),l||(o=1));let a=this.observer.delayedAndroidKey,h=null;if(a?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(n.doc)||!this.state.selection.eq(n.selection))&&(h=null)):this.observer.clear(),n.facet(ii.phrases)!=this.state.facet(ii.phrases))return this.setState(n);e=En.create(this,n,t),e.flags|=o;let c=this.viewState.scrollTarget;try{this.updateState=2;for(let e of t){if(c&&(c=c.map(e.changes)),e.scrollIntoView){let{main:t}=e.state.selection,{x:i,y:s}=this.state.facet(jo.cursorScrollMargin);c=new fn(t.empty?t:ue.cursor(t.head,t.head>t.anchor?-1:1),"nearest","nearest",s,i)}for(let t of e.effects)t.is(dn)&&(c=t.value.clip(this.state))}this.viewState.update(e,c),this.bidiCache=Yo.update(this.bidiCache,e.changes),e.empty||(this.updatePlugins(e),this.inputState.update(e)),i=this.docView.update(e),this.state.facet(Pn)!=this.styleModules&&this.mountStyles(),s=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(i,t.some(t=>t.isUserEvent("select.pointer")))}finally{this.updateState=0}if(e.startState.facet(Po)!=e.state.facet(Po)&&(this.viewState.mustMeasureContent=!0),(i||s||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),i&&this.docViewUpdate(),!e.empty)for(let t of this.state.facet(nn))try{t(e)}catch(t){mn(this.state,t,"update listener")}(l||h)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),h&&!Ar(this,h)&&a.force&&Ts(this.contentDOM,a.key,a.keyCode)})}setState(t){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=t);this.updateState=2;let e=this.hasFocus;try{for(let t of this.plugins)t.destroy(this);this.viewState=new So(this,t),this.plugins=t.facet(wn).map(t=>new yn(t)),this.pluginMap.clear();for(let t of this.plugins)t.update(this);this.docView.destroy(),this.docView=new nr(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(wn),i=t.state.facet(wn);if(e!=i){let s=[];for(let n of i){let i=e.indexOf(n);if(i<0)s.push(new yn(n));else{let e=this.plugins[i];e.mustUpdate=t,s.push(e)}}for(let e of this.plugins)e.mustUpdate!=t&&e.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let e of this.plugins)e.mustUpdate=t;for(let t=0;t-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,i=this.viewState.scrollParent,s=this.viewState.getScrollOffset(),{scrollAnchorPos:n,scrollAnchorHeight:r}=this.viewState;Math.abs(s-this.viewState.scrollOffset)>1&&(r=-1),this.viewState.scrollAnchorHeight=-1;try{for(let t=0;;t++){if(r<0)if(Ds(i||this.win))n=-1,r=this.viewState.heightMap.height;else{let t=this.viewState.scrollAnchorAt(s);n=t.from,r=t.top}this.updateState=1;let o=this.viewState.measure();if(!o&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(t>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let l=[];4&o||([this.measureRequests,l]=[l,this.measureRequests]);let a=l.map(t=>{try{return t.read(this)}catch(t){return mn(this.state,t),Uo}}),h=En.create(this,this.state,[]),c=!1;h.flags|=o,e?e.flags|=o:e=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),c=this.docView.update(h),c&&this.docViewUpdate());for(let t=0;t1||t<-1)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){s+=t,i?i.scrollTop+=t:this.win.scrollBy(0,t),r=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let t of this.state.facet(nn))t(e)}get themeClasses(){return Eo+" "+(this.state.facet(Bo)?No:Lo)+" "+this.state.facet(Po)}updateAttrs(){let t=Qo(this,xn,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(gn)?"true":"false",class:"cm-content",style:`${Qi.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),Qo(this,kn,e);let i=this.observer.ignore(()=>{let i=Zi(this.contentDOM,this.contentAttrs,e),s=Zi(this.dom,this.editorAttrs,t);return i||s});return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let t of i.effects)if(t.is(jo.announce)){e&&(this.announceDOM.textContent=""),e=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(Pn);let t=this.state.facet(jo.cspNonce);Oi.mount(this.root,this.styleModules.concat(Ho).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(null!=t.key)for(let e=0;ee.plugin==t)||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return pr(this,t,ur(this,t,e,i))}moveByGroup(t,e){return pr(this,t,ur(this,t,e,e=>function(t,e,i){let s=t.state.charCategorizer(e),n=s(i);return t=>{let e=s(t);return n==Je.Space&&(n=e),n==e}}(this,t.head,e)))}visualLineSide(t,e){let i=this.bidiSpans(t),s=this.textDirectionAt(t.from),n=i[e?i.length-1:0];return ue.cursor(n.side(e,s)+t.from,n.forward(!e,s)?1:-1)}moveToLineBoundary(t,e,i=!0){return function(t,e,i,s){let n=cr(t,e.head,e.assoc||-1),r=s&&n.type==is.Text&&(t.lineWrapping||n.widgetLineBreaks)?t.coordsAtPos(e.assoc<0&&e.head>n.from?e.head-1:e.head):null;if(r){let e=t.dom.getBoundingClientRect(),s=t.textDirectionAt(n.from),o=t.posAtCoords({x:i==(s==Es.LTR)?e.right-1:e.left+1,y:(r.top+r.bottom)/2});if(null!=o)return ue.cursor(o,i?-1:1)}return ue.cursor(i?n.to:n.from,i?-1:1)}(this,t,e,i)}moveVertically(t,e,i){return pr(this,t,function(t,e,i,s){let n=e.head,r=i?1:-1;if(n==(i?t.state.doc.length:0))return ue.cursor(n,e.assoc);let o,l=e.goalColumn,a=t.contentDOM.getBoundingClientRect(),h=t.coordsAtPos(n,e.assoc||((e.empty?i:e.head==e.from)?1:-1)),c=t.documentTop;if(h)null==l&&(l=h.left-a.left),o=r<0?h.top:h.bottom;else{let e=t.viewState.lineBlockAt(n);null==l&&(l=Math.min(a.right-a.left,t.defaultCharacterWidth*(n-e.from))),o=(r<0?e.top:e.bottom)+c}let u=a.left+l,f=t.viewState.heightOracle.textHeight>>1,d=null!=s?s:f;for(let e=0;;e+=f){let s=o+(d+e)*r,n=gr(t,{x:u,y:s},!1,r);if(i?s>a.bottom:so:c0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(hn)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>Ko)return Qs(t.length);let e,i=this.textDirectionAt(t.from);for(let s of this.bidiCache)if(s.from==t.from&&s.dir==i&&(s.fresh||$s(s.isolates,e=Tn(this,t))))return s.order;e||(e=Tn(this,t));let s=Ys(t.text,i,e);return this.bidiCache.push(new Yo(t.from,t.to,i,e,!0,s)),s}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||Qi.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Ms(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((9==t.nodeType?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){var i,s,n,r;return dn.of(new fn("number"==typeof t?ue.cursor(t):t,null!==(i=e.y)&&void 0!==i?i:"nearest",null!==(s=e.x)&&void 0!==s?s:"nearest",null!==(n=e.yMargin)&&void 0!==n?n:5,null!==(r=e.xMargin)&&void 0!==r?r:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return dn.of(new fn(ue.cursor(i.from),"start","start",i.top-t,e,!0))}setTabFocusMode(t){null==t?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof t?this.inputState.tabFocusMode=t?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return bn.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return bn.define(()=>({}),{eventObservers:t})}static theme(t,e){let i=Oi.newName(),s=[Po.of(i),Pn.of(Wo(`.${i}`,t))];return e&&e.dark&&s.push(Bo.of(!0)),s}static baseTheme(t){return Oe.lowest(Pn.of(Wo("."+Eo,t,Io)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),s=i&&Nn.get(i)||Nn.get(t);return(null===(e=null==s?void 0:s.root)||void 0===e?void 0:e.view)||null}}jo.styleModule=Pn,jo.inputHandler=rn,jo.clipboardInputFilter=ln,jo.clipboardOutputFilter=an,jo.scrollHandler=un,jo.focusChangeEffect=on,jo.perLineTextDirection=hn,jo.exceptionSink=sn,jo.updateListener=nn,jo.editable=gn,jo.mouseSelectionStyle=en,jo.dragMovesSelection=tn,jo.clickAddsSelectionRange=Zs,jo.decorations=Sn,jo.blockWrappers=Cn,jo.outerDecorations=An,jo.atomicRanges=Mn,jo.bidiIsolatedRanges=On,jo.cursorScrollMargin=pe.define({combine:t=>{let e=5,i=5;for(let s of t)"number"==typeof s?e=i=s:({x:e,y:i}=s);return{x:e,y:i}}}),jo.scrollMargins=Dn,jo.darkTheme=Bo,jo.cspNonce=pe.define({combine:t=>t.length?t[0]:""}),jo.contentAttributes=kn,jo.editorAttributes=xn,jo.lineWrapping=jo.contentAttributes.of({class:"cm-lineWrapping"}),jo.announce=$e.define();const Ko=4096,Uo={};class Yo{constructor(t,e,i,s,n,r){this.from=t,this.to=e,this.dir=i,this.isolates=s,this.fresh=n,this.order=r}static update(t,e){if(e.empty&&!t.some(t=>t.fresh))return t;let i=[],s=t.length?t[t.length-1].dir:Es.LTR;for(let n=Math.max(0,t.length-10);n=0;n--){let e=s[n],r="function"==typeof e?e(t):e;r&&Gi(r,i)}return i}const Go=Qi.mac?"mac":Qi.windows?"win":Qi.linux?"linux":"key";function Xo(t,e,i){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==i&&e.shiftKey&&(t="Shift-"+t),t}const Jo=Oe.default(jo.domEventHandlers({keydown:(t,e)=>rl(el(e.state),t,e,"editor")})),Zo=pe.define({enables:Jo}),tl=new WeakMap;function el(t){let e=t.facet(Zo),i=tl.get(e);return i||tl.set(e,i=function(t,e=Go){let i=Object.create(null),s=Object.create(null),n=(t,e)=>{let i=s[t];if(null==i)s[t]=e;else if(i!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},r=(t,s,r,o,l)=>{var a,h;let c=i[t]||(i[t]=Object.create(null)),u=s.split(/ (?!$)/).map(t=>function(t,e){const i=t.split(/-(?!$)/);let s,n,r,o,l=i[i.length-1];"Space"==l&&(l=" ");for(let t=0;t{let s=il={view:e,prefix:i,scope:t};return setTimeout(()=>{il==s&&(il=null)},sl),!0}]})}let f=u.join(" ");n(f,!1);let d=c[f]||(c[f]={preventDefault:!1,stopPropagation:!1,run:(null===(h=null===(a=c._any)||void 0===a?void 0:a.run)||void 0===h?void 0:h.slice())||[]});r&&d.run.push(r),o&&(d.preventDefault=!0),l&&(d.stopPropagation=!0)};for(let s of t){let t=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let e of t){let t=i[e]||(i[e]=Object.create(null));t._any||(t._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:n}=s;for(let e in t)t[e].run.push(t=>n(t,nl))}let n=s[e]||s.key;if(n)for(let e of t)r(e,n,s.run,s.preventDefault,s.stopPropagation),s.shift&&r(e,"Shift-"+n,s.shift,s.preventDefault,s.stopPropagation)}return i}(e.reduce((t,e)=>t.concat(e),[]))),i}let il=null;const sl=4e3;let nl=null;function rl(t,e,i,s){nl=e;let n=function(t){var e=!(Bi&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Ei&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?Pi:Ri)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(e),r=Zt(Xt(n,0))==n.length&&" "!=n,o="",l=!1,a=!1,h=!1;il&&il.view==i&&il.scope==s&&(o=il.prefix+" ",Lr.indexOf(e.keyCode)<0&&(a=!0,il=null));let c,u,f=new Set,d=t=>{if(t){for(let e of t.run)if(!f.has(e)&&(f.add(e),e(i)))return t.stopPropagation&&(h=!0),!0;t.preventDefault&&(t.stopPropagation&&(h=!0),a=!0)}return!1},p=t[s];return p&&(d(p[o+Xo(n,e,!r)])?l=!0:!r||!(e.altKey||e.metaKey||e.ctrlKey)||Qi.windows&&e.ctrlKey&&e.altKey||Qi.mac&&e.altKey&&!e.ctrlKey&&!e.metaKey||!(c=Ri[e.keyCode])||c==n?r&&e.shiftKey&&d(p[o+Xo(n,e,!0)])&&(l=!0):(d(p[o+Xo(c,e,!0)])||e.shiftKey&&(u=Pi[e.keyCode])!=n&&u!=c&&d(p[o+Xo(u,e,!1)]))&&(l=!0),!l&&d(p._any)&&(l=!0)),a&&(l=!0),l&&h&&e.stopPropagation(),nl=null,l}class ol{constructor(t,e,i,s,n){this.className=t,this.left=e,this.top=i,this.width=s,this.height=n}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,e){return e.className==this.className&&(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",null!=this.width&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,i){if(i.empty){let s=t.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let n=ll(t);return[new ol(e,s.left-n.left,s.top-n.top,null,s.bottom-s.top)]}return function(t,e,i){if(i.to<=t.viewport.from||i.from>=t.viewport.to)return[];let s=Math.max(i.from,t.viewport.from),n=Math.min(i.to,t.viewport.to),r=t.textDirection==Es.LTR,o=t.contentDOM,l=o.getBoundingClientRect(),a=ll(t),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),u=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),f=l.right-(c?parseInt(c.paddingRight):0),d=cr(t,s,1),p=cr(t,n,-1),m=d.type==is.Text?d:null,g=p.type==is.Text?p:null;m&&(t.lineWrapping||d.widgetLineBreaks)&&(m=al(t,s,1,m));g&&(t.lineWrapping||p.widgetLineBreaks)&&(g=al(t,n,-1,g));if(m&&g&&m.from==g.from&&m.to==g.to)return w(b(i.from,i.to,m));{let e=m?b(i.from,null,m):y(d,!1),s=g?b(null,i.to,g):y(p,!0),n=[];return(m||d).to<(g||p).from-(m&&g?1:0)||d.widgetLineBreaks>1&&e.bottom+t.defaultLineHeight/2h&&s.from=r)break;l>n&&a(Math.max(t,n),null==e&&t<=h,Math.min(l,r),null==i&&l>=c,o.dir)}if(n=s.to+1,n>=r)break}return 0==l.length&&a(h,null==e,c,null==i,t.textDirection),{top:n,bottom:o,horizontal:l}}function y(t,e){let i=l.top+(e?t.top:t.bottom);return{top:i,bottom:i,horizontal:[]}}}(t,e,i)}}function ll(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Es.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function al(t,e,i,s){let n=t.coordsAtPos(e,2*i);if(!n)return s;let r=t.dom.getBoundingClientRect(),o=(n.top+n.bottom)/2,l=t.posAtCoords({x:r.left+1,y:o}),a=t.posAtCoords({x:r.right-1,y:o});return null==l||null==a?s:{from:Math.max(s.from,Math.min(l,a)),to:Math.min(s.to,Math.max(l,a))}}class hl{constructor(t,e){this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e.class&&this.dom.classList.add(e.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t)}update(t){t.startState.facet(cl)!=t.state.facet(cl)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){!1!==this.layer.updateOnDocViewUpdate&&t.requestMeasure(this.measureReq)}setOrder(t){let e=0,i=t.facet(cl);for(;e{return i=t,s=this.drawn[e],!(i.constructor==s.constructor&&i.eq(s));var i,s})){let e=this.dom.firstChild,i=0;for(let s of t)s.update&&e&&s.constructor&&this.drawn[i].constructor&&s.update(e,this.drawn[i])?(e=e.nextSibling,i++):this.dom.insertBefore(s.draw(),e);for(;e;){let t=e.nextSibling;e.remove(),e=t}this.drawn=t,Qi.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const cl=pe.define();function ul(t){return[bn.define(e=>new hl(e,t)),cl.of(t)]}const fl=pe.define({combine:t=>si(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})});function dl(t={}){return[fl.of(t),ml,vl,wl,cn.of(!0)]}function pl(t){return t.startState.facet(fl)!=t.state.facet(fl)}const ml=ul({above:!0,markers(t){let{state:e}=t,i=e.facet(fl),s=[];for(let n of e.selection.ranges){let r=n==e.selection.main;if(n.empty||i.drawRangeCursor&&!(r&&Qi.ios&&i.iosSelectionHandles)){let e=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",i=n.empty?n:ue.cursor(n.head,n.assoc);for(let n of ol.forRange(t,e,i))s.push(n)}}return s},update(t,e){t.transactions.some(t=>t.selection)&&(e.style.animationName="cm-blink"==e.style.animationName?"cm-blink2":"cm-blink");let i=pl(t);return i&&gl(t.state,e),t.docChanged||t.selectionSet||i},mount(t,e){gl(e.state,t)},class:"cm-cursorLayer"});function gl(t,e){e.style.animationDuration=t.facet(fl).cursorBlinkRate+"ms"}const vl=ul({above:!1,markers(t){let e=[],{main:i,ranges:s}=t.state.selection;for(let i of s)if(!i.empty)for(let s of ol.forRange(t,"cm-selectionBackground",i))e.push(s);if(Qi.ios&&!i.empty&&t.state.facet(fl).iosSelectionHandles){for(let s of ol.forRange(t,"cm-selectionHandle cm-selectionHandle-start",ue.cursor(i.from,1)))e.push(s);for(let s of ol.forRange(t,"cm-selectionHandle cm-selectionHandle-end",ue.cursor(i.to,1)))e.push(s)}return e},update:(t,e)=>t.docChanged||t.selectionSet||t.viewportChanged||pl(t),class:"cm-selectionLayer"}),wl=Oe.highest(jo.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),bl=$e.define({map:(t,e)=>null==t?null:e.mapPos(t)}),yl=xe.define({create:()=>null,update:(t,e)=>(null!=t&&(t=e.changes.mapPos(t)),e.effects.reduce((t,e)=>e.is(bl)?e.value:t,t))}),xl=bn.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let i=t.state.field(yl);null==i?null!=this.cursor&&(null===(e=this.cursor)||void 0===e||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(yl)!=i||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(yl),i=null!=e&&t.coordsAtPos(e);if(!i)return null;let s=t.scrollDOM.getBoundingClientRect();return{left:i.left-s.left+t.scrollDOM.scrollLeft*t.scaleX,top:i.top-s.top+t.scrollDOM.scrollTop*t.scaleY,height:i.bottom-i.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:i}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/i+"px",this.cursor.style.height=t.height/i+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(yl)!=t&&this.view.dispatch({effects:bl.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){t.target!=this.view.contentDOM&&this.view.contentDOM.contains(t.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function kl(t,e,i,s,n){e.lastIndex=0;for(let r,o=t.iterRange(i,s),l=i;!o.next().done;l+=o.value.length)if(!o.lineBreak)for(;r=e.exec(o.value);)n(l+r.index,r)}class Sl{constructor(t){const{regexp:e,decoration:i,decorate:s,boundary:n,maxLength:r=1e3}=t;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,s)this.addMatch=(t,e,i,n)=>s(n,i,i+t[0].length,t,e);else if("function"==typeof i)this.addMatch=(t,e,s,n)=>{let r=i(t,e,s);r&&n(s,s+t[0].length,r)};else{if(!i)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(t,e,s,n)=>n(s,s+t[0].length,i)}this.boundary=n,this.maxLength=r}createDeco(t){let e=new ui,i=e.add.bind(e);for(let{from:e,to:s}of function(t,e){let i=t.visibleRanges;if(1==i.length&&i[0].from==t.viewport.from&&i[0].to==t.viewport.to)return i;let s=[];for(let{from:n,to:r}of i)n=Math.max(t.state.doc.lineAt(n).from,n-e),r=Math.min(t.state.doc.lineAt(r).to,r+e),s.length&&s[s.length-1].to>=n?s[s.length-1].to=r:s.push({from:n,to:r});return s}(t,this.maxLength))kl(t.state.doc,this.regexp,e,s,(e,s)=>this.addMatch(s,t,e,i));return e.finish()}updateDeco(t,e){let i=1e9,s=-1;return t.docChanged&&t.changes.iterChanges((e,n,r,o)=>{o>=t.view.viewport.from&&r<=t.view.viewport.to&&(i=Math.min(r,i),s=Math.max(o,s))}),t.viewportMoved||s-i>1e3?this.createDeco(t.view):s>-1?this.updateRange(t.view,e.map(t.changes),i,s):e}updateRange(t,e,i,s){for(let n of t.visibleRanges){let r=Math.max(n.from,i),o=Math.min(n.to,s);if(o>=r){let i=t.state.doc.lineAt(r),s=i.toi.from;r--)if(this.boundary.test(i.text[r-1-i.from])){l=r;break}for(;oc.push(i.range(t,e));if(i==s)for(this.regexp.lastIndex=l-i.from;(h=this.regexp.exec(i.text))&&h.indexthis.addMatch(i,t,e,u));e=e.update({filterFrom:l,filterTo:a,filter:(t,e)=>ta,add:c})}}return e}}const Cl=null!=/x/.unicode?"gu":"g",Al=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",Cl),Ml={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Ol=null;const Tl=pe.define({combine(t){let e=si(t,{render:null,specialChars:Al,addSpecialChars:null});return(e.replaceTabs=!function(){var t;if(null==Ol&&"undefined"!=typeof document&&document.body){let e=document.body.style;Ol=null!=(null!==(t=e.tabSize)&&void 0!==t?t:e.MozTabSize)}return Ol||!1}())&&(e.specialChars=new RegExp("\t|"+e.specialChars.source,Cl)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Cl)),e}});function Dl(t={}){return[Tl.of(t),Rl||(Rl=bn.fromClass(class{constructor(t){this.view=t,this.decorations=ss.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Tl)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Sl({regexp:t.specialChars,decoration:(e,i,s)=>{let{doc:n}=i.state,r=Xt(e[0],0);if(9==r){let t=n.lineAt(s),e=i.state.tabSize,r=ki(t.text,e,s-t.from);return ss.replace({widget:new Bl((e-r%e)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=ss.replace({widget:new Pl(t,r)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Tl);t.startState.facet(Tl)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))]}let Rl=null;class Pl extends es{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=function(t){return t>=32?"•":10==t?"␤":String.fromCharCode(9216+t)}(this.code),i=t.state.phrase("Control character")+" "+(Ml[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,e);if(s)return s;let n=document.createElement("span");return n.textContent=e,n.title=i,n.setAttribute("aria-label",i),n.className="cm-specialChar",n}ignoreEvent(){return!1}}class Bl extends es{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent="\t",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}const El=ss.line({class:"cm-activeLine"}),Ll=bn.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,i=[];for(let s of t.state.selection.ranges){let n=t.lineBlockAt(s.head);n.from>e&&(i.push(El.range(n.from)),e=n.from)}return ss.set(i)}},{decorations:t=>t.decorations});const Nl=2e3;function Il(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),s=t.state.doc.lineAt(i),n=i-s.from,r=n>Nl?-1:n==s.length?function(t,e){let i=t.coordsAtPos(t.viewport.from);return i?Math.round(Math.abs((i.left-e)/t.defaultCharacterWidth)):-1}(t,e.clientX):ki(s.text,t.state.tabSize,i-s.from);return{line:s.number,col:r,off:n}}function Wl(t,e){let i=Il(t,e),s=t.state.selection;return i?{update(t){if(t.docChanged){let e=t.changes.mapPos(t.startState.doc.line(i.line).from),n=t.state.doc.lineAt(e);i={line:n.number,col:i.col,off:Math.min(i.off,n.length)},s=s.map(t.changes)}},get(e,n,r){let o=Il(t,e);if(!o)return s;let l=function(t,e,i){let s=Math.min(e.line,i.line),n=Math.max(e.line,i.line),r=[];if(e.off>Nl||i.off>Nl||e.col<0||i.col<0){let o=Math.min(e.off,i.off),l=Math.max(e.off,i.off);for(let e=s;e<=n;e++){let i=t.doc.line(e);i.length<=l&&r.push(ue.range(i.from+o,i.to+l))}}else{let o=Math.min(e.col,i.col),l=Math.max(e.col,i.col);for(let e=s;e<=n;e++){let i=t.doc.line(e),s=Si(i.text,o,t.tabSize,!0);if(s<0)r.push(ue.cursor(i.to));else{let e=Si(i.text,l,t.tabSize);r.push(ue.range(i.from+s,i.from+e))}}}return r}(t.state,i,o);return l.length?r?ue.create(l.concat(s.ranges)):ue.create(l):s}}:null}function Hl(t){let e=(null==t?void 0:t.eventFilter)||(t=>t.altKey&&0==t.button);return jo.mouseSelectionStyle.of((t,i)=>e(i)?Wl(t,i):null)}const Vl={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},Fl={style:"cursor: crosshair"};function zl(t={}){let[e,i]=Vl[t.key||"Alt"],s=bn.fromClass(class{constructor(t){this.view=t,this.isDown=!1}set(t){this.isDown!=t&&(this.isDown=t,this.view.update([]))}},{eventObservers:{keydown(t){this.set(t.keyCode==e||i(t))},keyup(t){t.keyCode!=e&&i(t)||this.set(!1)},mousemove(t){this.set(i(t))}}});return[s,jo.contentAttributes.of(t=>{var e;return(null===(e=t.plugin(s))||void 0===e?void 0:e.isDown)?Fl:null})]}const ql="-10000px";class _l{constructor(t,e,i,s){this.facet=e,this.createTooltipView=i,this.removeTooltipView=s,this.input=t.state.facet(e),this.tooltips=this.input.filter(t=>t);let n=null;this.tooltipViews=this.tooltips.map(t=>n=i(t,n))}update(t,e){var i;let s=t.state.facet(this.facet),n=s.filter(t=>t);if(s===this.input){for(let e of this.tooltipViews)e.update&&e.update(t);return!1}let r=[],o=e?[]:null;for(let i=0;ie[i]=t),e.length=o.length),this.input=s,this.tooltips=n,this.tooltipViews=r,!0}}function $l(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const jl=pe.define({combine:t=>{var e,i,s;return{position:Qi.ios?"absolute":(null===(e=t.find(t=>t.position))||void 0===e?void 0:e.position)||"fixed",parent:(null===(i=t.find(t=>t.parent))||void 0===i?void 0:i.parent)||null,tooltipSpace:(null===(s=t.find(t=>t.tooltipSpace))||void 0===s?void 0:s.tooltipSpace)||$l}}}),Kl=new WeakMap,Ul=bn.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(jl);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new _l(t,Xl,(t,e)=>this.createTooltip(t,e),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let i=e||t.geometryChanged,s=t.state.facet(jl);if(s.position!=this.position&&!this.madeAbsolute){this.position=s.position;for(let t of this.manager.tooltipViews)t.dom.style.position=this.position;i=!0}if(s.parent!=this.parent){this.parent&&this.container.remove(),this.parent=s.parent,this.createContainer();for(let t of this.manager.tooltipViews)this.container.appendChild(t.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(t,e){let i=t.create(this.view),s=e?e.dom:null;if(i.dom.classList.add("cm-tooltip"),t.arrow&&!i.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",i.dom.appendChild(t)}return i.dom.style.position=this.position,i.dom.style.top=ql,i.dom.style.left="0px",this.container.insertBefore(i.dom,s),i.mount&&i.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(i.dom),i}destroy(){var t,e,i;this.view.win.removeEventListener("resize",this.measureSoon);for(let e of this.manager.tooltipViews)e.dom.remove(),null===(t=e.destroy)||void 0===t||t.call(e);this.parent&&this.container.remove(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),null===(i=this.intersectionObserver)||void 0===i||i.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,i=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:t}=this.manager.tooltipViews[0];if(Qi.safari){let e=t.getBoundingClientRect();i=Math.abs(e.top+1e4)>1||Math.abs(e.left)>1}else i=!!t.offsetParent&&t.offsetParent!=this.container.ownerDocument.body}if(i||"absolute"==this.position)if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(t=i.width/this.parent.offsetWidth,e=i.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let s=this.view.scrollDOM.getBoundingClientRect(),n=Rn(this.view);return{visible:{left:s.left+n.left,top:s.top+n.top,right:s.right-n.right,bottom:s.bottom-n.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((t,e)=>{let i=this.manager.tooltipViews[e];return i.getCoords?i.getCoords(t.pos):this.view.coordsAtPos(t.pos)}),size:this.manager.tooltipViews.map(({dom:t})=>t.getBoundingClientRect()),space:this.view.state.facet(jl).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:i}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let t of this.manager.tooltipViews)t.dom.style.position="absolute"}let{visible:i,space:s,scaleX:n,scaleY:r}=t,o=[];for(let l=0;l=Math.min(i.bottom,s.bottom)||u.rightMath.min(i.right,s.right)+.1)){c.style.top=ql;continue}let d=a.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=f.right-f.left,g=null!==(e=Kl.get(h))&&void 0!==e?e:f.bottom-f.top,v=h.offset||Gl,w=this.view.textDirection==Es.LTR,b=f.width>s.right-s.left?w?s.left:s.right-f.width:w?Math.max(s.left,Math.min(u.left-(d?14:0)+v.x,s.right-m)):Math.min(Math.max(s.left,u.left-m+(d?14:0)-v.x),s.right-m),y=this.above[l];!a.strictSide&&(y?u.top-g-p-v.ys.bottom)&&y==s.bottom-u.bottom>u.top-s.top&&(y=this.above[l]=!y);let x=(y?u.top-s.top:s.bottom-u.bottom)-p;if(xb&&t.topk&&(k=y?t.top-g-2-p:t.bottom+p+2);if("absolute"==this.position?(c.style.top=(k-t.parent.top)/r+"px",Yl(c,(b-t.parent.left)/n)):(c.style.top=k/r+"px",Yl(c,b/n)),d){let t=u.left+(w?v.x:-v.x)-(b+14-7);d.style.left=t/n+"px"}!0!==h.overlap&&o.push({left:b,top:k,right:S,bottom:k+g}),c.classList.toggle("cm-tooltip-above",y),c.classList.toggle("cm-tooltip-below",!y),h.positioned&&h.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=ql}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Yl(t,e){let i=parseInt(t.style.left,10);(isNaN(i)||Math.abs(e-i)>1)&&(t.style.left=e+"px")}const Ql=jo.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Gl={x:0,y:0},Xl=pe.define({enables:[Ul,Ql]}),Jl=pe.define({combine:t=>t.reduce((t,e)=>t.concat(e),[])});class Zl{static create(t){return new Zl(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new _l(t,Jl,(t,e)=>this.createHostedView(t,e),t=>t.dom.remove())}createHostedView(t,e){let i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,e?e.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(t){for(let e of this.manager.tooltipViews)e.mount&&e.mount(t);this.mounted=!0}positioned(t){for(let e of this.manager.tooltipViews)e.positioned&&e.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let e of this.manager.tooltipViews)null===(t=e.destroy)||void 0===t||t.call(e)}passProp(t){let e;for(let i of this.manager.tooltipViews){let s=i[t];if(void 0!==s)if(void 0===e)e=s;else if(e!==s)return}return e}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const ta=Xl.compute([Jl],t=>{let e=t.facet(Jl);return 0===e.length?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var e;return null!==(e=t.end)&&void 0!==e?e:t.pos})),create:Zl.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),ea=pe.define();class ia{constructor(t,e,i,s,n,r){this.view=t,this.source=e,this.field=i,this.locked=s,this.setHover=n,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(t){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;ti.bottom||e.xi.right+t.defaultCharacterWidth)return;let r=t.bidiSpans(t.state.doc.lineAt(s)).find(t=>t.from<=s&&t.to>=s),o=r&&r.dir==Es.RTL?-1:1;n=e.x{if(e&&(!Array.isArray(e)||e.length)){let i=Array.isArray(e)?e:[e];s&&this.locked.set(i,s),t.dispatch({effects:this.setHover.of(i)})}};if(n&&"then"in n){let i=this.pending={pos:e};n.then(t=>{this.pending==i&&(this.pending=null,r(t))},e=>mn(t.state,e,"hover tooltip"))}else r(n)}get tooltip(){let t=this.view.plugin(Ul),e=t?t.manager.tooltips.findIndex(t=>t.create==Zl.create):-1;return e>-1?t.manager.tooltipViews[e]:null}mousemove(t){var e,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:s,tooltip:n}=this;if(s.length&&!this.locked.has(s)&&n&&!function(t,e){let i,{left:s,right:n,top:r,bottom:o}=t.getBoundingClientRect();if(i=t.querySelector(".cm-tooltip-arrow")){let t=i.getBoundingClientRect();r=Math.min(t.top,r),o=Math.max(t.bottom,o)}return e.clientX>=s-sa&&e.clientX<=n+sa&&e.clientY>=r-sa&&e.clientY<=o+sa}(n.dom,t)||this.pending){let{pos:n}=s[0]||this.pending,r=null!==(i=null===(e=s[0])||void 0===e?void 0:e.end)&&void 0!==i?i:n;(n==r?this.view.posAtCoords(this.lastMove)==n:function(t,e,i,s,n){let r=t.scrollDOM.getBoundingClientRect(),o=t.documentTop+t.documentPadding.top+t.contentHeight;if(r.left>s||r.rightn||Math.min(r.bottom,o)=e&&l<=i}(this.view,n,r,t.clientX,t.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:e}=this;if(e.length&&!this.locked.has(e)){let{tooltip:e}=this;e&&e.dom.contains(t.relatedTarget)?this.watchTooltipLeave(e.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let e=i=>{t.removeEventListener("mouseleave",e);let{active:s}=this;!s.length||this.locked.has(s)||this.view.dom.contains(i.relatedTarget)||this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",e)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const sa=4;function na(t,e={}){let i=$e.define(),s=new WeakMap,n=xe.define({create:()=>[],update(t,r){let o=s.get(t);if(t.length&&(e.hideOnChange&&(r.docChanged||r.selection)||o&&o(r)?t=[]:e.hideOn&&(t=t.filter(t=>!e.hideOn(r,t)))),r.docChanged&&t.length){let e=[];for(let i of t){let t=r.changes.mapPos(i.pos,-1,ee.TrackDel);if(null!=t){let s=Object.assign(Object.create(null),i);s.pos=t,null!=s.end&&(s.end=r.changes.mapPos(s.end)),e.push(s)}}t=e}for(let e of r.effects)e.is(i)&&(t=e.value,o=void 0),(e.is(oa)&&!e.value||e.value==n)&&(t=[]);return t.length&&o&&s.set(t,o),t},provide:t=>Jl.from(t)});const r=bn.define(r=>new ia(r,t,n,s,i,e.hoverTime||300));return{active:n,extension:[n,r,ea.of(r),ta]}}function ra(t,e){let i=t.plugin(Ul);if(!i)return null;let s=i.manager.tooltips.indexOf(e);return s<0?null:i.manager.tooltipViews[s]}const oa=$e.define();const la=pe.define({combine(t){let e,i;for(let s of t)e=e||s.topContainer,i=i||s.bottomContainer;return{topContainer:e,bottomContainer:i}}});function aa(t,e){let i=t.plugin(ha),s=i?i.specs.indexOf(e):-1;return s>-1?i.panels[s]:null}const ha=bn.fromClass(class{constructor(t){this.input=t.state.facet(fa),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(e=>e(t));let e=t.state.facet(la);this.top=new ca(t,!0,e.topContainer),this.bottom=new ca(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(t){let e=t.state.facet(la);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new ca(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new ca(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=t.state.facet(fa);if(i!=this.input){let e=i.filter(t=>t),s=[],n=[],r=[],o=[];for(let i of e){let e,l=this.specs.indexOf(i);l<0?(e=i(t.view),o.push(e)):(e=this.panels[l],e.update&&e.update(t)),s.push(e),(e.top?n:r).push(e)}this.specs=e,this.panels=s,this.top.sync(n),this.bottom.sync(r);for(let t of o)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}else for(let e of this.panels)e.update&&e.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>jo.scrollMargins.of(e=>{let i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}})});class ca{constructor(t,e,i){this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=ua(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=ua(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function ua(t){let e=t.nextSibling;return t.remove(),e}const fa=pe.define({enables:ha});function da(t,e){let i,s=new Promise(t=>i=t),n=t=>function(t,e,i){let s=e.content?e.content(t,()=>o(null)):null;if(!s){if(s=Ii("form"),e.input){let t=Ii("input",e.input);/^(text|password|number|email|tel|url)$/.test(t.type)&&t.classList.add("cm-textfield"),t.name||(t.name="input"),s.appendChild(Ii("label",(e.label||"")+": ",t))}else s.appendChild(document.createTextNode(e.label||""));s.appendChild(document.createTextNode(" ")),s.appendChild(Ii("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let n="FORM"==s.nodeName?[s]:s.querySelectorAll("form");for(let t=0;t{27==t.keyCode?(t.preventDefault(),o(null)):13==t.keyCode&&(t.preventDefault(),o(e))}),e.addEventListener("submit",t=>{t.preventDefault(),o(e)})}let r=Ii("div",s,Ii("button",{onclick:()=>o(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(r.className=e.class);function o(e){r.contains(r.ownerDocument.activeElement)&&t.focus(),i(e)}return r.classList.add("cm-dialog"),{dom:r,top:e.top,mount:()=>{if(e.focus){let t;t="string"==typeof e.focus?s.querySelector(e.focus):s.querySelector("input")||s.querySelector("button"),t&&"select"in t?t.select():t&&"focus"in t&&t.focus()}}}}(t,e,i);t.state.field(pa,!1)?t.dispatch({effects:ma.of(n)}):t.dispatch({effects:$e.appendConfig.of(pa.init(()=>[n]))});let r=ga.of(n);return{close:r,result:s.then(e=>((t.win.queueMicrotask||(e=>t.win.setTimeout(e,10)))(()=>{t.state.field(pa).indexOf(n)>-1&&t.dispatch({effects:r})}),e))}}const pa=xe.define({create:()=>[],update(t,e){for(let i of e.effects)i.is(ma)?t=[i.value].concat(t):i.is(ga)&&(t=t.filter(t=>t!=i.value));return t},provide:t=>fa.computeN([t],e=>e.field(t))}),ma=$e.define(),ga=$e.define();class va extends ni{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}va.prototype.elementClass="",va.prototype.toDOM=void 0,va.prototype.mapMode=ee.TrackBefore,va.prototype.startSide=va.prototype.endSide=-1,va.prototype.point=!0;const wa=pe.define(),ba=pe.define(),ya={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>hi.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},xa=pe.define();function ka(t){return[Ca(),xa.of({...ya,...t})]}const Sa=pe.define({combine:t=>t.some(t=>t)});function Ca(t){let e=[Aa];return t&&!1===t.fixed&&e.push(Sa.of(!0)),e}const Aa=bn.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(xa).map(e=>new Da(t,e)),this.fixed=!t.state.facet(Sa);for(let t of this.gutters)"after"==t.config.side?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,i=t.view.viewport,s=Math.min(e.to,i.to)-Math.max(e.from,i.from);this.syncGutters(s<.8*(i.to-i.from))}if(t.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(Sa)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let i=hi.iter(this.view.state.facet(wa),this.view.viewport.from),s=[],n=this.gutters.map(t=>new Ta(t,this.view.viewport,-this.view.documentPadding.top));for(let t of this.view.viewportLineBlocks)if(s.length&&(s=[]),Array.isArray(t.type)){let e=!0;for(let r of t.type)if(r.type==is.Text&&e){Oa(i,s,r.from);for(let t of n)t.line(this.view,r,s);e=!1}else if(r.widget)for(let t of n)t.widget(this.view,r)}else if(t.type==is.Text){Oa(i,s,t.from);for(let e of n)e.line(this.view,t,s)}else if(t.widget)for(let e of n)e.widget(this.view,t);for(let t of n)t.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(xa),i=t.state.facet(xa),s=t.docChanged||t.heightChanged||t.viewportChanged||!hi.eq(t.startState.facet(wa),t.state.facet(wa),t.view.viewport.from,t.view.viewport.to);if(e==i)for(let e of this.gutters)e.update(t)&&(s=!0);else{s=!0;let n=[];for(let s of i){let i=e.indexOf(s);i<0?n.push(new Da(this.view,s)):(this.gutters[i].update(t),n.push(this.gutters[i]))}for(let t of this.gutters)t.dom.remove(),n.indexOf(t)<0&&t.destroy();for(let t of n)"after"==t.config.side?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.gutters=n}return s}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>jo.scrollMargins.of(e=>{let i=e.plugin(t);if(!i||0==i.gutters.length||!i.fixed)return null;let s=i.dom.offsetWidth*e.scaleX,n=i.domAfter?i.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Es.LTR?{left:s,right:n}:{right:s,left:n}})});function Ma(t){return Array.isArray(t)?t:[t]}function Oa(t,e,i){for(;t.value&&t.from<=i;)t.from==i&&e.push(t.value),t.next()}class Ta{constructor(t,e,i){this.gutter=t,this.height=i,this.i=0,this.cursor=hi.iter(t.markers,e.from)}addElement(t,e,i){let{gutter:s}=this,n=(e.top-this.height)/t.scaleY,r=e.height/t.scaleY;if(this.i==s.elements.length){let e=new Ra(t,r,n,i);s.elements.push(e),s.dom.appendChild(e.dom)}else s.elements[this.i].update(t,r,n,i);this.height=e.bottom,this.i++}line(t,e,i){let s=[];Oa(this.cursor,s,e.from),i.length&&(s=s.concat(i));let n=this.gutter.config.lineMarker(t,e,s);n&&s.unshift(n);let r=this.gutter;(0!=s.length||r.config.renderEmptyElements)&&this.addElement(t,e,s)}widget(t,e){let i=this.gutter.config.widgetMarker(t,e.widget,e),s=i?[i]:null;for(let i of t.state.facet(ba)){let n=i(t,e.widget,e);n&&(s||(s=[])).push(n)}s&&this.addElement(t,e,s)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let e=t.elements.pop();t.dom.removeChild(e.dom),e.destroy()}}}class Da{constructor(t,e){this.view=t,this.config=e,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in e.domEventHandlers)this.dom.addEventListener(i,s=>{let n,r=s.target;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let t=r.getBoundingClientRect();n=(t.top+t.bottom)/2}else n=s.clientY;let o=t.lineBlockAtHeight(n-t.documentTop);e.domEventHandlers[i](t,o,s)&&s.preventDefault()});this.markers=Ma(e.markers(t)),e.initialSpacer&&(this.spacer=new Ra(t,0,0,[e.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let e=this.markers;if(this.markers=Ma(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let e=this.config.updateSpacer(this.spacer.markers[0],t);e!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[e])}let i=t.view.viewport;return!hi.eq(this.markers,e,i.from,i.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(t)}destroy(){for(let t of this.elements)t.destroy()}}class Ra{constructor(t,e,i,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,e,i,s)}update(t,e,i,s){this.height!=e&&(this.height=e,this.dom.style.height=e+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),function(t,e){if(t.length!=e.length)return!1;for(let i=0;isi(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,e){let i=Object.assign({},t);for(let t in e){let s=i[t],n=e[t];i[t]=s?(t,e,i)=>s(t,e,i)||n(t,e,i):n}return i}})});class La extends va{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function Na(t,e){return t.state.facet(Ea).formatNumber(e,t.state)}const Ia=xa.compute([Ea],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:t=>t.state.facet(Pa),lineMarker:(t,e,i)=>i.some(t=>t.toDOM)?null:new La(Na(t,t.state.doc.lineAt(e.from).number)),widgetMarker:(t,e,i)=>{for(let s of t.state.facet(Ba)){let n=s(t,e,i);if(n)return n}return null},lineMarkerChange:t=>t.startState.facet(Ea)!=t.state.facet(Ea),initialSpacer:t=>new La(Na(t,Ha(t.state.doc.lines))),updateSpacer(t,e){let i=Na(e.view,Ha(e.view.state.doc.lines));return i==t.number?t:new La(i)},domEventHandlers:t.facet(Ea).domEventHandlers,side:"before"}));function Wa(t={}){return[Ea.of(t),Ca(),Ia]}function Ha(t){let e=9;for(;e{let e=[],i=-1;for(let s of t.selection.ranges){let n=t.doc.lineAt(s.head).from;n>i&&(i=n,e.push(Va.range(n)))}return hi.of(e)});var za;const qa=new s;function _a(t){return pe.define({combine:t?e=>e.concat(t):void 0})}const $a=new s;class ja{constructor(t,e,i=[],s=""){this.data=t,this.name=s,ii.prototype.hasOwnProperty("tree")||Object.defineProperty(ii.prototype,"tree",{get(){return Ya(this)}}),this.parser=e,this.extension=[sh.of(this),ii.languageData.of((t,e,i)=>{let s=Ka(t,e,i),n=s.type.prop(qa);if(!n)return[];let r=t.facet(n),o=s.type.prop($a);if(o){let n=s.resolve(e-s.from,i);for(let e of o)if(e.test(n,t)){let i=t.facet(e.facet);return"replace"==e.type?i:i.concat(r)}}return r})].concat(i)}isActiveAt(t,e,i=-1){return Ka(t,e,i).type.prop(qa)==this.data}findRegions(t){let e=t.facet(sh);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],n=(t,e)=>{if(t.prop(qa)==this.data)return void i.push({from:e,to:e+t.length});let r=t.prop(s.mounted);if(r){if(r.tree.prop(qa)==this.data){if(r.overlay)for(let t of r.overlay)i.push({from:t.from+e,to:t.to+e});else i.push({from:e,to:e+t.length});return}if(r.overlay){let t=i.length;if(n(r.tree,r.overlay[0].from+e),i.length>t)return}}for(let i=0;it.isTop?e:void 0)]}),t.name)}configure(t,e){return new Ua(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ya(t){let e=t.field(ja.state,!1);return e?e.tree:u.empty}class Qa{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}}let Ga=null;class Xa{constructor(t,e,i=[],s,n,r,o,l){this.parser=t,this.state=e,this.fragments=i,this.tree=s,this.treeLen=n,this.viewport=r,this.skipped=o,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new Xa(t,e,[],u.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Qa(this.state.doc),this.fragments)}work(t,e){return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=u.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if("number"==typeof t){let e=Date.now()+t;t=()=>Date.now()>e}for(this.parse||(this.parse=this.startParse()),null!=e&&(null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&e=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(e=this.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(D.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=Ga;Ga=this;try{return t()}finally{Ga=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=Ja(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:s,treeLen:n,viewport:r,skipped:o}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,i,s,n)=>e.push({fromA:t,toA:i,fromB:s,toB:n})),i=D.applyChanges(i,e),s=u.empty,n=0,r={from:t.mapPos(r.from,-1),to:t.mapPos(r.to,1)},this.skipped.length){o=[];for(let e of this.skipped){let i=t.mapPos(e.from,1),s=t.mapPos(e.to,-1);it.from&&(this.fragments=Ja(this.fragments,i,s),this.skipped.splice(e--,1))}return!(this.skipped.length>=e)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends R{createParse(e,i,s){let n=s[0].from,r=s[s.length-1].to;return{parsedPos:n,advance(){let e=Ga;if(e){for(let t of s)e.tempSkipped.push(t);t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=r,new u(o.none,[],[],r-n)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t}static get(){return Ga}}function Ja(t,e,i){return D.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}])}class Za{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new Za(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=Xa.create(t.facet(sh).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new Za(i)}}ja.state=xe.define({create:Za.init,update(t,e){for(let t of e.effects)if(t.is(ja.setState))return t.value;return e.startState.facet(sh)!=e.state.facet(sh)?Za.init(e.state):t.apply(e)}});let th=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(th=t=>{let e=-1,i=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(i):cancelIdleCallback(e)});const eh="undefined"!=typeof navigator&&(null===(za=navigator.scheduling)||void 0===za?void 0:za.isInputPending)?()=>navigator.scheduling.isInputPending():null,ih=bn.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(ja.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(ja.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=th(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnds+1e3,l=n.context.work(()=>eh&&eh()||Date.now()>r,s+(o?0:1e5));this.chunkBudget-=Date.now()-e,(l||this.chunkBudget<=0)&&(n.context.takeTree(),this.view.dispatch({effects:ja.setState.of(new Za(n.context))})),this.chunkBudget>0&&(!l||o)&&this.scheduleWork(),this.checkAsyncSchedule(n.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(t=>mn(this.view.state,t)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),sh=pe.define({combine:t=>t.length?t[0]:null,enables:t=>[ja.state,ih,jo.contentAttributes.compute([t],e=>{let i=e.facet(t);return i&&i.name?{"data-language":i.name}:{}})]});class nh{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}const rh=pe.define(),oh=pe.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function lh(t){let e=t.facet(oh);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function ah(t,e){let i="",s=t.tabSize,n=t.facet(oh)[0];if("\t"==n){for(;e>=s;)i+="\t",e-=s;n=" "}for(let t=0;t=e?function(t,e,i){let s=e.resolveStack(i),n=e.resolveInner(i,-1).resolve(i,0).enterUnfinishedNodesBefore(i);if(n!=s.node){let t=[];for(let e=n;e&&!(e.froms.node.to||e.from==s.node.from&&e.type==s.node.type);e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)s={node:t[e],next:s}}return fh(s,t,i)}(t,i,e):null}class ch{constructor(t,e={}){this.state=t,this.options=e,this.unit=lh(t)}lineAt(t,e=1){let i=this.state.doc.lineAt(t),{simulateBreak:s,simulateDoubleBreak:n}=this.options;return null!=s&&s>=i.from&&s<=i.to?n&&s==t?{text:"",from:t}:(e<0?s-1&&(n+=r-this.countColumn(i,i.search(/\S|$/))),n}countColumn(t,e=t.length){return ki(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:i,from:s}=this.lineAt(t,e),n=this.options.overrideIndentation;if(n){let t=n(s);if(t>-1)return t}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const uh=new s;function fh(t,e,i){for(let s=t;s;s=s.next){let t=dh(s.node);if(t)return t(mh.create(e,i,s))}return 0}function dh(t){let e=t.type.prop(uh);if(e)return e;let i,n=t.firstChild;if(n&&(i=n.type.prop(s.closedBy))){let e=t.lastChild,s=e&&i.indexOf(e.name)>-1;return t=>vh(t,!0,1,void 0,s&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?ph:null}function ph(){return 0}class mh extends ch{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.context=i}get node(){return this.context.node}static create(t,e,i){return new mh(t,e,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(e.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(gh(i,t))break;e=this.state.doc.lineAt(i.from)}return this.lineIndent(e.from)}continue(){return fh(this.context.next,this.base,this.pos)}}function gh(t,e){for(let i=e;i;i=i.parent)if(t==i)return!0;return!1}function vh(t,e,i,s,n){let r=t.textAfter,o=r.match(/^\s*/)[0].length,l=s&&r.slice(o,o+s.length)==s||n==t.pos+o,a=e?function(t){let e=t.node,i=e.childAfter(e.from),s=e.lastChild;if(!i)return null;let n=t.options.simulateBreak,r=t.state.doc.lineAt(i.from),o=null==n||n<=r.from?r.to:Math.min(r.to,n);for(let t=i.to;;){let n=e.childAfter(t);if(!n||n==s)return null;if(!n.type.isSkipped){if(n.from>=o)return null;let t=/^ */.exec(r.text.slice(i.to-r.from))[0].length;return{from:i.from,to:i.to+t}}t=n.to}}(t):null;return a?l?t.column(a.from):t.column(a.to):t.baseIndent+(l?0:t.unit*i)}function wh({except:t,units:e=1}={}){return i=>{let s=t&&t.test(i.textAfter);return i.baseIndent+(s?0:e*i.unit)}}const bh=pe.define(),yh=new s;function xh(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function kh(t,e,i){for(let s of t.facet(bh)){let n=s(t,e,i);if(n)return n}return function(t,e,i){let s=Ya(t);if(s.lengthi)continue;if(n&&o.from=e&&s.to>i&&(n=s)}}return n}(t,e,i)}function Sh(t,e){let i=e.mapPos(t.from,1),s=e.mapPos(t.to,-1);return i>=s?void 0:{from:i,to:s}}const Ch=$e.define({map:Sh}),Ah=$e.define({map:Sh});function Mh(t){let e=[];for(let{head:i}of t.state.selection.ranges)e.some(t=>t.from<=i&&t.to>=i)||e.push(t.lineBlockAt(i));return e}const Oh=xe.define({create:()=>ss.none,update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((e,i)=>t=Th(t,e,i)),t=t.map(e.changes);for(let i of e.effects)if(i.is(Ch)&&!Rh(t,i.value.from,i.value.to)){let{preparePlaceholder:s}=e.state.facet(Nh),n=s?ss.replace({widget:new Vh(s(e.state,i.value))}):Hh;t=t.update({add:[n.range(i.value.from,i.value.to)]})}else i.is(Ah)&&(t=t.update({filter:(t,e)=>i.value.from!=t||i.value.to!=e,filterFrom:i.value.from,filterTo:i.value.to}));return e.selection&&(t=Th(t,e.selection.main.head)),t},provide:t=>jo.decorations.from(t),toJSON(t,e){let i=[];return t.between(0,e.doc.length,(t,e)=>{i.push(t,e)}),i},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let i=0;i{te&&(s=!0)}),s?t.update({filterFrom:e,filterTo:i,filter:(t,s)=>t>=i||s<=e}):t}function Dh(t,e,i){var s;let n=null;return null===(s=t.field(Oh,!1))||void 0===s||s.between(e,i,(t,e)=>{(!n||n.from>t)&&(n={from:t,to:e})}),n}function Rh(t,e,i){let s=!1;return t.between(e,e,(t,n)=>{t==e&&n==i&&(s=!0)}),s}function Ph(t,e){return t.field(Oh,!1)?e:e.concat($e.appendConfig.of(Ih()))}function Bh(t,e,i=!0){let s=t.state.doc.lineAt(e.from).number,n=t.state.doc.lineAt(e.to).number;return jo.announce.of(`${t.state.phrase(i?"Folded lines":"Unfolded lines")} ${s} ${t.state.phrase("to")} ${n}.`)}const Eh=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:t=>{for(let e of Mh(t)){let i=kh(t.state,e.from,e.to);if(i)return t.dispatch({effects:Ph(t.state,[Ch.of(i),Bh(t,i)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:t=>{if(!t.state.field(Oh,!1))return!1;let e=[];for(let i of Mh(t)){let s=Dh(t.state,i.from,i.to);s&&e.push(Ah.of(s),Bh(t,s,!1))}return e.length&&t.dispatch({effects:e}),e.length>0}},{key:"Ctrl-Alt-[",run:t=>{let{state:e}=t,i=[];for(let s=0;s{let e=t.state.field(Oh,!1);if(!e||!e.size)return!1;let i=[];return e.between(0,t.state.doc.length,(t,e)=>{i.push(Ah.of({from:t,to:e}))}),t.dispatch({effects:i}),!0}}],Lh={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Nh=pe.define({combine:t=>si(t,Lh)});function Ih(t){let e=[Oh,_h];return t&&e.push(Nh.of(t)),e}function Wh(t,e){let{state:i}=t,s=i.facet(Nh),n=e=>{let i=t.lineBlockAt(t.posAtDOM(e.target)),s=Dh(t.state,i.from,i.to);s&&t.dispatch({effects:Ah.of(s)}),e.preventDefault()};if(s.placeholderDOM)return s.placeholderDOM(t,n,e);let r=document.createElement("span");return r.textContent=s.placeholderText,r.setAttribute("aria-label",i.phrase("folded code")),r.title=i.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=n,r}const Hh=ss.replace({widget:new class extends es{toDOM(t){return Wh(t,null)}}});class Vh extends es{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return Wh(t,this.value)}}const Fh={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class zh extends va{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}function qh(t={}){let e={...Fh,...t},i=new zh(e,!0),s=new zh(e,!1),n=bn.fromClass(class{constructor(t){this.from=t.viewport.from,this.markers=this.buildMarkers(t)}update(t){(t.docChanged||t.viewportChanged||t.startState.facet(sh)!=t.state.facet(sh)||t.startState.field(Oh,!1)!=t.state.field(Oh,!1)||Ya(t.startState)!=Ya(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view))}buildMarkers(t){let e=new ui;for(let n of t.viewportLineBlocks){let r=Dh(t.state,n.from,n.to)?s:kh(t.state,n.from,n.to)?i:null;r&&e.add(n.from,n.from,r)}return e.finish()}}),{domEventHandlers:r}=e;return[n,ka({class:"cm-foldGutter",markers(t){var e;return(null===(e=t.plugin(n))||void 0===e?void 0:e.markers)||hi.empty},initialSpacer:()=>new zh(e,!1),domEventHandlers:{...r,click:(t,e,i)=>{if(r.click&&r.click(t,e,i))return!0;let s=Dh(t.state,e.from,e.to);if(s)return t.dispatch({effects:Ah.of(s)}),!0;let n=kh(t.state,e.from,e.to);return!!n&&(t.dispatch({effects:Ch.of(n)}),!0)}}}),Ih()]}const _h=jo.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class $h{constructor(t,e){let i;function s(t){let e=Oi.newName();return(i||(i=Object.create(null)))["."+e]=t,e}this.specs=t;const n="string"==typeof e.all?e.all:e.all?s(e.all):void 0,r=e.scope;this.scope=r instanceof ja?t=>t.prop(qa)==r.data:r?t=>t==r:void 0,this.style=at(t.map(t=>({tag:t.tag,class:t.class||s(Object.assign({},t,{tag:null}))})),{all:n}).style,this.module=i?new Oi(i):null,this.themeType=e.themeType}static define(t,e){return new $h(t,e||{})}}const jh=pe.define(),Kh=pe.define({combine:t=>t.length?[t[0]]:null});function Uh(t){let e=t.facet(jh);return e.length?e:t.facet(Kh)}function Yh(t,e){let i,s=[Gh];return t instanceof $h&&(t.module&&s.push(jo.styleModule.of(t.module)),i=t.themeType),(null==e?void 0:e.fallback)?s.push(Kh.of(t)):i?s.push(jh.computeN([jo.darkTheme],e=>e.facet(jo.darkTheme)==("dark"==i)?[t]:[])):s.push(jh.of(t)),s}class Qh{constructor(t){this.markCache=Object.create(null),this.tree=Ya(t.state),this.decorations=this.buildDeco(t,Uh(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=Ya(t.state),i=Uh(t.state),s=i!=Uh(t.startState),{viewport:n}=t.view,r=t.changes.mapPos(this.decoratedTo,1);e.length=n.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=r):(e!=this.tree||t.viewportChanged||s)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=n.to)}buildDeco(t,e){if(!e||!this.tree.length)return ss.none;let i=new ui;for(let{from:s,to:n}of t.visibleRanges)ht(this.tree,e,(t,e,s)=>{i.add(t,e,this.markCache[s]||(this.markCache[s]=ss.mark({class:s})))},s,n);return i.finish()}}const Gh=Oe.high(bn.fromClass(Qh,{decorations:t=>t.decorations})),Xh=$h.define([{tag:Mt.meta,color:"#404740"},{tag:Mt.link,textDecoration:"underline"},{tag:Mt.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Mt.emphasis,fontStyle:"italic"},{tag:Mt.strong,fontWeight:"bold"},{tag:Mt.strikethrough,textDecoration:"line-through"},{tag:Mt.keyword,color:"#708"},{tag:[Mt.atom,Mt.bool,Mt.url,Mt.contentSeparator,Mt.labelName],color:"#219"},{tag:[Mt.literal,Mt.inserted],color:"#164"},{tag:[Mt.string,Mt.deleted],color:"#a11"},{tag:[Mt.regexp,Mt.escape,Mt.special(Mt.string)],color:"#e40"},{tag:Mt.definition(Mt.variableName),color:"#00f"},{tag:Mt.local(Mt.variableName),color:"#30a"},{tag:[Mt.typeName,Mt.namespace],color:"#085"},{tag:Mt.className,color:"#167"},{tag:[Mt.special(Mt.variableName),Mt.macroName],color:"#256"},{tag:Mt.definition(Mt.propertyName),color:"#00c"},{tag:Mt.comment,color:"#940"},{tag:Mt.invalid,color:"#f00"}]),Jh=jo.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Zh="()[]{}",tc=pe.define({combine:t=>si(t,{afterCursor:!0,brackets:Zh,maxScanDistance:1e4,renderMatch:sc})}),ec=ss.mark({class:"cm-matchingBracket"}),ic=ss.mark({class:"cm-nonmatchingBracket"});function sc(t){let e=[],i=t.matched?ec:ic;return e.push(i.range(t.start.from,t.start.to)),t.end&&e.push(i.range(t.end.from,t.end.to)),e}function nc(t){let e=[],i=t.facet(tc);for(let s of t.selection.ranges){if(!s.empty)continue;let n=cc(t,s.head,-1,i)||s.head>0&&cc(t,s.head-1,1,i)||i.afterCursor&&(cc(t,s.head,1,i)||s.headt.decorations}),Jh];function oc(t={}){return[tc.of(t),rc]}const lc=new s;function ac(t,e,i){let n=t.prop(e<0?s.openedBy:s.closedBy);if(n)return n;if(1==t.name.length){let s=i.indexOf(t.name);if(s>-1&&s%2==(e<0?1:0))return[i[s+e]]}return null}function hc(t){let e=t.type.prop(lc);return e?e(t.node):t}function cc(t,e,i,s={}){let n=s.maxScanDistance||1e4,r=s.brackets||Zh,o=Ya(t),l=o.resolveInner(e,i);for(let s=l;s;s=s.parent){let n=ac(s.type,i,r);if(n&&s.from0?e>=o.from&&eo.from&&e<=o.to))return uc(t,e,i,s,o,n,r)}}return function(t,e,i,s,n,r,o){if(i<0?!e:e==t.doc.length)return null;let l=i<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=i>0)return null;let h={from:i<0?e-1:e,to:i>0?e+1:e},c=t.doc.iterRange(e,i>0?t.doc.length:0),u=0;for(let t=0;!c.next().done&&t<=r;){let r=c.value;i<0&&(t+=r.length);let l=e+t*i;for(let t=i>0?0:r.length-1,e=i>0?r.length:-1;t!=e;t+=i){let e=o.indexOf(r[t]);if(!(e<0||s.resolveInner(l+t,1).type!=n))if(e%2==0==i>0)u++;else{if(1==u)return{start:h,end:{from:l+t,to:l+t+1},matched:e>>1==a>>1};u--}}i>0&&(t+=r.length)}return c.done?{start:h,matched:!1}:null}(t,e,i,o,l.type,n,r)}function uc(t,e,i,s,n,r,o){let l=s.parent,a={from:n.from,to:n.to},h=0,c=null==l?void 0:l.cursor();if(c&&(i<0?c.childBefore(s.from):c.childAfter(s.to)))do{if(i<0?c.to<=s.from:c.from>=s.to){if(0==h&&r.indexOf(c.type.name)>-1&&c.from-1||(pc.push(t),console.warn(e))}function wc(t,e){let i=[];for(let s of e.split(" ")){let e=[];for(let i of s.split(".")){let s=t[i]||Mt[i];s?"function"==typeof s?e.length?e=e.map(s):vc(i,`Modifier ${i} used at start of tag`):e.length?vc(i,`Tag ${i} used as modifier`):e=Array.isArray(s)?s:[s]:vc(i,`Unknown highlighting tag ${i}`)}for(let t of e)i.push(t)}if(!i.length)return 0;let s=e.replace(/ /g,"_"),n=s+" "+i.map(t=>t.id),r=mc[n];if(r)return r.id;let l=mc[n]=o.define({id:dc.length,name:s,props:[rt({[s]:i})]});return dc.push(l),l.id}Es.RTL,Es.LTR;const bc=Ua.define({name:"json",parser:Tt.configure({props:[uh.add({Object:wh({except:/^\s*\}/}),Array:wh({except:/^\s*\]/})}),yh.add({"Object Array":function(t){let e=t.firstChild,i=t.lastChild;return e&&e.to .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Lc},".cm-panels":{backgroundColor:Rc,color:Cc},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Bc,color:Ac,border:"none"},".cm-activeLineGutter":{backgroundColor:Pc},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Ec},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Ec,borderBottomColor:Ec},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Pc,color:Cc}}},{dark:!0}),Yh($h.define([{tag:Mt.keyword,color:Dc},{tag:[Mt.name,Mt.deleted,Mt.character,Mt.propertyName,Mt.macroName],color:xc},{tag:[Mt.function(Mt.variableName),Mt.labelName],color:Mc},{tag:[Mt.color,Mt.constant(Mt.name),Mt.standard(Mt.name)],color:Tc},{tag:[Mt.definition(Mt.name),Mt.separator],color:Cc},{tag:[Mt.typeName,Mt.className,Mt.number,Mt.changed,Mt.annotation,Mt.modifier,Mt.self,Mt.namespace],color:yc},{tag:[Mt.operator,Mt.operatorKeyword,Mt.url,Mt.escape,Mt.regexp,Mt.link,Mt.special(Mt.string)],color:kc},{tag:[Mt.meta,Mt.comment],color:Ac},{tag:Mt.strong,fontWeight:"bold"},{tag:Mt.emphasis,fontStyle:"italic"},{tag:Mt.strikethrough,textDecoration:"line-through"},{tag:Mt.link,color:Ac,textDecoration:"underline"},{tag:Mt.heading,fontWeight:"bold",color:xc},{tag:[Mt.atom,Mt.bool,Mt.special(Mt.variableName)],color:Tc},{tag:[Mt.processingInstruction,Mt.string,Mt.inserted],color:Oc},{tag:Mt.invalid,color:Sc}]))];function Wc(t,e){return({state:i,dispatch:s})=>{if(i.readOnly)return!1;let n=t(e,i);return!!n&&(s(i.update(n)),!0)}}const Hc=Wc($c,0),Vc=Wc(_c,0),Fc=Wc((t,e)=>_c(t,e,function(t){let e=[];for(let i of t.selection.ranges){let s=t.doc.lineAt(i.from),n=i.to<=s.to?s:t.doc.lineAt(i.to);n.from>s.from&&n.from==i.to&&(n=i.to==s.to+1?s:t.doc.lineAt(i.to-1));let r=e.length-1;r>=0&&e[r].to>s.from?e[r].to=n.to:e.push({from:s.from+/^\s*/.exec(s.text)[0].length,to:n.to})}return e}(e)),0);function zc(t,e){let i=t.languageDataAt("commentTokens",e,1);return i.length?i[0]:{}}const qc=50;function _c(t,e,i=e.selection.ranges){let s=i.map(t=>zc(e,t.from).block);if(!s.every(t=>t))return null;let n=i.map((t,i)=>function(t,{open:e,close:i},s,n){let r,o,l=t.sliceDoc(s-qc,s),a=t.sliceDoc(n,n+qc),h=/\s*$/.exec(l)[0].length,c=/^\s*/.exec(a)[0].length,u=l.length-h;if(l.slice(u-e.length,u)==e&&a.slice(c,c+i.length)==i)return{open:{pos:s-h,margin:h&&1},close:{pos:n+c,margin:c&&1}};n-s<=2*qc?r=o=t.sliceDoc(s,n):(r=t.sliceDoc(s,s+qc),o=t.sliceDoc(n-qc,n));let f=/^\s*/.exec(r)[0].length,d=/\s*$/.exec(o)[0].length,p=o.length-d-i.length;return r.slice(f,f+e.length)==e&&o.slice(p,p+i.length)==i?{open:{pos:s+f+e.length,margin:/\s/.test(r.charAt(f+e.length))?1:0},close:{pos:n-d-i.length,margin:/\s/.test(o.charAt(p-1))?1:0}}:null}(e,s[i],t.from,t.to));if(2!=t&&!n.every(t=>t))return{changes:e.changes(i.map((t,e)=>n[e]?[]:[{from:t.from,insert:s[e].open+" "},{from:t.to,insert:" "+s[e].close}]))};if(1!=t&&n.some(t=>t)){let t=[];for(let e,i=0;in&&(t==r||r>a.from)){n=a.from;let t=/^\s*/.exec(a.text)[0].length,e=t==a.length,r=a.text.slice(t,t+i.length)==i?t:-1;tt.comment<0&&(!t.empty||t.single))){let t=[];for(let{line:e,token:i,indent:n,empty:r,single:o}of s)!o&&r||t.push({from:e.from+n,insert:i+" "});let i=e.changes(t);return{changes:i,selection:e.selection.map(i,1)}}if(1!=t&&s.some(t=>t.comment>=0)){let t=[];for(let{line:e,comment:i,token:n}of s)if(i>=0){let s=e.from+i,r=s+n.length;" "==e.text[r-e.from]&&r++,t.push({from:s,to:r})}return{changes:t}}return null}const jc=ze.define(),Kc=ze.define(),Uc=pe.define(),Yc=pe.define({combine:t=>si(t,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(i,s)=>t(i,s)||e(i,s)})}),Qc=xe.define({create:()=>fu.empty,update(t,e){let i=e.state.facet(Yc),s=e.annotation(jc);if(s){let n=iu.fromTransaction(e,s.selection),r=s.side,o=0==r?t.undone:t.done;return o=n?su(o,o.length,i.minDepth,n):lu(o,e.startState.selection),new fu(0==r?s.rest:o,0==r?o:s.rest)}let n=e.annotation(Kc);if("full"!=n&&"before"!=n||(t=t.isolate()),!1===e.annotation(je.addToHistory))return e.changes.empty?t:t.addMapping(e.changes.desc);let r=iu.fromTransaction(e),o=e.annotation(je.time),l=e.annotation(je.userEvent);return r?t=t.addChanges(r,o,l,i,e):e.selection&&(t=t.addSelection(e.startState.selection,o,l,i.newGroupDelay)),"full"!=n&&"after"!=n||(t=t.isolate()),t},toJSON:t=>({done:t.done.map(t=>t.toJSON()),undone:t.undone.map(t=>t.toJSON())}),fromJSON:t=>new fu(t.done.map(iu.fromJSON),t.undone.map(iu.fromJSON))});function Gc(t={}){return[Qc,Yc.of(t),jo.domEventHandlers({beforeinput(t,e){let i="historyUndo"==t.inputType?Jc:"historyRedo"==t.inputType?Zc:null;return!!i&&(t.preventDefault(),i(e))}})]}function Xc(t,e){return function({state:i,dispatch:s}){if(!e&&i.readOnly)return!1;let n=i.field(Qc,!1);if(!n)return!1;let r=n.pop(t,i,e);return!!r&&(s(r),!0)}}const Jc=Xc(0,!1),Zc=Xc(1,!1),tu=Xc(0,!0),eu=Xc(1,!0);class iu{constructor(t,e,i,s,n){this.changes=t,this.effects=e,this.mapped=i,this.startSelection=s,this.selectionsAfter=n}setSelAfter(t){return new iu(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,i;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(e=this.mapped)||void 0===e?void 0:e.toJSON(),startSelection:null===(i=this.startSelection)||void 0===i?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(t=>t.toJSON())}}static fromJSON(t){return new iu(t.changes&&se.fromJSON(t.changes),[],t.mapped&&ie.fromJSON(t.mapped),t.startSelection&&ue.fromJSON(t.startSelection),t.selectionsAfter.map(ue.fromJSON))}static fromTransaction(t,e){let i=ru;for(let e of t.startState.facet(Uc)){let s=e(t);s.length&&(i=i.concat(s))}return!i.length&&t.changes.empty?null:new iu(t.changes.invert(t.startState.doc),i,void 0,e||t.startState.selection,ru)}static selection(t){return new iu(void 0,ru,void 0,void 0,t)}}function su(t,e,i,s){let n=e+1>i+20?e-i-1:0,r=t.slice(n,e);return r.push(s),r}function nu(t,e){return t.length?e.length?t.concat(e):t:e}const ru=[],ou=200;function lu(t,e){if(t.length){let i=t[t.length-1],s=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-ou));return s.length&&s[s.length-1].eq(e)?t:(s.push(e),su(t,t.length-1,1e9,i.setSelAfter(s)))}return[iu.selection([e])]}function au(t){let e=t[t.length-1],i=t.slice();return i[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),i}function hu(t,e){if(!t.length)return t;let i=t.length,s=ru;for(;i;){let n=cu(t[i-1],e,s);if(n.changes&&!n.changes.empty||n.effects.length){let e=t.slice(0,i);return e[i-1]=n,e}e=n.mapped,i--,s=n.selectionsAfter}return s.length?[iu.selection(s)]:ru}function cu(t,e,i){let s=nu(t.selectionsAfter.length?t.selectionsAfter.map(t=>t.map(e)):ru,i);if(!t.changes)return iu.selection(s);let n=t.changes.map(e),r=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(r):r;return new iu(n,$e.mapEffects(t.effects,e),o,t.startSelection.map(r),s)}const uu=/^(input\.type|delete)($|\.)/;class fu{constructor(t,e,i=0,s=void 0){this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new fu(this.done,this.undone):this}addChanges(t,e,i,s,n){let r=this.done,o=r[r.length-1];return r=o&&o.changes&&!o.changes.empty&&t.changes&&(!i||uu.test(i))&&(!o.selectionsAfter.length&&e-this.prevTimei.push(t,e)),e.iterChangedRanges((t,e,n,r)=>{for(let t=0;t=e&&n<=o&&(s=!0)}}),s}(o.changes,t.changes))||"input.type.compose"==i)?su(r,r.length-1,s.minDepth,new iu(t.changes.compose(o.changes),nu($e.mapEffects(t.effects,o.changes),o.effects),o.mapped,o.startSelection,ru)):su(r,r.length,s.minDepth,t),new fu(r,ru,e,i)}addSelection(t,e,i,s){let n=this.done.length?this.done[this.done.length-1].selectionsAfter:ru;return n.length>0&&e-this.prevTimet.empty!=o.ranges[e].empty).length)?this:new fu(lu(this.done,t),this.undone,e,i);var r,o}addMapping(t){return new fu(hu(this.done,t),hu(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,e,i){let s=0==t?this.done:this.undone;if(0==s.length)return null;let n=s[s.length-1],r=n.selectionsAfter[0]||(n.startSelection?n.startSelection.map(n.changes.invertedDesc,1):e.selection);if(i&&n.selectionsAfter.length)return e.update({selection:n.selectionsAfter[n.selectionsAfter.length-1],annotations:jc.of({side:t,rest:au(s),selection:r}),userEvent:0==t?"select.undo":"select.redo",scrollIntoView:!0});if(n.changes){let i=1==s.length?ru:s.slice(0,s.length-1);return n.mapped&&(i=hu(i,n.mapped)),e.update({changes:n.changes,selection:n.startSelection,effects:n.effects,annotations:jc.of({side:t,rest:i,selection:r}),filter:!1,userEvent:0==t?"undo":"redo",scrollIntoView:!0})}return null}}fu.empty=new fu(ru,ru);const du=[{key:"Mod-z",run:Jc,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Zc,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Zc,preventDefault:!0},{key:"Mod-u",run:tu,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:eu,preventDefault:!0}];function pu(t,e){return ue.create(t.ranges.map(e),t.mainIndex)}function mu(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function gu({state:t,dispatch:e},i){let s=pu(t.selection,i);return!s.eq(t.selection,!0)&&(e(mu(t,s)),!0)}function vu(t,e){return ue.cursor(e?t.to:t.from)}function wu(t,e){return gu(t,i=>i.empty?t.moveByChar(i,e):vu(i,e))}function bu(t){return t.textDirectionAt(t.state.selection.main.head)==Es.LTR}const yu=t=>wu(t,!bu(t)),xu=t=>wu(t,bu(t));function ku(t,e){return gu(t,i=>i.empty?t.moveByGroup(i,e):vu(i,e))}"undefined"!=typeof Intl&&Intl.Segmenter;function Su(t,e,i){if(e.type.prop(i))return!0;let s=e.to-e.from;return s&&(s>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Cu(t,e,i){let n,r,o=Ya(t).resolveInner(e.head),l=i?s.closedBy:s.openedBy;for(let s=e.head;;){let e=i?o.childAfter(s):o.childBefore(s);if(!e)break;Su(t,e,l)?o=e:s=i?e.to:e.from}return r=o.type.prop(l)&&(n=i?cc(t,o.from,1):cc(t,o.to,-1))&&n.matched?i?n.end.to:n.end.from:i?o.to:o.from,ue.cursor(r,i?-1:1)}function Au(t,e){return gu(t,i=>{if(!i.empty)return vu(i,e);let s=t.moveVertically(i,e);return s.head!=i.head?s:t.moveToLineBoundary(i,e)})}const Mu=t=>Au(t,!1),Ou=t=>Au(t,!0);function Tu(t){let e,i=t.scrollDOM.clientHeighti.empty?t.moveVertically(i,e,s.height):vu(i,e));if(r.eq(n.selection))return!1;if(s.selfScroll){let e=t.coordsAtPos(n.selection.main.head),o=t.scrollDOM.getBoundingClientRect(),l=o.top+s.marginTop,a=o.bottom-s.marginBottom;e&&e.top>l&&e.bottomDu(t,!1),Pu=t=>Du(t,!0);function Bu(t,e,i){let s=t.lineBlockAt(e.head),n=t.moveToLineBoundary(e,i);if(n.head==e.head&&n.head!=(i?s.to:s.from)&&(n=t.moveToLineBoundary(e,i,!1)),!i&&n.head==s.from&&s.length){let i=/^\s*/.exec(t.state.sliceDoc(s.from,Math.min(s.from+100,s.to)))[0].length;i&&e.head!=s.from+i&&(n=ue.cursor(s.from+i))}return n}function Eu(t,e,i){let s=!1,n=pu(t.selection,e=>{let n=cc(t,e.head,-1)||cc(t,e.head,1)||e.head>0&&cc(t,e.head-1,1)||e.head{let i=e(t);return ue.range(t.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return!i.eq(t.state.selection)&&(t.dispatch(mu(t.state,i)),!0)}function Nu(t,e){return Lu(t,i=>t.moveByChar(i,e))}const Iu=t=>Nu(t,!bu(t)),Wu=t=>Nu(t,bu(t));function Hu(t,e){return Lu(t,i=>t.moveByGroup(i,e))}function Vu(t,e){return Lu(t,i=>t.moveVertically(i,e))}const Fu=t=>Vu(t,!1),zu=t=>Vu(t,!0);function qu(t,e){return Lu(t,i=>t.moveVertically(i,e,Tu(t).height))}const _u=t=>qu(t,!1),$u=t=>qu(t,!0),ju=({state:t,dispatch:e})=>(e(mu(t,{anchor:0})),!0),Ku=({state:t,dispatch:e})=>(e(mu(t,{anchor:t.doc.length})),!0),Uu=({state:t,dispatch:e})=>(e(mu(t,{anchor:t.selection.main.anchor,head:0})),!0),Yu=({state:t,dispatch:e})=>(e(mu(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0);function Qu(t,e){let{state:i}=t,s=i.selection,n=i.selection.ranges.slice();for(let s of i.selection.ranges){let r=i.doc.lineAt(s.head);if(e?r.to0)for(let i=s;;){let s=t.moveVertically(i,e);if(s.headr.to){n.some(t=>t.head==s.head)||n.push(s);break}if(s.head==i.head)break;i=s}}return n.length!=s.ranges.length&&(t.dispatch(mu(i,ue.create(n,n.length-1))),!0)}function Gu(t,e){if(t.state.readOnly)return!1;let i="delete.selection",{state:s}=t,n=s.changeByRange(s=>{let{from:n,to:r}=s;if(n==r){let o=e(s);on&&(i="delete.forward",o=Xu(t,o,!0)),n=Math.min(n,o),r=Math.max(r,o)}else n=Xu(t,n,!1),r=Xu(t,r,!0);return n==r?{range:s}:{changes:{from:n,to:r},range:ue.cursor(n,ne(t)))s.between(e,e,(t,s)=>{te&&(e=i?s:t)});return e}const Ju=(t,e,i)=>Gu(t,s=>{let n,r,o=s.from,{state:l}=t,a=l.doc.lineAt(o);if(i&&!e&&o>a.from&&oJu(t,!1,!0),tf=t=>Ju(t,!0,!1),ef=(t,e)=>Gu(t,i=>{let s=i.head,{state:n}=t,r=n.doc.lineAt(s),o=n.charCategorizer(s);for(let t=null;;){if(s==(e?r.to:r.from)){s==i.head&&r.number!=(e?n.doc.lines:1)&&(s+=e?1:-1);break}let l=Gt(r.text,s-r.from,e)+r.from,a=r.text.slice(Math.min(s,l)-r.from,Math.max(s,l)-r.from),h=o(a);if(null!=t&&h!=t)break;" "==a&&s==i.head||(t=h),s=l}return s}),sf=t=>ef(t,!1);function nf(t){let e=[],i=-1;for(let s of t.selection.ranges){let n=t.doc.lineAt(s.from),r=t.doc.lineAt(s.to);if(s.empty||s.to!=r.from||(r=t.doc.lineAt(s.to-1)),i>=n.number){let t=e[e.length-1];t.to=r.to,t.ranges.push(s)}else e.push({from:n.from,to:r.to,ranges:[s]});i=r.number+1}return e}function rf(t,e,i){if(t.readOnly)return!1;let s=[],n=[];for(let e of nf(t)){if(i?e.to==t.doc.length:0==e.from)continue;let r=t.doc.lineAt(i?e.to+1:e.from-1),o=r.length+1;if(i){s.push({from:e.to,to:r.to},{from:e.from,insert:r.text+t.lineBreak});for(let i of e.ranges)n.push(ue.range(Math.min(t.doc.length,i.anchor+o),Math.min(t.doc.length,i.head+o)))}else{s.push({from:r.from,to:e.from},{from:e.to,insert:t.lineBreak+r.text});for(let t of e.ranges)n.push(ue.range(t.anchor-o,t.head-o))}}return!!s.length&&(e(t.update({changes:s,scrollIntoView:!0,selection:ue.create(n,t.selection.mainIndex),userEvent:"move.line"})),!0)}function of(t,e,i){if(t.readOnly)return!1;let s=[];for(let e of nf(t))i?s.push({from:e.from,insert:t.doc.slice(e.from,e.to)+t.lineBreak}):s.push({from:e.to,insert:t.lineBreak+t.doc.slice(e.from,e.to)});let n=t.changes(s);return e(t.update({changes:n,selection:t.selection.map(n,i?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const lf=af(!1);function af(t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{let{from:n,to:r}=i,o=e.doc.lineAt(n),l=!t&&n==r&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let i,n=Ya(t).resolveInner(e),r=n.childBefore(e),o=n.childAfter(e);return r&&o&&r.to<=e&&o.from>=e&&(i=r.type.prop(s.closedBy))&&i.indexOf(o.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(o.from).from&&!/\S/.test(t.sliceDoc(r.to,o.from))?{from:r.to,to:o.from}:null}(e,n);t&&(n=r=(r<=o.to?o:e.doc.lineAt(r)).to);let a=new ch(e,{simulateBreak:n,simulateDoubleBreak:!!l}),h=hh(a,n);for(null==h&&(h=ki(/^\s*/.exec(e.doc.lineAt(n).text)[0],e.tabSize));ro.from&&n{let n=[];for(let r=s.from;r<=s.to;){let o=t.doc.lineAt(r);o.number>i&&(s.empty||s.to>o.from)&&(e(o,n,s),i=o.number),r=o.to+1}let r=t.changes(n);return{changes:n,range:ue.range(r.mapPos(s.anchor,1),r.mapPos(s.head,1))}})}const cf=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(hf(t,(e,i)=>{i.push({from:e.from,insert:t.facet(oh)})}),{userEvent:"input.indent"})),!0),uf=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(hf(t,(e,i)=>{let s=/^\s*/.exec(e.text)[0];if(!s)return;let n=ki(s,t.tabSize),r=0,o=ah(t,Math.max(0,n-lh(t)));for(;rgu(t,e=>Cu(t.state,e,!bu(t))),shift:t=>Lu(t,e=>Cu(t.state,e,!bu(t)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:t=>gu(t,e=>Cu(t.state,e,bu(t))),shift:t=>Lu(t,e=>Cu(t.state,e,bu(t)))},{key:"Alt-ArrowUp",run:({state:t,dispatch:e})=>rf(t,e,!1)},{key:"Shift-Alt-ArrowUp",run:({state:t,dispatch:e})=>of(t,e,!1)},{key:"Alt-ArrowDown",run:({state:t,dispatch:e})=>rf(t,e,!0)},{key:"Shift-Alt-ArrowDown",run:({state:t,dispatch:e})=>of(t,e,!0)},{key:"Mod-Alt-ArrowUp",run:t=>Qu(t,!1)},{key:"Mod-Alt-ArrowDown",run:t=>Qu(t,!0)},{key:"Escape",run:({state:t,dispatch:e})=>{let i=t.selection,s=null;return i.ranges.length>1?s=ue.create([i.main]):i.main.empty||(s=ue.create([ue.cursor(i.main.head)])),!!s&&(e(mu(t,s)),!0)}},{key:"Mod-Enter",run:af(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:t,dispatch:e})=>{let i=nf(t).map(({from:e,to:i})=>ue.range(e,Math.min(i+1,t.doc.length)));return e(t.update({selection:ue.create(i),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:t,dispatch:e})=>{let i=pu(t.selection,e=>{let i=Ya(t),s=i.resolveStack(e.from,1);if(e.empty){let t=i.resolveStack(e.from,-1);t.node.from>=s.node.from&&t.node.to<=s.node.to&&(s=t)}for(let t=s;t;t=t.next){let{node:i}=t;if((i.from=e.to||i.to>e.to&&i.from<=e.from)&&t.next)return ue.range(i.to,i.from)}return e});return!i.eq(t.selection)&&(e(mu(t,i)),!0)},preventDefault:!0},{key:"Mod-[",run:uf},{key:"Mod-]",run:cf},{key:"Mod-Alt-\\",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=Object.create(null),s=new ch(t,{overrideIndentation:t=>{let e=i[t];return e??-1}}),n=hf(t,(e,n,r)=>{let o=hh(s,e.from);if(null==o)return;/\S/.test(e.text)||(o=0);let l=/^\s*/.exec(e.text)[0],a=ah(t,o);(l!=a||r.from{if(t.state.readOnly)return!1;let{state:e}=t,i=e.changes(nf(e).map(({from:t,to:i})=>(t>0?t--:i{let i;if(t.lineWrapping){let s=t.lineBlockAt(e.head),n=t.coordsAtPos(e.head,e.assoc||1);n&&(i=s.bottom+t.documentTop-n.bottom+t.defaultLineHeight/2)}return t.moveVertically(e,!0,i)}).map(i);return t.dispatch({changes:i,selection:s,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:t,dispatch:e})=>Eu(t,e,!1)},{key:"Mod-/",run:t=>{let{state:e}=t,i=e.doc.lineAt(e.selection.main.from),s=zc(t.state,i.from);return s.line?Hc(t):!!s.block&&Fc(t)}},{key:"Alt-A",run:Vc},{key:"Ctrl-m",mac:"Shift-Alt-m",run:t=>(t.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:yu,shift:Iu,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:t=>ku(t,!bu(t)),shift:t=>Hu(t,!bu(t)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:t=>gu(t,e=>Bu(t,e,!bu(t))),shift:t=>Lu(t,e=>Bu(t,e,!bu(t))),preventDefault:!0},{key:"ArrowRight",run:xu,shift:Wu,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:t=>ku(t,bu(t)),shift:t=>Hu(t,bu(t)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:t=>gu(t,e=>Bu(t,e,bu(t))),shift:t=>Lu(t,e=>Bu(t,e,bu(t))),preventDefault:!0},{key:"ArrowUp",run:Mu,shift:Fu,preventDefault:!0},{mac:"Cmd-ArrowUp",run:ju,shift:Uu},{mac:"Ctrl-ArrowUp",run:Ru,shift:_u},{key:"ArrowDown",run:Ou,shift:zu,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Ku,shift:Yu},{mac:"Ctrl-ArrowDown",run:Pu,shift:$u},{key:"PageUp",run:Ru,shift:_u},{key:"PageDown",run:Pu,shift:$u},{key:"Home",run:t=>gu(t,e=>Bu(t,e,!1)),shift:t=>Lu(t,e=>Bu(t,e,!1)),preventDefault:!0},{key:"Mod-Home",run:ju,shift:Uu},{key:"End",run:t=>gu(t,e=>Bu(t,e,!0)),shift:t=>Lu(t,e=>Bu(t,e,!0)),preventDefault:!0},{key:"Mod-End",run:Ku,shift:Yu},{key:"Enter",run:lf,shift:lf},{key:"Mod-a",run:({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:Zu,shift:Zu,preventDefault:!0},{key:"Delete",run:tf,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:sf,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:t=>ef(t,!0),preventDefault:!0},{mac:"Mod-Backspace",run:t=>Gu(t,e=>{let i=t.moveToLineBoundary(e,!1).head;return e.head>i?i:Math.max(0,e.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:t=>Gu(t,e=>{let i=t.moveToLineBoundary(e,!0).head;return e.headgu(t,e=>ue.cursor(t.lineBlockAt(e.head).from,1)),shift:t=>Lu(t,e=>ue.cursor(t.lineBlockAt(e.head).from))},{key:"Ctrl-e",run:t=>gu(t,e=>ue.cursor(t.lineBlockAt(e.head).to,-1)),shift:t=>Lu(t,e=>ue.cursor(t.lineBlockAt(e.head).to))},{key:"Ctrl-d",run:tf},{key:"Ctrl-h",run:Zu},{key:"Ctrl-k",run:t=>Gu(t,e=>{let i=t.lineBlockAt(e.head).to;return e.head{if(t.readOnly)return!1;let i=t.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:Ft.of(["",""])},range:ue.cursor(t.from)}));return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(e=>{if(!e.empty||0==e.from||e.from==t.doc.length)return{range:e};let i=e.from,s=t.doc.lineAt(i),n=i==s.from?i-1:Gt(s.text,i-s.from,!1)+s.from,r=i==s.to?i+1:Gt(s.text,i-s.from,!0)+s.from;return{changes:{from:n,to:r,insert:t.doc.slice(i,r).append(t.doc.slice(n,i))},range:ue.cursor(r)}});return!i.changes.empty&&(e(t.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Pu}].map(t=>({mac:t.key,run:t.run,shift:t.shift})))),df="function"==typeof String.prototype.normalize?t=>t.normalize("NFKD"):t=>t;class pf{constructor(t,e,i=0,s=t.length,n,r){this.test=r,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,s),this.bufferStart=i,this.normalize=n?t=>n(df(t)):df,this.query=this.normalize(e)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Xt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=Jt(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=Zt(t);let s=this.normalize(e);if(s.length)for(let t=0,n=i,r=!0;;t++){let i=s.charCodeAt(t),o=this.match(i,n,r,this.bufferPos+this.bufferStart,t==s.length-1);if(o)return this.value=o,this;if(t==s.length-1)break;r&&tthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let i=this.curLineStart+e.index,s=i+e[0].length;if(this.matchPos=xf(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,s,e)))return this.value={from:i,to:s,precise:!0,match:e},this;t=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=i||s.to<=e){let s=new bf(e,t.sliceString(e,i));return wf.set(t,s),s}if(s.from==e&&s.to==i)return s;let{text:n,from:r}=s;return r>e&&(n=t.sliceString(e,r)+n,r=e),s.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let t=this.flat.from+e.index,i=t+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(t,i,e)))return this.value={from:t,to:i,precise:!0,match:e},this.matchPos=xf(this.text,i+(t==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=bf.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function xf(t,e){if(e>=t.length)return e;let i,s=t.lineAt(e);for(;e=56320&&i<57344;)e++;return e}"undefined"!=typeof Symbol&&(vf.prototype[Symbol.iterator]=yf.prototype[Symbol.iterator]=function(){return this});const kf={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Sf=pe.define({combine:t=>si(t,kf,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})});function Cf(t){let e=[Df,Tf];return t&&e.push(Sf.of(t)),e}const Af=ss.mark({class:"cm-selectionMatch"}),Mf=ss.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Of(t,e,i,s){return!(0!=i&&t(e.sliceDoc(i-1,i))==Je.Word||s!=e.doc.length&&t(e.sliceDoc(s,s+1))==Je.Word)}const Tf=bn.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(Sf),{state:i}=t,s=i.selection;if(s.ranges.length>1)return ss.none;let n,r=s.main,o=null;if(r.empty){if(!e.highlightWordAroundCursor)return ss.none;let t=i.wordAt(r.head);if(!t)return ss.none;o=i.charCategorizer(r.head),n=i.sliceDoc(t.from,t.to)}else{let t=r.to-r.from;if(t200)return ss.none;if(e.wholeWords){if(n=i.sliceDoc(r.from,r.to),o=i.charCategorizer(r.head),!Of(o,i,r.from,r.to)||!function(t,e,i,s){return t(e.sliceDoc(i,i+1))==Je.Word&&t(e.sliceDoc(s-1,s))==Je.Word}(o,i,r.from,r.to))return ss.none}else if(n=i.sliceDoc(r.from,r.to),!n)return ss.none}let l=[];for(let s of t.visibleRanges){let t=new pf(i.doc,n,s.from,s.to);for(;!t.next().done;){let{from:s,to:n}=t.value;if((!o||Of(o,i,s,n))&&(r.empty&&s<=r.from&&n>=r.to?l.push(Mf.range(s,n)):(s>=r.to||n<=r.from)&&l.push(Af.range(s,n)),l.length>e.maxMatches))return ss.none}}return ss.set(l)}},{decorations:t=>t.decorations}),Df=jo.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});const Rf=pe.define({combine:t=>si(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new rd(t),scrollToMatch:t=>jo.scrollIntoView(t)})});class Pf{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||function(t){try{return new RegExp(t,gf),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(t,e)=>"n"==e?"\n":"r"==e?"\r":"t"==e?"\t":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new Hf(this):new Lf(this)}getCursor(t,e=0,i){let s=t.doc?t:ii.create({doc:t});return null==i&&(i=s.doc.length),this.regexp?Nf(this,s,e,i):Ef(this,s,e,i)}}class Bf{constructor(t){this.spec=t}}function Ef(t,e,i,s){let n;return t.wholeWord&&(n=function(t,e){return(i,s,n,r)=>((r>i||r+n.length{if(i&&!i(s,n,r,o))return!1;let l=s>=o&&n<=o+r.length?r.slice(s-o,n-o):e.doc.sliceString(s,n);return t(l,e,s,n)}}(t.test,e,n)),new pf(e.doc,t.unquoted,i,s,t.caseSensitive?void 0:t=>t.toLowerCase(),n)}class Lf extends Bf{constructor(t){super(t)}nextMatch(t,e,i){let s=Ef(this.spec,t,i,t.doc.length).nextOverlapping();if(s.done){let i=Math.min(t.doc.length,e+this.spec.unquoted.length);s=Ef(this.spec,t,0,i).nextOverlapping()}return s.done||s.value.from==e&&s.value.to==i?null:s.value}prevMatchInRange(t,e,i){for(let s=i;;){let i=Math.max(e,s-1e4-this.spec.unquoted.length),n=Ef(this.spec,t,i,s),r=null;for(;!n.nextOverlapping().done;)r=n.value;if(r)return r;if(i==e)return null;s-=1e4}}prevMatch(t,e,i){let s=this.prevMatchInRange(t,0,e);return s||(s=this.prevMatchInRange(t,Math.max(0,i-this.spec.unquoted.length),t.doc.length)),!s||s.from==e&&s.to==i?null:s}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,e){let i=Ef(this.spec,t,0,t.doc.length),s=[];for(;!i.next().done;){if(s.length>=e)return null;s.push(i.value)}return s}highlight(t,e,i,s){let n=Ef(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!n.next().done;)s(n.value.from,n.value.to)}}function Nf(t,e,i,s){let n;var r;return t.wholeWord&&(r=e.charCategorizer(e.selection.main.head),n=(t,e,i)=>!i[0].length||(r(If(i.input,i.index))!=Je.Word||r(Wf(i.input,i.index))!=Je.Word)&&(r(Wf(i.input,i.index+i[0].length))!=Je.Word||r(If(i.input,i.index+i[0].length))!=Je.Word)),t.test&&(n=function(t,e,i){return(s,n,r)=>(!i||i(s,n,r))&&t(r[0],e,s,n)}(t.test,e,n)),new vf(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:n},i,s)}function If(t,e){return t.slice(Gt(t,e,!1),e)}function Wf(t,e){return t.slice(e,Gt(t,e))}class Hf extends Bf{nextMatch(t,e,i){let s=Nf(this.spec,t,i,t.doc.length).next();return s.done&&(s=Nf(this.spec,t,0,e).next()),s.done?null:s.value}prevMatchInRange(t,e,i){for(let s=1;;s++){let n=Math.max(e,i-1e4*s),r=Nf(this.spec,t,n,i),o=null;for(;!r.next().done;)o=r.value;if(o&&(n==e||o.from>n+10))return o;if(n==e)return null}}prevMatch(t,e,i){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(e,i)=>{if("&"==i)return t.match[0];if("$"==i)return"$";for(let e=i.length;e>0;e--){let s=+i.slice(0,e);if(s>0&&s=e)return null;s.push(i.value)}return s}highlight(t,e,i,s){let n=Nf(this.spec,t,Math.max(0,e-250),Math.min(i+250,t.doc.length));for(;!n.next().done;)s(n.value.from,n.value.to)}}const Vf=$e.define(),Ff=$e.define(),zf=xe.define({create:t=>new qf(Zf(t).create(),null),update(t,e){for(let i of e.effects)i.is(Vf)?t=new qf(i.value.create(),t.panel):i.is(Ff)&&(t=new qf(t.query,i.value?Jf:null));return t},provide:t=>fa.from(t,t=>t.panel)});class qf{constructor(t,e){this.query=t,this.panel=e}}const _f=ss.mark({class:"cm-searchMatch"}),$f=ss.mark({class:"cm-searchMatch cm-searchMatch-selected"}),jf=bn.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(zf))}update(t){let e=t.state.field(zf);(e!=t.startState.field(zf)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return ss.none;let{view:i}=this,s=new ui;for(let e=0,n=i.visibleRanges,r=n.length;en[e+1].from-500;)l=n[++e].to;t.highlight(i.state,o,l,(t,e)=>{let n=i.state.selection.ranges.some(i=>i.from==t&&i.to==e);s.add(t,e,n?$f:_f)})}return s.finish()}},{decorations:t=>t.decorations});function Kf(t){return e=>{let i=e.state.field(zf,!1);return i&&i.query.spec.valid?t(e,i):id(e)}}const Uf=Kf((t,{query:e})=>{let{to:i}=t.state.selection.main,s=e.nextMatch(t.state,i,i);if(!s)return!1;let n=ue.single(s.from,s.to),r=t.state.facet(Rf);return t.dispatch({selection:n,effects:[hd(t,s),r.scrollToMatch(n.main,t)],userEvent:"select.search"}),ed(t),!0}),Yf=Kf((t,{query:e})=>{let{state:i}=t,{from:s}=i.selection.main,n=e.prevMatch(i,s,s);if(!n)return!1;let r=ue.single(n.from,n.to),o=t.state.facet(Rf);return t.dispatch({selection:r,effects:[hd(t,n),o.scrollToMatch(r.main,t)],userEvent:"select.search"}),ed(t),!0}),Qf=Kf((t,{query:e})=>{let i=e.matchAll(t.state,1e3);return!(!i||!i.length)&&(t.dispatch({selection:ue.create(i.map(t=>ue.range(t.from,t.to))),userEvent:"select.search.matches"}),!0)}),Gf=Kf((t,{query:e})=>{let{state:i}=t,{from:s,to:n}=i.selection.main;if(i.readOnly)return!1;let r=e.nextMatch(i,s,s);if(!r)return!1;let o,l,a=r,h=[],c=[];a.precise?a.from==s&&a.to==n&&(l=i.toText(e.getReplacement(a)),h.push({from:a.from,to:a.to,insert:l}),a=e.nextMatch(i,a.from,a.to),c.push(jo.announce.of(i.phrase("replaced match on line $",i.doc.lineAt(s).number)+"."))):a=e.nextMatch(i,a.from,a.to);let u=t.state.changes(h);return a&&(o=ue.single(a.from,a.to).map(u),c.push(hd(t,a)),c.push(i.facet(Rf).scrollToMatch(o.main,t))),t.dispatch({changes:u,selection:o,effects:c,userEvent:"input.replace"}),!0}),Xf=Kf((t,{query:e})=>{if(t.state.readOnly)return!1;let i=[];for(let s of e.matchAll(t.state,1e9)){let{from:t,to:n,precise:r}=s;r&&i.push({from:t,to:n,insert:e.getReplacement(s)})}if(!i.length)return!1;let s=t.state.phrase("replaced $ matches",i.length)+".";return t.dispatch({changes:i,effects:jo.announce.of(s),userEvent:"input.replace.all"}),!0});function Jf(t){return t.state.facet(Rf).createPanel(t)}function Zf(t,e){var i,s,n,r,o;let l=t.selection.main,a=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=t.facet(Rf);return new Pf({search:(null!==(i=null==e?void 0:e.literal)&&void 0!==i?i:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:null!==(s=null==e?void 0:e.caseSensitive)&&void 0!==s?s:h.caseSensitive,literal:null!==(n=null==e?void 0:e.literal)&&void 0!==n?n:h.literal,regexp:null!==(r=null==e?void 0:e.regexp)&&void 0!==r?r:h.regexp,wholeWord:null!==(o=null==e?void 0:e.wholeWord)&&void 0!==o?o:h.wholeWord})}function td(t){let e=aa(t,Jf);return e&&e.dom.querySelector("[main-field]")}function ed(t){let e=td(t);e&&e==t.root.activeElement&&e.select()}const id=t=>{let e=t.state.field(zf,!1);if(e&&e.panel){let i=td(t);if(i&&i!=t.root.activeElement){let s=Zf(t.state,e.query.spec);s.valid&&t.dispatch({effects:Vf.of(s)}),i.focus(),i.select()}}else t.dispatch({effects:[Ff.of(!0),e?Vf.of(Zf(t.state,e.query.spec)):$e.appendConfig.of(ud)]});return!0},sd=t=>{let e=t.state.field(zf,!1);if(!e||!e.panel)return!1;let i=aa(t,Jf);return i&&i.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:Ff.of(!1)}),!0},nd=[{key:"Mod-f",run:id,scope:"editor search-panel"},{key:"F3",run:Uf,shift:Yf,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Uf,shift:Yf,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:sd,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:t,dispatch:e})=>{let i=t.selection;if(i.ranges.length>1||i.main.empty)return!1;let{from:s,to:n}=i.main,r=[],o=0;for(let e=new pf(t.doc,t.sliceDoc(s,n));!e.next().done;){if(r.length>1e3)return!1;e.value.from==s&&(o=r.length),r.push(ue.range(e.value.from,e.value.to))}return e(t.update({selection:ue.create(r,o),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:t=>{let{state:e}=t,i=String(e.doc.lineAt(t.state.selection.main.head).number),{close:s,result:n}=da(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:i},focus:!0,submitLabel:e.phrase("go")});return n.then(i=>{let n=i&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(i.elements.line.value);if(!n)return void t.dispatch({effects:s});let r=e.doc.lineAt(e.selection.main.head),[,o,l,a,h]=n,c=a?+a.slice(1):0,u=l?+l:r.number;if(l&&h){let t=u/100;o&&(t=t*("-"==o?-1:1)+r.number/e.doc.lines),u=Math.round(e.doc.lines*t)}else l&&o&&(u=u*("-"==o?-1:1)+r.number);let f=e.doc.line(Math.max(1,Math.min(e.doc.lines,u))),d=ue.cursor(f.from+Math.max(0,Math.min(c,f.length)));t.dispatch({effects:[s,jo.scrollIntoView(d.from,{y:"center"})],selection:d})}),!0}},{key:"Mod-d",run:({state:t,dispatch:e})=>{let{ranges:i}=t.selection;if(i.some(t=>t.from===t.to))return(({state:t,dispatch:e})=>{let{selection:i}=t,s=ue.create(i.ranges.map(e=>t.wordAt(e.head)||ue.cursor(e.head)),i.mainIndex);return!s.eq(i)&&(e(t.update({selection:s})),!0)})({state:t,dispatch:e});let s=t.sliceDoc(i[0].from,i[0].to);if(t.selection.ranges.some(e=>t.sliceDoc(e.from,e.to)!=s))return!1;let n=function(t,e){let{main:i,ranges:s}=t.selection,n=t.wordAt(i.head),r=n&&n.from==i.from&&n.to==i.to;for(let i=!1,n=new pf(t.doc,e,s[s.length-1].to);;){if(n.next(),!n.done){if(i&&s.some(t=>t.from==n.value.from))continue;if(r){let e=t.wordAt(n.value.from);if(!e||e.from!=n.value.from||e.to!=n.value.to)continue}return n.value}if(i)return null;n=new pf(t.doc,e,0,Math.max(0,s[s.length-1].from-1)),i=!0}}(t,s);return!!n&&(e(t.update({selection:t.selection.addRange(ue.range(n.from,n.to),!1),effects:jo.scrollIntoView(n.to)})),!0)},preventDefault:!0}];class rd{constructor(t){this.view=t;let e=this.query=t.state.field(zf).query.spec;function i(t,e,i){return Ii("button",{class:"cm-button",name:t,onclick:e,type:"button"},i)}this.commit=this.commit.bind(this),this.searchField=Ii("input",{value:e.search,placeholder:od(t,"Find"),"aria-label":od(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ii("input",{value:e.replace,placeholder:od(t,"Replace"),"aria-label":od(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ii("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=Ii("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=Ii("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit}),this.dom=Ii("div",{onkeydown:t=>this.keydown(t),class:"cm-search"},[this.searchField,i("next",()=>Uf(t),[od(t,"next")]),i("prev",()=>Yf(t),[od(t,"previous")]),i("select",()=>Qf(t),[od(t,"all")]),Ii("label",null,[this.caseField,od(t,"match case")]),Ii("label",null,[this.reField,od(t,"regexp")]),Ii("label",null,[this.wordField,od(t,"by word")]),...t.state.readOnly?[]:[Ii("br"),this.replaceField,i("replace",()=>Gf(t),[od(t,"replace")]),i("replaceAll",()=>Xf(t),[od(t,"replace all")])],Ii("button",{name:"close",onclick:()=>sd(t),"aria-label":od(t,"close"),type:"button"},["×"])])}commit(){let t=new Pf({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:Vf.of(t)}))}keydown(t){var e,i,s;e=this.view,i=t,s="search-panel",rl(el(e.state),i,e,s)?t.preventDefault():13==t.keyCode&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?Yf:Uf)(this.view)):13==t.keyCode&&t.target==this.replaceField&&(t.preventDefault(),Gf(this.view))}update(t){for(let e of t.transactions)for(let t of e.effects)t.is(Vf)&&!t.value.eq(this.query)&&this.setQuery(t.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Rf).top}}function od(t,e){return t.state.phrase(e)}const ld=30,ad=/[\s\.,:;?!]/;function hd(t,{from:e,to:i}){let s=t.state.doc.lineAt(e),n=t.state.doc.lineAt(i).to,r=Math.max(s.from,e-ld),o=Math.min(n,i+ld),l=t.state.sliceDoc(r,o);if(r!=s.from)for(let t=0;tl.length-ld;t--)if(!ad.test(l[t-1])&&ad.test(l[t])){l=l.slice(0,t);break}return jo.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${s.number}.`)}const cd=jo.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),ud=[zf,Oe.low(jf),cd];class fd{constructor(t,e,i,s){this.state=t,this.pos=e,this.explicit=i,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=Ya(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),s=e.text.slice(i-e.from,this.pos-e.from),n=s.search(vd(t,!1));return n<0?null:{from:i+n,to:this.pos,text:s.slice(n)}}get aborted(){return null==this.abortListeners}addEventListener(t,e,i){"abort"==t&&this.abortListeners&&(this.abortListeners.push(e),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function dd(t){let e=Object.keys(t).join(""),i=/\w/.test(e);return i&&(e=e.replace(/\w/g,"")),`[${i?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function pd(t){let e=t.map(t=>"string"==typeof t?{label:t}:t),[i,s]=e.every(t=>/^\w+$/.test(t.label))?[/\w*$/,/\w+$/]:function(t){let e=Object.create(null),i=Object.create(null);for(let{label:s}of t){e[s[0]]=!0;for(let t=1;t{let n=t.matchBefore(s);return n||t.explicit?{from:n?n.from:t.pos,options:e,validFor:i}:null}}class md{constructor(t,e,i,s){this.completion=t,this.source=e,this.match=i,this.score=s}}function gd(t){return t.selection.main.from}function vd(t,e){var i;let{source:s}=t,n=e&&"^"!=s[0],r="$"!=s[s.length-1];return n||r?new RegExp(`${n?"^":""}(?:${s})${r?"$":""}`,null!==(i=t.flags)&&void 0!==i?i:t.ignoreCase?"i":""):t}const wd=ze.define();function bd(t,e,i,s){let{main:n}=t.selection,r=i-n.from,o=s-n.from;return{...t.changeByRange(l=>{if(l!=n&&i!=s&&t.sliceDoc(l.from+r,l.from+o)!=t.sliceDoc(i,s))return{range:l};let a=t.toText(e);return{changes:{from:l.from+r,to:s==n.from?l.to:l.from+o,insert:a},range:ue.cursor(l.from+r+a.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const yd=new WeakMap;function xd(t){if(!Array.isArray(t))return t;let e=yd.get(t);return e||yd.set(t,e=pd(t)),e}const kd=$e.define(),Sd=$e.define();class Cd{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e=48&&a<=57||a>=97&&a<=122?2:a>=65&&a<=90?1:0:(w=Jt(a))!=w.toLowerCase()?1:w!=w.toUpperCase()?2:0;(!s||1==b&&m||0==v&&0!=b)&&(e[c]==a||i[c]==a&&(u=!0)?r[c++]=s:r.length&&(g=!1)),v=b,s+=Zt(a)}return c==l&&0==r[0]&&g?this.result((u?-200:0)-100,r,t):f==l&&0==d?this.ret(-200-t.length+(p==t.length?0:-100),[0,p]):o>-1?this.ret(-700-t.length,[o,o+this.pattern.length]):f==l?this.ret(-900-t.length,[d,p]):c==l?this.result((u?-200:0)-100-700+(g?0:-1100),r,t):2==e.length?null:this.result((s[0]?-700:0)-200-1100,s,t)}result(t,e,i){let s=[],n=0;for(let t of e){let e=t+(this.astral?Zt(Xt(i,t)):1);n&&s[n-1]==t?s[n-1]=e:(s[n++]=t,s[n++]=e)}return this.ret(t-i.length,s)}}class Ad{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.lengthsi(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Td,filterStrict:!1,compareCompletions:(t,e)=>(t.sortText||t.label).localeCompare(e.sortText||e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>i=>Od(t(i),e(i)),optionClass:(t,e)=>i=>Od(t(i),e(i)),addToOptions:(t,e)=>t.concat(e),filterStrict:(t,e)=>t||e})});function Od(t,e){return t?e?t+" "+e:t:e}function Td(t,e,i,s,n,r){let o,l,a=t.textDirection==Es.RTL,h=a,c=!1,u="top",f=e.left-n.left,d=n.right-e.right,p=s.right-s.left,m=s.bottom-s.top;if(h&&f=m||t>e.top?o=i.bottom-e.top:(u="bottom",o=e.bottom-i.top)}return{style:`${u}: ${o/((e.bottom-e.top)/r.offsetHeight)}px; max-width: ${l/((e.right-e.left)/r.offsetWidth)}px`,class:"cm-completionInfo-"+(c?a?"left-narrow":"right-narrow":h?"left":"right")}}const Dd=$e.define();function Rd(t,e,i){if(t<=i)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let t=Math.floor(e/i);return{from:t*i,to:(t+1)*i}}let s=Math.ceil((t-e)/i);return{from:t-s*i,to:t-(s-1)*i}}class Pd{constructor(t,e,i){this.view=t,this.stateField=e,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:t=>this.placeInfo(t),key:this},this.space=null,this.currentClass="";let s=t.state.field(e),{options:n,selected:r}=s.open,o=t.state.facet(Md);this.optionContent=function(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(t){let e=document.createElement("div");return e.classList.add("cm-completionIcon"),t.type&&e.classList.add(...t.type.split(/\s+/g).map(t=>"cm-completionIcon-"+t)),e.setAttribute("aria-hidden","true"),e},position:20}),e.push({render(t,e,i,s){let n=document.createElement("span");n.className="cm-completionLabel";let r=t.displayLabel||t.label,o=0;for(let t=0;to&&n.appendChild(document.createTextNode(r.slice(o,e)));let l=n.appendChild(document.createElement("span"));l.appendChild(document.createTextNode(r.slice(e,i))),l.className="cm-completionMatchedText",o=i}return ot.position-e.position).map(t=>t.render)}(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=Rd(n.length,r,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",i=>{let{options:s}=t.state.field(e).open;for(let e,n=i.target;n&&n!=this.dom;n=n.parentNode)if("LI"==n.nodeName&&(e=/-(\d+)$/.exec(n.id))&&+e[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;null!=e&&(t.dispatch({effects:Dd.of(e)}),i.preventDefault())}}),this.dom.addEventListener("focusout",e=>{let i=t.state.field(this.stateField,!1);i&&i.tooltip&&t.state.facet(Md).closeOnBlur&&e.relatedTarget!=t.contentDOM&&t.dispatch({effects:Sd.of(null)})}),this.showOptions(n,s.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var e;let i=t.state.field(this.stateField),s=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=s){let{options:n,selected:r,disabled:o}=i.open;s.open&&s.open.options==n||(this.range=Rd(n.length,r,t.state.facet(Md).maxRenderedOptions),this.showOptions(n,i.id)),this.updateSel(),o!=(null===(e=s.open)||void 0===e?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let t of this.currentClass.split(" "))t&&this.dom.classList.remove(t);for(let t of e.split(" "))t&&this.dom.classList.add(t);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;(e.selected>-1&&e.selected=this.range.to)&&(this.range=Rd(e.options.length,e.selected,this.view.state.facet(Md).maxRenderedOptions),this.showOptions(e.options,t.id));let i=this.updateSelectedOption(e.selected);if(i){this.destroyInfo();let{completion:s}=e.options[e.selected],{info:n}=s;if(!n)return;let r="string"==typeof n?document.createTextNode(n):n(s);if(!r)return;"then"in r?r.then(e=>{e&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(e,s)}).catch(t=>mn(this.view.state,t,"completion info")):(this.addInfoPane(r,s),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,e){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=t.nodeType)i.appendChild(t),this.infoDestroy=null;else{let{dom:e,destroy:s}=t;i.appendChild(e),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)"LI"==i.nodeName&&i.id?s==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),e=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby")):s--;return e&&function(t,e){let i=t.getBoundingClientRect(),s=e.getBoundingClientRect(),n=i.height/t.offsetHeight;s.topi.bottom&&(t.scrollTop+=(s.bottom-i.bottom)/n)}(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=t.getBoundingClientRect(),n=this.space;if(!n){let t=this.dom.ownerDocument.documentElement;n={left:0,top:0,right:t.clientWidth,bottom:t.clientHeight}}return s.top>Math.min(n.bottom,e.bottom)-10||s.bottom{t.target==s&&t.preventDefault()});let n=null;for(let r=i.from;ri.from||0==i.from))if(n=t,"string"!=typeof a&&a.header)s.appendChild(a.header(a));else{s.appendChild(document.createElement("completion-section")).textContent=t}}const h=s.appendChild(document.createElement("li"));h.id=e+"-"+r,h.setAttribute("role","option");let c=this.optionClass(o);c&&(h.className=c);for(let t of this.optionContent){let e=t(o,this.view.state,this.view,l);e&&h.appendChild(e)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.tonew Pd(i,t,e)}function Ed(t){return 100*(t.boost||0)+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}class Ld{constructor(t,e,i,s,n,r){this.options=t,this.attrs=e,this.tooltip=i,this.timestamp=s,this.selected=n,this.disabled=r}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new Ld(this.options,Hd(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,i,s,n,r){if(s&&!r&&t.some(t=>t.isPending))return s.setDisabled();let o=function(t,e){let i=[],s=null,n=null,r=t=>{i.push(t);let{section:e}=t.completion;if(e){s||(s=[]);let t="string"==typeof e?e:e.name;s.some(e=>e.name==t)||s.push("string"==typeof e?{name:t}:e)}},o=e.facet(Md);for(let s of t)if(s.hasResult()){let t=s.result.getMatch;if(!1===s.result.filter)for(let e of s.result.options)r(new md(e,s.source,t?t(e):[],1e9-i.length));else{let i,l=e.sliceDoc(s.from,s.to),a=o.filterStrict?new Ad(l):new Cd(l);for(let e of s.result.options)if(i=a.match(e.label)){let o=e.displayLabel?t?t(e,i.matched):[]:i.matched,l=i.score+(e.boost||0);if(r(new md(e,s.source,o,l)),"object"==typeof e.section&&"dynamic"===e.section.rank){let{name:t}=e.section;n||(n=Object.create(null)),n[t]=Math.max(l,n[t]||-1e9)}}}}if(s){let t=Object.create(null),e=0,r=(t,e)=>("dynamic"===t.rank&&"dynamic"===e.rank?n[e.name]-n[t.name]:0)||("number"==typeof t.rank?t.rank:1e9)-("number"==typeof e.rank?e.rank:1e9)||(t.namee.score-t.score||h(t.completion,e.completion))){let e=t.completion;!a||a.label!=e.label||a.detail!=e.detail||null!=a.type&&null!=e.type&&a.type!=e.type||a.apply!=e.apply||a.boost!=e.boost?l.push(t):Ed(t.completion)>Ed(a)&&(l[l.length-1]=t),a=t.completion}return l}(t,e);if(!o.length)return s&&t.some(t=>t.isPending)?s.setDisabled():null;let l=e.facet(Md).selectOnOpen?0:-1;if(s&&s.selected!=l&&-1!=s.selected){let t=s.options[s.selected].completion;for(let e=0;ee.hasResult()?Math.min(t,e.from):t,1e8),create:Kd,above:n.aboveCursor},s?s.timestamp:Date.now(),l,!1)}map(t){return new Ld(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Ld(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Nd{constructor(t,e,i){this.active=t,this.id=e,this.open=i}static start(){return new Nd(Vd,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(t){let{state:e}=t,i=e.facet(Md),s=(i.override||e.languageDataAt("autocomplete",gd(e)).map(xd)).map(e=>(this.active.find(t=>t.source==e)||new zd(e,this.active.some(t=>0!=t.state)?1:0)).update(t,i));s.length==this.active.length&&s.every((t,e)=>t==this.active[e])&&(s=this.active);let n=this.open,r=t.effects.some(t=>t.is(_d));n&&t.docChanged&&(n=n.map(t.changes)),t.selection||s.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!function(t,e){if(t==e)return!0;for(let i=0,s=0;;){for(;it.isPending)&&(n=null),!n&&s.every(t=>!t.isPending)&&s.some(t=>t.hasResult())&&(s=s.map(t=>t.hasResult()?new zd(t.source,0):t));for(let e of t.effects)e.is(Dd)&&(n=n&&n.setSelected(e.value,this.id));return s==this.active&&n==this.open?this:new Nd(s,this.id,n)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Id:Wd}}const Id={"aria-autocomplete":"list"},Wd={};function Hd(t,e){let i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(i["aria-activedescendant"]=t+"-"+e),i}const Vd=[];function Fd(t,e){if(t.isUserEvent("input.complete")){let i=t.annotation(wd);if(i&&e.activateOnCompletion(i))return 12}let i=t.isUserEvent("input.type");return i&&e.activateOnTyping?5:i?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class zd{constructor(t,e,i=!1){this.source=t,this.state=e,this.explicit=i}hasResult(){return!1}get isPending(){return 1==this.state}update(t,e){let i=Fd(t,e),s=this;(8&i||16&i&&this.touches(t))&&(s=new zd(s.source,0)),4&i&&0==s.state&&(s=new zd(this.source,1)),s=s.updateFor(t,i);for(let e of t.effects)if(e.is(kd))s=new zd(s.source,1,e.value);else if(e.is(Sd))s=new zd(s.source,0);else if(e.is(_d))for(let t of e.value)t.source==s.source&&(s=t);return s}updateFor(t,e){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(gd(t.state))}}class qd extends zd{constructor(t,e,i,s,n,r){super(t,3,e),this.limit=i,this.result=s,this.from=n,this.to=r}hasResult(){return!0}updateFor(t,e){var i;if(!(3&e))return this.map(t.changes);let s=this.result;s.map&&!t.changes.empty&&(s=s.map(s,t.changes));let n=t.changes.mapPos(this.from),r=t.changes.mapPos(this.to,1),o=gd(t.state);if(o>r||!s||2&e&&(gd(t.startState)==this.from||ot.map(t=>t.map(e))}),$d=xe.define({create:()=>Nd.start(),update:(t,e)=>t.update(e),provide:t=>[Xl.from(t,t=>t.tooltip),jo.contentAttributes.from(t,t=>t.attrs)]});function jd(t,e){const i=e.completion.apply||e.completion.label;let s=t.state.field($d).active.find(t=>t.source==e.source);return s instanceof qd&&("string"==typeof i?t.dispatch({...bd(t.state,i,s.from,s.to),annotations:wd.of(e.completion)}):i(t,e.completion,s.from,s.to),!0)}const Kd=Bd($d,jd);function Ud(t,e="option"){return i=>{let s=i.state.field($d,!1);if(!s||!s.open||s.open.disabled||Date.now()-s.open.timestamp-1?s.open.selected+r*(t?1:-1):t?0:o-1;return l<0?l="page"==e?0:o-1:l>=o&&(l="page"==e?o-1:0),i.dispatch({effects:Dd.of(l)}),!0}}const Yd=t=>!!t.state.field($d,!1)&&(t.dispatch({effects:kd.of(!0)}),!0);class Qd{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const Gd=bn.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field($d).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field($d),i=t.state.facet(Md);if(!t.selectionSet&&!t.docChanged&&t.startState.field($d)==e)return;let s=t.transactions.some(t=>{let e=Fd(t,i);return 8&e||(t.selection||t.docChanged)&&!(3&e)});for(let e=0;e50&&Date.now()-i.time>1e3){for(let t of i.context.abortListeners)try{t()}catch(t){mn(this.view.state,t)}i.context.abortListeners=null,this.running.splice(e--,1)}else i.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(t=>t.effects.some(t=>t.is(kd)))&&(this.pendingStart=!0);let n=this.pendingStart?50:i.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(t=>t.isPending&&!this.running.some(e=>e.active.source==t.source))?setTimeout(()=>this.startUpdate(),n):-1,0!=this.composing)for(let e of t.transactions)e.isUserEvent("input.type")?this.composing=2:2==this.composing&&e.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field($d);for(let t of e.active)t.isPending&&!this.running.some(e=>e.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Md).updateSyncTime))}startQuery(t){let{state:e}=this.view,i=gd(e),s=new fd(e,i,t.explicit,this.view),n=new Qd(t,s);this.running.push(n),Promise.resolve(t.source(s)).then(t=>{n.context.aborted||(n.done=t||null,this.scheduleAccept())},t=>{this.view.dispatch({effects:Sd.of(null)}),mn(this.view.state,t)})}scheduleAccept(){this.running.every(t=>void 0!==t.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Md).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],i=this.view.state.facet(Md),s=this.view.state.field($d);for(let n=0;nt.source==r.active.source);if(o&&o.isPending)if(null==r.done){let t=new zd(r.active.source,0);for(let e of r.updates)t=t.update(e,i);t.isPending||e.push(t)}else this.startQuery(o)}(e.length||s.open&&s.open.disabled)&&this.view.dispatch({effects:_d.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field($d,!1);if(e&&e.tooltip&&this.view.state.facet(Md).closeOnBlur){let i=e.open&&ra(this.view,e.open.tooltip);i&&i.dom.contains(t.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:Sd.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:kd.of(!1)}),20),this.composing=0}}}),Xd="object"==typeof navigator&&/Win/.test(navigator.platform),Jd=Oe.highest(jo.domEventHandlers({keydown(t,e){let i=e.state.field($d,!1);if(!i||!i.open||i.open.disabled||i.open.selected<0||t.key.length>1||t.ctrlKey&&(!Xd||!t.altKey)||t.metaKey)return!1;let s=i.open.options[i.open.selected],n=i.active.find(t=>t.source==s.source),r=s.completion.commitCharacters||n.result.commitCharacters;return r&&r.indexOf(t.key)>-1&&jd(e,s),!1}})),Zd=jo.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});const tp={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},ep=$e.define({map(t,e){let i=e.mapPos(t,-1,ee.TrackAfter);return i??void 0}}),ip=new class extends ni{};ip.startSide=1,ip.endSide=-1;const sp=xe.define({create:()=>hi.empty,update(t,e){if(t=t.map(e.changes),e.selection){let i=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:t=>t>=i.from&&t<=i.to})}for(let i of e.effects)i.is(ep)&&(t=t.update({add:[ip.range(i.value,i.value+1)]}));return t}});const np="()[]{}<>«»»«[]{}";function rp(t){for(let e=0;e<16;e+=2)if(np.charCodeAt(e)==t)return np.charAt(e+1);return Jt(t<128?t:t+1)}function op(t,e){return t.languageDataAt("closeBrackets",e)[0]||tp}const lp="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),ap=jo.inputHandler.of((t,e,i,s)=>{if((lp?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let n=t.state.selection.main;if(s.length>2||2==s.length&&1==Zt(Xt(s,0))||e!=n.from||i!=n.to)return!1;let r=function(t,e){let i=op(t,t.selection.main.head),s=i.brackets||tp.brackets;for(let n of s){let r=rp(Xt(n,0));if(e==n)return r==n?pp(t,n,s.indexOf(n+n+n)>-1,i):fp(t,n,r,i.before||tp.before);if(e==r&&cp(t,t.selection.main.from))return dp(t,n,r)}return null}(t.state,s);return!!r&&(t.dispatch(r),!0)}),hp=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=op(t,t.selection.main.head).brackets||tp.brackets,s=null,n=t.changeByRange(e=>{if(e.empty){let s=function(t,e){let i=t.sliceString(e-2,e);return Zt(Xt(i,0))==i.length?i:i.slice(1)}(t.doc,e.head);for(let n of i)if(n==s&&up(t.doc,e.head)==rp(Xt(n,0)))return{changes:{from:e.head-n.length,to:e.head+n.length},range:ue.cursor(e.head-n.length)}}return{range:s=e}});return s||e(t.update(n,{scrollIntoView:!0,userEvent:"delete.backward"})),!s}}];function cp(t,e){let i=!1;return t.field(sp).between(0,t.doc.length,t=>{t==e&&(i=!0)}),i}function up(t,e){let i=t.sliceString(e,e+2);return i.slice(0,Zt(Xt(i,0)))}function fp(t,e,i,s){let n=null,r=t.changeByRange(r=>{if(!r.empty)return{changes:[{insert:e,from:r.from},{insert:i,from:r.to}],effects:ep.of(r.to+e.length),range:ue.range(r.anchor+e.length,r.head+e.length)};let o=up(t.doc,r.head);return!o||/\s/.test(o)||s.indexOf(o)>-1?{changes:{insert:e+i,from:r.head},effects:ep.of(r.head+e.length),range:ue.cursor(r.head+e.length)}:{range:n=r}});return n?null:t.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function dp(t,e,i){let s=null,n=t.changeByRange(e=>e.empty&&up(t.doc,e.head)==i?{changes:{from:e.head,to:e.head+i.length,insert:i},range:ue.cursor(e.head+i.length)}:s={range:e});return s?null:t.update(n,{scrollIntoView:!0,userEvent:"input.type"})}function pp(t,e,i,s){let n=s.stringPrefixes||tp.stringPrefixes,r=null,o=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:e,from:s.to}],effects:ep.of(s.to+e.length),range:ue.range(s.anchor+e.length,s.head+e.length)};let o,l=s.head,a=up(t.doc,l);if(a==e){if(mp(t,l))return{changes:{insert:e+e,from:l},effects:ep.of(l+e.length),range:ue.cursor(l+e.length)};if(cp(t,l)){let s=i&&t.sliceDoc(l,l+3*e.length)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+s.length,insert:s},range:ue.cursor(l+s.length)}}}else{if(i&&t.sliceDoc(l-2*e.length,l)==e+e&&(o=gp(t,l-2*e.length,n))>-1&&mp(t,o))return{changes:{insert:e+e+e+e,from:l},effects:ep.of(l+e.length),range:ue.cursor(l+e.length)};if(t.charCategorizer(l)(a)!=Je.Word&&gp(t,l,n)>-1&&!function(t,e,i,s){let n=Ya(t).resolveInner(e,-1),r=s.reduce((t,e)=>Math.max(t,e.length),0);for(let o=0;o<5;o++){let o=t.sliceDoc(n.from,Math.min(n.to,n.from+i.length+r)),l=o.indexOf(i);if(!l||l>-1&&s.indexOf(o.slice(0,l))>-1){let e=n.firstChild;for(;e&&e.from==n.from&&e.to-e.from>i.length+l;){if(t.sliceDoc(e.to-i.length,e.to)==i)return!1;e=e.firstChild}return!0}let a=n.to==e&&n.parent;if(!a)break;n=a}return!1}(t,l,e,n))return{changes:{insert:e+e,from:l},effects:ep.of(l+e.length),range:ue.cursor(l+e.length)}}return{range:r=s}});return r?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function mp(t,e){let i=Ya(t).resolveInner(e+1);return i.parent&&i.from==e}function gp(t,e,i){let s=t.charCategorizer(e);if(s(t.sliceDoc(e-1,e))!=Je.Word)return e;for(let n of i){let i=e-n.length;if(t.sliceDoc(i,e)==n&&s(t.sliceDoc(i-1,i))!=Je.Word)return i}return-1}function vp(t={}){return[Jd,$d,Md.of(t),Gd,bp,Zd]}const wp=[{key:"Ctrl-Space",run:Yd},{mac:"Alt-`",run:Yd},{mac:"Alt-i",run:Yd},{key:"Escape",run:t=>{let e=t.state.field($d,!1);return!(!e||!e.active.some(t=>0!=t.state))&&(t.dispatch({effects:Sd.of(null)}),!0)}},{key:"ArrowDown",run:Ud(!0)},{key:"ArrowUp",run:Ud(!1)},{key:"PageDown",run:Ud(!0,"page")},{key:"PageUp",run:Ud(!1,"page")},{key:"Enter",run:t=>{let e=t.state.field($d,!1);return!(t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.facet(Md).defaultKeymap?[wp]:[]));class yp{constructor(t,e,i){this.from=t,this.to=e,this.diagnostic=i}}class xp{constructor(t,e,i){this.diagnostics=t,this.panel=e,this.selected=i}static init(t,e,i){let s=i.facet(Lp).markerFilter;s&&(t=s(t,i));let n=t.slice().sort((t,e)=>t.from-e.from||t.to-e.to),r=new ui,o=[],l=0,a=i.doc.iter(),h=0,c=i.doc.length;for(let t=0;;){let e,i,s=t==n.length?null:n[t];if(!s&&!o.length)break;if(o.length)e=l,i=o.reduce((t,e)=>Math.min(t,e.to),s&&s.from>e?s.from:1e8);else{if(e=s.from,e>c)break;i=s.to,o.push(s),t++}for(;ts.from||s.to==e)){i=Math.min(s.from,i);break}o.push(s),t++,i=Math.min(s.to,i)}i=Math.min(i,c);let u=!1;if(o.some(t=>t.from==e&&(t.to==i||i==c))&&(u=e==i,!u&&i-e<10)){let t=e-(h+a.value.length);t>0&&(a.next(t),h=e);for(let t=e;;){if(t>=i){u=!0;break}if(!a.lineBreak&&h+a.value.length>t)break;t=h+a.value.length,h+=a.value.length,a.next()}}let f=jp(o);if(u)r.add(e,e,ss.widget({widget:new Hp(f),diagnostics:o.slice()}));else{let t=o.reduce((t,e)=>e.markClass?t+" "+e.markClass:t,"");r.add(e,i,ss.mark({class:"cm-lintRange cm-lintRange-"+f+t,diagnostics:o.slice(),inclusiveEnd:o.some(t=>t.to>i)}))}if(l=i,l==c)break;for(let t=0;t{if(!(e&&n.diagnostics.indexOf(e)<0))if(s){if(n.diagnostics.indexOf(s.diagnostic)<0)return!1;s=new yp(s.from,i,s.diagnostic)}else s=new yp(t,i,e||n.diagnostics[0])}),s}function Sp(t,e){let i=e.pos,s=e.end||i,n=t.state.facet(Lp).hideOn(t,i,s);if(null!=n)return n;let r=t.startState.doc.lineAt(e.pos);return!(!t.effects.some(t=>t.is(Ap))&&!t.changes.touchesRange(r.from,Math.max(r.to,s)))}function Cp(t,e){return t.field(Tp,!1)?e:e.concat($e.appendConfig.of(Up))}const Ap=$e.define(),Mp=$e.define(),Op=$e.define(),Tp=xe.define({create:()=>new xp(ss.none,null,null),update(t,e){if(e.docChanged&&t.diagnostics.size){let i=t.diagnostics.map(e.changes),s=null,n=t.panel;if(t.selected){let n=e.changes.mapPos(t.selected.from,1);s=kp(i,t.selected.diagnostic,n)||kp(i,null,n)}!i.size&&n&&e.state.facet(Lp).autoPanel&&(n=null),t=new xp(i,n,s)}for(let i of e.effects)if(i.is(Ap)){let s=e.state.facet(Lp).autoPanel?i.value.length?Fp.open:null:t.panel;t=xp.init(i.value,s,e.state)}else i.is(Mp)?t=new xp(t.diagnostics,i.value?Fp.open:null,t.selected):i.is(Op)&&(t=new xp(t.diagnostics,t.panel,i.value));return t},provide:t=>[fa.from(t,t=>t.panel),jo.decorations.from(t,t=>t.diagnostics)]});const Dp=ss.mark({class:"cm-lintRange cm-lintRange-active"});function Rp(t,e,i){let s,{diagnostics:n}=t.state.field(Tp),r=-1,o=-1;n.between(e-(i<0?1:0),e+(i>0?1:0),(t,n,{spec:l})=>{if(e>=t&&e<=n&&(t==n||(e>t||i>0)&&(e({dom:Pp(t,s)})}:null}function Pp(t,e){return Ii("ul",{class:"cm-tooltip-lint"},e.map(e=>Wp(t,e,!1)))}const Bp=t=>{let e=t.state.field(Tp,!1);return!(!e||!e.panel)&&(t.dispatch({effects:Mp.of(!1)}),!0)},Ep=[{key:"Mod-Shift-m",run:t=>{let e=t.state.field(Tp,!1);e&&e.panel||t.dispatch({effects:Cp(t.state,[Mp.of(!0)])});let i=aa(t,Fp.open);return i&&i.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:t=>{let e=t.state.field(Tp,!1);if(!e)return!1;let i=t.state.selection.main,s=kp(e.diagnostics,null,i.to+1);return!(!s&&(s=kp(e.diagnostics,null,0),!s||s.from==i.from&&s.to==i.to))&&(t.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0}),function(t,e,i,s={}){var n;let r=t.state.facet(ea).map(e=>t.plugin(e)).filter(t=>!!t);if(s.tooltip&&s.tooltip.active){let t=r.find(t=>t.field==s.tooltip.active);t&&(r=[t])}for(let o of r)o.activateHover(t,e,i,null!==(n=s.until)&&void 0!==n?n:()=>!1)}(t,s.from,1,{tooltip:Kp,until:t=>t.docChanged||t.newSelection.main.heads.to}),!0)}}];const Lp=pe.define({combine:t=>({sources:t.map(t=>t.source).filter(t=>null!=t),...si(t.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Np,tooltipFilter:Np,needsRefresh:(t,e)=>t?e?i=>t(i)||e(i):t:e,hideOn:(t,e)=>t?e?(i,s,n)=>t(i,s,n)||e(i,s,n):t:e,autoPanel:(t,e)=>t||e})})});function Np(t,e){return t?e?(i,s)=>e(t(i,s),s):t:e}function Ip(t){let e=[];if(t)t:for(let{name:i}of t){for(let t=0;tt.toLowerCase()==s.toLowerCase())){e.push(s);continue t}}e.push("")}return e}function Wp(t,e,i){var s;let n=i?Ip(e.actions):[];return Ii("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Ii("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),null===(s=e.actions)||void 0===s?void 0:s.map((i,s)=>{let r=!1,o=s=>{if(s.preventDefault(),r)return;r=!0;let n=kp(t.state.field(Tp).diagnostics,e);n&&i.apply(t,n.from,n.to)},{name:l}=i,a=n[s]?l.indexOf(n[s]):-1,h=a<0?l:[l.slice(0,a),Ii("u",l.slice(a,a+1)),l.slice(a+1)];return Ii("button",{type:"button",class:"cm-diagnosticAction"+(i.markClass?" "+i.markClass:""),onclick:o,onmousedown:o,"aria-label":` Action: ${l}${a<0?"":` (access key "${n[s]})"`}.`},h)}),e.source&&Ii("div",{class:"cm-diagnosticSource"},e.source))}class Hp extends es{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Ii("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Vp{constructor(t,e){this.diagnostic=e,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=Wp(t,e,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Fp{constructor(t){this.view=t,this.items=[];this.list=Ii("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:e=>{if(!(e.ctrlKey||e.altKey||e.metaKey)){if(27==e.keyCode)Bp(this.view),this.view.focus();else if(38==e.keyCode||33==e.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==e.keyCode||34==e.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==e.keyCode)this.moveSelection(0);else if(35==e.keyCode)this.moveSelection(this.items.length-1);else if(13==e.keyCode)this.view.focus();else{if(!(e.keyCode>=65&&e.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:i}=this.items[this.selectedIndex],s=Ip(i.actions);for(let n=0;n{for(let e=0;eBp(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Tp).selected;if(!t)return-1;for(let e=0;e{for(let t of l.diagnostics){if(r.has(t))continue;r.add(t);let o,l=-1;for(let e=i;ei&&(this.items.splice(i,l-i),s=!0)),e&&o.diagnostic==e.diagnostic?o.dom.hasAttribute("aria-selected")||(o.dom.setAttribute("aria-selected","true"),n=o):o.dom.hasAttribute("aria-selected")&&o.dom.removeAttribute("aria-selected"),i++}});i({sel:n.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:t,panel:e})=>{let i=e.height/this.list.offsetHeight;t.tope.bottom&&(this.list.scrollTop+=(t.bottom-e.bottom)/i)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let t=this.list.firstChild;function e(){let e=t;t=e.nextSibling,e.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;t!=i.dom;)e();t=i.dom.nextSibling}else this.list.insertBefore(i.dom,t);for(;t;)e()}moveSelection(t){if(this.selectedIndex<0)return;let e=kp(this.view.state.field(Tp).diagnostics,this.items[t].diagnostic);e&&this.view.dispatch({selection:{anchor:e.from,head:e.to},scrollIntoView:!0,effects:Op.of(e)})}static open(t){return new Fp(t)}}function zp(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function qp(t){return zp(``,'width="6" height="3"')}const _p=jo.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:qp("#f11")},".cm-lintRange-warning":{backgroundImage:qp("orange")},".cm-lintRange-info":{backgroundImage:qp("#999")},".cm-lintRange-hint":{backgroundImage:qp("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function $p(t){return"error"==t?4:"warning"==t?3:"info"==t?2:1}function jp(t){let e="hint",i=1;for(let s of t){let t=$p(s.severity);t>i&&(i=t,e=s.severity)}return e}const Kp=na(Rp,{hideOn:Sp}),Up=[Tp,jo.decorations.compute([Tp],t=>{let{selected:e,panel:i}=t.field(Tp);return e&&i&&e.from!=e.to?ss.set([Dp.range(e.from,e.to)]):ss.none}),Kp,_p];const Yp=(()=>[Wa(),Fa,Dl(),Gc(),qh(),dl(),[yl,xl],ii.allowMultipleSelections.of(!0),ii.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let i=t.newDoc,{head:s}=t.newSelection.main,n=i.lineAt(s);if(s>n.from+200)return t;let r=i.sliceString(n.from,s);if(!e.some(t=>t.test(r)))return t;let{state:o}=t,l=-1,a=[];for(let{head:t}of o.selection.ranges){let e=o.doc.lineAt(t);if(e.from==l)continue;l=e.from;let i=hh(o,e.from);if(null==i)continue;let s=/^\s*/.exec(e.text)[0],n=ah(o,i);s!=n&&a.push({from:e.from,to:e.from+s.length,insert:n})}return a.length?[t,{changes:a,sequential:!0}]:t}),Yh(Xh,{fallback:!0}),oc(),[ap,sp],vp(),Hl(),zl(),Ll,Cf(),Zo.of([...hp,...ff,...nd,...du,...Eh,...wp,...Ep])])(),Qp={init(){const t=[Yp,new nh(bc),ii.readOnly.of(!0),Ic,jo.theme({"&":{height:"600px"}})];document.addEventListener("DOMContentLoaded",function(){if(void 0===CLD_METADATA)return;const e=document.getElementById("meta-data"),i=JSON.stringify(CLD_METADATA,null," ");new jo({parent:e,doc:i,extensions:t})})}};Qp.init()})(); +(()=>{"use strict";const t=1024;let e=0;class i{constructor(t,e){this.from=t,this.to=e}}class s{constructor(t={}){this.id=e++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof t&&(t=o.match(t)),e=>{let i=t(e);return void 0===i?null:[this,i]}}}s.closedBy=new s({deserialize:t=>t.split(" ")}),s.openedBy=new s({deserialize:t=>t.split(" ")}),s.group=new s({deserialize:t=>t.split(" ")}),s.isolate=new s({deserialize:t=>{if(t&&"rtl"!=t&&"ltr"!=t&&"auto"!=t)throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),s.contextHash=new s({perNode:!0}),s.lookAhead=new s({perNode:!0}),s.mounted=new s({perNode:!0});class n{constructor(t,e,i,s=!1){this.tree=t,this.overlay=e,this.parser=i,this.bracketed=s}static get(t){return t&&t.props&&t.props[s.mounted.id]}}const r=Object.create(null);class o{constructor(t,e,i,s=0){this.name=t,this.props=e,this.id=i,this.flags=s}static define(t){let e=t.props&&t.props.length?Object.create(null):r,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),s=new o(t.name||"",e,t.id,i);if(t.props)for(let i of t.props)if(Array.isArray(i)||(i=i(s)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[i[0].id]=i[1]}return s}prop(t){return this.props[t.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(t){if("string"==typeof t){if(this.name==t)return!0;let e=this.prop(s.group);return!!e&&e.indexOf(t)>-1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let s of i.split(" "))e[s]=t[i];return t=>{for(let i=t.prop(s.group),n=-1;n<(i?i.length:0);n++){let s=e[n<0?t.name:i[n]];if(s)return s}}}}o.none=new o("",Object.create(null),0,8);class l{constructor(t){this.types=t;for(let e=0;e=e){let n=new v(o.tree,o.overlay[0].from+t.from,-1,t);(r||(r=[s])).push(m(n,e,i,!1))}}return r?k(r):s}(this,t,e)}iterate(t){let{enter:e,leave:i,from:s=0,to:n=this.length}=t,r=t.mode||0,o=(r&c.IncludeAnonymous)>0;for(let t=this.cursor(r|c.IncludeAnonymous);;){let r=!1;if(t.from<=n&&t.to>=s&&(!o&&t.type.isAnonymous||!1!==e(t))){if(t.firstChild())continue;r=!0}for(;r&&i&&(o||!t.type.isAnonymous)&&i(t),!t.nextSibling();){if(!t.parent())return;r=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:T(o.none,this.children,this.positions,0,this.children.length,0,this.length,(t,e,i)=>new u(this.type,t,e,i,this.propValues),t.makeTree||((t,e,i)=>new u(o.none,t,e,i)))}static build(e){return function(e){var i;let{buffer:n,nodeSet:r,maxBufferLength:o=t,reused:l=[],minRepeatType:a=r.types.length}=e,h=Array.isArray(n)?new f(n,n.length):n,c=r.types,p=0,m=0;function g(t,e,i,s,n,u){let{id:f,start:S,end:C,size:A}=h,M=m,O=p;if(A<0){if(h.next(),-1==A){let e=l[f];return i.push(e),void s.push(S-t)}if(-3==A)return void(p=f);if(-4==A)return void(m=f);throw new RangeError(`Unrecognized record size: ${A}`)}let D,R,P=c[f],B=S-t;if(C-S<=o&&(R=x(h.pos-e,n))){let e=new Uint16Array(R.size-R.skip),i=h.pos-R.size,s=e.length;for(;h.pos>i;)s=k(R.start,e,s);D=new d(e,C-R.start,r),B=R.start-t}else{let t=h.pos-A;h.next();let e=[],i=[],s=f>=a?f:-1,n=0,r=C;for(;h.pos>t;)s>=0&&h.id==s&&h.size>=0?(h.end<=r-o&&(b(e,i,S,n,h.end,r,s,M,O),n=e.length,r=h.end),h.next()):u>2500?v(S,t,e,i):g(S,t,e,i,s,u+1);if(s>=0&&n>0&&n-1&&n>0){let t=w(P,O);D=T(P,e,i,0,e.length,0,C-S,t,t)}else D=y(P,e,i,C-S,M-C,O)}i.push(D),s.push(B)}function v(t,e,i,s){let n=[],l=0,a=-1;for(;h.pos>e;){let{id:t,start:e,end:i,size:s}=h;if(s>4)h.next();else{if(a>-1&&e=0;t-=3)e[i++]=n[t],e[i++]=n[t+1]-o,e[i++]=n[t+2]-o,e[i++]=i;i.push(new d(e,n[2]-o,r)),s.push(o-t)}}function w(t,e){return(i,n,r)=>{let o,l,a=0,h=i.length-1;if(h>=0&&(o=i[h])instanceof u){if(!h&&o.type==t&&o.length==r)return o;(l=o.prop(s.lookAhead))&&(a=n[h]+o.length+l)}return y(t,i,n,r,a,e)}}function b(t,e,i,s,n,o,l,a,h){let c=[],u=[];for(;t.length>s;)c.push(t.pop()),u.push(e.pop()+i-n);t.push(y(r.types[l],c,u,o-n,a-o,h)),e.push(n-i)}function y(t,e,i,n,r,o,l){if(o){let t=[s.contextHash,o];l=l?[t].concat(l):[t]}if(r>25){let t=[s.lookAhead,r];l=l?[t].concat(l):[t]}return new u(t,e,i,n,l)}function x(t,e){let i=h.fork(),s=0,n=0,r=0,l=i.end-o,c={size:0,start:0,skip:0};t:for(let o=i.pos-t;i.pos>o;){let t=i.size;if(i.id==e&&t>=0){c.size=s,c.start=n,c.skip=r,r+=4,s+=4,i.next();continue}let h=i.pos-t;if(t<0||h=a?4:0,f=i.start;for(i.next();i.pos>h;){if(i.size<0){if(-3!=i.size&&-4!=i.size)break t;u+=4}else i.id>=a&&(u+=4);i.next()}n=f,s+=t,r+=u}return(e<0||s==t)&&(c.size=s,c.start=n,c.skip=r),c.size>4?c:void 0}function k(t,e,i){let{id:s,start:n,end:r,size:o}=h;if(h.next(),o>=0&&s4){let s=h.pos-(o-4);for(;h.pos>s;)i=k(t,e,i)}e[--i]=l,e[--i]=r-t,e[--i]=n-t,e[--i]=s}else-3==o?p=s:-4==o&&(m=s);return i}let S=[],C=[];for(;h.pos>0;)g(e.start||0,e.bufferStart||0,S,C,-1,0);let A=null!==(i=e.length)&&void 0!==i?i:S.length?C[0]+S[0].length:0;return new u(c[e.topID],S.reverse(),C.reverse(),A)}(e)}}u.empty=new u(o.none,[],[],0);class f{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new f(this.buffer,this.index)}}class d{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return o.none}toString(){let t=[];for(let e=0;e0));l=r[l+3]);return o}slice(t,e,i){let s=this.buffer,n=new Uint16Array(e-t),r=0;for(let o=t,l=0;o=e&&ie;case 1:return i<=e&&s>e;case 2:return s>e;case 4:return!0}}function m(t,e,i,s){for(var n;t.from==t.to||(i<1?t.from>=e:t.from>e)||(i>-1?t.to<=e:t.to0?l.length:-1;t!=h;t+=e){let h,f=l[t],m=a[t]+o.from;if(r&c.EnterBracketed&&f instanceof u&&(h=n.get(f))&&!h.overlay&&h.bracketed&&i>=m&&i<=m+f.length||p(s,i,m,m+f.length))if(f instanceof d){if(r&c.ExcludeBuffers)continue;let n=f.findChild(0,f.buffer.length,e,i-m,s);if(n>-1)return new x(new y(o,f,t,m),null,n)}else if(r&c.IncludeAnonymous||!f.type.isAnonymous||A(f)){let l;if(!(r&c.IgnoreMounts)&&(l=n.get(f))&&!l.overlay)return new v(l.tree,m,t,o);let a=new v(f,m,t,o);return r&c.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(e<0?f.children.length-1:0,e,i,s,r)}}if(r&c.IncludeAnonymous||!o.type.isAnonymous)return null;if(t=o.index>=0?o.index+e:e<0?-1:o._parent._tree.children.length,o=o._parent,!o)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,e,i=0){let s;if(!(i&c.IgnoreOverlays)&&(s=n.get(this._tree))&&s.overlay){let n=t-this.from,r=i&c.EnterBracketed&&s.bracketed;for(let{from:t,to:i}of s.overlay)if((e>0||r?t<=n:t=n:i>n))return new v(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function w(t,e,i,s){let n=t.cursor(),r=[];if(!n.firstChild())return r;if(null!=i)for(let t=!1;!t;)if(t=n.type.is(i),!n.nextSibling())return r;for(;;){if(null!=s&&n.type.is(s))return r;if(n.type.is(e)&&r.push(n.node),!n.nextSibling())return null==s?r:[]}}function b(t,e,i=e.length-1){for(let s=t;i>=0;s=s.parent){if(!s)return!1;if(!s.type.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}class y{constructor(t,e,i,s){this.parent=t,this.buffer=e,this.index=i,this.start=s}}class x extends g{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:s}=this.context,n=s.findChild(this.index+4,s.buffer[this.index+3],t,e-this.context.start,i);return n<0?null:new x(this.context,this,n)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,e,i=0){if(i&c.ExcludeBuffers)return null;let{buffer:s}=this.context,n=s.findChild(this.index+4,s.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return n<0?null:new x(this.context,this,n)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new x(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new x(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,s=this.index+4,n=i.buffer[this.index+3];if(n>s){let r=i.buffer[this.index+1];t.push(i.slice(s,n,r)),e.push(0)}return new u(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function k(t){if(!t.length)return null;let e=0,i=t[0];for(let s=1;si.from||n.to0){if(this.index-1)for(let s=e+t,n=t<0?-1:i._tree.children.length;s!=n;s+=t){let t=i._tree.children[s];if(this.mode&c.IncludeAnonymous||t instanceof d||!t.type.isAnonymous||A(t))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to=0;){for(let r=t;r;r=r._parent)if(r.index==s){if(s==this.index)return r;e=r,i=n+1;break t}s=this.stack[--n]}for(let t=i;t=0;n--){if(n<0)return b(this._tree,t,s);let r=i[e.buffer[this.stack[n]]];if(!r.isAnonymous){if(t[s]&&t[s]!=r.name)return!1;s--}}return!0}}function A(t){return t.children.some(t=>t instanceof d||!t.type.isAnonymous||A(t))}const M=new WeakMap;function O(t,e){if(!t.isAnonymous||e instanceof d||e.type!=t)return 1;let i=M.get(e);if(null==i){i=1;for(let s of e.children){if(s.type!=t||!(s instanceof u)){i=1;break}i+=O(t,s)}M.set(e,i)}return i}function T(t,e,i,s,n,r,o,l,a){let h=0;for(let i=s;i=c)break;p+=e}if(h==n+1){if(p>c){let t=i[n];e(t.children,t.positions,0,t.children.length,s[n]+l);continue}u.push(i[n])}else{let e=s[h-1]+i[h-1].length-d;u.push(T(t,i,s,n,h,d,e,null,a))}f.push(d+l-r)}}(e,i,s,n,0),(l||a)(u,f,o)}class D{constructor(t,e,i,s,n=!1,r=!1){this.from=t,this.to=e,this.tree=i,this.offset=s,this.open=(n?1:0)|(r?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(t,e=[],i=!1){let s=[new D(0,t.length,t,0,!1,i)];for(let i of e)i.to>t.length&&s.push(i);return s}static applyChanges(t,e,i=128){if(!e.length)return t;let s=[],n=1,r=t.length?t[0]:null;for(let o=0,l=0,a=0;;o++){let h=o=i)for(;r&&r.from=e.from||c<=e.to||a){let t=Math.max(e.from,l)-a,i=Math.min(e.to,c)-a;e=t>=i?null:new D(t,i,e.tree,e.offset+a,o>0,!!h)}if(e&&s.push(e),r.to>c)break;r=nnew i(t.from,t.to)):[new i(0,0)]:[new i(0,t.length)],this.createParse(t,e||[],s)}parse(t,e,i){let s=this.startParse(t,e,i);for(;;){let t=s.advance();if(t)return t}}}class P{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}new s({perNode:!0});class B{constructor(t,e,i,s,n,r,o,l,a,h=0,c){this.p=t,this.stack=e,this.state=i,this.reducePos=s,this.pos=n,this.score=r,this.buffer=o,this.bufferBase=l,this.curContext=a,this.lookAhead=h,this.parent=c}toString(){return`[${this.stack.filter((t,e)=>e%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,i=0){let s=t.parser.context;return new B(t,[],e,i,i,0,[],0,s?new E(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let i=t>>19,s=65535&t,{parser:n}=this.p,r=this.reducePos=2e3&&!(null===(e=this.p.parser.nodeSet.types[s])||void 0===e?void 0:e.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(s,a)}storeNode(t,e,i,s=4,n=!1){if(0==t&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==this.buffer[t-4]&&this.buffer[t-1]>-1){if(e==i)return;if(this.buffer[t-2]>=e)return void(this.buffer[t-2]=i)}}if(n&&this.pos!=i){let n=this.buffer.length;if(n>0&&(0!=this.buffer[n-4]||this.buffer[n-1]<0)){let t=!1;for(let e=n;e>0&&this.buffer[e-2]>i;e-=4)if(this.buffer[e-1]>=0){t=!0;break}if(t)for(;n>0&&this.buffer[n-2]>i;)this.buffer[n]=this.buffer[n-4],this.buffer[n+1]=this.buffer[n-3],this.buffer[n+2]=this.buffer[n-2],this.buffer[n+3]=this.buffer[n-1],n-=4,s>4&&(s-=4)}this.buffer[n]=t,this.buffer[n+1]=e,this.buffer[n+2]=i,this.buffer[n+3]=s}else this.buffer.push(t,e,i,s)}shift(t,e,i,s){if(131072&t)this.pushState(65535&t,this.pos);else if(262144&t)this.pos=s,this.shiftContext(e,i),e<=this.p.parser.maxNode&&this.buffer.push(e,i,s,4);else{let n=t,{parser:r}=this.p;this.pos=s;let o=r.stateFlag(n,1);!o&&(s>i||e<=r.maxNode)&&(this.reducePos=s),this.pushState(n,o?i:Math.min(i,this.reducePos)),this.shiftContext(e,i),e<=r.maxNode&&this.buffer.push(e,i,s,4)}}apply(t,e,i,s){65536&t?this.reduce(t):this.shift(t,e,i,s)}useNode(t,e){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let s=this.pos;this.reducePos=this.pos=s+t.length,this.pushState(e,s),this.buffer.push(i,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(e&&0==t.buffer[e-4]&&(e-=4);e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let i=t.buffer.slice(e),s=t.bufferBase+e;for(;t&&s==t.bufferBase;)t=t.parent;return new B(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,s,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,i?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new L(this);;){let i=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(0==i)return!1;if(!(65536&i))return!0;e.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let i=[];for(let s,n=0;n1&e&&t==s)||i.push(e[t],s)}e=i}let i=[];for(let t=0;t>19,s=65535&e,n=this.stack.length-3*i;if(n<0||t.getGoto(this.stack[n],s,!1)<0){let t=this.findForcedReduction();if(null==t)return!1;e=t}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}findForcedReduction(){let{parser:t}=this.p,e=[],i=(s,n)=>{if(!e.includes(s))return e.push(s),t.allActions(s,e=>{if(393216&e);else if(65536&e){let i=(e>>19)-n;if(i>1){let s=65535&e,n=this.stack.length-3*i;if(n>=0&&t.getGoto(this.stack[n],s,!1)>=0)return i<<19|65536|s}}else{let t=i(e,n+1);if(null!=t)return t}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:t}=this.p;return 65535==t.data[t.stateSlot(this.state,1)]&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;e0&&this.emitLookAhead()}}class E{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}class L{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=65535&t,i=t>>19;0==i?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(i-1);let s=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=s}}class N{constructor(t,e,i){this.stack=t,this.pos=e,this.index=i,this.buffer=t.buffer,0==this.index&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new N(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;null!=t&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new N(this.stack,this.pos,this.index)}}function I(t,e=Uint16Array){if("string"!=typeof t)return t;let i=null;for(let s=0,n=0;s=92&&e--,e>=34&&e--;let n=e-32;if(n>=46&&(n-=46,i=!0),r+=n,i)break;r*=46}i?i[n++]=r:i=new e(r)}return i}class W{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const H=new W;class V{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=H,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let i=this.range,s=this.rangeIndex,n=this.pos+t;for(;ni.to:n>=i.to;){if(s==this.ranges.length-1)return null;let t=this.ranges[++s];n+=t.from-i.to,i=t}return n}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,e.from);return this.end}peek(t){let e,i,s=this.chunkOff+t;if(s>=0&&s=this.chunk2Pos&&es.to&&(this.chunk2=this.chunk2.slice(0,s.to-e)),i=this.chunk2.charCodeAt(0)}}return e>=this.token.lookAhead&&(this.token.lookAhead=e+1),i}acceptToken(t,e=0){let i=e?this.resolveOffset(e,-1):this.pos;if(null==i||i=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=H,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let i="";for(let s of this.ranges){if(s.from>=e)break;s.to>t&&(i+=this.input.read(Math.max(s.from,t),Math.min(s.to,e)))}return i}}class F{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:i}=e.p;z(this.data,t,e,this.id,i.data,i.tokenPrecTable)}}F.prototype.contextual=F.prototype.fallback=F.prototype.extend=!1;F.prototype.fallback=F.prototype.extend=!1;function z(t,e,i,s,n,r){let o=0,l=1<0){let i=t[s];if(a.allows(i)&&(-1==e.token.value||e.token.value==i||_(i,e.token.value,n,r))){e.acceptToken(i);break}}let s=e.next,h=0,c=t[o+2];if(!(e.next<0&&c>h&&65535==t[i+3*c-3])){for(;h>1,r=i+n+(n<<1),l=t[r],a=t[r+1]||65536;if(s=a)){o=t[r+2],e.advance();continue t}h=n+1}}break}o=t[i+3*c-1]}}function q(t,e,i){for(let s,n=e;65535!=(s=t[n]);n++)if(s==i)return n-e;return-1}function _(t,e,i,s){let n=q(i,s,e);return n<0||q(i,s,t)e)&&!s.type.isError)return i<0?Math.max(0,Math.min(s.to-1,e-25)):Math.min(t.length,Math.max(s.from+1,e+25));if(i<0?s.prevSibling():s.nextSibling())break;if(!s.parent())return i<0?0:t.length}}class U{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?K(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?K(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=o,null;if(r instanceof u){if(o==t){if(o=Math.max(this.safeFrom,t)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[e]++,this.nextStart=o+r.length}}}class Y{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(t=>new W)}getActions(t){let e=0,i=null,{parser:s}=t.p,{tokenizers:n}=s,r=s.stateSlot(t.state,3),o=t.curContext?t.curContext.hash:0,l=0;for(let s=0;sh.end+25&&(l=Math.max(h.lookAhead,l)),0!=h.value)){let s=e;if(h.extended>-1&&(e=this.addActions(t,h.extended,h.end,e)),e=this.addActions(t,h.value,h.end,e),!a.extend&&(i=h,e>s))break}}for(;this.actions.length>e;)this.actions.pop();return l&&t.setLookAhead(l),i||t.pos!=this.stream.end||(i=new W,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,e=this.addActions(t,i.value,i.end,e)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new W,{pos:i,p:s}=t;return e.start=i,e.end=Math.min(i+1,s.stream.end),e.value=i==s.stream.end?s.parser.eofTerm:0,e}updateCachedToken(t,e,i){let s=this.stream.clipPos(i.pos);if(e.token(this.stream.reset(s,t),i),t.value>-1){let{parser:e}=i.p;for(let s=0;s=0&&i.p.parser.dialect.allows(n>>1)){1&n?t.extended=n>>1:t.value=n>>1;break}}}else t.value=0,t.end=this.stream.clipPos(s+1)}putAction(t,e,i,s){for(let e=0;e4*t.bufferLength?new U(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t,e,i=this.stacks,s=this.minStackPos,n=this.stacks=[];if(this.bigReductionCount>300&&1==i.length){let[t]=i;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let r=0;rs)n.push(o);else{if(this.advanceStack(o,n,i))continue;{t||(t=[],e=[]),t.push(o);let i=this.tokens.getMainToken(o);e.push(i.value,i.end)}}break}}if(!n.length){let e=t&&function(t){let e=null;for(let i of t){let t=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=t&&i.pos>t)&&i.p.parser.stateFlag(i.state,2)&&(!e||e.scorethis.stoppedAt?t[0]:this.runRecovery(t,e,n);if(i)return $&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let t=1==this.recovering?1:3*this.recovering;if(n.length>t)for(n.sort((t,e)=>e.score-t.score);n.length>t;)n.pop();n.some(t=>t.reducePos>s)&&this.recovering--}else if(n.length>1){t:for(let t=0;t500&&s.buffer.length>500){if(!((e.score-s.score||e.buffer.length-s.buffer.length)>0)){n.splice(t--,1);continue t}n.splice(i--,1)}}}n.length>12&&(n.sort((t,e)=>e.score-t.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let t=1;t ":"";if(null!=this.stoppedAt&&n>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let e=t.curContext&&t.curContext.tracker.strict,i=e?t.curContext.hash:0;for(let l=this.fragments.nodeAt(n);l;){let n=this.parser.nodeSet.types[l.type.id]==l.type?r.getGoto(t.state,l.type.id):-1;if(n>-1&&l.length&&(!e||(l.prop(s.contextHash)||0)==i))return t.useNode(l,n),$&&console.log(o+this.stackID(t)+` (via reuse of ${r.getName(l.type.id)})`),!0;if(!(l instanceof u)||0==l.children.length||l.positions[0]>0)break;let a=l.children[0];if(!(a instanceof u&&0==l.positions[0]))break;l=a}}let l=r.stateSlot(t.state,4);if(l>0)return t.reduce(l),$&&console.log(o+this.stackID(t)+` (via always-reduce ${r.getName(65535&l)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let a=this.tokens.getActions(t);for(let s=0;sn?e.push(f):i.push(f)}return!1}advanceFully(t,e){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return G(t,e),!0}}runRecovery(t,e,i){let s=null,n=!1;for(let r=0;r ":"";if(o.deadEnd){if(n)continue;if(n=!0,o.restart(),$&&console.log(h+this.stackID(o)+" (restarted)"),this.advanceFully(o,i))continue}let c=o.split(),u=h;for(let t=0;t<10&&c.forceReduce();t++){if($&&console.log(u+this.stackID(c)+" (via force-reduce)"),this.advanceFully(c,i))break;$&&(u=this.stackID(c)+" -> ")}for(let t of o.recoverByInsert(l))$&&console.log(h+this.stackID(t)+" (via recover-insert)"),this.advanceFully(t,i);this.stream.end>o.pos?(a==o.pos&&(a++,l=0),o.recoverByDelete(l,a),$&&console.log(h+this.stackID(o)+` (via recover-delete ${this.parser.getName(l)})`),G(o,i)):(!s||s.scoret.topRules[e][1]),n=[];for(let t=0;t=0)r(s,t,e[i++]);else{let n=e[i+-s];for(let o=-s;o>0;o--)r(e[i++],t,n);i++}}}this.nodeSet=new l(e.map((e,s)=>o.define({name:s>=this.minRepeatTerm?void 0:e,id:s,props:n[s],top:i.indexOf(s)>-1,error:0==s,skipped:t.skippedNodes&&t.skippedNodes.indexOf(s)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=1024;let a=I(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let t=0;t"number"==typeof t?new F(a,t):t),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,i){let s=new Q(this,t,e,i);for(let n of this.wrappers)s=n(s,t,e,i);return s}getGoto(t,e,i=!1){let s=this.goto;if(e>=s[0])return-1;for(let n=s[e+1];;){let e=s[n++],r=1&e,o=s[n++];if(r&&i)return o;for(let i=n+(e>>1);n0}validAction(t,e){return!!this.allActions(t,t=>t==e||null)}allActions(t,e){let i=this.stateSlot(t,4),s=i?e(i):void 0;for(let i=this.stateSlot(t,1);null==s;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=Z(this.data,i+2)}s=e(Z(this.data,i+1))}return s}nextStates(t){let e=[];for(let i=this.stateSlot(t,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=Z(this.data,i+2)}if(!(1&this.data[i+2])){let t=this.data[i+1];e.some((e,i)=>1&i&&e==t)||e.push(this.data[i],t)}}return e}configure(t){let e=Object.assign(Object.create(J.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=i}return t.tokenizers&&(e.tokenizers=this.tokenizers.map(e=>{let i=t.tokenizers.find(t=>t.from==e);return i?i.to:e})),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map((i,s)=>{let n=t.specializers.find(t=>t.from==i.external);if(!n)return i;let r=Object.assign(Object.assign({},i),{external:n.to});return e.specializers[s]=tt(r),r})),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),null!=t.strict&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),null!=t.bufferLength&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return null==e?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),i=e.map(()=>!1);if(t)for(let s of t.split(" ")){let t=e.indexOf(s);t>=0&&(i[t]=!0)}let s=null;for(let t=0;tt.external(i,s)<<1|e}return t.get}let et=0;class it{constructor(t,e,i,s){this.name=t,this.set=e,this.base=i,this.modified=s,this.id=et++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let i="string"==typeof t?t:"?";if(t instanceof it&&(e=t),null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let s=new it(i,[],null,[]);if(s.set.push(s),e)for(let t of e.set)s.set.push(t);return s}static defineModifier(t){let e=new nt(t);return t=>t.modified.indexOf(e)>-1?t:nt.get(t.base||t,t.modified.concat(e).sort((t,e)=>t.id-e.id))}}let st=0;class nt{constructor(t){this.name=t,this.instances=[],this.id=st++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find(i=>{return i.base==t&&(s=e,n=i.modified,s.length==n.length&&s.every((t,e)=>t==n[e]));var s,n});if(i)return i;let s=[],n=new it(t.name,s,t,e);for(let t of e)t.instances.push(n);let r=function(t){let e=[[]];for(let i=0;ie.length-t.length)}(e);for(let e of t.set)if(!e.modified.length)for(let t of r)s.push(nt.get(e,t));return n}}function rt(t){let e=Object.create(null);for(let i in t){let s=t[i];Array.isArray(s)||(s=[s]);for(let t of i.split(" "))if(t){let i=[],n=2,r=t;for(let e=0;;){if("..."==r&&e>0&&e+3==t.length){n=1;break}let s=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(r);if(!s)throw new RangeError("Invalid path: "+t);if(i.push("*"==s[0]?"":'"'==s[0][0]?JSON.parse(s[0]):s[0]),e+=s[0].length,e==t.length)break;let o=t[e++];if(e==t.length&&"!"==o){n=0;break}if("/"!=o)throw new RangeError("Invalid path: "+t);r=t.slice(e)}let o=i.length-1,l=i[o];if(!l)throw new RangeError("Invalid path: "+t);let a=new lt(s,n,o>0?i.slice(0,o):null);e[l]=a.sort(e[l])}}return ot.add(e)}const ot=new s({combine(t,e){let i,s,n;for(;t||e;){if(!t||e&&t.depth>=e.depth?(n=e,e=e.next):(n=t,t=t.next),i&&i.mode==n.mode&&!n.context&&!i.context)continue;let r=new lt(n.tags,n.mode,n.context);i?i.next=r:s=r,i=r}return s}});class lt{constructor(t,e,i,s){this.tags=t,this.mode=e,this.context=i,this.next=s}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(t){return!t||t.depth{let e=n;for(let s of t)for(let t of s.set){let s=i[t.id];if(s){e=e?e+" "+s:s;break}}return e},scope:s}}function ht(t,e,i,s=0,n=t.length){let r=new ct(s,Array.isArray(e)?e:[e],i);r.highlightRange(t.cursor(),s,n,"",r.highlighters),r.flush(n)}lt.empty=new lt([],2,null);class ct{constructor(t,e,i){this.at=t,this.highlighters=e,this.span=i,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,i,n,r){let{type:o,from:l,to:a}=t;if(l>=i||a<=e)return;o.isTop&&(r=this.highlighters.filter(t=>!t.scope||t.scope(o)));let h=n,c=function(t){let e=t.type.prop(ot);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}(t)||lt.empty,u=function(t,e){let i=null;for(let s of t){let t=s.style(e);t&&(i=i?i+" "+t:t)}return i}(r,c.tags);if(u&&(h&&(h+=" "),h+=u,1==c.mode&&(n+=(n?" ":"")+u)),this.startSpan(Math.max(e,l),h),c.opaque)return;let f=t.tree&&t.tree.prop(s.mounted);if(f&&f.overlay){let s=t.node.enter(f.overlay[0].from+l,1),o=this.highlighters.filter(t=>!t.scope||t.scope(f.tree.type)),c=t.firstChild();for(let u=0,d=l;;u++){let p=u=m)&&t.nextSibling()););if(!p||m>i)break;d=p.to+l,d>e&&(this.highlightRange(s.cursor(),Math.max(e,p.from+l),Math.min(i,d),"",o),this.startSpan(Math.min(i,d),h))}c&&t.parent()}else if(t.firstChild()){f&&(n="");do{if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,n,r),this.startSpan(Math.min(i,t.to),h)}}while(t.nextSibling());t.parent()}}}const ut=it.define,ft=ut(),dt=ut(),pt=ut(dt),mt=ut(dt),gt=ut(),vt=ut(gt),wt=ut(gt),bt=ut(),yt=ut(bt),xt=ut(),kt=ut(),St=ut(),Ct=ut(St),At=ut(),Mt={comment:ft,lineComment:ut(ft),blockComment:ut(ft),docComment:ut(ft),name:dt,variableName:ut(dt),typeName:pt,tagName:ut(pt),propertyName:mt,attributeName:ut(mt),className:ut(dt),labelName:ut(dt),namespace:ut(dt),macroName:ut(dt),literal:gt,string:vt,docString:ut(vt),character:ut(vt),attributeValue:ut(vt),number:wt,integer:ut(wt),float:ut(wt),bool:ut(gt),regexp:ut(gt),escape:ut(gt),color:ut(gt),url:ut(gt),keyword:xt,self:ut(xt),null:ut(xt),atom:ut(xt),unit:ut(xt),modifier:ut(xt),operatorKeyword:ut(xt),controlKeyword:ut(xt),definitionKeyword:ut(xt),moduleKeyword:ut(xt),operator:kt,derefOperator:ut(kt),arithmeticOperator:ut(kt),logicOperator:ut(kt),bitwiseOperator:ut(kt),compareOperator:ut(kt),updateOperator:ut(kt),definitionOperator:ut(kt),typeOperator:ut(kt),controlOperator:ut(kt),punctuation:St,separator:ut(St),bracket:Ct,angleBracket:ut(Ct),squareBracket:ut(Ct),paren:ut(Ct),brace:ut(Ct),content:bt,heading:yt,heading1:ut(yt),heading2:ut(yt),heading3:ut(yt),heading4:ut(yt),heading5:ut(yt),heading6:ut(yt),contentSeparator:ut(bt),list:ut(bt),quote:ut(bt),emphasis:ut(bt),strong:ut(bt),link:ut(bt),monospace:ut(bt),strikethrough:ut(bt),inserted:ut(),deleted:ut(),changed:ut(),invalid:ut(),meta:At,documentMeta:ut(At),annotation:ut(At),processingInstruction:ut(At),definition:it.defineModifier("definition"),constant:it.defineModifier("constant"),function:it.defineModifier("function"),standard:it.defineModifier("standard"),local:it.defineModifier("local"),special:it.defineModifier("special")};for(let t in Mt){let e=Mt[t];e instanceof it&&(e.name=t)}at([{tag:Mt.link,class:"tok-link"},{tag:Mt.heading,class:"tok-heading"},{tag:Mt.emphasis,class:"tok-emphasis"},{tag:Mt.strong,class:"tok-strong"},{tag:Mt.keyword,class:"tok-keyword"},{tag:Mt.atom,class:"tok-atom"},{tag:Mt.bool,class:"tok-bool"},{tag:Mt.url,class:"tok-url"},{tag:Mt.labelName,class:"tok-labelName"},{tag:Mt.inserted,class:"tok-inserted"},{tag:Mt.deleted,class:"tok-deleted"},{tag:Mt.literal,class:"tok-literal"},{tag:Mt.string,class:"tok-string"},{tag:Mt.number,class:"tok-number"},{tag:[Mt.regexp,Mt.escape,Mt.special(Mt.string)],class:"tok-string2"},{tag:Mt.variableName,class:"tok-variableName"},{tag:Mt.local(Mt.variableName),class:"tok-variableName tok-local"},{tag:Mt.definition(Mt.variableName),class:"tok-variableName tok-definition"},{tag:Mt.special(Mt.variableName),class:"tok-variableName2"},{tag:Mt.definition(Mt.propertyName),class:"tok-propertyName tok-definition"},{tag:Mt.typeName,class:"tok-typeName"},{tag:Mt.namespace,class:"tok-namespace"},{tag:Mt.className,class:"tok-className"},{tag:Mt.macroName,class:"tok-macroName"},{tag:Mt.propertyName,class:"tok-propertyName"},{tag:Mt.operator,class:"tok-operator"},{tag:Mt.comment,class:"tok-comment"},{tag:Mt.meta,class:"tok-meta"},{tag:Mt.invalid,class:"tok-invalid"},{tag:Mt.punctuation,class:"tok-punctuation"}]);const Ot=rt({String:Mt.string,Number:Mt.number,"True False":Mt.bool,PropertyName:Mt.propertyName,Null:Mt.null,", :":Mt.separator,"[ ]":Mt.squareBracket,"{ }":Mt.brace}),Tt=J.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[Ot],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});let Dt=[],Rt=[];function Pt(t){if(t<768)return!1;for(let e=0,i=Dt.length;;){let s=e+i>>1;if(t=Rt[s]))return!0;e=s+1}if(e==i)return!1}}function Bt(t){return t>=127462&&t<=127487}(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let e=0,i=0;e=0&&Bt(It(t,s));)i++,s-=2;if(i%2==0)break;e+=2}}}return e}function Nt(t,e,i){for(;e>0;){let s=Lt(t,e-2,i);if(s=56320&&t<57344}function Ht(t){return t>=55296&&t<56320}function Vt(t){return t<65536?1:2}class Ft{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=Qt(this,t,e);let s=[];return this.decompose(0,t,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(e,this.length,s,1),qt.from(s,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=Qt(this,t,e);let i=[];return this.decompose(t,e,i,0),qt.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),s=new jt(this),n=new jt(t);for(let t=e,r=e;;){if(s.next(t),n.next(t),t=0,s.lineBreak!=n.lineBreak||s.done!=n.done||s.value!=n.value)return!1;if(r+=s.value.length,s.done||r>=i)return!0}}iter(t=1){return new jt(this,t)}iterRange(t,e=this.length){return new Kt(this,t,e)}iterLines(t,e){let i;if(null==t)i=this.iter();else{null==e&&(e=this.lines+1);let s=this.line(t).from;i=this.iterRange(s,Math.max(s,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new Ut(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new zt(t):qt.from(zt.split(t,[])):Ft.empty}}class zt extends Ft{constructor(t,e=function(t){let e=-1;for(let i of t)e+=i.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,s){for(let n=0;;n++){let r=this.text[n],o=s+r.length;if((e?i:o)>=t)return new Yt(s,o,i,r);s=o+1,i++}}decompose(t,e,i,s){let n=t<=0&&e>=this.length?this:new zt($t(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&s){let t=i.pop(),e=_t(n.text,t.text.slice(),0,n.length);if(e.length<=32)i.push(new zt(e,t.length+n.length));else{let t=e.length>>1;i.push(new zt(e.slice(0,t)),new zt(e.slice(t)))}}else i.push(n)}replace(t,e,i){if(!(i instanceof zt))return super.replace(t,e,i);[t,e]=Qt(this,t,e);let s=_t(this.text,_t(i.text,$t(this.text,0,t)),e),n=this.length+i.length-(e-t);return s.length<=32?new zt(s,n):qt.from(zt.split(s,[]),n)}sliceString(t,e=this.length,i="\n"){[t,e]=Qt(this,t,e);let s="";for(let n=0,r=0;n<=e&&rt&&r&&(s+=i),tn&&(s+=o.slice(Math.max(0,t-n),e-n)),n=l+1}return s}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],s=-1;for(let n of t)i.push(n),s+=n.length+1,32==i.length&&(e.push(new zt(i,s)),i=[],s=-1);return s>-1&&e.push(new zt(i,s)),e}}class qt extends Ft{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let e of t)this.lines+=e.lines}lineInner(t,e,i,s){for(let n=0;;n++){let r=this.children[n],o=s+r.length,l=i+r.lines-1;if((e?l:o)>=t)return r.lineInner(t,e,i,s);s=o+1,i=l+1}}decompose(t,e,i,s){for(let n=0,r=0;r<=e&&n=r){let n=s&((r<=t?1:0)|(l>=e?2:0));r>=t&&l<=e&&!n?i.push(o):o.decompose(t-r,e-r,i,n)}r=l+1}}replace(t,e,i){if([t,e]=Qt(this,t,e),i.lines=n&&e<=o){let l=r.replace(t-n,e-n,i),a=this.lines-r.lines+l.lines;if(l.lines>4&&l.lines>a>>6){let n=this.children.slice();return n[s]=l,new qt(n,this.length-(e-t)+i.length)}return super.replace(n,o,l)}n=o+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i="\n"){[t,e]=Qt(this,t,e);let s="";for(let n=0,r=0;nt&&n&&(s+=i),tr&&(s+=o.sliceString(t-r,e-r,i)),r=l+1}return s}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof qt))return 0;let i=0,[s,n,r,o]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;s+=e,n+=e){if(s==r||n==o)return i;let l=this.children[s],a=t.children[n];if(l!=a)return i+l.scanIdentical(a,e);i+=l.length+1}}static from(t,e=t.reduce((t,e)=>t+e.length+1,-1)){let i=0;for(let e of t)i+=e.lines;if(i<32){let i=[];for(let e of t)e.flatten(i);return new zt(i,e)}let s=Math.max(32,i>>5),n=s<<1,r=s>>1,o=[],l=0,a=-1,h=[];function c(t){let e;if(t.lines>n&&t instanceof qt)for(let e of t.children)c(e);else t.lines>r&&(l>r||!l)?(u(),o.push(t)):t instanceof zt&&l&&(e=h[h.length-1])instanceof zt&&t.lines+e.lines<=32?(l+=t.lines,a+=t.length+1,h[h.length-1]=new zt(e.text.concat(t.text),e.length+1+t.length)):(l+t.lines>s&&u(),l+=t.lines,a+=t.length+1,h.push(t))}function u(){0!=l&&(o.push(1==h.length?h[0]:qt.from(h,a)),a=-1,l=h.length=0)}for(let e of t)c(e);return u(),1==o.length?o[0]:new qt(o,e)}}function _t(t,e,i=0,s=1e9){for(let n=0,r=0,o=!0;r=i&&(a>s&&(l=l.slice(0,s-n)),n0?1:(t instanceof zt?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],n=this.offsets[i],r=n>>1,o=s instanceof zt?s.text.length:s.children.length;if(r==(e>0?o:0)){if(0==i)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&n)==(e>0?0:1)){if(this.offsets[i]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(s instanceof zt){let n=s.text[r+(e<0?-1:0)];if(this.offsets[i]+=e,n.length>Math.max(0,t))return this.value=0==t?n:e>0?n.slice(t):n.slice(0,n.length-t),this;t-=n.length}else{let n=s.children[r+(e<0?-1:0)];t>n.length?(t-=n.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(n),this.offsets.push(e>0?1:(n instanceof zt?n.text.length:n.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class Kt{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new jt(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:s}=this.cursor.next(t);return this.pos+=(s.length+t)*e,this.value=s.length<=i?s:e<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class Ut{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:s}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(Ft.prototype[Symbol.iterator]=function(){return this.iter()},jt.prototype[Symbol.iterator]=Kt.prototype[Symbol.iterator]=Ut.prototype[Symbol.iterator]=function(){return this});class Yt{constructor(t,e,i,s){this.from=t,this.to=e,this.number=i,this.text=s}get length(){return this.to-this.from}}function Qt(t,e,i){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,i))]}function Gt(t,e,i=!0,s=!0){return Et(t,e,i,s)}function Xt(t,e){let i=t.charCodeAt(e);if(!(s=i,s>=55296&&s<56320&&e+1!=t.length))return i;var s;let n=t.charCodeAt(e+1);return function(t){return t>=56320&&t<57344}(n)?n-56320+(i-55296<<10)+65536:i}function Jt(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function Zt(t){return t<65536?1:2}const te=/\r\n?|\n/;var ee=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(ee||(ee={}));class ie{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;et)return n+(t-s);n+=o}else{if(i!=ee.Simple&&a>=t&&(i==ee.TrackDel&&st||i==ee.TrackBefore&&st))return null;if(a>t||a==t&&e<0&&!o)return t==s||e<0?n:n+l;n+=l}s=a}if(t>s)throw new RangeError(`Position ${t} is out of range for changeset of length ${s}`);return n}touchesRange(t,e=t){for(let i=0,s=0;i=0&&s<=e&&n>=t)return!(se)||"cover";s=n}return!1}toString(){let t="";for(let e=0;e=0?":"+s:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(t=>"number"!=typeof t))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ie(t)}static create(t){return new ie(t)}}class se extends ie{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return oe(this,(e,i,s,n,r)=>t=t.replace(s,s+(i-e),r),!1),t}mapDesc(t,e=!1){return le(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let s=0,n=0;s=0){e[s]=o,e[s+1]=r;let l=s>>1;for(;i.length0&&re(i,e,n.text),n.forward(t),o+=t}let a=t[r++];for(;o>1].toJSON()))}return t}static of(t,e,i){let s=[],n=[],r=0,o=null;function l(t=!1){if(!t&&!s.length)return;ro||t<0||o>e)throw new RangeError(`Invalid change range ${t} to ${o} (in doc of length ${e})`);let c=h?"string"==typeof h?Ft.of(h.split(i||te)):h:Ft.empty,u=c.length;if(t==o&&0==u)return;tr&&ne(s,t-r,-1),ne(s,o-t,u),re(n,s,c),r=o}}(t),l(!o),o}static empty(t){return new se(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let s=0;se&&"string"!=typeof t))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==n.length)e.push(n[0],0);else{for(;i.length=0&&i<=0&&i==t[n+1]?t[n]+=e:n>=0&&0==e&&0==t[n]?t[n+1]+=i:s?(t[n]+=e,t[n+1]+=i):t.push(e,i)}function re(t,e,i){if(0==i.length)return;let s=e.length-2>>1;if(s>1])),!(i||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],a=t.sections[o++];e(n,h,r,c,u),n=h,r=c}}}function le(t,e,i,s=!1){let n=[],r=s?[]:null,o=new he(t),l=new he(e);for(let t=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(-1==o.ins&&-1==l.ins){let t=Math.min(o.len,l.len);ne(n,t,-1),o.forward(t),l.forward(t)}else if(l.ins>=0&&(o.ins<0||t==o.i||0==o.off&&(l.len=0&&t=0)){if(o.done&&l.done)return r?se.createSet(n,r):ie.create(n);throw new Error("Mismatched change set lengths")}{let e=0,i=o.len;for(;i;)if(-1==l.ins){let t=Math.min(i,l.len);e+=t,i-=t,l.forward(t)}else{if(!(0==l.ins&&l.lene||o.ins>=0&&o.len>e)&&(t||s.length>i),r.forward2(e),o.forward(e)}}else ne(s,0,o.ins,t),n&&re(n,s,o.text),o.next()}}class he{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return e>=t.length?Ft.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?Ft.empty:e[i].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class ce{constructor(t,e,i,s){this.from=t,this.to=e,this.flags=i,this.goalColumn=s}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get undirectional(){return(64&this.flags)>0}get bidiLevel(){let t=7&this.flags;return 7==t?null:t}map(t,e=-1){let i,s;return this.empty?i=s=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),s=t.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new ce(i,s,this.flags,this.goalColumn)}extend(t,e=t,i=0){if(t<=this.anchor&&e>=this.anchor)return ue.range(t,e,void 0,void 0,i);let s=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return ue.range(this.anchor,s,void 0,void 0,i)}eq(t,e=!1){return!(this.anchor!=t.anchor||this.head!=t.head||this.goalColumn!=t.goalColumn||e&&this.empty&&this.assoc!=t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return ue.range(t.anchor,t.head)}static create(t,e,i,s){return new ce(t,e,i,s)}}class ue{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:ue.create(this.ranges.map(i=>i.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ue(t.ranges.map(t=>ce.fromJSON(t)),t.main)}static single(t,e=t){return new ue([ue.range(t,e)],0)}static create(t,e=0){if(0==t.length)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;st.from-e.from),e=t.indexOf(i);for(let i=1;is.head?ue.range(o,r):ue.range(r,o))}}return new ue(t,e)}}function fe(t,e){for(let i of t.ranges)if(i.to>e)throw new RangeError("Selection points outside of document")}let de=0;class pe{constructor(t,e,i,s,n){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=s,this.id=de++,this.default=t([]),this.extensions="function"==typeof n?n(this):n}get reader(){return this}static define(t={}){return new pe(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:me),!!t.static,t.enables)}of(t){return new ge([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new ge(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new ge(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],i=>e(i.field(t)))}}function me(t,e){return t==e||t.length==e.length&&t.every((t,i)=>t===e[i])}class ge{constructor(t,e,i,s){this.dependencies=t,this.facet=e,this.type=i,this.value=s,this.id=de++}dynamicSlot(t){var e;let i=this.value,s=this.facet.compareInput,n=this.id,r=t[n]>>1,o=2==this.type,l=!1,a=!1,h=[];for(let i of this.dependencies)"doc"==i?l=!0:"selection"==i?a=!0:1&(null!==(e=t[i.id])&&void 0!==e?e:1)||h.push(t[i.id]);return{create:t=>(t.values[r]=i(t),1),update(t,e){if(l&&e.docChanged||a&&(e.docChanged||e.selection)||we(t,h)){let e=i(t);if(o?!ve(e,t.values[r],s):!s(e,t.values[r]))return t.values[r]=e,1}return 0},reconfigure:(t,e)=>{let l,a=e.config.address[n];if(null!=a){let n=Ee(e,a);if(this.dependencies.every(i=>i instanceof pe?e.facet(i)===t.facet(i):!(i instanceof xe)||e.field(i,!1)==t.field(i,!1))||(o?ve(l=i(t),n,s):s(l=i(t),n)))return t.values[r]=n,0}else l=i(t);return t.values[r]=l,1}}}get extension(){return this}}function ve(t,e,i){if(t.length!=e.length)return!1;for(let s=0;st[e.id]),n=i.map(t=>t.type),r=s.filter(t=>!(1&t)),o=t[e.id]>>1;function l(t){let i=[];for(let e=0;et===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(ye).find(t=>t.field==this);return((null==e?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:t=>(t.values[e]=this.create(t),1),update:(t,i)=>{let s=t.values[e],n=this.updateF(s,i);return this.compareF(s,n)?0:(t.values[e]=n,1)},reconfigure:(t,i)=>{let s,n=t.facet(ye),r=i.facet(ye);return(s=n.find(t=>t.field==this))&&s!=r.find(t=>t.field==this)?(t.values[e]=s.create(t),1):null!=i.config.address[this.id]?(t.values[e]=i.field(this),0):(t.values[e]=this.create(t),1)}}}init(t){return[this,ye.of({field:this,create:t})]}get extension(){return this}}const ke=4,Se=3,Ce=2,Ae=1;function Me(t){return e=>new Te(e,t)}const Oe={highest:Me(0),high:Me(Ae),default:Me(Ce),low:Me(Se),lowest:Me(ke)};class Te{constructor(t,e){this.inner=t,this.prec=e}get extension(){return this}}class De{of(t){return new Re(this,t)}reconfigure(t){return De.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class Re{constructor(t,e){this.compartment=t,this.inner=e}get extension(){return this}}class Pe{constructor(t,e,i,s,n,r){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=s,this.staticValues=n,this.facets=r,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,e,i){let s=[],n=Object.create(null),r=new Map;for(let i of function(t,e,i){let s=[[],[],[],[],[]],n=new Map;function r(t,o){let l=n.get(t);if(null!=l){if(l<=o)return;let e=s[l].indexOf(t);e>-1&&s[l].splice(e,1),t instanceof Re&&i.delete(t.compartment)}if(n.set(t,o),Array.isArray(t))for(let e of t)r(e,o);else if(t instanceof Re){if(i.has(t.compartment))throw new RangeError("Duplicate use of compartment in extensions");let s=e.get(t.compartment)||t.inner;i.set(t.compartment,s),r(s,o)}else if(t instanceof Te)r(t.inner,t.prec);else if(t instanceof xe)s[o].push(t),t.provides&&r(t.provides,o);else if(t instanceof ge)s[o].push(t),t.facet.extensions&&r(t.facet.extensions,Ce);else{let e=t.extension;if(!e)throw new Error(`Unrecognized extension value in extension set (${t}).`);if(e==t)throw new Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(e,o)}}return r(t,Ce),s.reduce((t,e)=>t.concat(e))}(t,e,r))i instanceof xe?s.push(i):(n[i.facet.id]||(n[i.facet.id]=[])).push(i);let o=Object.create(null),l=[],a=[];for(let t of s)o[t.id]=a.length<<1,a.push(e=>t.slot(e));let h=null==i?void 0:i.config.facets;for(let t in n){let e=n[t],s=e[0].facet,r=h&&h[t]||[];if(e.every(t=>0==t.type))if(o[s.id]=l.length<<1|1,me(r,e))l.push(i.facet(s));else{let t=s.combine(e.map(t=>t.value));l.push(i&&s.compare(t,i.facet(s))?i.facet(s):t)}else{for(let t of e)0==t.type?(o[t.id]=l.length<<1|1,l.push(t.value)):(o[t.id]=a.length<<1,a.push(e=>t.dynamicSlot(e)));o[s.id]=a.length<<1,a.push(t=>be(t,s,e))}}let c=a.map(t=>t(o));return new Pe(t,r,c,o,l,n)}}function Be(t,e){if(1&e)return 2;let i=e>>1,s=t.status[i];if(4==s)throw new Error("Cyclic dependency between fields and/or facets");if(2&s)return s;t.status[i]=4;let n=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|n}function Ee(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}const Le=pe.define(),Ne=pe.define({combine:t=>t.some(t=>t),static:!0}),Ie=pe.define({combine:t=>t.length?t[0]:void 0,static:!0}),We=pe.define(),He=pe.define(),Ve=pe.define(),Fe=pe.define({combine:t=>!!t.length&&t[0]});class ze{constructor(t,e){this.type=t,this.value=e}static define(){return new qe}}class qe{of(t){return new ze(this,t)}}class _e{constructor(t){this.map=t}of(t){return new $e(this,t)}}class $e{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new $e(this.type,e)}is(t){return this.type==t}static define(t={}){return new _e(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let s of t){let t=s.map(e);t&&i.push(t)}return i}}$e.reconfigure=$e.define(),$e.appendConfig=$e.define();class je{constructor(t,e,i,s,n,r){this.startState=t,this.changes=e,this.selection=i,this.effects=s,this.annotations=n,this.scrollIntoView=r,this._doc=null,this._state=null,i&&fe(i,e.newLength),n.some(t=>t.type==je.time)||(this.annotations=n.concat(je.time.of(Date.now())))}static create(t,e,i,s,n,r){return new je(t,e,i,s,n,r)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(je.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function Ke(t,e){let i=[];for(let s=0,n=0;;){let r,o;if(s=t[s]))r=t[s++],o=t[s++];else{if(!(n=0;n--){let r=i[n](t);r&&Object.keys(r).length&&(s=Ue(s,Ye(e,r,t.changes.newLength),!0))}return s==t?t:je.create(e,t.changes,t.selection,s.effects,s.annotations,s.scrollIntoView)}(i?function(t){let e=t.startState,i=!0;for(let s of e.facet(We)){let e=s(t);if(!1===e){i=!1;break}Array.isArray(e)&&(i=!0===i?e:Ke(i,e))}if(!0!==i){let s,n;if(!1===i)n=t.changes.invertedDesc,s=se.empty(e.doc.length);else{let e=t.changes.filter(i);s=e.changes,n=e.filtered.mapDesc(e.changes).invertedDesc}t=je.create(e,s,t.selection&&t.selection.map(n),$e.mapEffects(t.effects,n),t.annotations,t.scrollIntoView)}let s=e.facet(He);for(let i=s.length-1;i>=0;i--){let n=s[i](t);t=n instanceof je?n:Array.isArray(n)&&1==n.length&&n[0]instanceof je?n[0]:Qe(e,Xe(n),!1)}return t}(n):n)}je.time=ze.define(),je.userEvent=ze.define(),je.addToHistory=ze.define(),je.remote=ze.define();const Ge=[];function Xe(t){return null==t?Ge:Array.isArray(t)?t:[t]}var Je=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Je||(Je={}));const Ze=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ti;try{ti=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(t){}function ei(t){return e=>{if(!/\S/.test(e))return Je.Space;if(function(t){if(ti)return ti.test(t);for(let e=0;e"€"&&(i.toUpperCase()!=i.toLowerCase()||Ze.test(i)))return!0}return!1}(e))return Je.Word;for(let i=0;i-1)return Je.Word;return Je.Other}}class ii{constructor(t,e,i,s,n,r){this.config=t,this.doc=e,this.selection=i,this.values=s,this.status=t.statusTemplate.slice(),this.computeSlot=n,r&&(r._state=this);for(let t=0;tn.set(e,t)),i=null),n.set(e.value.compartment,e.value.extension)):e.is($e.reconfigure)?(i=null,s=e.value):e.is($e.appendConfig)&&(i=null,s=Xe(s).concat(e.value));if(i)e=t.startState.values.slice();else{i=Pe.resolve(s,n,this),e=new ii(i,this.doc,this.selection,i.dynamicSlots.map(()=>null),(t,e)=>e.reconfigure(t,this),null).values}let r=t.startState.facet(Ne)?t.newSelection:t.newSelection.asSingle();new ii(i,t.newDoc,r,e,(e,i)=>i.update(e,t),t)}replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:ue.cursor(e.from+t.length,-1)}))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),s=this.changes(i.changes),n=[i.range],r=Xe(i.effects);for(let i=1;in.spec.fromJSON(r,t)))}return ii.create({doc:t.doc,selection:ue.fromJSON(t.selection),extensions:e.extensions?s.concat([e.extensions]):s})}static create(t={}){let e=Pe.resolve(t.extensions||[],new Map),i=t.doc instanceof Ft?t.doc:Ft.of((t.doc||"").split(e.staticFacet(ii.lineSeparator)||te)),s=t.selection?t.selection instanceof ue?t.selection:ue.single(t.selection.anchor,t.selection.head):ue.single(0);return fe(s,i.length),e.staticFacet(Ne)||(s=s.asSingle()),new ii(e,i,s,e.dynamicSlots.map(()=>null),(t,e)=>e.create(t),null)}get tabSize(){return this.facet(ii.tabSize)}get lineBreak(){return this.facet(ii.lineSeparator)||"\n"}get readOnly(){return this.facet(Fe)}phrase(t,...e){for(let e of this.facet(ii.phrases))if(Object.prototype.hasOwnProperty.call(e,t)){t=e[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,(t,i)=>{if("$"==i)return"$";let s=+(i||1);return!s||s>e.length?t:e[s-1]})),t}languageDataAt(t,e,i=-1){let s=[];for(let n of this.facet(Le))for(let r of n(this,e,i))Object.prototype.hasOwnProperty.call(r,t)&&s.push(r[t]);return s}charCategorizer(t){let e=this.languageDataAt("wordChars",t);return ei(e.length?e[0]:"")}wordAt(t){let{text:e,from:i,length:s}=this.doc.lineAt(t),n=this.charCategorizer(t),r=t-i,o=t-i;for(;r>0;){let t=Gt(e,r,!1);if(n(e.slice(t,r))!=Je.Word)break;r=t}for(;ot.length?t[0]:4}),ii.lineSeparator=Ie,ii.readOnly=Fe,ii.phrases=pe.define({compare(t,e){let i=Object.keys(t),s=Object.keys(e);return i.length==s.length&&i.every(i=>t[i]==e[i])}}),ii.languageData=Le,ii.changeFilter=We,ii.transactionFilter=He,ii.transactionExtender=Ve,De.reconfigure=$e.define();class ni{eq(t){return this==t}range(t,e=t){return oi.create(t,e,this)}}function ri(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}ni.prototype.startSide=ni.prototype.endSide=0,ni.prototype.point=!1,ni.prototype.mapMode=ee.TrackDel;class oi{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(t,e,i){return new oi(t,e,i)}}function li(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class ai{constructor(t,e,i,s){this.from=t,this.to=e,this.value=i,this.maxPoint=s}get length(){return ci(this.to)}findIndex(t,e,i,s=0){let n=i?this.to:this.from;for(let r=s,o=n.length;;){if(r==o)return r;let s=r+o>>1,l=n[s]-t||(i?this.value[s].endSide:this.value[s].startSide)-e;if(s==r)return l>=0?r:o;l>=0?o=s:r=s+1}}between(t,e,i,s){for(let n=this.findIndex(e,-1e9,!0),r=this.findIndex(i,1e9,!1,n);nf||u==f&&d.startSide>0&&d.endSide<=0)continue;if(!((f-u||d.endSide-d.startSide)<0))if(a<0&&(a=u),d.point&&(h=Math.max(h,f-u)),(u-i||d.startSide-s)>=0)r.push(d),o.push(u-a),l.push(f-a),i=f,s=d.endSide;else{if(u==f)for(let t=r.length;t>0;t--){if((u-(l[t-1]+a)||d.startSide-r[t-1].endSide)>=0){r.splice(t,0,d),o.splice(t,0,u-a),l.splice(t,0,f-a);continue t}if((u-(o[t-1]+a)||d.endSide-r[t-1].startSide)>0)break}n(u,f,d)}}return{mapped:r.length?new ai(o,l,r,h):null,pos:a}}}class hi{constructor(t,e,i,s){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=s}static create(t,e,i,s){return new hi(t,e,i,s)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:i=!1,filterFrom:s=0,filterTo:n=this.length}=t,r=t.filter;if(0==e.length&&!r)return this;if(i&&(e=e.slice().sort(li)),this.isEmpty)return e.length?hi.of(e):this;let o=new di(this,null,-1).goto(0),l=0,a=[],h=new ui;for(;o.value||l=0){let t=e[l++];h.addInner(t.from,t.to,t.value,!1)||a.push(t)}else 1==o.rangeIndex&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||no.to||n{e||(e=new ui),e.addRange(t,i,s,!1)};for(let e=0;e=n&&t<=n+r.length&&!1===r.between(n,t-n,e-n,i))return}this.nextLayer.between(t,e,i)}}iter(t=0){return pi.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return pi.from(t).goto(e)}static compare(t,e,i,s,n=-1){let r=t.filter(t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=n),o=e.filter(t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=n),l=fi(r,o,i),a=new gi(r,l,n),h=new gi(o,l,n);i.iterGaps((t,e,i)=>vi(a,t,h,e,i,s)),i.empty&&0==i.length&&vi(a,0,h,0,0,s)}static eq(t,e,i=0,s){null==s&&(s=999999999);let n=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0),r=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0);if(n.length!=r.length)return!1;if(!n.length)return!0;let o=fi(n,r),l=new gi(n,o,0).goto(i),a=new gi(r,o,0).goto(i);for(;;){if(l.to!=a.to||!wi(l.active,a.active)||l.point&&(!a.point||!ri(l.point,a.point)))return!1;if(l.to>s)return!0;l.next(),a.next()}}static spans(t,e,i,s,n=-1){let r=new gi(t,null,n).goto(e),o=e,l=r.openStart;for(;;){let t=Math.min(r.to,i);if(r.point){let i=r.activeForPoint(r.to),n=r.pointFromo&&(s.span(o,t,r.active,l),l=r.openEnd(t));if(r.to>i)return l+(r.point&&r.to>i?1:0);o=r.to,r.next()}}static of(t,e=!1){let i=new ui;for(let s of t instanceof oi?[t]:e?function(t){if(t.length>1)for(let e=t[0],i=1;i0)return t.slice().sort(li);e=s}return t}(t):t)i.add(s.from,s.to,s.value);return i.finish()}static join(t){if(!t.length)return hi.empty;let e=ci(t);for(let i=t.length-2;i>=0;i--)for(let s=t[i];s!=hi.empty;s=s.nextLayer)e=new hi(s.chunkPos,s.chunk,e,Math.max(s.maxPoint,e.maxPoint));return e}}function ci(t){return t[t.length-1]}hi.empty=new hi([],[],null,-1),hi.empty.nextLayer=hi.empty;class ui{finishChunk(t){this.chunks.push(new ai(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,i){this.addRange(t,e,i,!0)}addRange(t,e,i,s){this.addInner(t,e,i,s)||(this.nextLayer||(this.nextLayer=new ui)).addRange(t,e,i,s)}addInner(t,e,i,s){let n=t-this.lastTo||i.startSide-this.last.endSide;if(s&&n<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(n<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(hi.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;let e=hi.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function fi(t,e,i){let s=new Map;for(let e of t)for(let t=0;t=this.minPoint)break}}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new di(r,e,i,n));return 1==s.length?s[0]:new pi(s)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let i of this.heap)i.goto(t,e);for(let t=this.heap.length>>1;t>=0;t--)mi(this.heap,t);return this.next(),this}forward(t,e){for(let i of this.heap)i.forward(t,e);for(let t=this.heap.length>>1;t>=0;t--)mi(this.heap,t);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),mi(this.heap,0)}}}function mi(t,e){for(let i=t[e];;){let s=1+(e<<1);if(s>=t.length)break;let n=t[s];if(s+1=0&&(n=t[s+1],s++),i.compare(n)<0)break;t[s]=i,t[e]=n,e=s}}class gi{constructor(t,e,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=pi.from(t,e,i)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){bi(this.active,t),bi(this.activeTo,t),bi(this.activeRank,t),this.minActive=xi(this.active,this.activeTo)}addActive(t){let e=0,{value:i,to:s,rank:n}=this.cursor;for(;e0;)e++;yi(this.active,e,i),yi(this.activeTo,e,s),yi(this.activeRank,e,n),t&&yi(t,e,this.cursor.from),this.minActive=xi(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>t){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&bi(i,s)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let t=this.cursor.value;if(t.point){if(!(e&&this.cursor.to==this.to&&this.cursor.from=0&&i[e]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&e.push(this.active[i]);return e.reverse()}openEnd(t){let e=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)e++;return e}}function vi(t,e,i,s,n,r){t.goto(e),i.goto(s);let o=s+n,l=s,a=s-e,h=!!r.boundChange;for(let e=!1;;){let s=t.to+a-i.to,n=s||t.endSide-i.endSide,c=n<0?t.to+a:i.to,u=Math.min(c,o);if(t.point||i.point?(t.point&&i.point&&ri(t.point,i.point)&&wi(t.activeForPoint(t.to),i.activeForPoint(i.to))||r.comparePoint(l,u,t.point,i.point),e=!1):(e&&(r.boundChange(l),e=!1),u>l&&!wi(t.active,i.active)&&r.compareRange(l,u,t.active,i.active),h&&uo)break;l=c,n<=0&&t.next(),n>=0&&i.next()}}function wi(t,e){if(t.length!=e.length)return!1;for(let i=0;i=e;i--)t[i+1]=t[i];t[e]=i}function xi(t,e){let i=-1,s=1e9;for(let n=0;n=e)return s;if(s==t.length)break;n+=9==t.charCodeAt(s)?i-n%i:1,s=Gt(t,s)}return!0===s?-1:t.length}const Ci="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),Ai="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),Mi="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class Oi{constructor(t,e){this.rules=[];let{finish:i}=e||{};function s(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}function n(t,e,r,o){let l=[],a=/^@(\w+)\b/.exec(t[0]),h=a&&"keyframes"==a[1];if(a&&null==e)return r.push(t[0]+";");for(let i in e){let o=e[i];if(/&/.test(i))n(i.split(/,\s*/).map(e=>t.map(t=>e.replace(/&/,t))).reduce((t,e)=>t.concat(e)),o,r);else if(o&&"object"==typeof o){if(!a)throw new RangeError("The value of a property ("+i+") should be a primitive value.");n(s(i),o,l,h)}else null!=o&&l.push(i.replace(/_.*/,"").replace(/[A-Z]/g,t=>"-"+t.toLowerCase())+": "+o+";")}(l.length||h)&&r.push((!i||a||o?t:t.map(i)).join(", ")+" {"+l.join(" ")+"}")}for(let e in t)n(s(e),t[e],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=Mi[Ci]||1;return Mi[Ci]=t+1,"ͼ"+t.toString(36)}static mount(t,e,i){let s=t[Ai],n=i&&i.nonce;s?n&&s.setNonce(n):s=new Di(t,n),s.mount(Array.isArray(e)?e:[e],t)}}let Ti=new Map;class Di{constructor(t,e){let i=t.ownerDocument||t,s=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&s.CSSStyleSheet){let e=Ti.get(i);if(e)return t[Ai]=e;this.sheet=new s.CSSStyleSheet,Ti.set(i,this)}else this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[Ai]=this}mount(t,e){let i=this.sheet,s=0,n=0;for(let e=0;e-1&&(this.modules.splice(o,1),n--,o=-1),-1==o){if(this.modules.splice(n++,0,r),i)for(let t=0;t",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Bi="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Ei="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Li=0;Li<10;Li++)Ri[48+Li]=Ri[96+Li]=String(Li);for(Li=1;Li<=24;Li++)Ri[Li+111]="F"+Li;for(Li=65;Li<=90;Li++)Ri[Li]=String.fromCharCode(Li+32),Pi[Li]=String.fromCharCode(Li);for(var Ni in Ri)Pi.hasOwnProperty(Ni)||(Pi[Ni]=Ri[Ni]);function Ii(){var t=arguments[0];"string"==typeof t&&(t=document.createElement(t));var e=1,i=arguments[1];if(i&&"object"==typeof i&&null==i.nodeType&&!Array.isArray(i)){for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)){var n=i[s];"string"==typeof n?t.setAttribute(s,n):null!=n&&(t[s]=n)}e++}for(;e2);var Qi={mac:Yi||/Mac/.test(Hi.platform),windows:/Win/.test(Hi.platform),linux:/Linux|X11/.test(Hi.platform),ie:_i,ie_version:zi?Vi.documentMode||6:qi?+qi[1]:Fi?+Fi[1]:0,gecko:$i,gecko_version:$i?+(/Firefox\/(\d+)/.exec(Hi.userAgent)||[0,0])[1]:0,chrome:!!ji,chrome_version:ji?+ji[1]:0,ios:Yi,android:/Android\b/.test(Hi.userAgent),webkit:Ki,webkit_version:Ki?+(/\bAppleWebKit\/(\d+)/.exec(Hi.userAgent)||[0,0])[1]:0,safari:Ui,safari_version:Ui?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Hi.userAgent)||[0,0])[1]:0,tabSize:null!=Vi.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function Gi(t,e){for(let i in t)"class"==i&&e.class?e.class+=" "+t.class:"style"==i&&e.style?e.style+=";"+t.style:e[i]=t[i];return e}const Xi=Object.create(null);function Ji(t,e,i){if(t==e)return!0;t||(t=Xi),e||(e=Xi);let s=Object.keys(t),n=Object.keys(e);if(s.length-(i&&s.indexOf(i)>-1?1:0)!=n.length-(i&&n.indexOf(i)>-1?1:0))return!1;for(let r of s)if(r!=i&&(-1==n.indexOf(r)||t[r]!==e[r]))return!1;return!0}function Zi(t,e,i){let s=!1;if(e)for(let n in e)i&&n in i||(s=!0,"style"==n?t.style.cssText="":t.removeAttribute(n));if(i)for(let n in i)e&&e[n]==i[n]||(s=!0,"style"==n?t.style.cssText=i[n]:t.setAttribute(n,i[n]));return s}function ts(t){let e=Object.create(null);for(let i=0;i0?3e8:-4e8:e>0?1e8:-1e8,new os(t,e,e,i,t.widget||null,!1)}static replace(t){let e,i,s=!!t.block;if(t.isBlockGap)e=-5e8,i=4e8;else{let{start:n,end:r}=ls(t,s);e=(n?s?-3e8:-1:5e8)-1,i=1+(r?s?2e8:1:-6e8)}return new os(t,e,i,s,t.widget||null,!0)}static line(t){return new rs(t)}static set(t,e=!1){return hi.of(t,e)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}ss.none=hi.empty;class ns extends ss{constructor(t){let{start:e,end:i}=ls(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?Gi(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||Xi}eq(t){return this==t||t instanceof ns&&this.tagName==t.tagName&&Ji(this.attrs,t.attrs)}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}ns.prototype.point=!1;class rs extends ss{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof rs&&this.spec.class==t.spec.class&&Ji(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}rs.prototype.mapMode=ee.TrackBefore,rs.prototype.point=!0;class os extends ss{constructor(t,e,i,s,n,r){super(e,i,n,t),this.block=s,this.isReplace=r,this.mapMode=s?e<=0?ee.TrackBefore:ee.TrackAfter:ee.TrackDel}get type(){return this.startSide!=this.endSide?is.WidgetRange:this.startSide<=0?is.WidgetBefore:is.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof os&&(e=this.widget,i=t.widget,e==i||!!(e&&i&&e.compare(i)))&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide;var e,i}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}function ls(t,e=!1){let{inclusiveStart:i,inclusiveEnd:s}=t;return null==i&&(i=t.inclusive),null==s&&(s=t.inclusive),{start:null!=i?i:e,end:null!=s?s:e}}function as(t,e,i,s=0){let n=i.length-1;n>=0&&i[n]+s>=t?i[n]=Math.max(i[n],e):i.push(t,e)}os.prototype.point=!0;class hs extends ni{constructor(t,e,i){super(),this.tagName=t,this.attributes=e,this.rank=i}eq(t){return t==this||t instanceof hs&&this.tagName==t.tagName&&Ji(this.attributes,t.attributes)}static create(t){return new hs(t.tagName,t.attributes||Xi,null==t.rank?50:Math.max(0,Math.min(t.rank,100)))}static set(t,e=!1){return hi.of(t,e)}}function cs(t){let e;return e=11==t.nodeType?t.getSelection?t:t.ownerDocument:t,e.getSelection()}function us(t,e){return!!e&&(t==e||t.contains(1!=e.nodeType?e.parentNode:e))}function fs(t,e){if(!e.anchorNode)return!1;try{return us(t,e.anchorNode)}catch(t){return!1}}function ds(t){return 3==t.nodeType?Os(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[]}function ps(t,e,i,s){return!!i&&(vs(t,e,i,s,-1)||vs(t,e,i,s,1))}function ms(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function gs(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function vs(t,e,i,s,n){for(;;){if(t==i&&e==s)return!0;if(e==(n<0?0:ws(t))){if("DIV"==t.nodeName)return!1;let i=t.parentNode;if(!i||1!=i.nodeType)return!1;e=ms(t)+(n<0?0:1),t=i}else{if(1!=t.nodeType)return!1;if(1==(t=t.childNodes[e+(n<0?-1:0)]).nodeType&&"false"==t.contentEditable)return!1;e=n<0?ws(t):0}}}function ws(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function bs(t,e){let i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom}}function ys(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function xs(t,e){let i=e.width/t.offsetWidth,s=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(s>.995&&s<1.005||!isFinite(s)||Math.abs(e.height-t.offsetHeight)<1)&&(s=1),{scaleX:i,scaleY:s}}function ks(t,e=!0){let i=t.ownerDocument,s=null,n=null;for(let r=t.parentNode;r&&(r!=i.body&&(e&&!s||!n));)if(1==r.nodeType)!n&&r.scrollHeight>r.clientHeight&&(n=r),e&&!s&&r.scrollWidth>r.clientWidth&&(s=r),r=r.assignedSlot||r.parentNode;else{if(11!=r.nodeType)break;r=r.host}return{x:s,y:n}}hs.prototype.startSide=hs.prototype.endSide=-1;class Ss{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?ws(e):0),i,Math.min(t.focusOffset,i?ws(i):0))}set(t,e,i,s){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=s}}let Cs,As=null;function Ms(t){if(t.setActive)return t.setActive();if(As)return t.focus(As);let e=[];for(let i=t;i&&(e.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(t.focus(null==As?{get preventScroll(){return As={preventScroll:!0},!0}}:void 0),!As){As=!1;for(let t=0;tMath.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function Rs(t,e){for(let i=t,s=e;;){if(3==i.nodeType&&s>0)return{node:i,offset:s};if(1==i.nodeType&&s>0){if("false"==i.contentEditable)return null;i=i.childNodes[s-1],s=ws(i)}else{if(!i.parentNode||gs(i))return null;s=ms(i),i=i.parentNode}}}function Ps(t,e){for(let i=t,s=e;;){if(3==i.nodeType&&s=26&&(As=!1);class Bs{constructor(t,e,i=!0){this.node=t,this.offset=e,this.precise=i}static before(t,e){return new Bs(t.parentNode,ms(t),e)}static after(t,e){return new Bs(t.parentNode,ms(t)+1,e)}}var Es=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(Es||(Es={}));const Ls=Es.LTR,Ns=Es.RTL;function Is(t){let e=[];for(let i=0;i=e){if(o.level==i)return r;(n<0||(0!=s?s<0?o.frome:t[n].level>o.level))&&(n=r)}}if(n<0)throw new RangeError("Index out of range");return n}}function $s(t,e){if(t.length!=e.length)return!1;for(let i=0;ia&&o.push(new _s(a,p.from,f)),Us(t,p.direction==Ls!=!(f%2)?s+1:s,n,p.inner,p.from,p.to,o),a=p.to}d=p.to}else{if(d==i||(e?js[d]!=l:js[d]==l))break;d++}u?Ks(t,a,d,s+1,n,u,o):ae;){let i=!0,c=!1;if(!h||a>r[h-1].to){let t=js[a-1];t!=l&&(i=!1,c=16==t)}let u=i||1!=l?null:[],f=i?s:s+1,d=a;t:for(;;)if(h&&d==r[h-1].to){if(c)break t;let p=r[--h];if(!i)for(let t=p.from,i=h;;){if(t==e)break t;if(!i||r[i-1].to!=t){if(js[t-1]==l)break t;break}t=r[--i].from}if(u)u.push(p);else{p.to=0;t-=3)if(Fs[t+1]==-i){let e=Fs[t+2],i=2&e?n:4&e?1&e?r:n:0;i&&(js[o]=js[Fs[t]]=i),l=t;break}}else{if(189==Fs.length)break;Fs[l++]=o,Fs[l++]=e,Fs[l++]=a}else if(2==(s=js[o])||1==s){let t=s==n;a=t?0:1;for(let e=l-3;e>=0;e-=3){let i=Fs[e+2];if(2&i)break;if(t)Fs[e+2]|=2;else{if(4&i)break;Fs[e+2]|=4}}}}}(t,n,r,s,l),function(t,e,i,s){for(let n=0,r=s;n<=i.length;n++){let o=n?i[n-1].to:t,l=na;)e==r&&(e=i[--s].from,r=s?i[s-1].to:t),js[--e]=c;a=o}else r=o,a++}}}(n,r,s,l),Ks(t,n,r,e,i,s,o)}function Ys(t,e,i){if(!t)return[new _s(0,0,e==Ns?1:0)];if(e==Ls&&!i.length&&!qs.test(t))return Qs(t.length);if(i.length)for(;t.length>js.length;)js[js.length]=256;let s=[],n=e==Ls?0:1;return Us(t,n,n,i,0,t.length,s),s}function Qs(t){return[new _s(0,t,0)]}let Gs="";function Xs(t,e,i,s,n){var r;let o=s.head-t.from,l=_s.find(e,o,null!==(r=s.bidiLevel)&&void 0!==r?r:-1,s.assoc),a=e[l],h=a.side(n,i);if(o==h){let t=l+=n?1:-1;if(t<0||t>=e.length)return null;a=e[l=t],o=a.side(!n,i),h=a.side(n,i)}let c=Gt(t.text,o,a.forward(n,i));(ca.to)&&(c=h),Gs=t.text.slice(Math.min(o,c),Math.max(o,c));let u=l==(n?e.length-1:0)?null:e[l+(n?1:-1)];return u&&c==h&&u.level+(n?0:1)t.some(t=>t)}),cn=pe.define({combine:t=>t.some(t=>t)}),un=pe.define();class fn{constructor(t,e,i,s,n,r=!1){this.range=t,this.y=e,this.x=i,this.yMargin=s,this.xMargin=n,this.isSnapshot=r}map(t){return t.empty?this:new fn(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new fn(ue.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const dn=$e.define({map:(t,e)=>t.map(e)}),pn=$e.define();function mn(t,e,i){let s=t.facet(sn);s.length?s[0](e):window.onerror&&window.onerror(String(e),i,void 0,void 0,e)||(i?console.error(i+":",e):console.error(e))}const gn=pe.define({combine:t=>!t.length||t[0]});let vn=0;const wn=pe.define({combine:t=>t.filter((e,i)=>{for(let s=0;s{let e=[];return r&&e.push(Sn.of(e=>{let i=e.plugin(t);return i?r(i):ss.none})),n&&e.push(n(t)),e})}static fromClass(t,e){return bn.define((e,i)=>new t(e,i),e)}}class yn{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(e){if(mn(t.state,e,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(t){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(e){mn(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy()}catch(e){mn(t.state,e,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const xn=pe.define(),kn=pe.define(),Sn=pe.define(),Cn=pe.define(),An=pe.define(),Mn=pe.define(),On=pe.define();function Tn(t,e){let i=t.state.facet(On);if(!i.length)return i;let s=i.map(e=>e instanceof Function?e(t):e),n=[];return hi.spans(s,e.from,e.to,{point(){},span(t,i,s,r){let o=t-e.from,l=i-e.from,a=n;for(let t=s.length-1;t>=0;t--,r--){let i,n=s[t].spec.bidiIsolate;if(null==n&&(n=Js(e.text,o,l)),r>0&&a.length&&(i=a[a.length-1]).to==o&&i.direction==n)i.to=l,a=i.inner;else{let t={from:o,to:l,direction:n,inner:[]};a.push(t),a=t.inner}}}}),n}const Dn=pe.define();function Rn(t){let e=0,i=0,s=0,n=0;for(let r of t.state.facet(Dn)){let o=r(t);o&&(null!=o.left&&(e=Math.max(e,o.left)),null!=o.right&&(i=Math.max(i,o.right)),null!=o.top&&(s=Math.max(s,o.top)),null!=o.bottom&&(n=Math.max(n,o.bottom)))}return{left:e,right:i,top:s,bottom:n}}const Pn=pe.define();class Bn{constructor(t,e,i,s){this.fromA=t,this.toA=e,this.fromB=i,this.toB=s}join(t){return new Bn(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let s=t[e-1];if(!(s.fromA>i.toA)){if(s.toAs.push(new Bn(t,e,i,n))),this.changedRanges=s}static create(t,e,i){return new En(t,e,i)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}const Ln=[];class Nn{constructor(t,e,i=0){this.dom=t,this.length=e,this.flags=i,this.parent=null,t.cmTile=this}get breakAfter(){return 1&this.flags}get children(){return Ln}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,4&this.flags){this.flags&=-5;let t=this.domAttrs;t&&function(t,e){for(let i=t.attributes.length-1;i>=0;i--){let s=t.attributes[i].name;null==e[s]&&t.removeAttribute(s)}for(let i in e){let s=e[i];"style"==i?t.style.cssText=s:t.getAttribute(i)!=s&&t.setAttribute(i,s)}}(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,e=this.posAtStart){let i=e;for(let e of this.children){if(e==t)return i;i+=e.length+e.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,e){return null}domPosFor(t,e){let i=ms(this.dom),s=this.length?t>0:e>0;return new Bs(this.parent.dom,i+(s?1:0),0==t||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&2&this.parent.flags&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof Hn)return t;return null}static get(t){return t.cmTile}}class In extends Nn{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(2&this.flags)return;super.sync(t);let e,i=this.dom,s=null,n=(null==t?void 0:t.node)==i?t:null,r=0;for(let o of this.children){if(o.sync(t),r+=o.length+o.breakAfter,e=s?s.nextSibling:i.firstChild,n&&e!=o.dom&&(n.written=!0),o.dom.parentNode==i)for(;e&&e!=o.dom;)e=Wn(e);else i.insertBefore(o.dom,e);s=o.dom}for(e=s?s.nextSibling:i.firstChild,n&&e&&(n.written=!0);e;)e=Wn(e);this.length=r}}function Wn(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Hn extends In{constructor(t,e){super(e),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let e=Nn.get(t);if(e&&this.owns(e))return e;t=t.parentNode}}blockTiles(t){for(let e=[],i=this,s=0,n=0;;)if(s==i.children.length){if(!e.length)return;i=i.parent,i.breakAfter&&n++,s=e.pop()}else{let r=i.children[s++];if(r instanceof Vn)e.push(s),i=r,s=0;else{let e=n+r.length,i=t(r,n);if(void 0!==i)return i;n=e+r.breakAfter}}}resolveBlock(t,e){let i,s,n=-1,r=-1;if(this.blockTiles((o,l)=>{let a=l+o.length;if(t>=l&&t<=a){if(o.isWidget()&&e>=-1&&e<=1){if(32&o.flags)return!0;16&o.flags&&(i=void 0)}(lt||t==l&&(e>1?o.length:o.covers(-1)))&&(!s||!o.isWidget()&&s.isWidget())&&(s=o,r=t-l)}}),!i&&!s)throw new Error("No tile at position "+t);return i&&e<0||!s?{tile:i,offset:n}:{tile:s,offset:r}}}class Vn extends In{constructor(t,e){super(t),this.wrapper=e}isBlock(){return!0}covers(t){return!!this.children.length&&(t<0?this.children[0].covers(-1):this.lastChild.covers(1))}get domAttrs(){return this.wrapper.attributes}static of(t,e){let i=new Vn(e||document.createElement(t.tagName),t);return e||(i.flags|=4),i}}class Fn extends In{constructor(t,e){super(t),this.attrs=e}isLine(){return!0}static start(t,e,i){let s=new Fn(e||document.createElement("div"),t);return e&&i||(s.flags|=4),s}get domAttrs(){return this.attrs}resolveInline(t,e,i){let s=null,n=-1,r=null,o=-1;!function t(l,a){for(let h=0,c=0;h=a&&(u.isComposite()?t(u,a-c):(!r||r.isHidden&&(e>0||i&&zn(r,u)))&&(f>a||32&u.flags)?(r=u,o=a-c):(ci&&(t=i);let s=t,n=t,r=0;0==t&&e<0||t==i&&e>=0?Qi.chrome||Qi.gecko||(t?(s--,r=1):n=0)?0:o.length-1];return Qi.safari&&!r&&0==l.width&&(l=Array.prototype.find.call(o,t=>t.width)||l),r?bs(l,r<0):l||null}static of(t,e){let i=new _n(e||document.createTextNode(t),t);return e||(i.flags|=2),i}}class $n extends Nn{constructor(t,e,i,s){super(t,e,s),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return!(48&this.flags)&&(this.flags&(t<0?64:128))>0}coordsIn(t,e){return this.coordsInWidget(t,e,!1)}coordsInWidget(t,e,i){let s=this.widget.coordsAt(this.dom,t,e);if(s)return s;if(i)return bs(this.dom.getBoundingClientRect(),this.length?0==t:e<=0);{let e=this.dom.getClientRects(),i=null;if(!e.length)return null;let s=!!(16&this.flags)||!(32&this.flags)&&t>0;for(let n=s?e.length-1:0;i=e[n],!(t>0?0==n:n==e.length-1||i.top0;)if(s.isComposite())if(r){if(!t)break;i&&i.break(),t--,r=!1}else if(n==s.children.length){if(!t&&!o.length)break;i&&i.leave(s),r=!!s.breakAfter,({tile:s,index:n}=o.pop()),n++}else{let l=s.children[n],a=l.breakAfter;!(e>0?l.length<=t:l.length=0;t--){let i=e.marks[t],n=s.lastChild;if(n instanceof qn&&n.mark.eq(i.mark))n.dom!=i.dom&&n.setDOM(er(i.dom)),s=n;else{if(this.cache.reused.get(i)){let t=Nn.get(i.dom);t&&t.setDOM(er(i.dom))}let t=qn.of(i.mark,i.dom);s.append(t),s=t}this.cache.reused.set(i,2)}let n=Nn.get(t.text);n&&this.cache.reused.set(n,2);let r=new _n(t.text,t.text.nodeValue);r.flags|=8,this.pos=t.range.toB,s.append(r)}addInlineWidget(t,e,i){let s=this.afterWidget&&48&t.flags&&(48&this.afterWidget.flags)==(48&t.flags);s||this.flushBuffer();let n=this.ensureMarks(e,i);s||16&t.flags||n.append(this.getBuffer(1)),n.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,e,i){this.flushBuffer(),this.ensureMarks(e,i).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){(this.afterWidget||this.lastBlock).length+=t,this.pos+=t}addLineStart(t,e){var i;t||(t=tr);let s=Fn.start(t,e||(null===(i=this.cache.find(Fn))||void 0===i?void 0:i.dom),!!e);this.getBlockPos().append(this.lastBlock=this.curLine=s)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,e){var i;let s=this.curLine;for(let n=t.length-1;n>=0;n--){let r,o=t[n];if(e>0&&(r=s.lastChild)&&r instanceof qn&&r.mark.eq(o))s=r,e--;else{let t=qn.of(o,null===(i=this.cache.find(qn,t=>t.mark.eq(o)))||void 0===i?void 0:i.dom);s.append(t),s=t,e=0}}return s}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;t&&Zn(this.curLine,!1)&&("BR"==t.dom.nodeName||!t.isWidget()||Qi.ios&&Zn(this.curLine,!0))||this.curLine.append(this.cache.findWidget(sr,0,32)||new $n(sr.toDOM(),0,sr,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to=this.pos){let e=102*t.rank+t.value.rank,i=new Un(t.from,t.to,t.value,e),s=this.wrappers.length;for(;s>0&&(this.wrappers[s-1].rank-i.rank||this.wrappers[s-1].to-i.to)<0;)s--;this.wrappers.splice(s,0,i)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let e=this.root;for(let i of this.wrappers){let s=e.lastChild;if(i.fromt.wrapper.eq(i.wrapper)))||void 0===t?void 0:t.dom);e.append(s),e=s}}return e}blockPosCovered(){let t=this.lastBlock;return null!=t&&!t.breakAfter&&(!t.isWidget()||(160&t.flags)>0)}getBuffer(t){let e=2|(t<0?16:32),i=this.cache.find(jn,void 0,1);return i&&(i.flags=e),i||new jn(e)}flushBuffer(){!this.afterWidget||32&this.afterWidget.flags||(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class Qn{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:e,lineBreak:i,done:s}=this.cursor.next(this.skipCount);if(this.skipCount=0,s)throw new Error("Ran out of text content when drawing inline views");this.text=e;let n=this.textOff=Math.min(t,e.length);return i?null:e.slice(0,n)}let e=Math.min(this.text.length,this.textOff+t),i=this.text.slice(this.textOff,e);return this.textOff=e,i}}const Gn=[$n,Fn,_n,qn,jn,Vn,Hn];for(let t=0;t[]),this.index=Gn.map(()=>0),this.reused=new Map}add(t){let e=t.constructor.bucket,i=this.buckets[e];i.length<6?i.push(t):i[this.index[e]=(this.index[e]+1)%6]=t}find(t,e,i=2){let s=t.bucket,n=this.buckets[s],r=this.index[s];for(let t=n.length-1;t>=0;t--){let o=(t+r)%n.length,l=n[o];if((!e||e(l))&&!this.reused.has(l))return n.splice(o,1),o{if(this.cache.add(t),t.isComposite())return!1},enter:t=>this.cache.add(t),leave:()=>{},break:()=>{}}}run(t,e){let i=e&&this.getCompositionContext(e.text);for(let s=0,n=0,r=0;;){let o=rs){let t=l-s;this.preserve(t,!r,!o),s=l,n+=t}if(!o)break;e&&o.fromA<=e.range.fromA&&o.toA>=e.range.toA?(this.forward(o.fromA,e.range.fromA,e.range.fromA1;i--){let s=i==t.parents.length?t.tile:t.parents[i].tile;s instanceof qn&&e.push(s.mark)}return e}(this.old),n=this.openMarks;this.old.advance(t,i?1:-1,{skip:(t,e,i)=>{if(t.isWidget())if(this.openWidget)this.builder.continueWidget(i-e);else{let r=i>0||e{t.isLine()?this.builder.addLineStart(t.attrs,this.cache.maybeReuse(t)):(this.cache.add(t),t instanceof qn&&s.unshift(t.mark)),this.openWidget=!1},leave:t=>{t.isLine()?s.length&&(s.length=n=0):t instanceof qn&&(s.shift(),n=Math.min(n,s.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,e){let i=null,s=this.builder,n=0,r=hi.spans(this.decorations,t,e,{point:(t,e,r,o,l,a)=>{if(r instanceof os){if(this.disallowBlockEffectsFor[a]){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.view.state.doc.lineAt(t).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(n=o.length,l>o.length)s.continueWidget(e-t);else{let n=r.widget||(r.block?ir.block:ir.inline),a=function(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;t.block&&(e|=256);return e}(r),h=this.cache.findWidget(n,e-t,a)||$n.of(n,this.view,e-t,a);r.block?(r.startSide>0&&s.addLineStartIfNotCovered(i),s.addBlockWidget(h)):(s.ensureLine(i),s.addInlineWidget(h,o,l))}i=null}else i=function(t,e){let i=e.spec.attributes,s=e.spec.class;if(!i&&!s)return t;t||(t={class:"cm-line"});i&&Gi(i,t);s&&(t.class+=" "+s);return t}(i,r);e>t&&this.text.skip(e-t)},span:(t,e,n,r)=>{for(let o=t;on,this.openMarks=r}forward(t,e,i=1){e-t<=10?this.old.advance(e-t,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(e-t-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(t){let e=[],i=null;for(let s=t.parentNode;;s=s.parentNode){let t=Nn.get(s);if(s==this.view.contentDOM)break;t instanceof qn?e.push(t):(null==t?void 0:t.isLine())?i=t:t instanceof Vn||("DIV"!=s.nodeName||i||s==this.view.contentDOM?i||e.push(qn.of(new ns({tagName:s.nodeName.toLowerCase(),attributes:ts(s)}),s)):i=new Fn(s,tr))}return{line:i,marks:e}}}function Zn(t,e){let i=t=>{for(let s of t.children)if((e?s.isText():s.length)||i(s))return!0;return!1};return i(t)}const tr={class:"cm-line"};function er(t){let e=Nn.get(t);return e&&e.setDOM(t.cloneNode()),t}class ir extends es{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}ir.inline=new ir("span"),ir.block=new ir("div");const sr=new class extends es{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class nr{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=ss.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Hn(t,t.contentDOM),this.updateInner([new Bn(0,0,0,t.state.doc.length)],null)}update(t){var e;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:t,toA:e})=>ethis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(e=this.domChanged)||void 0===e?void 0:e.newSel)?s=this.domChanged.newSel.head:function(t,e){let i=!1;e&&t.iterChangedRanges((t,s)=>{te.from&&(i=!0)});return i}(t.changes,this.hasComposition)||t.selectionSet||(s=t.state.selection.main.head));let n=s>-1?function(t,e,i){let s=or(t,i);if(!s)return null;let{node:n,from:r,to:o}=s,l=n.nodeValue;if(/[\n\r]/.test(l))return null;if(t.state.doc.sliceString(s.from,s.to)!=l)return null;let a=e.invertedDesc;return{range:new Bn(a.mapPos(r),a.mapPos(o),r,o),text:n}}(this.view,t.changes,s):null;if(this.domChanged=null,this.hasComposition){let{from:e,to:s}=this.hasComposition;i=new Bn(e,s,t.changes.mapPos(e,-1),t.changes.mapPos(s,1)).addToSet(i.slice())}this.hasComposition=n?{from:n.range.fromB,to:n.range.toB}:null,(Qi.ie||Qi.chrome)&&!n&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let r=this.decorations,o=this.blockWrappers;this.updateDeco();let l=function(t,e,i){let s=new lr;return hi.compare(t,e,i,s),s.changes}(r,this.decorations,t.changes);l.length&&(i=Bn.extendWithRanges(i,l));let a=function(t,e,i){let s=new ar;return hi.compare(t,e,i,s),s.changes}(o,this.blockWrappers,t.changes);return a.length&&(i=Bn.extendWithRanges(i,a)),n&&!i.some(t=>t.fromA<=n.range.fromA&&t.toA>=n.range.toA)&&(i=n.range.addToSet(i.slice())),!(2&this.tile.flags&&0==i.length)&&(this.updateInner(i,n),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(e||t.length){let i=this.tile,s=new Jn(this.view,i,this.blockWrappers,this.decorations,this.dynamicDecorationMap);e&&Nn.get(e.text)&&s.cache.reused.set(Nn.get(e.text),2),this.tile=s.run(t,e),rr(i,s.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=Qi.chrome||Qi.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),!s||!s.written&&i.selectionRange.focusNode==s.node&&this.tile.dom.contains(s.node)||(this.forceSelection=!0),this.tile.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to-1)&&fs(i,this.view.observer.selectionRange)&&!(s&&i.contains(s));if(!(n||e||r))return;let o=this.forceSelection;this.forceSelection=!1;let l,a,h=this.view.state.selection.main;if(h.empty?a=l=this.inlineDOMNearPos(h.anchor,h.assoc||1):(a=this.inlineDOMNearPos(h.head,h.head==h.from?1:-1),l=this.inlineDOMNearPos(h.anchor,h.anchor==h.from?1:-1)),Qi.gecko&&h.empty&&!this.hasComposition&&(1==(c=l).node.nodeType&&c.node.firstChild&&(0==c.offset||"false"==c.node.childNodes[c.offset-1].contentEditable)&&(c.offset==c.node.childNodes.length||"false"==c.node.childNodes[c.offset].contentEditable))){let t=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(t,l.node.childNodes[l.offset]||null)),l=a=new Bs(t,0),o=!0}var c;let u=this.view.observer.selectionRange;!o&&u.focusNode&&(ps(l.node,l.offset,u.anchorNode,u.anchorOffset)&&ps(a.node,a.offset,u.focusNode,u.focusOffset)||this.suppressWidgetCursorChange(u,h))||(this.view.observer.ignore(()=>{Qi.android&&Qi.chrome&&i.contains(u.focusNode)&&function(t,e){for(let i=t;i&&i!=e;i=i.assignedSlot||i.parentNode)if(1==i.nodeType&&"false"==i.contentEditable)return!0;return!1}(u.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let t=cs(this.view.root);if(t)if(h.empty){if(Qi.gecko){let t=(e=l.node,n=l.offset,1!=e.nodeType?0:(n&&"false"==e.childNodes[n-1].contentEditable?1:0)|(nh.head&&([l,a]=[a,l]),e.setEnd(a.node,a.offset),e.setStart(l.node,l.offset),t.removeAllRanges(),t.addRange(e)}else;var e,n;r&&this.view.root.activeElement==i&&(i.blur(),s&&s.focus())}),this.view.observer.setSelectionRange(l,a)),this.impreciseAnchor=l.precise?null:new Bs(u.anchorNode,u.anchorOffset),this.impreciseHead=a.precise?null:new Bs(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&ps(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,i=cs(t.root),{anchorNode:s,anchorOffset:n}=t.observer.selectionRange;if(!(i&&e.empty&&e.assoc&&i.modify))return;let r=this.lineAt(e.head,e.assoc);if(!r)return;let o=r.posAtStart;if(e.head==o||e.head==o+r.length)return;let l=this.coordsAt(e.head,-1),a=this.coordsAt(e.head,1);if(!l||!a||l.bottom>a.top)return;let h=this.domAtPos(e.head+e.assoc,e.assoc);i.collapse(h.node,h.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let c=t.observer.selectionRange;t.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=e.from&&i.collapse(s,n)}posFromDOM(t,e){let i=this.tile.nearest(t);if(!i)return 2&this.tile.dom.compareDocumentPosition(t)?0:this.view.state.doc.length;let s=i.posAtStart;if(!i.isComposite())return i.isText()?t==i.dom?s+e:s+(e?i.length:0):s;{let n;if(t==i.dom)n=i.dom.childNodes[e];else{let s=0==ws(t)?0:0==e?-1:1;for(;;){let e=t.parentNode;if(e==i.dom)break;0==s&&e.firstChild!=e.lastChild&&(s=t==e.firstChild?-1:1),t=e}n=s<0?t:t.nextSibling}if(n==i.dom.firstChild)return s;for(;n&&!Nn.get(n);)n=n.nextSibling;if(!n)return s+i.length;for(let t=0,e=s;;t++){let s=i.children[t];if(s.dom==n)return e;e+=s.length+s.breakAfter}}}domAtPos(t,e){let{tile:i,offset:s}=this.tile.resolveBlock(t,e);return i.isWidget()?i.domPosFor(t,e):i.domIn(s,e)}inlineDOMNearPos(t,e){let i,s,n=-1,r=!1,o=-1,l=!1;return this.tile.blockTiles((e,a)=>{if(e.isWidget()){if(32&e.flags&&a>=t)return!0;16&e.flags&&(r=!0)}else{let h=a+e.length;if(a<=t&&(i=e,n=t-a,r=h=t&&!s&&(s=e,o=t-a,l=a>t),a>t&&s)return!0}}),i||s?(r&&s?i=null:l&&i&&(s=null),i&&e<0||!s?i.domIn(n,e):s.domIn(o,e)):this.domAtPos(t,e)}coordsAt(t,e){let{tile:i,offset:s}=this.tile.resolveBlock(t,e);return i.isWidget()?i.widget instanceof hr?null:i.coordsInWidget(s,e,!0):i.coordsIn(s,e)}lineAt(t,e){let{tile:i}=this.tile.resolveBlock(t,e);return i.isLine()?i:null}coordsForChar(t){let{tile:e,offset:i}=this.tile.resolveBlock(t,1);if(!e.isLine())return null;return function t(e,i){if(e.isComposite())for(let s of e.children){if(s.length>=i){let e=t(s,i);if(e)return e}if((i-=s.length)<0)break}else if(e.isText()&&iMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,l=this.view.textDirection==Es.LTR,a=0,h=(t,c,u)=>{for(let f=0;fs);f++){let s=t.children[f],d=c+s.length,p=s.dom.getBoundingClientRect(),{height:m}=p;if(u&&!f&&(a+=p.top-u.top),s instanceof Vn)d>i&&h(s,c,p);else if(c>=i&&(a>0&&e.push(-a),e.push(m+a),a=0,r)){let t=s.dom.lastChild,e=t?ds(t):[];if(e.length){let t=e[e.length-1],i=l?t.right-p.left:p.right-t.left;i>o&&(o=i,this.minWidth=n,this.minWidthFrom=c,this.minWidthTo=d)}}u&&f==t.children.length-1&&(a+=u.bottom-p.bottom),c=d+s.breakAfter}};return h(this.tile,0,null),e}textDirectionAt(t){let{tile:e}=this.tile.resolveBlock(t,1);return"rtl"==getComputedStyle(e.dom).direction?Es.RTL:Es.LTR}measureTextSize(){let t=this.tile.blockTiles(t=>{if(t.isLine()&&t.children.length&&t.length<=20){let e,i=0;for(let s of t.children){if(!s.isText()||/[^ -~]/.test(s.text))return;let t=ds(s.dom);if(1!=t.length)return;i+=t[0].width,e=t[0].height}if(i)return{lineHeight:t.dom.getBoundingClientRect().height,charWidth:i/t.length,textHeight:e}}});if(t)return t;let e,i,s,n=document.createElement("div");return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let t=ds(n.firstChild)[0];e=n.getBoundingClientRect().height,i=t&&t.width?t.width/27:7,s=t&&t.height?t.height:e,n.remove()}),{lineHeight:e,charWidth:i,textHeight:s}}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,s=0;;s++){let n=s==e.viewports.length?null:e.viewports[s],r=n?n.from-1:this.view.state.doc.length;if(r>i){let s=(e.lineBlockAt(r).bottom-e.lineBlockAt(i).top)/this.view.scaleY;t.push(ss.replace({widget:new hr(s),block:!0,inclusive:!0,isBlockGap:!0}).range(i,r))}if(!n)break;i=n.to+1}return ss.set(t)}updateDeco(){let t=1,e=this.view.state.facet(Sn).map(e=>(this.dynamicDecorationMap[t++]="function"==typeof e)?e(this.view):e),i=!1,s=this.view.state.facet(An).map((t,e)=>{let s="function"==typeof t;return s&&(i=!0),s?t(this.view):t});for(s.length&&(this.dynamicDecorationMap[t++]=i,e.push(hi.join(s))),this.decorations=[this.editContextFormatting,...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];t"function"==typeof t?t(this.view):t)}scrollIntoView(t){var e;if(t.isSnapshot){let e=this.view.viewState.lineBlockAt(t.range.head);return this.view.scrollDOM.scrollTop=e.top-t.yMargin,void(this.view.scrollDOM.scrollLeft=t.xMargin)}for(let e of this.view.state.facet(un))try{if(e(this.view,t.range,t))return!0}catch(t){mn(this.view.state,t,"scroll handler")}let i,{range:s}=t,n=this.coordsAt(s.head,null!==(e=s.assoc)&&void 0!==e?e:s.empty?0:s.head>s.anchor?-1:1);if(!n)return;!s.empty&&(i=this.coordsAt(s.anchor,s.anchor>s.head?-1:1))&&(n={left:Math.min(n.left,i.left),top:Math.min(n.top,i.top),right:Math.max(n.right,i.right),bottom:Math.max(n.bottom,i.bottom)});let r=Rn(this.view),o={left:n.left-r.left,top:n.top-r.top,right:n.right+r.right,bottom:n.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;if(function(t,e,i,s,n,r,o,l){let a=t.ownerDocument,h=a.defaultView||window;for(let c=t,u=!1;c&&!u;)if(1==c.nodeType){let t,f=c==a.body,d=1,p=1;if(f)t=ys(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(u=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let e=c.getBoundingClientRect();({scaleX:d,scaleY:p}=xs(c,e)),t={left:e.left,right:e.left+c.clientWidth*d,top:e.top,bottom:e.top+c.clientHeight*p}}let m=0,g=0;if("nearest"==n)e.top0&&e.bottom>t.bottom+g&&(g=e.bottom-t.bottom+o)):e.bottom>t.bottom-o&&(g=e.bottom-t.bottom+o,i<0&&e.top-g0&&e.right>t.right+m&&(m=e.right-t.right+r)):e.right>t.right-r&&(m=e.right-t.right+r,i<0&&e.leftt.bottom||e.leftt.right)&&(e={left:Math.max(e.left,t.left),right:Math.min(e.right,t.right),top:Math.max(e.top,t.top),bottom:Math.min(e.bottom,t.bottom)}),c=c.assignedSlot||c.parentNode}else{if(11!=c.nodeType)break;c=c.host}}(this.view.scrollDOM,o,s.head1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottomt.isWidget()||t.children.some(e);return e(this.tile.resolveBlock(t,1).tile)}destroy(){rr(this.tile)}}function rr(t,e){let i=null==e?void 0:e.get(t);if(1!=i){null==i&&t.destroy();for(let i of t.children)rr(i,e)}}function or(t,e){let i=t.observer.selectionRange;if(!i.focusNode)return null;let s=Rs(i.focusNode,i.focusOffset),n=Ps(i.focusNode,i.focusOffset),r=s||n;if(n&&s&&n.node!=s.node){let e=Nn.get(n.node);if(!e||e.isText()&&e.text!=n.node.nodeValue)r=n;else if(t.docView.lastCompositionAfterCursor){let t=Nn.get(s.node);!t||t.isText()&&t.text!=s.node.nodeValue||(r=n)}}if(t.docView.lastCompositionAfterCursor=r!=s,!r)return null;let o=e-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}let lr=class{constructor(){this.changes=[]}compareRange(t,e){as(t,e,this.changes)}comparePoint(t,e){as(t,e,this.changes)}boundChange(t){as(t,t,this.changes)}};class ar{constructor(){this.changes=[]}compareRange(t,e){as(t,e,this.changes)}comparePoint(){}boundChange(t){as(t,t,this.changes)}}class hr extends es{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function cr(t,e,i){let s=t.lineBlockAt(e);if(Array.isArray(s.type)){let t;for(let n of s.type){if(n.from>e)break;if(!(n.toe)return n;t&&(n.type!=is.Text||t.type==n.type&&!(i<0?n.frome))||(t=n)}}return t||s}return s}function ur(t,e,i,s){let n=t.state.doc.lineAt(e.head),r=t.bidiSpans(n),o=t.textDirectionAt(n.from);for(let l=e,a=null;;){let e=Xs(n,r,o,l,i),h=Gs;if(!e){if(n.number==(i?t.state.doc.lines:1))return l;h="\n",n=t.state.doc.line(n.number+(i?1:-1)),r=t.bidiSpans(n),e=t.visualLineSide(n,!i)}if(a){if(!a(h))return l}else{if(!s)return e;a=s(h)}l=e}}function fr(t,e,i){for(;;){let s=0;for(let n of t)n.between(e-1,e+1,(t,n,r)=>{if(e>t&&ee(t)),i.from,e.head>i.from?-1:1);return s==i.from?i:ue.cursor(s,st.viewState.docHeight)return new mr(t.state.doc.length,-1);if(n=t.elementAtHeight(h),null==s)break;if(n.type==is.Text){if(s<0?n.tot.viewport.to)break;let e=t.docView.coordsAt(s<0?n.from:n.to,s>0?-1:1);if(e&&(s<0?e.top<=h+o:e.bottom>=h+o))break}let e=t.viewState.heightOracle.textHeight/2;h=s>0?n.bottom+e:n.top-e}if(t.viewport.from>=n.to||t.viewport.to<=n.from){if(i)return null;if(n.type==is.Text){let e=function(t,e,i,s,n){let r=Math.round((s-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&i.height>1.5*t.defaultLineHeight){let e=t.viewState.heightOracle.textHeight;r+=Math.floor((n-i.top-.5*(t.defaultLineHeight-e))/e)*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(i.from,i.to);return i.from+Si(o,r,t.state.tabSize)}(t,r,n,l,a);return new mr(e,e==n.from?1:-1)}}if(n.type!=is.Text)return h<(n.top+n.bottom)/2?new mr(n.from,1):new mr(n.to,-1);let c=t.docView.lineAt(n.from,2);return c&&c.length==n.length||(c=t.docView.lineAt(n.from,-2)),new vr(t,l,a,t.textDirectionAt(n.from)).scanTile(c,n.from)}class vr{constructor(t,e,i,s){this.view=t,this.x=e,this.y=i,this.baseDir=s,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+s.from>1;e:if(a.has(f)){let t=o+Math.floor(Math.random()*i);for(let e=0;e1)){if(i.bottomthis.y)(!n||n.top>i.top)&&(n=i),a=-1;else{let t=i.left>this.x?this.x-i.left:i.right(i+i+o)/3)return this.y=s.bottom-1,this.scan(t,e,!0);if(n&&n.top<(i+o+o)/3)return this.y=n.top+1,this.scan(t,e,!0)}let f=(h?this.dirAt(t[c],1):this.baseDir)==Es.LTR;return{i:c,after:this.x>(r.left+r.right)/2==f}}scanText(t,e){let i=[];for(let s=0;s{let n=i[s]-e,r=i[s+1]-e;return Os(t.dom,n,r).getClientRects()});return s.after?new mr(i[s.i+1],-1):new mr(i[s.i],1)}scanTile(t,e){if(!t.length)return new mr(e,1);if(1==t.children.length){let i=t.children[0];if(i.isText())return this.scanText(i,e);if(i.isComposite())return this.scanTile(i,e)}let i=[e];for(let s=0,n=e;s{let i=t.children[e];return 48&i.flags?null:(1==i.dom.nodeType?i.dom:Os(i.dom,0,i.length)).getClientRects()}),n=t.children[s.i],r=i[s.i];return n.isText()?this.scanText(n,r):n.isComposite()?this.scanTile(n,r):s.after?new mr(i[s.i+1],-1):new mr(r,1)}}const wr="￿";class br{constructor(t,e){this.points=t,this.view=e,this.text="",this.lineSeparator=e.state.facet(ii.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=wr}readRange(t,e){if(!t)return this;let i=t.parentNode;for(let s=t;;){this.findPointBefore(i,s);let t=this.text.length;this.readNode(s);let n=Nn.get(s),r=s.nextSibling;if(r==e){(null==n?void 0:n.breakAfter)&&!r&&i!=this.view.contentDOM&&this.lineBreak();break}let o=Nn.get(r);(n&&o?n.breakAfter:(n?n.breakAfter:gs(s))||gs(r)&&("BR"!=s.nodeName||(null==n?void 0:n.isWidget()))&&this.text.length>t)&&!xr(r,e)&&this.lineBreak(),s=r}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let n,r=-1,o=1;if(this.lineSeparator?(r=e.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(n=s.exec(e))&&(r=n.index,o=n[0].length),this.append(e.slice(i,r<0?e.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let e of this.points)e.node==t&&e.pos>this.text.length&&(e.pos-=o-1);i=r+o}}readNode(t){let e=Nn.get(t),i=e&&e.overrideDOMText;if(null!=i){this.findPointInside(t,i.length);for(let t=i.iter();!t.next().done;)t.lineBreak?this.lineBreak():this.append(t.value)}else 3==t.nodeType?this.readTextNode(t):"BR"==t.nodeName?t.nextSibling&&this.lineBreak():1==t.nodeType&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(3==t.nodeType?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(yr(t,i.node,i.offset)?e:0))}}function yr(t,e,i){for(;;){if(!e||i-1;let{impreciseHead:n,impreciseAnchor:r}=t.docView,o=t.state.selection;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=Cr(t.docView.tile,e,i,0))){let e=n||r?[]:function(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:s,focusNode:n,focusOffset:r}=t.observer.selectionRange;i&&(e.push(new kr(i,s)),n==i&&r==s||e.push(new kr(n,r)));return e}(t),i=new br(e,t);i.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=i.text,this.newSel=function(t,e){if(0==t.length)return null;let i=t[0].pos,s=2==t.length?t[1].pos:i;return i>-1&&s>-1?ue.single(i+e,s+e):null}(e,this.bounds.from)}else{let e=t.observer.selectionRange,i=n&&n.node==e.focusNode&&n.offset==e.focusOffset||!us(t.contentDOM,e.focusNode)?o.main.head:t.docView.posFromDOM(e.focusNode,e.focusOffset),s=r&&r.node==e.anchorNode&&r.offset==e.anchorOffset||!us(t.contentDOM,e.anchorNode)?o.main.anchor:t.docView.posFromDOM(e.anchorNode,e.anchorOffset),l=t.viewport;if((Qi.ios||Qi.chrome)&&o.main.empty&&i!=s&&(l.from>0||l.to-1&&o.ranges.length>1)this.newSel=o.replaceRange(ue.range(s,i));else if(t.lineWrapping&&s==i&&(!o.main.empty||o.main.head!=i)&&t.inputState.lastTouchTime>Date.now()-100){let e=t.coordsAtPos(i,-1),s=0;e&&(s=t.inputState.lastTouchY<=e.bottom?-1:1),this.newSel=ue.create([ue.cursor(i,s)])}else this.newSel=ue.single(s,i)}}}function Cr(t,e,i,s){if(t.isComposite()){let n=-1,r=-1,o=-1,l=-1;for(let a=0,h=s,c=s;ai)return Cr(s,e,i,h);if(u>=e&&-1==n&&(n=a,r=h),h>i&&s.dom.parentNode==t.dom){o=a,l=c;break}c=u,h=u+s.breakAfter}return{from:r,to:l<0?s+t.length:l,startDOM:(n?t.children[n-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o=0?t.children[o].dom:null}}return t.isText()?{from:s,to:s+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function Ar(t,e){let i,{newSel:s}=e,{state:n}=t,r=n.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:t,to:s}=e.bounds,l=r.from,a=null;(8===o||Qi.android&&e.text.length=t&&r.to<=s&&(e.typeOver||u!=e.text)&&u.slice(0,r.from-t)==e.text.slice(0,r.from-t)&&u.slice(r.to-t)==e.text.slice(h=e.text.length-(u.length-(r.to-t)))?i={from:r.from,to:r.to,insert:Ft.of(e.text.slice(r.from-t,h).split(wr))}:(c=Or(u,e.text,l-t,a))&&(Qi.chrome&&13==o&&c.toB==c.from+2&&e.text.slice(c.from,c.toB)==wr+wr&&c.toB--,i={from:t+c.from,to:t+c.toA,insert:Ft.of(e.text.slice(c.from,c.toB).split(wr))})}else s&&(!t.hasFocus&&n.facet(gn)||Tr(s,r))&&(s=null);if(!i&&!s)return!1;if((Qi.mac||Qi.android)&&i&&i.from==i.to&&i.from==r.head-1&&/^\. ?$/.test(i.insert.toString())&&"off"==t.contentDOM.getAttribute("autocorrect")?(s&&2==i.insert.length&&(s=ue.single(s.main.anchor-1,s.main.head-1)),i={from:i.from,to:i.to,insert:Ft.of([i.insert.toString().replace("."," ")])}):n.doc.lineAt(r.from).toDate.now()-50?i={from:r.from,to:r.to,insert:n.toText(t.inputState.insertingText)}:Qi.chrome&&i&&i.from==i.to&&i.from==r.head&&"\n "==i.insert.toString()&&t.lineWrapping&&(s&&(s=ue.single(s.main.anchor-1,s.main.head-1)),i={from:r.from,to:r.to,insert:Ft.of([" "])}),i)return Mr(t,i,s,o);if(s&&!Tr(s,r)){let e=!1,i="select";return t.inputState.lastSelectionTime>Date.now()-50&&("select"==t.inputState.lastSelectionOrigin&&(e=!0),i=t.inputState.lastSelectionOrigin,"select.pointer"==i&&(s=dr(n.facet(Mn).map(e=>e(t)),s))),t.dispatch({selection:s,scrollIntoView:e,userEvent:i}),!0}return!1}function Mr(t,e,i,s=-1){if(Qi.ios&&t.inputState.flushIOSKey(e))return!0;let n=t.state.selection.main;if(Qi.android&&(e.to==n.to&&(e.from==n.from||e.from==n.from-1&&" "==t.state.sliceDoc(e.from,n.from))&&1==e.insert.length&&2==e.insert.lines&&Ts(t.contentDOM,"Enter",13)||(e.from==n.from-1&&e.to==n.to&&0==e.insert.length||8==s&&e.insert.lengthn.head)&&Ts(t.contentDOM,"Backspace",8)||e.from==n.from&&e.to==n.to+1&&0==e.insert.length&&Ts(t.contentDOM,"Delete",46)))return!0;let r,o=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let l=()=>r||(r=function(t,e,i){let s,n=t.state,r=n.selection.main,o=-1;if(e.from==e.to&&e.fromr.to){let i=e.frome(t)),s,i);e.from==l&&(o=l)}if(o>-1)s={changes:e,selection:ue.cursor(e.from+e.insert.length,-1)};else if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let i=r.frome.to?n.sliceDoc(e.to,r.to):"";s=n.replaceSelection(t.state.toText(i+e.insert.sliceString(0,void 0,t.state.lineBreak)+o))}else{let o=n.changes(e),l=i&&i.main.to<=o.newLength?i.main:void 0;if(n.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=r.to+10&&e.to>=r.to-10){let a,h=t.state.sliceDoc(e.from,e.to),c=i&&or(t,i.main.head);if(c){let t=e.insert.length-(e.to-e.from);a={from:c.from,to:c.to-t}}else a=t.state.doc.lineAt(r.head);let u=r.to-e.to;s=n.changeByRange(i=>{if(i.from==r.from&&i.to==r.to)return{changes:o,range:l||i.map(o)};let s=i.to-u,c=s-h.length;if(t.state.sliceDoc(c,s)!=h||s>=a.from&&c<=a.to)return{range:i};let f=n.changes({from:c,to:s,insert:e.insert}),d=i.to-r.to;return{changes:f,range:l?ue.range(Math.max(0,l.anchor+d),Math.max(0,l.head+d)):i.map(f)}})}else s={changes:o,selection:l&&n.selection.replaceRange(l)}}let l="input.type";(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1));return n.update(s,{userEvent:l,scrollIntoView:!0})}(t,e,i));return t.state.facet(rn).some(i=>i(t,e.from,e.to,o,l))||t.dispatch(l()),!0}function Or(t,e,i,s){let n=Math.min(t.length,e.length),r=0;for(;r0&&l>0&&t.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if("end"==s){i-=o+Math.max(0,r-Math.min(o,l))-r}if(o=o?r-i:0,l=r+(l-o),o=r}else if(l=l?r-i:0,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function Tr(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class Dr{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,Qi.safari&&t.contentDOM.addEventListener("input",()=>null),Qi.gecko&&function(t){Zr.has(t)||(Zr.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}(t.contentDOM.ownerDocument)}handleEvent(t){(function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let i,s=e.target;s!=t.contentDOM;s=s.parentNode)if(!s||11==s.nodeType||(i=Nn.get(s))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0})(this.view,t)&&!this.ignoreDuringComposition(t)&&("keydown"==t.type&&this.keydown(t)||(0!=this.view.updateState?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t)))}runHandlers(t,e){let i=this.handlers[t];if(i){for(let t of i.observers)t(this.view,e);for(let t of i.handlers){if(e.defaultPrevented)break;if(t(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=Pr(t),i=this.handlers,s=this.view.contentDOM;for(let t in e)if("scroll"!=t){let n=!e[t].handlers.length,r=i[t];r&&n!=!r.handlers.length&&(s.removeEventListener(t,this.handleEvent),r=null),r||s.addEventListener(t,this.handleEvent,{passive:n})}for(let t in i)"scroll"==t||e[t]||s.removeEventListener(t,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=t.keyCode&&Lr.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),Qi.android&&Qi.chrome&&!t.synthetic&&(13==t.keyCode||8==t.keyCode))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let e;return!Qi.ios||t.synthetic||t.altKey||t.metaKey||t.shiftKey||!((e=Br.find(e=>e.keyCode==t.keyCode))&&!t.ctrlKey||Er.indexOf(t.key)>-1&&t.ctrlKey)?(229!=t.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=e||t,setTimeout(()=>this.flushIOSKey(),250),!0)}flushIOSKey(t){let e=this.pendingIOSKey;return!!e&&(!("Enter"==e.key&&t&&t.from0||!!(Qi.safari&&!Qi.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Rr(t,e){return(i,s)=>{try{return e.call(t,s,i)}catch(t){mn(i.state,t)}}}function Pr(t){let e=Object.create(null);function i(t){return e[t]||(e[t]={observers:[],handlers:[]})}for(let e of t){let t=e.spec,s=t&&t.plugin.domEventHandlers,n=t&&t.plugin.domEventObservers;if(s)for(let t in s){let n=s[t];n&&i(t).handlers.push(Rr(e.value,n))}if(n)for(let t in n){let s=n[t];s&&i(t).observers.push(Rr(e.value,s))}}for(let t in Wr)i(t).handlers.push(Wr[t]);for(let t in Hr)i(t).observers.push(Hr[t]);return e}const Br=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Er="dthko",Lr=[16,17,18,20,91,92,224,225];function Nr(t){return.7*Math.max(0,t)+8}class Ir{constructor(t,e,i,s){this.view=t,this.startEvent=e,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=ks(t.contentDOM),this.atoms=t.state.facet(Mn).map(e=>e(t));let n=t.contentDOM.ownerDocument;n.addEventListener("mousemove",this.move=this.move.bind(this)),n.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(ii.allowMultipleSelections)&&function(t,e){let i=t.state.facet(Zs);return i.length?i[0](e):Qi.mac?e.metaKey:e.ctrlKey}(t,e),this.dragging=!(!function(t,e){let{main:i}=t.state.selection;if(i.empty)return!1;let s=cs(t.root);if(!s||0==s.rangeCount)return!0;let n=s.getRangeAt(0).getClientRects();for(let t=0;t=e.clientX&&i.top<=e.clientY&&i.bottom>=e.clientY)return!0}return!1}(t,e)||1!=Ur(e))&&null}start(t){!1===this.dragging&&this.select(t)}move(t){if(0==t.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(e=this.startEvent,i=t,Math.max(Math.abs(e.clientX-i.clientX),Math.abs(e.clientY-i.clientY))<10))return;var e,i;this.select(this.lastEvent=t);let s=0,n=0,r=0,o=0,l=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:l}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:a}=this.scrollParents.y.getBoundingClientRect());let h=Rn(this.view);t.clientX-h.left<=r+6?s=-Nr(r-t.clientX):t.clientX+h.right>=l-6&&(s=Nr(t.clientX-l)),t.clientY-h.top<=o+6?n=-Nr(o-t.clientY):t.clientY+h.bottom>=a-6&&(n=Nr(t.clientY-a)),this.setScrollSpeed(s,n)}up(t){null==this.dragging&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:e}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),!1===this.dragging&&this.select(this.lastEvent)}select(t){let{view:e}=this,i=dr(this.atoms,this.style.get(t,this.extend,this.multiple));!this.mustSelect&&i.eq(e.state.selection,!1===this.dragging)||this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}const Wr=Object.create(null),Hr=Object.create(null),Vr=Qi.ie&&Qi.ie_version<15||Qi.ios&&Qi.webkit_version<604;function Fr(t,e,i){for(let s of t.facet(e))i=s(i,t);return i}function zr(t,e){e=Fr(t.state,ln,e);let i,{state:s}=t,n=1,r=s.toText(e),o=r.lines==s.selection.ranges.length;if(null!=Qr&&s.selection.ranges.every(t=>t.empty)&&Qr==r.toString()){let t=-1;i=s.changeByRange(i=>{let l=s.doc.lineAt(i.from);if(l.from==t)return{range:i};t=l.from;let a=s.toText((o?r.line(n++).text:e)+s.lineBreak);return{changes:{from:l.from,insert:a},range:ue.cursor(i.from+a.length)}})}else i=o?s.changeByRange(t=>{let e=r.line(n++);return{changes:{from:t.from,to:t.to,insert:e.text},range:ue.cursor(t.from+e.length)}}):s.replaceSelection(r);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}function qr(t,e,i,s){if(1==s)return ue.cursor(e,i);if(2==s)return function(t,e,i=1){let s=t.charCategorizer(e),n=t.doc.lineAt(e),r=e-n.from;if(0==n.length)return ue.cursor(e);0==r?i=1:r==n.length&&(i=-1);let o=r,l=r;i<0?o=Gt(n.text,r,!1):l=Gt(n.text,r);let a=s(n.text.slice(o,l));for(;o>0;){let t=Gt(n.text,o,!1);if(s(n.text.slice(t,o))!=a)break;o=t}for(;l{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft},Hr.wheel=Hr.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()},Wr.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),27==e.keyCode&&0!=t.inputState.tabFocusMode&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),Hr.touchstart=(t,e)=>{let i=t.inputState,s=e.targetTouches[0];i.lastTouchTime=Date.now(),s&&(i.lastTouchX=s.clientX,i.lastTouchY=s.clientY),i.setSelectionOrigin("select.pointer")},Hr.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},Wr.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let i=null;for(let s of t.state.facet(en))if(i=s(t,e),i)break;if(i||0!=e.button||(i=function(t,e){let i=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),s=Ur(e),n=t.state.selection;return{update(t){t.docChanged&&(i.pos=t.changes.mapPos(i.pos),n=n.map(t.changes))},get(e,r,o){let l,a=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),h=qr(t,a.pos,a.assoc,s);if(i.pos!=a.pos&&!r){let e=qr(t,i.pos,i.assoc,s),n=Math.min(e.from,h.from),r=Math.max(e.to,h.to);h=n1&&(l=function(t,e){for(let i=0;i=e)return ue.create(t.ranges.slice(0,i).concat(t.ranges.slice(i+1)),t.mainIndex==i?0:t.mainIndex-(t.mainIndex>i?1:0))}return null}(n,a.pos))?l:o?n.addRange(h):ue.create([h])}}}(t,e)),i){let s=!t.hasFocus;t.inputState.startMouseSelection(new Ir(t,e,i,s)),s&&t.observer.ignore(()=>{Ms(t.contentDOM);let e=t.root.activeElement;e&&!e.contains(t.contentDOM)&&e.blur()});let n=t.inputState.mouseSelection;if(n)return n.start(e),!1===n.dragging}else t.inputState.setSelectionOrigin("select.pointer");return!1};const _r=Qi.ie&&Qi.ie_version<=11;let $r=null,jr=0,Kr=0;function Ur(t){if(!_r)return t.detail;let e=$r,i=Kr;return $r=t,Kr=Date.now(),jr=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(jr+1)%3:1}function Yr(t,e,i,s){if(!(i=Fr(t.state,ln,i)))return;let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=t.inputState,o=s&&r&&function(t,e){let i=t.state.facet(tn);return i.length?i[0](e):Qi.mac?!e.altKey:!e.ctrlKey}(t,e)?{from:r.from,to:r.to}:null,l={from:n,insert:i},a=t.state.changes(o?[o,l]:l);t.focus(),t.dispatch({changes:a,selection:{anchor:a.mapPos(n,-1),head:a.mapPos(n,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Wr.dragstart=(t,e)=>{let{selection:{main:i}}=t.state;if(e.target.draggable){let s=t.docView.tile.nearest(e.target);if(s&&s.isWidget()){let t=s.posAtStart,e=t+s.length;(t>=i.to||e<=i.from)&&(i=ue.range(t,e))}}let{inputState:s}=t;return s.mouseSelection&&(s.mouseSelection.dragging=!0),s.draggedContent=i,e.dataTransfer&&(e.dataTransfer.setData("Text",Fr(t.state,an,t.state.sliceDoc(i.from,i.to))),e.dataTransfer.effectAllowed="copyMove"),!1},Wr.dragend=t=>(t.inputState.draggedContent=null,!1),Wr.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let i=e.dataTransfer.files;if(i&&i.length){let s=Array(i.length),n=0,r=()=>{++n==i.length&&Yr(t,e,s.filter(t=>null!=t).join(t.state.lineBreak),!1)};for(let t=0;t{/[\x00-\x08\x0e-\x1f]{2}/.test(e.result)||(s[t]=e.result),r()},e.readAsText(i[t])}return!0}{let i=e.dataTransfer.getData("Text");if(i)return Yr(t,e,i,!0),!0}return!1},Wr.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let i=Vr?null:e.clipboardData;return i?(zr(t,i.getData("text/plain")||i.getData("text/uri-list")),!0):(function(t){let e=t.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout(()=>{t.focus(),i.remove(),zr(t,i.value)},50)}(t),!1)};let Qr=null;Wr.copy=Wr.cut=(t,e)=>{if(!fs(t.contentDOM,t.observer.selectionRange))return!1;let{text:i,ranges:s,linewise:n}=function(t){let e=[],i=[],s=!1;for(let s of t.selection.ranges)s.empty||(e.push(t.sliceDoc(s.from,s.to)),i.push(s));if(!e.length){let n=-1;for(let{from:s}of t.selection.ranges){let r=t.doc.lineAt(s);r.number>n&&(e.push(r.text),i.push({from:r.from,to:Math.min(t.doc.length,r.to+1)})),n=r.number}s=!0}return{text:Fr(t,an,e.join(t.lineBreak)),ranges:i,linewise:s}}(t.state);if(!i&&!n)return!1;Qr=n?i:null,"cut"!=e.type||t.state.readOnly||t.dispatch({changes:s,scrollIntoView:!0,userEvent:"delete.cut"});let r=Vr?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",i),!0):(function(t,e){let i=t.dom.parentNode;if(!i)return;let s=i.appendChild(document.createElement("textarea"));s.style.cssText="position: fixed; left: -10000px; top: 10px",s.value=e,s.focus(),s.selectionEnd=e.length,s.selectionStart=0,setTimeout(()=>{s.remove(),t.focus()},50)}(t,i),!1)};const Gr=ze.define();function Xr(t,e){let i=[];for(let s of t.facet(on)){let n=s(t,e);n&&i.push(n)}return i.length?t.update({effects:i,annotations:Gr.of(!0)}):null}function Jr(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let i=Xr(t.state,e);i?t.dispatch(i):t.update([])}},10)}Hr.focus=t=>{t.inputState.lastFocusTime=Date.now(),t.scrollDOM.scrollTop||!t.inputState.lastScrollTop&&!t.inputState.lastScrollLeft||(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),Jr(t)},Hr.blur=t=>{t.observer.clearSelectionRange(),Jr(t)},Hr.compositionstart=Hr.compositionupdate=t=>{t.observer.editContext||(null==t.inputState.compositionFirstChange&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},Hr.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Qi.chrome&&Qi.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))},Hr.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},Wr.beforeinput=(t,e)=>{var i,s;if("insertText"!=e.inputType&&"insertCompositionText"!=e.inputType||(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),"insertReplacementText"==e.inputType&&t.observer.editContext){let s=null===(i=e.dataTransfer)||void 0===i?void 0:i.getData("text/plain"),n=e.getTargetRanges();if(s&&n.length){let e=n[0],i=t.posAtDOM(e.startContainer,e.startOffset),r=t.posAtDOM(e.endContainer,e.endOffset);return Mr(t,{from:i,to:r,insert:t.state.toText(s)},null),!0}}let n;if(Qi.chrome&&Qi.android&&(n=Br.find(t=>t.inputType==e.inputType))&&(t.observer.delayAndroidKey(n.key,n.keyCode),"Backspace"==n.key||"Delete"==n.key)){let e=(null===(s=window.visualViewport)||void 0===s?void 0:s.height)||0;setTimeout(()=>{var i;((null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0)>e+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Qi.ios&&"deleteContentForward"==e.inputType&&t.observer.flushSoon(),Qi.safari&&"insertText"==e.inputType&&t.inputState.composing>=0&&setTimeout(()=>Hr.compositionend(t,e),20),!1};const Zr=new Set;const to=["pre-wrap","normal","pre-line","break-spaces"];let eo=!1;function io(){eo=!1}class so{constructor(t){this.lineWrapping=t,this.doc=Ft.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){if(!this.lineWrapping)return this.lineHeight;return(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return to.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i-1,l=Math.abs(e-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=e,this.charWidth=i,this.textHeight=s,this.lineLength=n,l){this.heightSamples={};for(let t=0;t0}set outdated(t){this.flags=(t?2:0)|-3&this.flags}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>lo&&(eo=!0),this.height=t)}replace(t,e,i){return ao.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,s){let n=this,r=i.doc;for(let o=s.length-1;o>=0;o--){let{fromA:l,toA:a,fromB:h,toB:c}=s[o],u=n.lineAt(l,oo.ByPosNoHeight,i.setDoc(e),0,0),f=u.to>=a?u:n.lineAt(a,oo.ByPosNoHeight,i,0,0);for(c+=f.to-a,a=f.to;o>0&&u.from<=s[o-1].toA;)l=s[o-1].fromA,h=s[o-1].fromB,o--,l2*n){let n=t[e-1];n.break?t.splice(--e,1,n.left,null,n.right):t.splice(--e,1,n.left,n.right),i+=1+n.break,s-=n.size}else{if(!(n>2*s))break;{let e=t[i];e.break?t.splice(i,1,e.left,null,e.right):t.splice(i,1,e.left,e.right),i+=2+e.break,n-=e.size}}else if(s=n&&r(this.lineAt(0,oo.ByPos,i,s,n))}setMeasuredHeight(t){let e=t.heights[t.index++];e<0?(this.spaceAbove=-e,e=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(e)}updateHeight(t,e=0,i=!1,s){return s&&s.from<=e&&s.more&&this.setMeasuredHeight(s),this.outdated=!1,this}toString(){return`block(${this.length})`}}class fo extends uo{constructor(t,e,i){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(t,e){return new ro(e,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,e,i){let s=i[0];return 1==i.length&&(s instanceof fo||s instanceof po&&4&s.flags)&&Math.abs(this.length-s.length)<10?(s instanceof po?s=new fo(s.length,this.height,this.spaceAbove):s.height=this.height,this.outdated||(s.outdated=!1),s):ao.of(i)}updateHeight(t,e=0,i=!1,s){return s&&s.from<=e&&s.more?this.setMeasuredHeight(s):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class po extends ao{constructor(t){super(t,0)}heightMetrics(t,e){let i,s=t.doc.lineAt(e).number,n=t.doc.lineAt(e+this.length).number,r=n-s+1,o=0;if(t.lineWrapping){let e=Math.min(this.height,t.lineHeight*r);i=e/r,this.length>r+1&&(o=(this.height-e)/(this.length-r-1))}else i=this.height/r;return{firstLine:s,lastLine:n,perLine:i,perChar:o}}blockAt(t,e,i,s){let{firstLine:n,lastLine:r,perLine:o,perChar:l}=this.heightMetrics(e,s);if(e.lineWrapping){let n=s+(t0){let t=i[i.length-1];t instanceof po?i[i.length-1]=new po(t.length+s):i.push(null,new po(s-1))}if(t>0){let e=i[0];e instanceof po?i[0]=new po(t+e.length):i.unshift(new po(t-1),null)}return ao.of(i)}decomposeLeft(t,e){e.push(new po(t-1),null)}decomposeRight(t,e){e.push(null,new po(this.length-t-1))}updateHeight(t,e=0,i=!1,s){let n=e+this.length;if(s&&s.from<=e+this.length&&s.more){let i=[],r=Math.max(e,s.from),o=-1;for(s.from>e&&i.push(new po(s.from-e-1).updateHeight(t,e));r<=n&&s.more;){let e=t.doc.lineAt(r).length;i.length&&i.push(null);let n=s.heights[s.index++],l=0;n<0&&(l=-n,n=s.heights[s.index++]),-1==o?o=n:Math.abs(n-o)>=lo&&(o=-2);let a=new fo(e,n,l);a.outdated=!1,i.push(a),r+=e+1}r<=n&&i.push(null,new po(n-r).updateHeight(t,r));let l=ao.of(i);return(o<0||Math.abs(l.height-this.height)>=lo||Math.abs(o-this.heightMetrics(t,e).perLine)>=lo)&&(eo=!0),ho(this,l)}return(i||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class mo extends ao{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return 1&this.flags}blockAt(t,e,i,s){let n=i+this.left.height;return to))return a;let h=e==oo.ByPosNoHeight?oo.ByPosNoHeight:oo.ByPos;return l?a.join(this.right.lineAt(o,h,i,r,o)):this.left.lineAt(o,h,i,s,n).join(a)}forEachLine(t,e,i,s,n,r){let o=s+this.left.height,l=n+this.left.length+this.break;if(this.break)t=l&&this.right.forEachLine(t,e,i,o,l,r);else{let a=this.lineAt(l,oo.ByPos,i,s,n);t=t&&a.from<=e&&r(a),e>a.to&&this.right.forEachLine(a.to+1,e,i,o,l,r)}}replace(t,e,i){let s=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-s,e-s,i));let n=[];t>0&&this.decomposeLeft(t,n);let r=n.length;for(let t of i)n.push(t);if(t>0&&go(n,r-1),e=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,s=i+this.break;if(t>=s)return this.right.decomposeRight(t-s,e);t2*e.size||e.size>2*t.size?ao.of(this.break?[t,null,e]:[t,e]):(this.left=ho(this.left,t),this.right=ho(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,s){let{left:n,right:r}=this,o=e+n.length+this.break,l=null;return s&&s.from<=e+n.length&&s.more?l=n=n.updateHeight(t,e,i,s):n.updateHeight(t,e,i),s&&s.from<=o+r.length&&s.more?l=r=r.updateHeight(t,o,i,s):r.updateHeight(t,o,i),l?this.balanced(n,r):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function go(t,e){let i,s;null==t[e]&&(i=t[e-1])instanceof po&&(s=t[e+1])instanceof po&&t.splice(e-1,3,new po(i.length+1+s.length))}class vo{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let t=Math.min(e,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof fo?i.length+=t-this.pos:(t>this.pos||!this.isCovered)&&this.nodes.push(new fo(t-this.pos,-1,0)),this.writtenTo=t,e>t&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t=5)&&this.addLineDeco(s,n,r)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTot&&this.nodes.push(new fo(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,e){let i=new po(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof fo)return t;let e=new fo(0,-1,0);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,t),s.breaks+=e,this.writtenTo=this.pos=this.pos+i}finish(t){let e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof fo||this.isCovered?(this.writtenToi.clientHeight||i.scrollWidth>i.clientWidth)&&"visible"!=s.overflow){let s=i.getBoundingClientRect();r=Math.max(r,s.left),o=Math.min(o,s.right),l=Math.max(l,s.top),a=Math.min(e==t.parentNode?n.innerHeight:a,s.bottom)}e="absolute"==s.position||"fixed"==s.position?i.offsetParent:i.parentNode}else{if(11!=e.nodeType)break;e=e.host}return{left:r-i.left,right:Math.max(r,o)-i.left,top:l-(i.top+e),bottom:Math.max(l,a)-(i.top+e)}}function yo(t,e){let i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)}}class xo{constructor(t,e,i,s){this.from=t,this.to=e,this.size=i,this.displaySize=s}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;i"function"!=typeof t&&"cm-lineWrapping"==t.class);this.heightOracle=new so(i),this.stateDeco=To(e),this.heightMap=ao.empty().applyChanges(this.stateDeco,Ft.empty,this.heightOracle.setDoc(e.doc),[new Bn(0,0,0,e.doc.length)]);for(let t=0;t<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());t++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=ss.set(this.lineGaps.map(t=>t.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let s=i?e.head:e.anchor;if(!t.some(({from:t,to:e})=>s>=t&&s<=e)){let{from:e,to:i}=this.lineBlockAt(s);t.push(new Co(e,i))}}return this.viewports=t.sort((t,e)=>t.from-e.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?Oo:new Do(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(Ro(t,this.scaler))})}update(t,e=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=To(this.state);let s=t.changedRanges,n=Bn.extendWithRanges(s,function(t,e,i){let s=new wo;return hi.compare(t,e,i,s,0),s.changes}(i,this.stateDeco,t?t.changes:se.empty(this.state.doc.length))),r=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);io(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),n),(this.heightMap.height!=r||eo)&&(t.flags|=2),o?(this.scrollAnchorPos=t.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=r);let l=n.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,e));let a=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,t.flags|=this.updateForViewport(),(a||!t.changes.empty||2&t.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(cn)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,e=t.contentDOM,i=window.getComputedStyle(e),s=this.heightOracle,n=i.whiteSpace;this.defaultTextDirection="rtl"==i.direction?Es.RTL:Es.LTR;let r=this.heightOracle.mustRefreshForWrapping(n)||"refresh"===this.mustMeasureContent,o=e.getBoundingClientRect(),l=r||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let a=0,h=0;if(o.width&&o.height){let{scaleX:t,scaleY:i}=xs(e,o);(t>.005&&Math.abs(this.scaleX-t)>.005||i>.005&&Math.abs(this.scaleY-i)>.005)&&(this.scaleX=t,this.scaleY=i,a|=16,r=l=!0)}let c=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;this.paddingTop==c&&this.paddingBottom==u||(this.paddingTop=c,this.paddingBottom=u,a|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(s.lineWrapping&&(l=!0),this.editorWidth=t.scrollDOM.clientWidth,a|=16);let f=ks(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let d=this.getScrollOffset();this.scrollOffset!=d&&(this.scrollAnchorHeight=-1,this.scrollOffset=d),this.scrolledToBottom=Ds(this.scrollParent||t.win);let p=(this.printing?yo:bo)(e,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(l=!0)),!this.inView&&!this.scrollTarget&&!function(t){let e=t.getBoundingClientRect(),i=t.ownerDocument.defaultView||window;return e.left0&&e.top0}(t.dom))return 0;let w=o.width;if(this.contentDOMWidth==w&&this.editorHeight==t.scrollDOM.clientHeight||(this.contentDOMWidth=o.width,this.editorHeight=t.scrollDOM.clientHeight,a|=16),l){let e=t.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(e)&&(r=!0),r||s.lineWrapping&&Math.abs(w-this.contentDOMWidth)>s.charWidth){let{lineHeight:i,charWidth:o,textHeight:l}=t.docView.measureTextSize();r=i>0&&s.refresh(n,i,o,l,Math.max(5,w/o),e),r&&(t.docView.minWidth=0,a|=16)}m>0&&g>0?h=Math.max(m,g):m<0&&g<0&&(h=Math.min(m,g)),io();for(let i of this.viewports){let n=i.from==this.viewport.from?e:t.docView.measureVisibleLineHeights(i);this.heightMap=(r?ao.empty().applyChanges(this.stateDeco,Ft.empty,this.heightOracle,[new Bn(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(s,0,r,new no(i.from,n))}eo&&(a|=2)}let b=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return b&&(2&a&&(a|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),a|=this.updateForViewport()),(2&a||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(r?[]:this.lineGaps,t)),a|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),a}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),s=this.heightMap,n=this.heightOracle,{visibleTop:r,visibleBottom:o}=this,l=new Co(s.lineAt(r-1e3*i,oo.ByHeight,n,0,0).from,s.lineAt(o+1e3*(1-i),oo.ByHeight,n,0,0).to);if(e){let{head:t}=e.range;if(tl.to){let i,r=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),o=s.lineAt(t,oo.ByPos,n,0,0);i="center"==e.y?(o.top+o.bottom)/2-r/2:"start"==e.y||"nearest"==e.y&&t=o+Math.max(10,Math.min(i,250)))&&s>r-2e3&&n>1,r=s<<1;if(this.defaultTextDirection!=Es.LTR&&!i)return[];let o=[],l=(s,r,a,h)=>{if(r-ss&&tt.from>=a.from&&t.to<=a.to&&Math.abs(t.from-s)t.frome));if(!f){if(rt.from<=r&&t.to>=r)){let t=e.moveToLineBoundary(ue.cursor(r),!1,!0).head;t>s&&(r=t)}let t=this.gapSize(a,s,r,h);f=new xo(s,r,t,i||t<2e6?t:2e6)}o.push(f)},a=e=>{if(e.lengthn&&(s.push({from:n,to:t}),r+=t-n),n=e}},20),n2e6)for(let i of t)i.from>=e.from&&i.frome.from&&l(e.from,o,e,n),at.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let i=[];hi.spans(e,this.viewport.from,this.viewport.to,{span(t,e){i.push({from:t,to:e})},point(){}},20);let s=0;if(i.length!=this.visibleRanges.length)s=12;else for(let e=0;e=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(e=>e.from<=t&&e.to>=t)||Ro(this.heightMap.lineAt(t,oo.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(e=>e.top<=t&&e.bottom>=t)||Ro(this.heightMap.lineAt(this.scaler.fromDOM(t),oo.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return Ro(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Co{constructor(t,e){this.from=t,this.to=e}}function Ao({total:t,ranges:e},i){if(i<=0)return e[0].from;if(i>=1)return e[e.length-1].to;let s=Math.floor(t*i);for(let t=0;;t++){let{from:i,to:n}=e[t],r=n-i;if(s<=r)return i+s;s-=r}}function Mo(t,e){let i=0;for(let{from:s,to:n}of t.ranges){if(e<=n){i+=e-s;break}i+=n-s}return i/t.total}const Oo={toDOM:t=>t,fromDOM:t=>t,scale:1,eq(t){return t==this}};function To(t){let e=t.facet(Sn).filter(t=>"function"!=typeof t),i=t.facet(An).filter(t=>"function"!=typeof t);return i.length&&e.push(hi.join(i)),e}class Do{constructor(t,e,i){let s=0,n=0,r=0;this.viewports=i.map(({from:i,to:n})=>{let r=e.lineAt(i,oo.ByPos,t,0,0).top,o=e.lineAt(n,oo.ByPos,t,0,0).bottom;return s+=o-r,{from:i,to:n,top:r,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(e.height-s);for(let t of this.viewports)t.domTop=r+(t.top-n)*this.scale,r=t.domBottom=t.domTop+(t.bottom-t.top),n=t.bottom}toDOM(t){for(let e=0,i=0,s=0;;e++){let n=ee.from==t.viewports[i].from&&e.to==t.viewports[i].to))}}function Ro(t,e){if(1==e.scale)return t;let i=e.toDOM(t.top),s=e.toDOM(t.bottom);return new ro(t.from,t.length,i,s-i,Array.isArray(t._content)?t._content.map(t=>Ro(t,e)):t._content)}const Po=pe.define({combine:t=>t.join(" ")}),Bo=pe.define({combine:t=>t.indexOf(!0)>-1}),Eo=Oi.newName(),Lo=Oi.newName(),No=Oi.newName(),Io={"&light":"."+Lo,"&dark":"."+No};function Wo(t,e,i){return new Oi(e,{finish:e=>/&/.test(e)?e.replace(/&\w*/,e=>{if("&"==e)return t;if(!i||!i[e])throw new RangeError(`Unsupported selector: ${e}`);return i[e]}):t+" "+e})}const Ho=Wo("."+Eo,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Io),Vo={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Fo=Qi.ie&&Qi.ie_version<=11;class zo{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new Ss,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(e=>{for(let t of e)this.queue.push(t);(Qi.ie&&Qi.ie_version<=11||Qi.ios&&t.composing)&&e.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),!window.EditContext||!Qi.android||!1===t.constructor.EDIT_CONTEXT||Qi.chrome&&Qi.chrome_version<126||(this.editContext=new $o(t),t.state.facet(gn)&&(t.contentDOM.editContext=this.editContext.editContext)),Fo&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(()=>{var t;(null===(t=this.view.docView)||void 0===t?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){("change"!=t.type&&t.type||t.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((e,i)=>e!=t[i]))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(gn)?i.root.activeElement!=this.dom:!fs(this.dom,s))return;let n=s.anchorNode&&i.docView.tile.nearest(s.anchorNode);n&&n.isWidget()&&n.widget.ignoreEvent(t)?e||(this.selectionChanged=!1):(Qi.ie&&Qi.ie_version<=11||Qi.android&&Qi.chrome)&&!i.state.selection.main.empty&&s.focusNode&&ps(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=cs(t.root);if(!e)return!1;let i=Qi.safari&&11==t.root.nodeType&&t.root.activeElement==this.dom&&function(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return _o(t,i)}let i=null;function s(t){t.preventDefault(),t.stopImmediatePropagation(),i=t.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",s,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",s,!0),i?_o(t,i):null}(this.view,e)||e;if(!i||this.selectionRange.eq(i))return!1;let s=fs(this.dom,i);return s&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let t=this.delayedAndroidKey;if(t){this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=t.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&t.force&&Ts(this.dom,t.key,t.keyCode)}};this.flushingAndroidKey=this.view.win.requestAnimationFrame(t)}this.delayedAndroidKey&&"Enter"!=t||(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,i=-1,s=!1;for(let n of t){let t=this.readMutation(n);t&&(t.typeOver&&(s=!0),-1==e?({from:e,to:i}=t):(e=Math.min(t.from,e),i=Math.max(t.to,i)))}return{from:e,to:i,typeOver:s}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),s=this.selectionChanged&&fs(this.dom,this.selectionRange);if(t<0&&!s)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let n=new Sr(this.view,t,e,i);return this.view.docView.domChanged={newSel:n.newSel?n.newSel.main:null},n}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let i=this.view.state,s=Ar(this.view,e);return this.view.state==i&&(e.domChanged||e.newSel&&!Tr(this.view.state.selection,e.newSel.main))&&this.view.update([]),s}readMutation(t){let e=this.view.docView.tile.nearest(t.target);if(!e||e.isWidget())return null;if(e.markDirty("attributes"==t.type),"childList"==t.type){let i=qo(e,t.previousSibling||t.target.previousSibling,-1),s=qo(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:s?e.posBefore(s):e.posAtEnd,typeOver:!1}}return"characterData"==t.type?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(gn)!=t.state.facet(gn)&&(t.view.contentDOM.editContext=t.state.facet(gn)?this.editContext.editContext:null))}destroy(){var t,e,i;this.stop(),null===(t=this.intersection)||void 0===t||t.disconnect(),null===(e=this.gapIntersection)||void 0===e||e.disconnect(),null===(i=this.resizeScroll)||void 0===i||i.disconnect();for(let t of this.scrollTargets)t.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function qo(t,e,i){for(;e;){let s=Nn.get(e);if(s&&s.parent==t)return s;let n=e.parentNode;e=n!=t.dom?n:i>0?e.nextSibling:e.previousSibling}return null}function _o(t,e){let i=e.startContainer,s=e.startOffset,n=e.endContainer,r=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return ps(o.node,o.offset,n,r)&&([i,s,n,r]=[n,r,i,s]),{anchorNode:i,anchorOffset:s,focusNode:n,focusOffset:r}}class $o{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let s=t.state.selection.main,{anchor:n,head:r}=s,o=this.toEditorPos(i.updateRangeStart),l=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:o,drifted:!1});let a=l-o>i.text.length;o==this.from&&nthis.to&&(l=n);let h=Or(t.state.sliceDoc(o,l),i.text,(a?s.from:s.to)-o,a?"end":null);if(!h){let e=ue.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));return void(Tr(e,s)||t.dispatch({selection:e,userEvent:"select"}))}let c={from:h.from+o,to:h.toA+o,insert:Ft.of(i.text.slice(h.from,h.toB).split("\n"))};if((Qi.mac||Qi.android)&&c.from==r-1&&/^\. ?$/.test(i.text)&&"off"==t.contentDOM.getAttribute("autocorrect")&&(c={from:o,to:l,insert:Ft.of([i.text.replace("."," ")])}),this.pendingContextChange=c,!t.state.readOnly){let e=this.to-this.from+(c.to-c.from+c.insert.length);Mr(t,c,ue.single(this.toEditorPos(i.selectionStart,e),this.toEditorPos(i.selectionEnd,e)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),c.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(e.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(e.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let s=[],n=null;for(let e=this.toEditorPos(i.rangeStart),r=this.toEditorPos(i.rangeEnd);e{let i=[];for(let t of e.getTextFormats()){let e=t.underlineStyle,s=t.underlineThickness;if(!/none/i.test(e)&&!/none/i.test(s)){let n=this.toEditorPos(t.rangeStart),r=this.toEditorPos(t.rangeEnd);if(n{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:e}=this.composing;this.composing=null,e&&this.reset(t.state)}};for(let t in this.handlers)e.addEventListener(t,this.handlers[t]);this.measureReq={read:t=>{this.editContext.updateControlBounds(t.contentDOM.getBoundingClientRect());let e=cs(t.root);e&&e.rangeCount&&this.editContext.updateSelectionBounds(e.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,i=!1,s=this.pendingContextChange;return t.changes.iterChanges((n,r,o,l,a)=>{if(i)return;let h=a.length-(r-n);if(s&&r>=s.to){if(s.from==n&&s.to==r&&s.insert.eq(a))return s=this.pendingContextChange=null,e+=h,void(this.to+=h);s=null,this.revertPending(t.state)}if(n+=e,(r+=e)<=this.from)this.from+=h,this.to+=h;else if(nthis.to||this.to-this.from+a.length>3e4)return void(i=!0);this.editContext.updateText(this.toContextPos(n),this.toContextPos(r),a.toString()),this.to+=h}e+=h}),s&&!i&&this.revertPending(t.state),!i}update(t){let e=this.pendingContextChange,i=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some(t=>!t.isUserEvent("input.type")&&t.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):this.applyEdits(t)&&this.rangeIsValid(t.state)?(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state):(this.pendingContextChange=null,this.reset(t.state)),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),s=this.toContextPos(e.head);this.editContext.selectionStart==i&&this.editContext.selectionEnd==s||this.editContext.updateSelection(i,s)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to3e4)}toEditorPos(t,e=this.to-this.from){t=Math.min(t,e);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let e=this.composing;return e&&e.drifted?e.contextBase+(t-e.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class jo{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var e;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(t=>t.forEach(t=>i(t,this)))||(t=>this.update(t)),this.dispatch=this.dispatch.bind(this),this._root=t.root||function(t){for(;t;){if(t&&(9==t.nodeType||11==t.nodeType&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}(t.parent)||document,this.viewState=new So(this,t.state||ii.create(t)),t.scrollTo&&t.scrollTo.is(dn)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(wn).map(t=>new yn(t));for(let t of this.plugins)t.update(this);this.observer=new zo(this),this.inputState=new Dr(this),this.inputState.ensureHandlers(this.plugins),this.docView=new nr(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(e=document.fonts)||void 0===e?void 0:e.ready)&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let e=1==t.length&&t[0]instanceof je?t:1==t.length&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e,i=!1,s=!1,n=this.state;for(let e of t){if(e.startState!=n)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");n=e.state}if(this.destroyed)return void(this.viewState.state=n);let r=this.hasFocus,o=0,l=null;t.some(t=>t.annotation(Gr))?(this.inputState.notifiedFocused=r,o=1):r!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=r,l=Xr(n,r),l||(o=1));let a=this.observer.delayedAndroidKey,h=null;if(a?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(n.doc)||!this.state.selection.eq(n.selection))&&(h=null)):this.observer.clear(),n.facet(ii.phrases)!=this.state.facet(ii.phrases))return this.setState(n);e=En.create(this,n,t),e.flags|=o;let c=this.viewState.scrollTarget;try{this.updateState=2;for(let e of t){if(c&&(c=c.map(e.changes)),e.scrollIntoView){let{main:t}=e.state.selection,{x:i,y:s}=this.state.facet(jo.cursorScrollMargin);c=new fn(t.empty?t:ue.cursor(t.head,t.head>t.anchor?-1:1),"nearest","nearest",s,i)}for(let t of e.effects)t.is(dn)&&(c=t.value.clip(this.state))}this.viewState.update(e,c),this.bidiCache=Yo.update(this.bidiCache,e.changes),e.empty||(this.updatePlugins(e),this.inputState.update(e)),i=this.docView.update(e),this.state.facet(Pn)!=this.styleModules&&this.mountStyles(),s=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(i,t.some(t=>t.isUserEvent("select.pointer")))}finally{this.updateState=0}if(e.startState.facet(Po)!=e.state.facet(Po)&&(this.viewState.mustMeasureContent=!0),(i||s||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),i&&this.docViewUpdate(),!e.empty)for(let t of this.state.facet(nn))try{t(e)}catch(t){mn(this.state,t,"update listener")}(l||h)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),h&&!Ar(this,h)&&a.force&&Ts(this.contentDOM,a.key,a.keyCode)})}setState(t){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=t);this.updateState=2;let e=this.hasFocus;try{for(let t of this.plugins)t.destroy(this);this.viewState=new So(this,t),this.plugins=t.facet(wn).map(t=>new yn(t)),this.pluginMap.clear();for(let t of this.plugins)t.update(this);this.docView.destroy(),this.docView=new nr(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(wn),i=t.state.facet(wn);if(e!=i){let s=[];for(let n of i){let i=e.indexOf(n);if(i<0)s.push(new yn(n));else{let e=this.plugins[i];e.mustUpdate=t,s.push(e)}}for(let e of this.plugins)e.mustUpdate!=t&&e.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let e of this.plugins)e.mustUpdate=t;for(let t=0;t-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,i=this.viewState.scrollParent,s=this.viewState.getScrollOffset(),{scrollAnchorPos:n,scrollAnchorHeight:r}=this.viewState;Math.abs(s-this.viewState.scrollOffset)>1&&(r=-1),this.viewState.scrollAnchorHeight=-1;try{for(let t=0;;t++){if(r<0)if(Ds(i||this.win))n=-1,r=this.viewState.heightMap.height;else{let t=this.viewState.scrollAnchorAt(s);n=t.from,r=t.top}this.updateState=1;let o=this.viewState.measure();if(!o&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(t>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let l=[];4&o||([this.measureRequests,l]=[l,this.measureRequests]);let a=l.map(t=>{try{return t.read(this)}catch(t){return mn(this.state,t),Uo}}),h=En.create(this,this.state,[]),c=!1;h.flags|=o,e?e.flags|=o:e=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),c=this.docView.update(h),c&&this.docViewUpdate());for(let t=0;t1||t<-1)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){s+=t,i?i.scrollTop+=t:this.win.scrollBy(0,t),r=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let t of this.state.facet(nn))t(e)}get themeClasses(){return Eo+" "+(this.state.facet(Bo)?No:Lo)+" "+this.state.facet(Po)}updateAttrs(){let t=Qo(this,xn,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(gn)?"true":"false",class:"cm-content",style:`${Qi.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),Qo(this,kn,e);let i=this.observer.ignore(()=>{let i=Zi(this.contentDOM,this.contentAttrs,e),s=Zi(this.dom,this.editorAttrs,t);return i||s});return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let t of i.effects)if(t.is(jo.announce)){e&&(this.announceDOM.textContent=""),e=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(Pn);let t=this.state.facet(jo.cspNonce);Oi.mount(this.root,this.styleModules.concat(Ho).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(null!=t.key)for(let e=0;ee.plugin==t)||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return pr(this,t,ur(this,t,e,i))}moveByGroup(t,e){return pr(this,t,ur(this,t,e,e=>function(t,e,i){let s=t.state.charCategorizer(e),n=s(i);return t=>{let e=s(t);return n==Je.Space&&(n=e),n==e}}(this,t.head,e)))}visualLineSide(t,e){let i=this.bidiSpans(t),s=this.textDirectionAt(t.from),n=i[e?i.length-1:0];return ue.cursor(n.side(e,s)+t.from,n.forward(!e,s)?1:-1)}moveToLineBoundary(t,e,i=!0){return function(t,e,i,s){let n=cr(t,e.head,e.assoc||-1),r=s&&n.type==is.Text&&(t.lineWrapping||n.widgetLineBreaks)?t.coordsAtPos(e.assoc<0&&e.head>n.from?e.head-1:e.head):null;if(r){let e=t.dom.getBoundingClientRect(),s=t.textDirectionAt(n.from),o=t.posAtCoords({x:i==(s==Es.LTR)?e.right-1:e.left+1,y:(r.top+r.bottom)/2});if(null!=o)return ue.cursor(o,i?-1:1)}return ue.cursor(i?n.to:n.from,i?-1:1)}(this,t,e,i)}moveVertically(t,e,i){return pr(this,t,function(t,e,i,s){let n=e.head,r=i?1:-1;if(n==(i?t.state.doc.length:0))return ue.cursor(n,e.assoc);let o,l=e.goalColumn,a=t.contentDOM.getBoundingClientRect(),h=t.coordsAtPos(n,e.assoc||((e.empty?i:e.head==e.from)?1:-1)),c=t.documentTop;if(h)null==l&&(l=h.left-a.left),o=r<0?h.top:h.bottom;else{let e=t.viewState.lineBlockAt(n);null==l&&(l=Math.min(a.right-a.left,t.defaultCharacterWidth*(n-e.from))),o=(r<0?e.top:e.bottom)+c}let u=a.left+l,f=t.viewState.heightOracle.textHeight>>1,d=null!=s?s:f;for(let e=0;;e+=f){let s=o+(d+e)*r,n=gr(t,{x:u,y:s},!1,r);if(i?s>a.bottom:so:c0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(hn)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>Ko)return Qs(t.length);let e,i=this.textDirectionAt(t.from);for(let s of this.bidiCache)if(s.from==t.from&&s.dir==i&&(s.fresh||$s(s.isolates,e=Tn(this,t))))return s.order;e||(e=Tn(this,t));let s=Ys(t.text,i,e);return this.bidiCache.push(new Yo(t.from,t.to,i,e,!0,s)),s}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||Qi.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Ms(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((9==t.nodeType?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){var i,s,n,r;return dn.of(new fn("number"==typeof t?ue.cursor(t):t,null!==(i=e.y)&&void 0!==i?i:"nearest",null!==(s=e.x)&&void 0!==s?s:"nearest",null!==(n=e.yMargin)&&void 0!==n?n:5,null!==(r=e.xMargin)&&void 0!==r?r:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return dn.of(new fn(ue.cursor(i.from),"start","start",i.top-t,e,!0))}setTabFocusMode(t){null==t?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof t?this.inputState.tabFocusMode=t?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return bn.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return bn.define(()=>({}),{eventObservers:t})}static theme(t,e){let i=Oi.newName(),s=[Po.of(i),Pn.of(Wo(`.${i}`,t))];return e&&e.dark&&s.push(Bo.of(!0)),s}static baseTheme(t){return Oe.lowest(Pn.of(Wo("."+Eo,t,Io)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),s=i&&Nn.get(i)||Nn.get(t);return(null===(e=null==s?void 0:s.root)||void 0===e?void 0:e.view)||null}}jo.styleModule=Pn,jo.inputHandler=rn,jo.clipboardInputFilter=ln,jo.clipboardOutputFilter=an,jo.scrollHandler=un,jo.focusChangeEffect=on,jo.perLineTextDirection=hn,jo.exceptionSink=sn,jo.updateListener=nn,jo.editable=gn,jo.mouseSelectionStyle=en,jo.dragMovesSelection=tn,jo.clickAddsSelectionRange=Zs,jo.decorations=Sn,jo.blockWrappers=Cn,jo.outerDecorations=An,jo.atomicRanges=Mn,jo.bidiIsolatedRanges=On,jo.cursorScrollMargin=pe.define({combine:t=>{let e=5,i=5;for(let s of t)"number"==typeof s?e=i=s:({x:e,y:i}=s);return{x:e,y:i}}}),jo.scrollMargins=Dn,jo.darkTheme=Bo,jo.cspNonce=pe.define({combine:t=>t.length?t[0]:""}),jo.contentAttributes=kn,jo.editorAttributes=xn,jo.lineWrapping=jo.contentAttributes.of({class:"cm-lineWrapping"}),jo.announce=$e.define();const Ko=4096,Uo={};class Yo{constructor(t,e,i,s,n,r){this.from=t,this.to=e,this.dir=i,this.isolates=s,this.fresh=n,this.order=r}static update(t,e){if(e.empty&&!t.some(t=>t.fresh))return t;let i=[],s=t.length?t[t.length-1].dir:Es.LTR;for(let n=Math.max(0,t.length-10);n=0;n--){let e=s[n],r="function"==typeof e?e(t):e;r&&Gi(r,i)}return i}const Go=Qi.mac?"mac":Qi.windows?"win":Qi.linux?"linux":"key";function Xo(t,e,i){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==i&&e.shiftKey&&(t="Shift-"+t),t}const Jo=Oe.default(jo.domEventHandlers({keydown:(t,e)=>rl(el(e.state),t,e,"editor")})),Zo=pe.define({enables:Jo}),tl=new WeakMap;function el(t){let e=t.facet(Zo),i=tl.get(e);return i||tl.set(e,i=function(t,e=Go){let i=Object.create(null),s=Object.create(null),n=(t,e)=>{let i=s[t];if(null==i)s[t]=e;else if(i!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},r=(t,s,r,o,l)=>{var a,h;let c=i[t]||(i[t]=Object.create(null)),u=s.split(/ (?!$)/).map(t=>function(t,e){const i=t.split(/-(?!$)/);let s,n,r,o,l=i[i.length-1];"Space"==l&&(l=" ");for(let t=0;t{let s=il={view:e,prefix:i,scope:t};return setTimeout(()=>{il==s&&(il=null)},sl),!0}]})}let f=u.join(" ");n(f,!1);let d=c[f]||(c[f]={preventDefault:!1,stopPropagation:!1,run:(null===(h=null===(a=c._any)||void 0===a?void 0:a.run)||void 0===h?void 0:h.slice())||[]});r&&d.run.push(r),o&&(d.preventDefault=!0),l&&(d.stopPropagation=!0)};for(let s of t){let t=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let e of t){let t=i[e]||(i[e]=Object.create(null));t._any||(t._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:n}=s;for(let e in t)t[e].run.push(t=>n(t,nl))}let n=s[e]||s.key;if(n)for(let e of t)r(e,n,s.run,s.preventDefault,s.stopPropagation),s.shift&&r(e,"Shift-"+n,s.shift,s.preventDefault,s.stopPropagation)}return i}(e.reduce((t,e)=>t.concat(e),[]))),i}let il=null;const sl=4e3;let nl=null;function rl(t,e,i,s){nl=e;let n=function(t){var e=!(Bi&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Ei&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?Pi:Ri)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(e),r=Zt(Xt(n,0))==n.length&&" "!=n,o="",l=!1,a=!1,h=!1;il&&il.view==i&&il.scope==s&&(o=il.prefix+" ",Lr.indexOf(e.keyCode)<0&&(a=!0,il=null));let c,u,f=new Set,d=t=>{if(t){for(let e of t.run)if(!f.has(e)&&(f.add(e),e(i)))return t.stopPropagation&&(h=!0),!0;t.preventDefault&&(t.stopPropagation&&(h=!0),a=!0)}return!1},p=t[s];return p&&(d(p[o+Xo(n,e,!r)])?l=!0:!r||!(e.altKey||e.metaKey||e.ctrlKey)||Qi.windows&&e.ctrlKey&&e.altKey||Qi.mac&&e.altKey&&!e.ctrlKey&&!e.metaKey||!(c=Ri[e.keyCode])||c==n?r&&e.shiftKey&&d(p[o+Xo(n,e,!0)])&&(l=!0):(d(p[o+Xo(c,e,!0)])||e.shiftKey&&(u=Pi[e.keyCode])!=n&&u!=c&&d(p[o+Xo(u,e,!1)]))&&(l=!0),!l&&d(p._any)&&(l=!0)),a&&(l=!0),l&&h&&e.stopPropagation(),nl=null,l}class ol{constructor(t,e,i,s,n){this.className=t,this.left=e,this.top=i,this.width=s,this.height=n}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,e){return e.className==this.className&&(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",null!=this.width&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,i){if(i.empty){let s=t.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let n=ll(t);return[new ol(e,s.left-n.left,s.top-n.top,null,s.bottom-s.top)]}return function(t,e,i){if(i.to<=t.viewport.from||i.from>=t.viewport.to)return[];let s=Math.max(i.from,t.viewport.from),n=Math.min(i.to,t.viewport.to),r=t.textDirection==Es.LTR,o=t.contentDOM,l=o.getBoundingClientRect(),a=ll(t),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),u=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),f=l.right-(c?parseInt(c.paddingRight):0),d=cr(t,s,1),p=cr(t,n,-1),m=d.type==is.Text?d:null,g=p.type==is.Text?p:null;m&&(t.lineWrapping||d.widgetLineBreaks)&&(m=al(t,s,1,m));g&&(t.lineWrapping||p.widgetLineBreaks)&&(g=al(t,n,-1,g));if(m&&g&&m.from==g.from&&m.to==g.to)return w(b(i.from,i.to,m));{let e=m?b(i.from,null,m):y(d,!1),s=g?b(null,i.to,g):y(p,!0),n=[];return(m||d).to<(g||p).from-(m&&g?1:0)||d.widgetLineBreaks>1&&e.bottom+t.defaultLineHeight/2h&&s.from=r)break;l>n&&a(Math.max(t,n),null==e&&t<=h,Math.min(l,r),null==i&&l>=c,o.dir)}if(n=s.to+1,n>=r)break}return 0==l.length&&a(h,null==e,c,null==i,t.textDirection),{top:n,bottom:o,horizontal:l}}function y(t,e){let i=l.top+(e?t.top:t.bottom);return{top:i,bottom:i,horizontal:[]}}}(t,e,i)}}function ll(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Es.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function al(t,e,i,s){let n=t.coordsAtPos(e,2*i);if(!n)return s;let r=t.dom.getBoundingClientRect(),o=(n.top+n.bottom)/2,l=t.posAtCoords({x:r.left+1,y:o}),a=t.posAtCoords({x:r.right-1,y:o});return null==l||null==a?s:{from:Math.max(s.from,Math.min(l,a)),to:Math.min(s.to,Math.max(l,a))}}class hl{constructor(t,e){this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e.class&&this.dom.classList.add(e.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t)}update(t){t.startState.facet(cl)!=t.state.facet(cl)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){!1!==this.layer.updateOnDocViewUpdate&&t.requestMeasure(this.measureReq)}setOrder(t){let e=0,i=t.facet(cl);for(;e{return i=t,s=this.drawn[e],!(i.constructor==s.constructor&&i.eq(s));var i,s})){let e=this.dom.firstChild,i=0;for(let s of t)s.update&&e&&s.constructor&&this.drawn[i].constructor&&s.update(e,this.drawn[i])?(e=e.nextSibling,i++):this.dom.insertBefore(s.draw(),e);for(;e;){let t=e.nextSibling;e.remove(),e=t}this.drawn=t,Qi.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const cl=pe.define();function ul(t){return[bn.define(e=>new hl(e,t)),cl.of(t)]}const fl=pe.define({combine:t=>si(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})});function dl(t={}){return[fl.of(t),ml,vl,wl,cn.of(!0)]}function pl(t){return t.startState.facet(fl)!=t.state.facet(fl)}const ml=ul({above:!0,markers(t){let{state:e}=t,i=e.facet(fl),s=[];for(let n of e.selection.ranges){let r=n==e.selection.main;if(n.empty||i.drawRangeCursor&&!(r&&Qi.ios&&i.iosSelectionHandles)){let e=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",i=n.empty?n:ue.cursor(n.head,n.assoc);for(let n of ol.forRange(t,e,i))s.push(n)}}return s},update(t,e){t.transactions.some(t=>t.selection)&&(e.style.animationName="cm-blink"==e.style.animationName?"cm-blink2":"cm-blink");let i=pl(t);return i&&gl(t.state,e),t.docChanged||t.selectionSet||i},mount(t,e){gl(e.state,t)},class:"cm-cursorLayer"});function gl(t,e){e.style.animationDuration=t.facet(fl).cursorBlinkRate+"ms"}const vl=ul({above:!1,markers(t){let e=[],{main:i,ranges:s}=t.state.selection;for(let i of s)if(!i.empty)for(let s of ol.forRange(t,"cm-selectionBackground",i))e.push(s);if(Qi.ios&&!i.empty&&t.state.facet(fl).iosSelectionHandles){for(let s of ol.forRange(t,"cm-selectionHandle cm-selectionHandle-start",ue.cursor(i.from,1)))e.push(s);for(let s of ol.forRange(t,"cm-selectionHandle cm-selectionHandle-end",ue.cursor(i.to,1)))e.push(s)}return e},update:(t,e)=>t.docChanged||t.selectionSet||t.viewportChanged||pl(t),class:"cm-selectionLayer"}),wl=Oe.highest(jo.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),bl=$e.define({map:(t,e)=>null==t?null:e.mapPos(t)}),yl=xe.define({create:()=>null,update:(t,e)=>(null!=t&&(t=e.changes.mapPos(t)),e.effects.reduce((t,e)=>e.is(bl)?e.value:t,t))}),xl=bn.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let i=t.state.field(yl);null==i?null!=this.cursor&&(null===(e=this.cursor)||void 0===e||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(yl)!=i||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(yl),i=null!=e&&t.coordsAtPos(e);if(!i)return null;let s=t.scrollDOM.getBoundingClientRect();return{left:i.left-s.left+t.scrollDOM.scrollLeft*t.scaleX,top:i.top-s.top+t.scrollDOM.scrollTop*t.scaleY,height:i.bottom-i.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:i}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/i+"px",this.cursor.style.height=t.height/i+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(yl)!=t&&this.view.dispatch({effects:bl.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){t.target!=this.view.contentDOM&&this.view.contentDOM.contains(t.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function kl(t,e,i,s,n){e.lastIndex=0;for(let r,o=t.iterRange(i,s),l=i;!o.next().done;l+=o.value.length)if(!o.lineBreak)for(;r=e.exec(o.value);)n(l+r.index,r)}class Sl{constructor(t){const{regexp:e,decoration:i,decorate:s,boundary:n,maxLength:r=1e3}=t;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,s)this.addMatch=(t,e,i,n)=>s(n,i,i+t[0].length,t,e);else if("function"==typeof i)this.addMatch=(t,e,s,n)=>{let r=i(t,e,s);r&&n(s,s+t[0].length,r)};else{if(!i)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(t,e,s,n)=>n(s,s+t[0].length,i)}this.boundary=n,this.maxLength=r}createDeco(t){let e=new ui,i=e.add.bind(e);for(let{from:e,to:s}of function(t,e){let i=t.visibleRanges;if(1==i.length&&i[0].from==t.viewport.from&&i[0].to==t.viewport.to)return i;let s=[];for(let{from:n,to:r}of i)n=Math.max(t.state.doc.lineAt(n).from,n-e),r=Math.min(t.state.doc.lineAt(r).to,r+e),s.length&&s[s.length-1].to>=n?s[s.length-1].to=r:s.push({from:n,to:r});return s}(t,this.maxLength))kl(t.state.doc,this.regexp,e,s,(e,s)=>this.addMatch(s,t,e,i));return e.finish()}updateDeco(t,e){let i=1e9,s=-1;return t.docChanged&&t.changes.iterChanges((e,n,r,o)=>{o>=t.view.viewport.from&&r<=t.view.viewport.to&&(i=Math.min(r,i),s=Math.max(o,s))}),t.viewportMoved||s-i>1e3?this.createDeco(t.view):s>-1?this.updateRange(t.view,e.map(t.changes),i,s):e}updateRange(t,e,i,s){for(let n of t.visibleRanges){let r=Math.max(n.from,i),o=Math.min(n.to,s);if(o>=r){let i=t.state.doc.lineAt(r),s=i.toi.from;r--)if(this.boundary.test(i.text[r-1-i.from])){l=r;break}for(;oc.push(i.range(t,e));if(i==s)for(this.regexp.lastIndex=l-i.from;(h=this.regexp.exec(i.text))&&h.indexthis.addMatch(i,t,e,u));e=e.update({filterFrom:l,filterTo:a,filter:(t,e)=>ta,add:c})}}return e}}const Cl=null!=/x/.unicode?"gu":"g",Al=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",Cl),Ml={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Ol=null;const Tl=pe.define({combine(t){let e=si(t,{render:null,specialChars:Al,addSpecialChars:null});return(e.replaceTabs=!function(){var t;if(null==Ol&&"undefined"!=typeof document&&document.body){let e=document.body.style;Ol=null!=(null!==(t=e.tabSize)&&void 0!==t?t:e.MozTabSize)}return Ol||!1}())&&(e.specialChars=new RegExp("\t|"+e.specialChars.source,Cl)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Cl)),e}});function Dl(t={}){return[Tl.of(t),Rl||(Rl=bn.fromClass(class{constructor(t){this.view=t,this.decorations=ss.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Tl)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Sl({regexp:t.specialChars,decoration:(e,i,s)=>{let{doc:n}=i.state,r=Xt(e[0],0);if(9==r){let t=n.lineAt(s),e=i.state.tabSize,r=ki(t.text,e,s-t.from);return ss.replace({widget:new Bl((e-r%e)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=ss.replace({widget:new Pl(t,r)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Tl);t.startState.facet(Tl)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))]}let Rl=null;class Pl extends es{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=function(t){return t>=32?"•":10==t?"␤":String.fromCharCode(9216+t)}(this.code),i=t.state.phrase("Control character")+" "+(Ml[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,e);if(s)return s;let n=document.createElement("span");return n.textContent=e,n.title=i,n.setAttribute("aria-label",i),n.className="cm-specialChar",n}ignoreEvent(){return!1}}class Bl extends es{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent="\t",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}const El=ss.line({class:"cm-activeLine"}),Ll=bn.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,i=[];for(let s of t.state.selection.ranges){let n=t.lineBlockAt(s.head);n.from>e&&(i.push(El.range(n.from)),e=n.from)}return ss.set(i)}},{decorations:t=>t.decorations});const Nl=2e3;function Il(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),s=t.state.doc.lineAt(i),n=i-s.from,r=n>Nl?-1:n==s.length?function(t,e){let i=t.coordsAtPos(t.viewport.from);return i?Math.round(Math.abs((i.left-e)/t.defaultCharacterWidth)):-1}(t,e.clientX):ki(s.text,t.state.tabSize,i-s.from);return{line:s.number,col:r,off:n}}function Wl(t,e){let i=Il(t,e),s=t.state.selection;return i?{update(t){if(t.docChanged){let e=t.changes.mapPos(t.startState.doc.line(i.line).from),n=t.state.doc.lineAt(e);i={line:n.number,col:i.col,off:Math.min(i.off,n.length)},s=s.map(t.changes)}},get(e,n,r){let o=Il(t,e);if(!o)return s;let l=function(t,e,i){let s=Math.min(e.line,i.line),n=Math.max(e.line,i.line),r=[];if(e.off>Nl||i.off>Nl||e.col<0||i.col<0){let o=Math.min(e.off,i.off),l=Math.max(e.off,i.off);for(let e=s;e<=n;e++){let i=t.doc.line(e);i.length<=l&&r.push(ue.range(i.from+o,i.to+l))}}else{let o=Math.min(e.col,i.col),l=Math.max(e.col,i.col);for(let e=s;e<=n;e++){let i=t.doc.line(e),s=Si(i.text,o,t.tabSize,!0);if(s<0)r.push(ue.cursor(i.to));else{let e=Si(i.text,l,t.tabSize);r.push(ue.range(i.from+s,i.from+e))}}}return r}(t.state,i,o);return l.length?r?ue.create(l.concat(s.ranges)):ue.create(l):s}}:null}function Hl(t){let e=(null==t?void 0:t.eventFilter)||(t=>t.altKey&&0==t.button);return jo.mouseSelectionStyle.of((t,i)=>e(i)?Wl(t,i):null)}const Vl={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},Fl={style:"cursor: crosshair"};function zl(t={}){let[e,i]=Vl[t.key||"Alt"],s=bn.fromClass(class{constructor(t){this.view=t,this.isDown=!1}set(t){this.isDown!=t&&(this.isDown=t,this.view.update([]))}},{eventObservers:{keydown(t){this.set(t.keyCode==e||i(t))},keyup(t){t.keyCode!=e&&i(t)||this.set(!1)},mousemove(t){this.set(i(t))}}});return[s,jo.contentAttributes.of(t=>{var e;return(null===(e=t.plugin(s))||void 0===e?void 0:e.isDown)?Fl:null})]}const ql="-10000px";class _l{constructor(t,e,i,s){this.facet=e,this.createTooltipView=i,this.removeTooltipView=s,this.input=t.state.facet(e),this.tooltips=this.input.filter(t=>t);let n=null;this.tooltipViews=this.tooltips.map(t=>n=i(t,n))}update(t,e){var i;let s=t.state.facet(this.facet),n=s.filter(t=>t);if(s===this.input){for(let e of this.tooltipViews)e.update&&e.update(t);return!1}let r=[],o=e?[]:null;for(let i=0;ie[i]=t),e.length=o.length),this.input=s,this.tooltips=n,this.tooltipViews=r,!0}}function $l(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const jl=pe.define({combine:t=>{var e,i,s;return{position:Qi.ios?"absolute":(null===(e=t.find(t=>t.position))||void 0===e?void 0:e.position)||"fixed",parent:(null===(i=t.find(t=>t.parent))||void 0===i?void 0:i.parent)||null,tooltipSpace:(null===(s=t.find(t=>t.tooltipSpace))||void 0===s?void 0:s.tooltipSpace)||$l}}}),Kl=new WeakMap,Ul=bn.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(jl);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new _l(t,Xl,(t,e)=>this.createTooltip(t,e),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let i=e||t.geometryChanged,s=t.state.facet(jl);if(s.position!=this.position&&!this.madeAbsolute){this.position=s.position;for(let t of this.manager.tooltipViews)t.dom.style.position=this.position;i=!0}if(s.parent!=this.parent){this.parent&&this.container.remove(),this.parent=s.parent,this.createContainer();for(let t of this.manager.tooltipViews)this.container.appendChild(t.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(t,e){let i=t.create(this.view),s=e?e.dom:null;if(i.dom.classList.add("cm-tooltip"),t.arrow&&!i.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",i.dom.appendChild(t)}return i.dom.style.position=this.position,i.dom.style.top=ql,i.dom.style.left="0px",this.container.insertBefore(i.dom,s),i.mount&&i.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(i.dom),i}destroy(){var t,e,i;this.view.win.removeEventListener("resize",this.measureSoon);for(let e of this.manager.tooltipViews)e.dom.remove(),null===(t=e.destroy)||void 0===t||t.call(e);this.parent&&this.container.remove(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),null===(i=this.intersectionObserver)||void 0===i||i.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,i=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:t}=this.manager.tooltipViews[0];if(Qi.safari){let e=t.getBoundingClientRect();i=Math.abs(e.top+1e4)>1||Math.abs(e.left)>1}else i=!!t.offsetParent&&t.offsetParent!=this.container.ownerDocument.body}if(i||"absolute"==this.position)if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(t=i.width/this.parent.offsetWidth,e=i.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let s=this.view.scrollDOM.getBoundingClientRect(),n=Rn(this.view);return{visible:{left:s.left+n.left,top:s.top+n.top,right:s.right-n.right,bottom:s.bottom-n.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((t,e)=>{let i=this.manager.tooltipViews[e];return i.getCoords?i.getCoords(t.pos):this.view.coordsAtPos(t.pos)}),size:this.manager.tooltipViews.map(({dom:t})=>t.getBoundingClientRect()),space:this.view.state.facet(jl).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:i}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let t of this.manager.tooltipViews)t.dom.style.position="absolute"}let{visible:i,space:s,scaleX:n,scaleY:r}=t,o=[];for(let l=0;l=Math.min(i.bottom,s.bottom)||u.rightMath.min(i.right,s.right)+.1)){c.style.top=ql;continue}let d=a.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=f.right-f.left,g=null!==(e=Kl.get(h))&&void 0!==e?e:f.bottom-f.top,v=h.offset||Gl,w=this.view.textDirection==Es.LTR,b=f.width>s.right-s.left?w?s.left:s.right-f.width:w?Math.max(s.left,Math.min(u.left-(d?14:0)+v.x,s.right-m)):Math.min(Math.max(s.left,u.left-m+(d?14:0)-v.x),s.right-m),y=this.above[l];!a.strictSide&&(y?u.top-g-p-v.ys.bottom)&&y==s.bottom-u.bottom>u.top-s.top&&(y=this.above[l]=!y);let x=(y?u.top-s.top:s.bottom-u.bottom)-p;if(xb&&t.topk&&(k=y?t.top-g-2-p:t.bottom+p+2);if("absolute"==this.position?(c.style.top=(k-t.parent.top)/r+"px",Yl(c,(b-t.parent.left)/n)):(c.style.top=k/r+"px",Yl(c,b/n)),d){let t=u.left+(w?v.x:-v.x)-(b+14-7);d.style.left=t/n+"px"}!0!==h.overlap&&o.push({left:b,top:k,right:S,bottom:k+g}),c.classList.toggle("cm-tooltip-above",y),c.classList.toggle("cm-tooltip-below",!y),h.positioned&&h.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=ql}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Yl(t,e){let i=parseInt(t.style.left,10);(isNaN(i)||Math.abs(e-i)>1)&&(t.style.left=e+"px")}const Ql=jo.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Gl={x:0,y:0},Xl=pe.define({enables:[Ul,Ql]}),Jl=pe.define({combine:t=>t.reduce((t,e)=>t.concat(e),[])});class Zl{static create(t){return new Zl(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new _l(t,Jl,(t,e)=>this.createHostedView(t,e),t=>t.dom.remove())}createHostedView(t,e){let i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,e?e.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(t){for(let e of this.manager.tooltipViews)e.mount&&e.mount(t);this.mounted=!0}positioned(t){for(let e of this.manager.tooltipViews)e.positioned&&e.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let e of this.manager.tooltipViews)null===(t=e.destroy)||void 0===t||t.call(e)}passProp(t){let e;for(let i of this.manager.tooltipViews){let s=i[t];if(void 0!==s)if(void 0===e)e=s;else if(e!==s)return}return e}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const ta=Xl.compute([Jl],t=>{let e=t.facet(Jl);return 0===e.length?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var e;return null!==(e=t.end)&&void 0!==e?e:t.pos})),create:Zl.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),ea=pe.define();class ia{constructor(t,e,i,s,n,r){this.view=t,this.source=e,this.field=i,this.locked=s,this.setHover=n,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(t){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;ti.bottom||e.xi.right+t.defaultCharacterWidth)return;let r=t.bidiSpans(t.state.doc.lineAt(s)).find(t=>t.from<=s&&t.to>=s),o=r&&r.dir==Es.RTL?-1:1;n=e.x{if(e&&(!Array.isArray(e)||e.length)){let i=Array.isArray(e)?e:[e];s&&this.locked.set(i,s),t.dispatch({effects:this.setHover.of(i)})}};if(n&&"then"in n){let i=this.pending={pos:e};n.then(t=>{this.pending==i&&(this.pending=null,r(t))},e=>mn(t.state,e,"hover tooltip"))}else r(n)}get tooltip(){let t=this.view.plugin(Ul),e=t?t.manager.tooltips.findIndex(t=>t.create==Zl.create):-1;return e>-1?t.manager.tooltipViews[e]:null}mousemove(t){var e,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:s,tooltip:n}=this;if(s.length&&!this.locked.has(s)&&n&&!function(t,e){let i,{left:s,right:n,top:r,bottom:o}=t.getBoundingClientRect();if(i=t.querySelector(".cm-tooltip-arrow")){let t=i.getBoundingClientRect();r=Math.min(t.top,r),o=Math.max(t.bottom,o)}return e.clientX>=s-sa&&e.clientX<=n+sa&&e.clientY>=r-sa&&e.clientY<=o+sa}(n.dom,t)||this.pending){let{pos:n}=s[0]||this.pending,r=null!==(i=null===(e=s[0])||void 0===e?void 0:e.end)&&void 0!==i?i:n;(n==r?this.view.posAtCoords(this.lastMove)==n:function(t,e,i,s,n){let r=t.scrollDOM.getBoundingClientRect(),o=t.documentTop+t.documentPadding.top+t.contentHeight;if(r.left>s||r.rightn||Math.min(r.bottom,o)=e&&l<=i}(this.view,n,r,t.clientX,t.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:e}=this;if(e.length&&!this.locked.has(e)){let{tooltip:e}=this;e&&e.dom.contains(t.relatedTarget)?this.watchTooltipLeave(e.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let e=i=>{t.removeEventListener("mouseleave",e);let{active:s}=this;!s.length||this.locked.has(s)||this.view.dom.contains(i.relatedTarget)||this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",e)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const sa=4;function na(t,e={}){let i=$e.define(),s=new WeakMap,n=xe.define({create:()=>[],update(t,r){let o=s.get(t);if(t.length&&(e.hideOnChange&&(r.docChanged||r.selection)||o&&o(r)?t=[]:e.hideOn&&(t=t.filter(t=>!e.hideOn(r,t)))),r.docChanged&&t.length){let e=[];for(let i of t){let t=r.changes.mapPos(i.pos,-1,ee.TrackDel);if(null!=t){let s=Object.assign(Object.create(null),i);s.pos=t,null!=s.end&&(s.end=r.changes.mapPos(s.end)),e.push(s)}}t=e}for(let e of r.effects)e.is(i)&&(t=e.value,o=void 0),(e.is(oa)&&!e.value||e.value==n)&&(t=[]);return t.length&&o&&s.set(t,o),t},provide:t=>Jl.from(t)});const r=bn.define(r=>new ia(r,t,n,s,i,e.hoverTime||300));return{active:n,extension:[n,r,ea.of(r),ta]}}function ra(t,e){let i=t.plugin(Ul);if(!i)return null;let s=i.manager.tooltips.indexOf(e);return s<0?null:i.manager.tooltipViews[s]}const oa=$e.define();const la=pe.define({combine(t){let e,i;for(let s of t)e=e||s.topContainer,i=i||s.bottomContainer;return{topContainer:e,bottomContainer:i}}});function aa(t,e){let i=t.plugin(ha),s=i?i.specs.indexOf(e):-1;return s>-1?i.panels[s]:null}const ha=bn.fromClass(class{constructor(t){this.input=t.state.facet(fa),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(e=>e(t));let e=t.state.facet(la);this.top=new ca(t,!0,e.topContainer),this.bottom=new ca(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(t){let e=t.state.facet(la);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new ca(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new ca(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=t.state.facet(fa);if(i!=this.input){let e=i.filter(t=>t),s=[],n=[],r=[],o=[];for(let i of e){let e,l=this.specs.indexOf(i);l<0?(e=i(t.view),o.push(e)):(e=this.panels[l],e.update&&e.update(t)),s.push(e),(e.top?n:r).push(e)}this.specs=e,this.panels=s,this.top.sync(n),this.bottom.sync(r);for(let t of o)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}else for(let e of this.panels)e.update&&e.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>jo.scrollMargins.of(e=>{let i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}})});class ca{constructor(t,e,i){this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=ua(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=ua(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function ua(t){let e=t.nextSibling;return t.remove(),e}const fa=pe.define({enables:ha});function da(t,e){let i,s=new Promise(t=>i=t),n=t=>function(t,e,i){let s=e.content?e.content(t,()=>o(null)):null;if(!s){if(s=Ii("form"),e.input){let t=Ii("input",e.input);/^(text|password|number|email|tel|url)$/.test(t.type)&&t.classList.add("cm-textfield"),t.name||(t.name="input"),s.appendChild(Ii("label",(e.label||"")+": ",t))}else s.appendChild(document.createTextNode(e.label||""));s.appendChild(document.createTextNode(" ")),s.appendChild(Ii("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let n="FORM"==s.nodeName?[s]:s.querySelectorAll("form");for(let t=0;t{27==t.keyCode?(t.preventDefault(),o(null)):13==t.keyCode&&(t.preventDefault(),o(e))}),e.addEventListener("submit",t=>{t.preventDefault(),o(e)})}let r=Ii("div",s,Ii("button",{onclick:()=>o(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(r.className=e.class);function o(e){r.contains(r.ownerDocument.activeElement)&&t.focus(),i(e)}return r.classList.add("cm-dialog"),{dom:r,top:e.top,mount:()=>{if(e.focus){let t;t="string"==typeof e.focus?s.querySelector(e.focus):s.querySelector("input")||s.querySelector("button"),t&&"select"in t?t.select():t&&"focus"in t&&t.focus()}}}}(t,e,i);t.state.field(pa,!1)?t.dispatch({effects:ma.of(n)}):t.dispatch({effects:$e.appendConfig.of(pa.init(()=>[n]))});let r=ga.of(n);return{close:r,result:s.then(e=>((t.win.queueMicrotask||(e=>t.win.setTimeout(e,10)))(()=>{t.state.field(pa).indexOf(n)>-1&&t.dispatch({effects:r})}),e))}}const pa=xe.define({create:()=>[],update(t,e){for(let i of e.effects)i.is(ma)?t=[i.value].concat(t):i.is(ga)&&(t=t.filter(t=>t!=i.value));return t},provide:t=>fa.computeN([t],e=>e.field(t))}),ma=$e.define(),ga=$e.define();class va extends ni{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}va.prototype.elementClass="",va.prototype.toDOM=void 0,va.prototype.mapMode=ee.TrackBefore,va.prototype.startSide=va.prototype.endSide=-1,va.prototype.point=!0;const wa=pe.define(),ba=pe.define(),ya={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>hi.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},xa=pe.define();function ka(t){return[Ca(),xa.of({...ya,...t})]}const Sa=pe.define({combine:t=>t.some(t=>t)});function Ca(t){let e=[Aa];return t&&!1===t.fixed&&e.push(Sa.of(!0)),e}const Aa=bn.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(xa).map(e=>new Da(t,e)),this.fixed=!t.state.facet(Sa);for(let t of this.gutters)"after"==t.config.side?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,i=t.view.viewport,s=Math.min(e.to,i.to)-Math.max(e.from,i.from);this.syncGutters(s<.8*(i.to-i.from))}if(t.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(Sa)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let i=hi.iter(this.view.state.facet(wa),this.view.viewport.from),s=[],n=this.gutters.map(t=>new Ta(t,this.view.viewport,-this.view.documentPadding.top));for(let t of this.view.viewportLineBlocks)if(s.length&&(s=[]),Array.isArray(t.type)){let e=!0;for(let r of t.type)if(r.type==is.Text&&e){Oa(i,s,r.from);for(let t of n)t.line(this.view,r,s);e=!1}else if(r.widget)for(let t of n)t.widget(this.view,r)}else if(t.type==is.Text){Oa(i,s,t.from);for(let e of n)e.line(this.view,t,s)}else if(t.widget)for(let e of n)e.widget(this.view,t);for(let t of n)t.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(xa),i=t.state.facet(xa),s=t.docChanged||t.heightChanged||t.viewportChanged||!hi.eq(t.startState.facet(wa),t.state.facet(wa),t.view.viewport.from,t.view.viewport.to);if(e==i)for(let e of this.gutters)e.update(t)&&(s=!0);else{s=!0;let n=[];for(let s of i){let i=e.indexOf(s);i<0?n.push(new Da(this.view,s)):(this.gutters[i].update(t),n.push(this.gutters[i]))}for(let t of this.gutters)t.dom.remove(),n.indexOf(t)<0&&t.destroy();for(let t of n)"after"==t.config.side?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.gutters=n}return s}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>jo.scrollMargins.of(e=>{let i=e.plugin(t);if(!i||0==i.gutters.length||!i.fixed)return null;let s=i.dom.offsetWidth*e.scaleX,n=i.domAfter?i.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Es.LTR?{left:s,right:n}:{right:s,left:n}})});function Ma(t){return Array.isArray(t)?t:[t]}function Oa(t,e,i){for(;t.value&&t.from<=i;)t.from==i&&e.push(t.value),t.next()}class Ta{constructor(t,e,i){this.gutter=t,this.height=i,this.i=0,this.cursor=hi.iter(t.markers,e.from)}addElement(t,e,i){let{gutter:s}=this,n=(e.top-this.height)/t.scaleY,r=e.height/t.scaleY;if(this.i==s.elements.length){let e=new Ra(t,r,n,i);s.elements.push(e),s.dom.appendChild(e.dom)}else s.elements[this.i].update(t,r,n,i);this.height=e.bottom,this.i++}line(t,e,i){let s=[];Oa(this.cursor,s,e.from),i.length&&(s=s.concat(i));let n=this.gutter.config.lineMarker(t,e,s);n&&s.unshift(n);let r=this.gutter;(0!=s.length||r.config.renderEmptyElements)&&this.addElement(t,e,s)}widget(t,e){let i=this.gutter.config.widgetMarker(t,e.widget,e),s=i?[i]:null;for(let i of t.state.facet(ba)){let n=i(t,e.widget,e);n&&(s||(s=[])).push(n)}s&&this.addElement(t,e,s)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let e=t.elements.pop();t.dom.removeChild(e.dom),e.destroy()}}}class Da{constructor(t,e){this.view=t,this.config=e,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in e.domEventHandlers)this.dom.addEventListener(i,s=>{let n,r=s.target;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let t=r.getBoundingClientRect();n=(t.top+t.bottom)/2}else n=s.clientY;let o=t.lineBlockAtHeight(n-t.documentTop);e.domEventHandlers[i](t,o,s)&&s.preventDefault()});this.markers=Ma(e.markers(t)),e.initialSpacer&&(this.spacer=new Ra(t,0,0,[e.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let e=this.markers;if(this.markers=Ma(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let e=this.config.updateSpacer(this.spacer.markers[0],t);e!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[e])}let i=t.view.viewport;return!hi.eq(this.markers,e,i.from,i.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(t)}destroy(){for(let t of this.elements)t.destroy()}}class Ra{constructor(t,e,i,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,e,i,s)}update(t,e,i,s){this.height!=e&&(this.height=e,this.dom.style.height=e+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),function(t,e){if(t.length!=e.length)return!1;for(let i=0;isi(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,e){let i=Object.assign({},t);for(let t in e){let s=i[t],n=e[t];i[t]=s?(t,e,i)=>s(t,e,i)||n(t,e,i):n}return i}})});class La extends va{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function Na(t,e){return t.state.facet(Ea).formatNumber(e,t.state)}const Ia=xa.compute([Ea],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:t=>t.state.facet(Pa),lineMarker:(t,e,i)=>i.some(t=>t.toDOM)?null:new La(Na(t,t.state.doc.lineAt(e.from).number)),widgetMarker:(t,e,i)=>{for(let s of t.state.facet(Ba)){let n=s(t,e,i);if(n)return n}return null},lineMarkerChange:t=>t.startState.facet(Ea)!=t.state.facet(Ea),initialSpacer:t=>new La(Na(t,Ha(t.state.doc.lines))),updateSpacer(t,e){let i=Na(e.view,Ha(e.view.state.doc.lines));return i==t.number?t:new La(i)},domEventHandlers:t.facet(Ea).domEventHandlers,side:"before"}));function Wa(t={}){return[Ea.of(t),Ca(),Ia]}function Ha(t){let e=9;for(;e{let e=[],i=-1;for(let s of t.selection.ranges){let n=t.doc.lineAt(s.head).from;n>i&&(i=n,e.push(Va.range(n)))}return hi.of(e)});var za;const qa=new s;function _a(t){return pe.define({combine:t?e=>e.concat(t):void 0})}const $a=new s;class ja{constructor(t,e,i=[],s=""){this.data=t,this.name=s,ii.prototype.hasOwnProperty("tree")||Object.defineProperty(ii.prototype,"tree",{get(){return Ya(this)}}),this.parser=e,this.extension=[sh.of(this),ii.languageData.of((t,e,i)=>{let s=Ka(t,e,i),n=s.type.prop(qa);if(!n)return[];let r=t.facet(n),o=s.type.prop($a);if(o){let n=s.resolve(e-s.from,i);for(let e of o)if(e.test(n,t)){let i=t.facet(e.facet);return"replace"==e.type?i:i.concat(r)}}return r})].concat(i)}isActiveAt(t,e,i=-1){return Ka(t,e,i).type.prop(qa)==this.data}findRegions(t){let e=t.facet(sh);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],n=(t,e)=>{if(t.prop(qa)==this.data)return void i.push({from:e,to:e+t.length});let r=t.prop(s.mounted);if(r){if(r.tree.prop(qa)==this.data){if(r.overlay)for(let t of r.overlay)i.push({from:t.from+e,to:t.to+e});else i.push({from:e,to:e+t.length});return}if(r.overlay){let t=i.length;if(n(r.tree,r.overlay[0].from+e),i.length>t)return}}for(let i=0;it.isTop?e:void 0)]}),t.name)}configure(t,e){return new Ua(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ya(t){let e=t.field(ja.state,!1);return e?e.tree:u.empty}class Qa{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}}let Ga=null;class Xa{constructor(t,e,i=[],s,n,r,o,l){this.parser=t,this.state=e,this.fragments=i,this.tree=s,this.treeLen=n,this.viewport=r,this.skipped=o,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new Xa(t,e,[],u.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Qa(this.state.doc),this.fragments)}work(t,e){return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=u.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if("number"==typeof t){let e=Date.now()+t;t=()=>Date.now()>e}for(this.parse||(this.parse=this.startParse()),null!=e&&(null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&e=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(e=this.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(D.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=Ga;Ga=this;try{return t()}finally{Ga=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=Ja(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:s,treeLen:n,viewport:r,skipped:o}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,i,s,n)=>e.push({fromA:t,toA:i,fromB:s,toB:n})),i=D.applyChanges(i,e),s=u.empty,n=0,r={from:t.mapPos(r.from,-1),to:t.mapPos(r.to,1)},this.skipped.length){o=[];for(let e of this.skipped){let i=t.mapPos(e.from,1),s=t.mapPos(e.to,-1);it.from&&(this.fragments=Ja(this.fragments,i,s),this.skipped.splice(e--,1))}return!(this.skipped.length>=e)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends R{createParse(e,i,s){let n=s[0].from,r=s[s.length-1].to;return{parsedPos:n,advance(){let e=Ga;if(e){for(let t of s)e.tempSkipped.push(t);t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=r,new u(o.none,[],[],r-n)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t}static get(){return Ga}}function Ja(t,e,i){return D.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}])}class Za{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new Za(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=Xa.create(t.facet(sh).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new Za(i)}}ja.state=xe.define({create:Za.init,update(t,e){for(let t of e.effects)if(t.is(ja.setState))return t.value;return e.startState.facet(sh)!=e.state.facet(sh)?Za.init(e.state):t.apply(e)}});let th=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(th=t=>{let e=-1,i=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(i):cancelIdleCallback(e)});const eh="undefined"!=typeof navigator&&(null===(za=navigator.scheduling)||void 0===za?void 0:za.isInputPending)?()=>navigator.scheduling.isInputPending():null,ih=bn.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(ja.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(ja.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=th(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnds+1e3,l=n.context.work(()=>eh&&eh()||Date.now()>r,s+(o?0:1e5));this.chunkBudget-=Date.now()-e,(l||this.chunkBudget<=0)&&(n.context.takeTree(),this.view.dispatch({effects:ja.setState.of(new Za(n.context))})),this.chunkBudget>0&&(!l||o)&&this.scheduleWork(),this.checkAsyncSchedule(n.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(t=>mn(this.view.state,t)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),sh=pe.define({combine:t=>t.length?t[0]:null,enables:t=>[ja.state,ih,jo.contentAttributes.compute([t],e=>{let i=e.facet(t);return i&&i.name?{"data-language":i.name}:{}})]});class nh{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}const rh=pe.define(),oh=pe.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function lh(t){let e=t.facet(oh);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function ah(t,e){let i="",s=t.tabSize,n=t.facet(oh)[0];if("\t"==n){for(;e>=s;)i+="\t",e-=s;n=" "}for(let t=0;t=e?function(t,e,i){let s=e.resolveStack(i),n=e.resolveInner(i,-1).resolve(i,0).enterUnfinishedNodesBefore(i);if(n!=s.node){let t=[];for(let e=n;e&&!(e.froms.node.to||e.from==s.node.from&&e.type==s.node.type);e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)s={node:t[e],next:s}}return fh(s,t,i)}(t,i,e):null}class ch{constructor(t,e={}){this.state=t,this.options=e,this.unit=lh(t)}lineAt(t,e=1){let i=this.state.doc.lineAt(t),{simulateBreak:s,simulateDoubleBreak:n}=this.options;return null!=s&&s>=i.from&&s<=i.to?n&&s==t?{text:"",from:t}:(e<0?s-1&&(n+=r-this.countColumn(i,i.search(/\S|$/))),n}countColumn(t,e=t.length){return ki(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:i,from:s}=this.lineAt(t,e),n=this.options.overrideIndentation;if(n){let t=n(s);if(t>-1)return t}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const uh=new s;function fh(t,e,i){for(let s=t;s;s=s.next){let t=dh(s.node);if(t)return t(mh.create(e,i,s))}return 0}function dh(t){let e=t.type.prop(uh);if(e)return e;let i,n=t.firstChild;if(n&&(i=n.type.prop(s.closedBy))){let e=t.lastChild,s=e&&i.indexOf(e.name)>-1;return t=>vh(t,!0,1,void 0,s&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?ph:null}function ph(){return 0}class mh extends ch{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.context=i}get node(){return this.context.node}static create(t,e,i){return new mh(t,e,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(e.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(gh(i,t))break;e=this.state.doc.lineAt(i.from)}return this.lineIndent(e.from)}continue(){return fh(this.context.next,this.base,this.pos)}}function gh(t,e){for(let i=e;i;i=i.parent)if(t==i)return!0;return!1}function vh(t,e,i,s,n){let r=t.textAfter,o=r.match(/^\s*/)[0].length,l=s&&r.slice(o,o+s.length)==s||n==t.pos+o,a=e?function(t){let e=t.node,i=e.childAfter(e.from),s=e.lastChild;if(!i)return null;let n=t.options.simulateBreak,r=t.state.doc.lineAt(i.from),o=null==n||n<=r.from?r.to:Math.min(r.to,n);for(let t=i.to;;){let n=e.childAfter(t);if(!n||n==s)return null;if(!n.type.isSkipped){if(n.from>=o)return null;let t=/^ */.exec(r.text.slice(i.to-r.from))[0].length;return{from:i.from,to:i.to+t}}t=n.to}}(t):null;return a?l?t.column(a.from):t.column(a.to):t.baseIndent+(l?0:t.unit*i)}function wh({except:t,units:e=1}={}){return i=>{let s=t&&t.test(i.textAfter);return i.baseIndent+(s?0:e*i.unit)}}const bh=pe.define(),yh=new s;function xh(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function kh(t,e,i){for(let s of t.facet(bh)){let n=s(t,e,i);if(n)return n}return function(t,e,i){let s=Ya(t);if(s.lengthi)continue;if(n&&o.from=e&&s.to>i&&(n=s)}}return n}(t,e,i)}function Sh(t,e){let i=e.mapPos(t.from,1),s=e.mapPos(t.to,-1);return i>=s?void 0:{from:i,to:s}}const Ch=$e.define({map:Sh}),Ah=$e.define({map:Sh});function Mh(t){let e=[];for(let{head:i}of t.state.selection.ranges)e.some(t=>t.from<=i&&t.to>=i)||e.push(t.lineBlockAt(i));return e}const Oh=xe.define({create:()=>ss.none,update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((e,i)=>t=Th(t,e,i)),t=t.map(e.changes);for(let i of e.effects)if(i.is(Ch)&&!Rh(t,i.value.from,i.value.to)){let{preparePlaceholder:s}=e.state.facet(Nh),n=s?ss.replace({widget:new Vh(s(e.state,i.value))}):Hh;t=t.update({add:[n.range(i.value.from,i.value.to)]})}else i.is(Ah)&&(t=t.update({filter:(t,e)=>i.value.from!=t||i.value.to!=e,filterFrom:i.value.from,filterTo:i.value.to}));return e.selection&&(t=Th(t,e.selection.main.head)),t},provide:t=>jo.decorations.from(t),toJSON(t,e){let i=[];return t.between(0,e.doc.length,(t,e)=>{i.push(t,e)}),i},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let i=0;i{te&&(s=!0)}),s?t.update({filterFrom:e,filterTo:i,filter:(t,s)=>t>=i||s<=e}):t}function Dh(t,e,i){var s;let n=null;return null===(s=t.field(Oh,!1))||void 0===s||s.between(e,i,(t,e)=>{(!n||n.from>t)&&(n={from:t,to:e})}),n}function Rh(t,e,i){let s=!1;return t.between(e,e,(t,n)=>{t==e&&n==i&&(s=!0)}),s}function Ph(t,e){return t.field(Oh,!1)?e:e.concat($e.appendConfig.of(Ih()))}function Bh(t,e,i=!0){let s=t.state.doc.lineAt(e.from).number,n=t.state.doc.lineAt(e.to).number;return jo.announce.of(`${t.state.phrase(i?"Folded lines":"Unfolded lines")} ${s} ${t.state.phrase("to")} ${n}.`)}const Eh=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:t=>{for(let e of Mh(t)){let i=kh(t.state,e.from,e.to);if(i)return t.dispatch({effects:Ph(t.state,[Ch.of(i),Bh(t,i)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:t=>{if(!t.state.field(Oh,!1))return!1;let e=[];for(let i of Mh(t)){let s=Dh(t.state,i.from,i.to);s&&e.push(Ah.of(s),Bh(t,s,!1))}return e.length&&t.dispatch({effects:e}),e.length>0}},{key:"Ctrl-Alt-[",run:t=>{let{state:e}=t,i=[];for(let s=0;s{let e=t.state.field(Oh,!1);if(!e||!e.size)return!1;let i=[];return e.between(0,t.state.doc.length,(t,e)=>{i.push(Ah.of({from:t,to:e}))}),t.dispatch({effects:i}),!0}}],Lh={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Nh=pe.define({combine:t=>si(t,Lh)});function Ih(t){let e=[Oh,_h];return t&&e.push(Nh.of(t)),e}function Wh(t,e){let{state:i}=t,s=i.facet(Nh),n=e=>{let i=t.lineBlockAt(t.posAtDOM(e.target)),s=Dh(t.state,i.from,i.to);s&&t.dispatch({effects:Ah.of(s)}),e.preventDefault()};if(s.placeholderDOM)return s.placeholderDOM(t,n,e);let r=document.createElement("span");return r.textContent=s.placeholderText,r.setAttribute("aria-label",i.phrase("folded code")),r.title=i.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=n,r}const Hh=ss.replace({widget:new class extends es{toDOM(t){return Wh(t,null)}}});class Vh extends es{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return Wh(t,this.value)}}const Fh={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class zh extends va{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}function qh(t={}){let e={...Fh,...t},i=new zh(e,!0),s=new zh(e,!1),n=bn.fromClass(class{constructor(t){this.from=t.viewport.from,this.markers=this.buildMarkers(t)}update(t){(t.docChanged||t.viewportChanged||t.startState.facet(sh)!=t.state.facet(sh)||t.startState.field(Oh,!1)!=t.state.field(Oh,!1)||Ya(t.startState)!=Ya(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view))}buildMarkers(t){let e=new ui;for(let n of t.viewportLineBlocks){let r=Dh(t.state,n.from,n.to)?s:kh(t.state,n.from,n.to)?i:null;r&&e.add(n.from,n.from,r)}return e.finish()}}),{domEventHandlers:r}=e;return[n,ka({class:"cm-foldGutter",markers(t){var e;return(null===(e=t.plugin(n))||void 0===e?void 0:e.markers)||hi.empty},initialSpacer:()=>new zh(e,!1),domEventHandlers:{...r,click:(t,e,i)=>{if(r.click&&r.click(t,e,i))return!0;let s=Dh(t.state,e.from,e.to);if(s)return t.dispatch({effects:Ah.of(s)}),!0;let n=kh(t.state,e.from,e.to);return!!n&&(t.dispatch({effects:Ch.of(n)}),!0)}}}),Ih()]}const _h=jo.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class $h{constructor(t,e){let i;function s(t){let e=Oi.newName();return(i||(i=Object.create(null)))["."+e]=t,e}this.specs=t;const n="string"==typeof e.all?e.all:e.all?s(e.all):void 0,r=e.scope;this.scope=r instanceof ja?t=>t.prop(qa)==r.data:r?t=>t==r:void 0,this.style=at(t.map(t=>({tag:t.tag,class:t.class||s(Object.assign({},t,{tag:null}))})),{all:n}).style,this.module=i?new Oi(i):null,this.themeType=e.themeType}static define(t,e){return new $h(t,e||{})}}const jh=pe.define(),Kh=pe.define({combine:t=>t.length?[t[0]]:null});function Uh(t){let e=t.facet(jh);return e.length?e:t.facet(Kh)}function Yh(t,e){let i,s=[Gh];return t instanceof $h&&(t.module&&s.push(jo.styleModule.of(t.module)),i=t.themeType),(null==e?void 0:e.fallback)?s.push(Kh.of(t)):i?s.push(jh.computeN([jo.darkTheme],e=>e.facet(jo.darkTheme)==("dark"==i)?[t]:[])):s.push(jh.of(t)),s}class Qh{constructor(t){this.markCache=Object.create(null),this.tree=Ya(t.state),this.decorations=this.buildDeco(t,Uh(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=Ya(t.state),i=Uh(t.state),s=i!=Uh(t.startState),{viewport:n}=t.view,r=t.changes.mapPos(this.decoratedTo,1);e.length=n.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=r):(e!=this.tree||t.viewportChanged||s)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=n.to)}buildDeco(t,e){if(!e||!this.tree.length)return ss.none;let i=new ui;for(let{from:s,to:n}of t.visibleRanges)ht(this.tree,e,(t,e,s)=>{i.add(t,e,this.markCache[s]||(this.markCache[s]=ss.mark({class:s})))},s,n);return i.finish()}}const Gh=Oe.high(bn.fromClass(Qh,{decorations:t=>t.decorations})),Xh=$h.define([{tag:Mt.meta,color:"#404740"},{tag:Mt.link,textDecoration:"underline"},{tag:Mt.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Mt.emphasis,fontStyle:"italic"},{tag:Mt.strong,fontWeight:"bold"},{tag:Mt.strikethrough,textDecoration:"line-through"},{tag:Mt.keyword,color:"#708"},{tag:[Mt.atom,Mt.bool,Mt.url,Mt.contentSeparator,Mt.labelName],color:"#219"},{tag:[Mt.literal,Mt.inserted],color:"#164"},{tag:[Mt.string,Mt.deleted],color:"#a11"},{tag:[Mt.regexp,Mt.escape,Mt.special(Mt.string)],color:"#e40"},{tag:Mt.definition(Mt.variableName),color:"#00f"},{tag:Mt.local(Mt.variableName),color:"#30a"},{tag:[Mt.typeName,Mt.namespace],color:"#085"},{tag:Mt.className,color:"#167"},{tag:[Mt.special(Mt.variableName),Mt.macroName],color:"#256"},{tag:Mt.definition(Mt.propertyName),color:"#00c"},{tag:Mt.comment,color:"#940"},{tag:Mt.invalid,color:"#f00"}]),Jh=jo.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Zh="()[]{}",tc=pe.define({combine:t=>si(t,{afterCursor:!0,brackets:Zh,maxScanDistance:1e4,renderMatch:sc})}),ec=ss.mark({class:"cm-matchingBracket"}),ic=ss.mark({class:"cm-nonmatchingBracket"});function sc(t){let e=[],i=t.matched?ec:ic;return e.push(i.range(t.start.from,t.start.to)),t.end&&e.push(i.range(t.end.from,t.end.to)),e}function nc(t){let e=[],i=t.facet(tc);for(let s of t.selection.ranges){if(!s.empty)continue;let n=cc(t,s.head,-1,i)||s.head>0&&cc(t,s.head-1,1,i)||i.afterCursor&&(cc(t,s.head,1,i)||s.headt.decorations}),Jh];function oc(t={}){return[tc.of(t),rc]}const lc=new s;function ac(t,e,i){let n=t.prop(e<0?s.openedBy:s.closedBy);if(n)return n;if(1==t.name.length){let s=i.indexOf(t.name);if(s>-1&&s%2==(e<0?1:0))return[i[s+e]]}return null}function hc(t){let e=t.type.prop(lc);return e?e(t.node):t}function cc(t,e,i,s={}){let n=s.maxScanDistance||1e4,r=s.brackets||Zh,o=Ya(t),l=o.resolveInner(e,i);for(let s=l;s;s=s.parent){let n=ac(s.type,i,r);if(n&&s.from0?e>=o.from&&eo.from&&e<=o.to))return uc(t,e,i,s,o,n,r)}}return function(t,e,i,s,n,r,o){if(i<0?!e:e==t.doc.length)return null;let l=i<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=i>0)return null;let h={from:i<0?e-1:e,to:i>0?e+1:e},c=t.doc.iterRange(e,i>0?t.doc.length:0),u=0;for(let t=0;!c.next().done&&t<=r;){let r=c.value;i<0&&(t+=r.length);let l=e+t*i;for(let t=i>0?0:r.length-1,e=i>0?r.length:-1;t!=e;t+=i){let e=o.indexOf(r[t]);if(!(e<0||s.resolveInner(l+t,1).type!=n))if(e%2==0==i>0)u++;else{if(1==u)return{start:h,end:{from:l+t,to:l+t+1},matched:e>>1==a>>1};u--}}i>0&&(t+=r.length)}return c.done?{start:h,matched:!1}:null}(t,e,i,o,l.type,n,r)}function uc(t,e,i,s,n,r,o){let l=s.parent,a={from:n.from,to:n.to},h=0,c=null==l?void 0:l.cursor();if(c&&(i<0?c.childBefore(s.from):c.childAfter(s.to)))do{if(i<0?c.to<=s.from:c.from>=s.to){if(0==h&&r.indexOf(c.type.name)>-1&&c.from-1||(pc.push(t),console.warn(e))}function wc(t,e){let i=[];for(let s of e.split(" ")){let e=[];for(let i of s.split(".")){let s=t[i]||Mt[i];s?"function"==typeof s?e.length?e=e.map(s):vc(i,`Modifier ${i} used at start of tag`):e.length?vc(i,`Tag ${i} used as modifier`):e=Array.isArray(s)?s:[s]:vc(i,`Unknown highlighting tag ${i}`)}for(let t of e)i.push(t)}if(!i.length)return 0;let s=e.replace(/ /g,"_"),n=s+" "+i.map(t=>t.id),r=mc[n];if(r)return r.id;let l=mc[n]=o.define({id:dc.length,name:s,props:[rt({[s]:i})]});return dc.push(l),l.id}Es.RTL,Es.LTR;const bc=Ua.define({name:"json",parser:Tt.configure({props:[uh.add({Object:wh({except:/^\s*\}/}),Array:wh({except:/^\s*\]/})}),yh.add({"Object Array":function(t){let e=t.firstChild,i=t.lastChild;return e&&e.to .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Lc},".cm-panels":{backgroundColor:Rc,color:Cc},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Bc,color:Ac,border:"none"},".cm-activeLineGutter":{backgroundColor:Pc},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Ec},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Ec,borderBottomColor:Ec},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Pc,color:Cc}}},{dark:!0}),Yh($h.define([{tag:Mt.keyword,color:Dc},{tag:[Mt.name,Mt.deleted,Mt.character,Mt.propertyName,Mt.macroName],color:xc},{tag:[Mt.function(Mt.variableName),Mt.labelName],color:Mc},{tag:[Mt.color,Mt.constant(Mt.name),Mt.standard(Mt.name)],color:Tc},{tag:[Mt.definition(Mt.name),Mt.separator],color:Cc},{tag:[Mt.typeName,Mt.className,Mt.number,Mt.changed,Mt.annotation,Mt.modifier,Mt.self,Mt.namespace],color:yc},{tag:[Mt.operator,Mt.operatorKeyword,Mt.url,Mt.escape,Mt.regexp,Mt.link,Mt.special(Mt.string)],color:kc},{tag:[Mt.meta,Mt.comment],color:Ac},{tag:Mt.strong,fontWeight:"bold"},{tag:Mt.emphasis,fontStyle:"italic"},{tag:Mt.strikethrough,textDecoration:"line-through"},{tag:Mt.link,color:Ac,textDecoration:"underline"},{tag:Mt.heading,fontWeight:"bold",color:xc},{tag:[Mt.atom,Mt.bool,Mt.special(Mt.variableName)],color:Tc},{tag:[Mt.processingInstruction,Mt.string,Mt.inserted],color:Oc},{tag:Mt.invalid,color:Sc}]))];function Wc(t,e){return({state:i,dispatch:s})=>{if(i.readOnly)return!1;let n=t(e,i);return!!n&&(s(i.update(n)),!0)}}const Hc=Wc($c,0),Vc=Wc(_c,0),Fc=Wc((t,e)=>_c(t,e,function(t){let e=[];for(let i of t.selection.ranges){let s=t.doc.lineAt(i.from),n=i.to<=s.to?s:t.doc.lineAt(i.to);n.from>s.from&&n.from==i.to&&(n=i.to==s.to+1?s:t.doc.lineAt(i.to-1));let r=e.length-1;r>=0&&e[r].to>s.from?e[r].to=n.to:e.push({from:s.from+/^\s*/.exec(s.text)[0].length,to:n.to})}return e}(e)),0);function zc(t,e){let i=t.languageDataAt("commentTokens",e,1);return i.length?i[0]:{}}const qc=50;function _c(t,e,i=e.selection.ranges){let s=i.map(t=>zc(e,t.from).block);if(!s.every(t=>t))return null;let n=i.map((t,i)=>function(t,{open:e,close:i},s,n){let r,o,l=t.sliceDoc(s-qc,s),a=t.sliceDoc(n,n+qc),h=/\s*$/.exec(l)[0].length,c=/^\s*/.exec(a)[0].length,u=l.length-h;if(l.slice(u-e.length,u)==e&&a.slice(c,c+i.length)==i)return{open:{pos:s-h,margin:h&&1},close:{pos:n+c,margin:c&&1}};n-s<=2*qc?r=o=t.sliceDoc(s,n):(r=t.sliceDoc(s,s+qc),o=t.sliceDoc(n-qc,n));let f=/^\s*/.exec(r)[0].length,d=/\s*$/.exec(o)[0].length,p=o.length-d-i.length;return r.slice(f,f+e.length)==e&&o.slice(p,p+i.length)==i?{open:{pos:s+f+e.length,margin:/\s/.test(r.charAt(f+e.length))?1:0},close:{pos:n-d-i.length,margin:/\s/.test(o.charAt(p-1))?1:0}}:null}(e,s[i],t.from,t.to));if(2!=t&&!n.every(t=>t))return{changes:e.changes(i.map((t,e)=>n[e]?[]:[{from:t.from,insert:s[e].open+" "},{from:t.to,insert:" "+s[e].close}]))};if(1!=t&&n.some(t=>t)){let t=[];for(let e,i=0;in&&(t==r||r>a.from)){n=a.from;let t=/^\s*/.exec(a.text)[0].length,e=t==a.length,r=a.text.slice(t,t+i.length)==i?t:-1;tt.comment<0&&(!t.empty||t.single))){let t=[];for(let{line:e,token:i,indent:n,empty:r,single:o}of s)!o&&r||t.push({from:e.from+n,insert:i+" "});let i=e.changes(t);return{changes:i,selection:e.selection.map(i,1)}}if(1!=t&&s.some(t=>t.comment>=0)){let t=[];for(let{line:e,comment:i,token:n}of s)if(i>=0){let s=e.from+i,r=s+n.length;" "==e.text[r-e.from]&&r++,t.push({from:s,to:r})}return{changes:t}}return null}const jc=ze.define(),Kc=ze.define(),Uc=pe.define(),Yc=pe.define({combine:t=>si(t,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(i,s)=>t(i,s)||e(i,s)})}),Qc=xe.define({create:()=>fu.empty,update(t,e){let i=e.state.facet(Yc),s=e.annotation(jc);if(s){let n=iu.fromTransaction(e,s.selection),r=s.side,o=0==r?t.undone:t.done;return o=n?su(o,o.length,i.minDepth,n):lu(o,e.startState.selection),new fu(0==r?s.rest:o,0==r?o:s.rest)}let n=e.annotation(Kc);if("full"!=n&&"before"!=n||(t=t.isolate()),!1===e.annotation(je.addToHistory))return e.changes.empty?t:t.addMapping(e.changes.desc);let r=iu.fromTransaction(e),o=e.annotation(je.time),l=e.annotation(je.userEvent);return r?t=t.addChanges(r,o,l,i,e):e.selection&&(t=t.addSelection(e.startState.selection,o,l,i.newGroupDelay)),"full"!=n&&"after"!=n||(t=t.isolate()),t},toJSON:t=>({done:t.done.map(t=>t.toJSON()),undone:t.undone.map(t=>t.toJSON())}),fromJSON:t=>new fu(t.done.map(iu.fromJSON),t.undone.map(iu.fromJSON))});function Gc(t={}){return[Qc,Yc.of(t),jo.domEventHandlers({beforeinput(t,e){let i="historyUndo"==t.inputType?Jc:"historyRedo"==t.inputType?Zc:null;return!!i&&(t.preventDefault(),i(e))}})]}function Xc(t,e){return function({state:i,dispatch:s}){if(!e&&i.readOnly)return!1;let n=i.field(Qc,!1);if(!n)return!1;let r=n.pop(t,i,e);return!!r&&(s(r),!0)}}const Jc=Xc(0,!1),Zc=Xc(1,!1),tu=Xc(0,!0),eu=Xc(1,!0);class iu{constructor(t,e,i,s,n){this.changes=t,this.effects=e,this.mapped=i,this.startSelection=s,this.selectionsAfter=n}setSelAfter(t){return new iu(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,i;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(e=this.mapped)||void 0===e?void 0:e.toJSON(),startSelection:null===(i=this.startSelection)||void 0===i?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(t=>t.toJSON())}}static fromJSON(t){return new iu(t.changes&&se.fromJSON(t.changes),[],t.mapped&&ie.fromJSON(t.mapped),t.startSelection&&ue.fromJSON(t.startSelection),t.selectionsAfter.map(ue.fromJSON))}static fromTransaction(t,e){let i=ru;for(let e of t.startState.facet(Uc)){let s=e(t);s.length&&(i=i.concat(s))}return!i.length&&t.changes.empty?null:new iu(t.changes.invert(t.startState.doc),i,void 0,e||t.startState.selection,ru)}static selection(t){return new iu(void 0,ru,void 0,void 0,t)}}function su(t,e,i,s){let n=e+1>i+20?e-i-1:0,r=t.slice(n,e);return r.push(s),r}function nu(t,e){return t.length?e.length?t.concat(e):t:e}const ru=[],ou=200;function lu(t,e){if(t.length){let i=t[t.length-1],s=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-ou));return s.length&&s[s.length-1].eq(e)?t:(s.push(e),su(t,t.length-1,1e9,i.setSelAfter(s)))}return[iu.selection([e])]}function au(t){let e=t[t.length-1],i=t.slice();return i[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),i}function hu(t,e){if(!t.length)return t;let i=t.length,s=ru;for(;i;){let n=cu(t[i-1],e,s);if(n.changes&&!n.changes.empty||n.effects.length){let e=t.slice(0,i);return e[i-1]=n,e}e=n.mapped,i--,s=n.selectionsAfter}return s.length?[iu.selection(s)]:ru}function cu(t,e,i){let s=nu(t.selectionsAfter.length?t.selectionsAfter.map(t=>t.map(e)):ru,i);if(!t.changes)return iu.selection(s);let n=t.changes.map(e),r=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(r):r;return new iu(n,$e.mapEffects(t.effects,e),o,t.startSelection.map(r),s)}const uu=/^(input\.type|delete)($|\.)/;class fu{constructor(t,e,i=0,s=void 0){this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new fu(this.done,this.undone):this}addChanges(t,e,i,s,n){let r=this.done,o=r[r.length-1];return r=o&&o.changes&&!o.changes.empty&&t.changes&&(!i||uu.test(i))&&(!o.selectionsAfter.length&&e-this.prevTimei.push(t,e)),e.iterChangedRanges((t,e,n,r)=>{for(let t=0;t=e&&n<=o&&(s=!0)}}),s}(o.changes,t.changes))||"input.type.compose"==i)?su(r,r.length-1,s.minDepth,new iu(t.changes.compose(o.changes),nu($e.mapEffects(t.effects,o.changes),o.effects),o.mapped,o.startSelection,ru)):su(r,r.length,s.minDepth,t),new fu(r,ru,e,i)}addSelection(t,e,i,s){let n=this.done.length?this.done[this.done.length-1].selectionsAfter:ru;return n.length>0&&e-this.prevTimet.empty!=o.ranges[e].empty).length)?this:new fu(lu(this.done,t),this.undone,e,i);var r,o}addMapping(t){return new fu(hu(this.done,t),hu(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,e,i){let s=0==t?this.done:this.undone;if(0==s.length)return null;let n=s[s.length-1],r=n.selectionsAfter[0]||(n.startSelection?n.startSelection.map(n.changes.invertedDesc,1):e.selection);if(i&&n.selectionsAfter.length)return e.update({selection:n.selectionsAfter[n.selectionsAfter.length-1],annotations:jc.of({side:t,rest:au(s),selection:r}),userEvent:0==t?"select.undo":"select.redo",scrollIntoView:!0});if(n.changes){let i=1==s.length?ru:s.slice(0,s.length-1);return n.mapped&&(i=hu(i,n.mapped)),e.update({changes:n.changes,selection:n.startSelection,effects:n.effects,annotations:jc.of({side:t,rest:i,selection:r}),filter:!1,userEvent:0==t?"undo":"redo",scrollIntoView:!0})}return null}}fu.empty=new fu(ru,ru);const du=[{key:"Mod-z",run:Jc,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Zc,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Zc,preventDefault:!0},{key:"Mod-u",run:tu,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:eu,preventDefault:!0}];function pu(t,e){return ue.create(t.ranges.map(e),t.mainIndex)}function mu(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function gu({state:t,dispatch:e},i){let s=pu(t.selection,i);return!s.eq(t.selection,!0)&&(e(mu(t,s)),!0)}function vu(t,e){return ue.cursor(e?t.to:t.from)}function wu(t,e){return gu(t,i=>i.empty?t.moveByChar(i,e):vu(i,e))}function bu(t){return t.textDirectionAt(t.state.selection.main.head)==Es.LTR}const yu=t=>wu(t,!bu(t)),xu=t=>wu(t,bu(t));function ku(t,e){return gu(t,i=>i.empty?t.moveByGroup(i,e):vu(i,e))}"undefined"!=typeof Intl&&Intl.Segmenter;function Su(t,e,i){if(e.type.prop(i))return!0;let s=e.to-e.from;return s&&(s>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Cu(t,e,i){let n,r,o=Ya(t).resolveInner(e.head),l=i?s.closedBy:s.openedBy;for(let s=e.head;;){let e=i?o.childAfter(s):o.childBefore(s);if(!e)break;Su(t,e,l)?o=e:s=i?e.to:e.from}return r=o.type.prop(l)&&(n=i?cc(t,o.from,1):cc(t,o.to,-1))&&n.matched?i?n.end.to:n.end.from:i?o.to:o.from,ue.cursor(r,i?-1:1)}function Au(t,e){return gu(t,i=>{if(!i.empty)return vu(i,e);let s=t.moveVertically(i,e);return s.head!=i.head?s:t.moveToLineBoundary(i,e)})}const Mu=t=>Au(t,!1),Ou=t=>Au(t,!0);function Tu(t){let e,i=t.scrollDOM.clientHeighti.empty?t.moveVertically(i,e,s.height):vu(i,e));if(r.eq(n.selection))return!1;if(s.selfScroll){let e=t.coordsAtPos(n.selection.main.head),o=t.scrollDOM.getBoundingClientRect(),l=o.top+s.marginTop,a=o.bottom-s.marginBottom;e&&e.top>l&&e.bottomDu(t,!1),Pu=t=>Du(t,!0);function Bu(t,e,i){let s=t.lineBlockAt(e.head),n=t.moveToLineBoundary(e,i);if(n.head==e.head&&n.head!=(i?s.to:s.from)&&(n=t.moveToLineBoundary(e,i,!1)),!i&&n.head==s.from&&s.length){let i=/^\s*/.exec(t.state.sliceDoc(s.from,Math.min(s.from+100,s.to)))[0].length;i&&e.head!=s.from+i&&(n=ue.cursor(s.from+i))}return n}function Eu(t,e,i){let s=!1,n=pu(t.selection,e=>{let n=cc(t,e.head,-1)||cc(t,e.head,1)||e.head>0&&cc(t,e.head-1,1)||e.head{let i=e(t);return ue.range(t.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return!i.eq(t.state.selection)&&(t.dispatch(mu(t.state,i)),!0)}function Nu(t,e){return Lu(t,i=>t.moveByChar(i,e))}const Iu=t=>Nu(t,!bu(t)),Wu=t=>Nu(t,bu(t));function Hu(t,e){return Lu(t,i=>t.moveByGroup(i,e))}function Vu(t,e){return Lu(t,i=>t.moveVertically(i,e))}const Fu=t=>Vu(t,!1),zu=t=>Vu(t,!0);function qu(t,e){return Lu(t,i=>t.moveVertically(i,e,Tu(t).height))}const _u=t=>qu(t,!1),$u=t=>qu(t,!0),ju=({state:t,dispatch:e})=>(e(mu(t,{anchor:0})),!0),Ku=({state:t,dispatch:e})=>(e(mu(t,{anchor:t.doc.length})),!0),Uu=({state:t,dispatch:e})=>(e(mu(t,{anchor:t.selection.main.anchor,head:0})),!0),Yu=({state:t,dispatch:e})=>(e(mu(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0);function Qu(t,e){let{state:i}=t,s=i.selection,n=i.selection.ranges.slice();for(let s of i.selection.ranges){let r=i.doc.lineAt(s.head);if(e?r.to0)for(let i=s;;){let s=t.moveVertically(i,e);if(s.headr.to){n.some(t=>t.head==s.head)||n.push(s);break}if(s.head==i.head)break;i=s}}return n.length!=s.ranges.length&&(t.dispatch(mu(i,ue.create(n,n.length-1))),!0)}function Gu(t,e){if(t.state.readOnly)return!1;let i="delete.selection",{state:s}=t,n=s.changeByRange(s=>{let{from:n,to:r}=s;if(n==r){let o=e(s);on&&(i="delete.forward",o=Xu(t,o,!0)),n=Math.min(n,o),r=Math.max(r,o)}else n=Xu(t,n,!1),r=Xu(t,r,!0);return n==r?{range:s}:{changes:{from:n,to:r},range:ue.cursor(n,ne(t)))s.between(e,e,(t,s)=>{te&&(e=i?s:t)});return e}const Ju=(t,e,i)=>Gu(t,s=>{let n,r,o=s.from,{state:l}=t,a=l.doc.lineAt(o);if(i&&!e&&o>a.from&&oJu(t,!1,!0),tf=t=>Ju(t,!0,!1),ef=(t,e)=>Gu(t,i=>{let s=i.head,{state:n}=t,r=n.doc.lineAt(s),o=n.charCategorizer(s);for(let t=null;;){if(s==(e?r.to:r.from)){s==i.head&&r.number!=(e?n.doc.lines:1)&&(s+=e?1:-1);break}let l=Gt(r.text,s-r.from,e)+r.from,a=r.text.slice(Math.min(s,l)-r.from,Math.max(s,l)-r.from),h=o(a);if(null!=t&&h!=t)break;" "==a&&s==i.head||(t=h),s=l}return s}),sf=t=>ef(t,!1);function nf(t){let e=[],i=-1;for(let s of t.selection.ranges){let n=t.doc.lineAt(s.from),r=t.doc.lineAt(s.to);if(s.empty||s.to!=r.from||(r=t.doc.lineAt(s.to-1)),i>=n.number){let t=e[e.length-1];t.to=r.to,t.ranges.push(s)}else e.push({from:n.from,to:r.to,ranges:[s]});i=r.number+1}return e}function rf(t,e,i){if(t.readOnly)return!1;let s=[],n=[];for(let e of nf(t)){if(i?e.to==t.doc.length:0==e.from)continue;let r=t.doc.lineAt(i?e.to+1:e.from-1),o=r.length+1;if(i){s.push({from:e.to,to:r.to},{from:e.from,insert:r.text+t.lineBreak});for(let i of e.ranges)n.push(ue.range(Math.min(t.doc.length,i.anchor+o),Math.min(t.doc.length,i.head+o)))}else{s.push({from:r.from,to:e.from},{from:e.to,insert:t.lineBreak+r.text});for(let t of e.ranges)n.push(ue.range(t.anchor-o,t.head-o))}}return!!s.length&&(e(t.update({changes:s,scrollIntoView:!0,selection:ue.create(n,t.selection.mainIndex),userEvent:"move.line"})),!0)}function of(t,e,i){if(t.readOnly)return!1;let s=[];for(let e of nf(t))i?s.push({from:e.from,insert:t.doc.slice(e.from,e.to)+t.lineBreak}):s.push({from:e.to,insert:t.lineBreak+t.doc.slice(e.from,e.to)});let n=t.changes(s);return e(t.update({changes:n,selection:t.selection.map(n,i?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const lf=af(!1);function af(t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{let{from:n,to:r}=i,o=e.doc.lineAt(n),l=!t&&n==r&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let i,n=Ya(t).resolveInner(e),r=n.childBefore(e),o=n.childAfter(e);return r&&o&&r.to<=e&&o.from>=e&&(i=r.type.prop(s.closedBy))&&i.indexOf(o.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(o.from).from&&!/\S/.test(t.sliceDoc(r.to,o.from))?{from:r.to,to:o.from}:null}(e,n);t&&(n=r=(r<=o.to?o:e.doc.lineAt(r)).to);let a=new ch(e,{simulateBreak:n,simulateDoubleBreak:!!l}),h=hh(a,n);for(null==h&&(h=ki(/^\s*/.exec(e.doc.lineAt(n).text)[0],e.tabSize));ro.from&&n{let n=[];for(let r=s.from;r<=s.to;){let o=t.doc.lineAt(r);o.number>i&&(s.empty||s.to>o.from)&&(e(o,n,s),i=o.number),r=o.to+1}let r=t.changes(n);return{changes:n,range:ue.range(r.mapPos(s.anchor,1),r.mapPos(s.head,1))}})}const cf=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(hf(t,(e,i)=>{i.push({from:e.from,insert:t.facet(oh)})}),{userEvent:"input.indent"})),!0),uf=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(hf(t,(e,i)=>{let s=/^\s*/.exec(e.text)[0];if(!s)return;let n=ki(s,t.tabSize),r=0,o=ah(t,Math.max(0,n-lh(t)));for(;rgu(t,e=>Cu(t.state,e,!bu(t))),shift:t=>Lu(t,e=>Cu(t.state,e,!bu(t)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:t=>gu(t,e=>Cu(t.state,e,bu(t))),shift:t=>Lu(t,e=>Cu(t.state,e,bu(t)))},{key:"Alt-ArrowUp",run:({state:t,dispatch:e})=>rf(t,e,!1)},{key:"Shift-Alt-ArrowUp",run:({state:t,dispatch:e})=>of(t,e,!1)},{key:"Alt-ArrowDown",run:({state:t,dispatch:e})=>rf(t,e,!0)},{key:"Shift-Alt-ArrowDown",run:({state:t,dispatch:e})=>of(t,e,!0)},{key:"Mod-Alt-ArrowUp",run:t=>Qu(t,!1)},{key:"Mod-Alt-ArrowDown",run:t=>Qu(t,!0)},{key:"Escape",run:({state:t,dispatch:e})=>{let i=t.selection,s=null;return i.ranges.length>1?s=ue.create([i.main]):i.main.empty||(s=ue.create([ue.cursor(i.main.head)])),!!s&&(e(mu(t,s)),!0)}},{key:"Mod-Enter",run:af(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:t,dispatch:e})=>{let i=nf(t).map(({from:e,to:i})=>ue.range(e,Math.min(i+1,t.doc.length)));return e(t.update({selection:ue.create(i),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:t,dispatch:e})=>{let i=pu(t.selection,e=>{let i=Ya(t),s=i.resolveStack(e.from,1);if(e.empty){let t=i.resolveStack(e.from,-1);t.node.from>=s.node.from&&t.node.to<=s.node.to&&(s=t)}for(let t=s;t;t=t.next){let{node:i}=t;if((i.from=e.to||i.to>e.to&&i.from<=e.from)&&t.next)return ue.range(i.to,i.from)}return e});return!i.eq(t.selection)&&(e(mu(t,i)),!0)},preventDefault:!0},{key:"Mod-[",run:uf},{key:"Mod-]",run:cf},{key:"Mod-Alt-\\",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=Object.create(null),s=new ch(t,{overrideIndentation:t=>{let e=i[t];return e??-1}}),n=hf(t,(e,n,r)=>{let o=hh(s,e.from);if(null==o)return;/\S/.test(e.text)||(o=0);let l=/^\s*/.exec(e.text)[0],a=ah(t,o);(l!=a||r.from{if(t.state.readOnly)return!1;let{state:e}=t,i=e.changes(nf(e).map(({from:t,to:i})=>(t>0?t--:i{let i;if(t.lineWrapping){let s=t.lineBlockAt(e.head),n=t.coordsAtPos(e.head,e.assoc||1);n&&(i=s.bottom+t.documentTop-n.bottom+t.defaultLineHeight/2)}return t.moveVertically(e,!0,i)}).map(i);return t.dispatch({changes:i,selection:s,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:t,dispatch:e})=>Eu(t,e,!1)},{key:"Mod-/",run:t=>{let{state:e}=t,i=e.doc.lineAt(e.selection.main.from),s=zc(t.state,i.from);return s.line?Hc(t):!!s.block&&Fc(t)}},{key:"Alt-A",run:Vc},{key:"Ctrl-m",mac:"Shift-Alt-m",run:t=>(t.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:yu,shift:Iu,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:t=>ku(t,!bu(t)),shift:t=>Hu(t,!bu(t)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:t=>gu(t,e=>Bu(t,e,!bu(t))),shift:t=>Lu(t,e=>Bu(t,e,!bu(t))),preventDefault:!0},{key:"ArrowRight",run:xu,shift:Wu,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:t=>ku(t,bu(t)),shift:t=>Hu(t,bu(t)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:t=>gu(t,e=>Bu(t,e,bu(t))),shift:t=>Lu(t,e=>Bu(t,e,bu(t))),preventDefault:!0},{key:"ArrowUp",run:Mu,shift:Fu,preventDefault:!0},{mac:"Cmd-ArrowUp",run:ju,shift:Uu},{mac:"Ctrl-ArrowUp",run:Ru,shift:_u},{key:"ArrowDown",run:Ou,shift:zu,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Ku,shift:Yu},{mac:"Ctrl-ArrowDown",run:Pu,shift:$u},{key:"PageUp",run:Ru,shift:_u},{key:"PageDown",run:Pu,shift:$u},{key:"Home",run:t=>gu(t,e=>Bu(t,e,!1)),shift:t=>Lu(t,e=>Bu(t,e,!1)),preventDefault:!0},{key:"Mod-Home",run:ju,shift:Uu},{key:"End",run:t=>gu(t,e=>Bu(t,e,!0)),shift:t=>Lu(t,e=>Bu(t,e,!0)),preventDefault:!0},{key:"Mod-End",run:Ku,shift:Yu},{key:"Enter",run:lf,shift:lf},{key:"Mod-a",run:({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:Zu,shift:Zu,preventDefault:!0},{key:"Delete",run:tf,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:sf,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:t=>ef(t,!0),preventDefault:!0},{mac:"Mod-Backspace",run:t=>Gu(t,e=>{let i=t.moveToLineBoundary(e,!1).head;return e.head>i?i:Math.max(0,e.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:t=>Gu(t,e=>{let i=t.moveToLineBoundary(e,!0).head;return e.headgu(t,e=>ue.cursor(t.lineBlockAt(e.head).from,1)),shift:t=>Lu(t,e=>ue.cursor(t.lineBlockAt(e.head).from))},{key:"Ctrl-e",run:t=>gu(t,e=>ue.cursor(t.lineBlockAt(e.head).to,-1)),shift:t=>Lu(t,e=>ue.cursor(t.lineBlockAt(e.head).to))},{key:"Ctrl-d",run:tf},{key:"Ctrl-h",run:Zu},{key:"Ctrl-k",run:t=>Gu(t,e=>{let i=t.lineBlockAt(e.head).to;return e.head{if(t.readOnly)return!1;let i=t.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:Ft.of(["",""])},range:ue.cursor(t.from)}));return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(e=>{if(!e.empty||0==e.from||e.from==t.doc.length)return{range:e};let i=e.from,s=t.doc.lineAt(i),n=i==s.from?i-1:Gt(s.text,i-s.from,!1)+s.from,r=i==s.to?i+1:Gt(s.text,i-s.from,!0)+s.from;return{changes:{from:n,to:r,insert:t.doc.slice(i,r).append(t.doc.slice(n,i))},range:ue.cursor(r)}});return!i.changes.empty&&(e(t.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Pu}].map(t=>({mac:t.key,run:t.run,shift:t.shift})))),df="function"==typeof String.prototype.normalize?t=>t.normalize("NFKD"):t=>t;class pf{constructor(t,e,i=0,s=t.length,n,r){this.test=r,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,s),this.bufferStart=i,this.normalize=n?t=>n(df(t)):df,this.query=this.normalize(e)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Xt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=Jt(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=Zt(t);let s=this.normalize(e);if(s.length)for(let t=0,n=i,r=!0;;t++){let i=s.charCodeAt(t),o=this.match(i,n,r,this.bufferPos+this.bufferStart,t==s.length-1);if(o)return this.value=o,this;if(t==s.length-1)break;r&&tthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let i=this.curLineStart+e.index,s=i+e[0].length;if(this.matchPos=xf(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,s,e)))return this.value={from:i,to:s,precise:!0,match:e},this;t=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=i||s.to<=e){let s=new bf(e,t.sliceString(e,i));return wf.set(t,s),s}if(s.from==e&&s.to==i)return s;let{text:n,from:r}=s;return r>e&&(n=t.sliceString(e,r)+n,r=e),s.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let t=this.flat.from+e.index,i=t+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(t,i,e)))return this.value={from:t,to:i,precise:!0,match:e},this.matchPos=xf(this.text,i+(t==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=bf.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function xf(t,e){if(e>=t.length)return e;let i,s=t.lineAt(e);for(;e=56320&&i<57344;)e++;return e}"undefined"!=typeof Symbol&&(vf.prototype[Symbol.iterator]=yf.prototype[Symbol.iterator]=function(){return this});const kf={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Sf=pe.define({combine:t=>si(t,kf,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})});function Cf(t){let e=[Df,Tf];return t&&e.push(Sf.of(t)),e}const Af=ss.mark({class:"cm-selectionMatch"}),Mf=ss.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Of(t,e,i,s){return!(0!=i&&t(e.sliceDoc(i-1,i))==Je.Word||s!=e.doc.length&&t(e.sliceDoc(s,s+1))==Je.Word)}const Tf=bn.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(Sf),{state:i}=t,s=i.selection;if(s.ranges.length>1)return ss.none;let n,r=s.main,o=null;if(r.empty){if(!e.highlightWordAroundCursor)return ss.none;let t=i.wordAt(r.head);if(!t)return ss.none;o=i.charCategorizer(r.head),n=i.sliceDoc(t.from,t.to)}else{let t=r.to-r.from;if(t200)return ss.none;if(e.wholeWords){if(n=i.sliceDoc(r.from,r.to),o=i.charCategorizer(r.head),!Of(o,i,r.from,r.to)||!function(t,e,i,s){return t(e.sliceDoc(i,i+1))==Je.Word&&t(e.sliceDoc(s-1,s))==Je.Word}(o,i,r.from,r.to))return ss.none}else if(n=i.sliceDoc(r.from,r.to),!n)return ss.none}let l=[];for(let s of t.visibleRanges){let t=new pf(i.doc,n,s.from,s.to);for(;!t.next().done;){let{from:s,to:n}=t.value;if((!o||Of(o,i,s,n))&&(r.empty&&s<=r.from&&n>=r.to?l.push(Mf.range(s,n)):(s>=r.to||n<=r.from)&&l.push(Af.range(s,n)),l.length>e.maxMatches))return ss.none}}return ss.set(l)}},{decorations:t=>t.decorations}),Df=jo.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});const Rf=pe.define({combine:t=>si(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new rd(t),scrollToMatch:t=>jo.scrollIntoView(t)})});class Pf{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||function(t){try{return new RegExp(t,gf),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(t,e)=>"n"==e?"\n":"r"==e?"\r":"t"==e?"\t":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new Hf(this):new Lf(this)}getCursor(t,e=0,i){let s=t.doc?t:ii.create({doc:t});return null==i&&(i=s.doc.length),this.regexp?Nf(this,s,e,i):Ef(this,s,e,i)}}class Bf{constructor(t){this.spec=t}}function Ef(t,e,i,s){let n;return t.wholeWord&&(n=function(t,e){return(i,s,n,r)=>((r>i||r+n.length{if(i&&!i(s,n,r,o))return!1;let l=s>=o&&n<=o+r.length?r.slice(s-o,n-o):e.doc.sliceString(s,n);return t(l,e,s,n)}}(t.test,e,n)),new pf(e.doc,t.unquoted,i,s,t.caseSensitive?void 0:t=>t.toLowerCase(),n)}class Lf extends Bf{constructor(t){super(t)}nextMatch(t,e,i){let s=Ef(this.spec,t,i,t.doc.length).nextOverlapping();if(s.done){let i=Math.min(t.doc.length,e+this.spec.unquoted.length);s=Ef(this.spec,t,0,i).nextOverlapping()}return s.done||s.value.from==e&&s.value.to==i?null:s.value}prevMatchInRange(t,e,i){for(let s=i;;){let i=Math.max(e,s-1e4-this.spec.unquoted.length),n=Ef(this.spec,t,i,s),r=null;for(;!n.nextOverlapping().done;)r=n.value;if(r)return r;if(i==e)return null;s-=1e4}}prevMatch(t,e,i){let s=this.prevMatchInRange(t,0,e);return s||(s=this.prevMatchInRange(t,Math.max(0,i-this.spec.unquoted.length),t.doc.length)),!s||s.from==e&&s.to==i?null:s}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,e){let i=Ef(this.spec,t,0,t.doc.length),s=[];for(;!i.next().done;){if(s.length>=e)return null;s.push(i.value)}return s}highlight(t,e,i,s){let n=Ef(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!n.next().done;)s(n.value.from,n.value.to)}}function Nf(t,e,i,s){let n;var r;return t.wholeWord&&(r=e.charCategorizer(e.selection.main.head),n=(t,e,i)=>!i[0].length||(r(If(i.input,i.index))!=Je.Word||r(Wf(i.input,i.index))!=Je.Word)&&(r(Wf(i.input,i.index+i[0].length))!=Je.Word||r(If(i.input,i.index+i[0].length))!=Je.Word)),t.test&&(n=function(t,e,i){return(s,n,r)=>(!i||i(s,n,r))&&t(r[0],e,s,n)}(t.test,e,n)),new vf(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:n},i,s)}function If(t,e){return t.slice(Gt(t,e,!1),e)}function Wf(t,e){return t.slice(e,Gt(t,e))}class Hf extends Bf{nextMatch(t,e,i){let s=Nf(this.spec,t,i,t.doc.length).next();return s.done&&(s=Nf(this.spec,t,0,e).next()),s.done?null:s.value}prevMatchInRange(t,e,i){for(let s=1;;s++){let n=Math.max(e,i-1e4*s),r=Nf(this.spec,t,n,i),o=null;for(;!r.next().done;)o=r.value;if(o&&(n==e||o.from>n+10))return o;if(n==e)return null}}prevMatch(t,e,i){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(e,i)=>{if("&"==i)return t.match[0];if("$"==i)return"$";for(let e=i.length;e>0;e--){let s=+i.slice(0,e);if(s>0&&s=e)return null;s.push(i.value)}return s}highlight(t,e,i,s){let n=Nf(this.spec,t,Math.max(0,e-250),Math.min(i+250,t.doc.length));for(;!n.next().done;)s(n.value.from,n.value.to)}}const Vf=$e.define(),Ff=$e.define(),zf=xe.define({create:t=>new qf(Zf(t).create(),null),update(t,e){for(let i of e.effects)i.is(Vf)?t=new qf(i.value.create(),t.panel):i.is(Ff)&&(t=new qf(t.query,i.value?Jf:null));return t},provide:t=>fa.from(t,t=>t.panel)});class qf{constructor(t,e){this.query=t,this.panel=e}}const _f=ss.mark({class:"cm-searchMatch"}),$f=ss.mark({class:"cm-searchMatch cm-searchMatch-selected"}),jf=bn.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(zf))}update(t){let e=t.state.field(zf);(e!=t.startState.field(zf)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return ss.none;let{view:i}=this,s=new ui;for(let e=0,n=i.visibleRanges,r=n.length;en[e+1].from-500;)l=n[++e].to;t.highlight(i.state,o,l,(t,e)=>{let n=i.state.selection.ranges.some(i=>i.from==t&&i.to==e);s.add(t,e,n?$f:_f)})}return s.finish()}},{decorations:t=>t.decorations});function Kf(t){return e=>{let i=e.state.field(zf,!1);return i&&i.query.spec.valid?t(e,i):id(e)}}const Uf=Kf((t,{query:e})=>{let{to:i}=t.state.selection.main,s=e.nextMatch(t.state,i,i);if(!s)return!1;let n=ue.single(s.from,s.to),r=t.state.facet(Rf);return t.dispatch({selection:n,effects:[hd(t,s),r.scrollToMatch(n.main,t)],userEvent:"select.search"}),ed(t),!0}),Yf=Kf((t,{query:e})=>{let{state:i}=t,{from:s}=i.selection.main,n=e.prevMatch(i,s,s);if(!n)return!1;let r=ue.single(n.from,n.to),o=t.state.facet(Rf);return t.dispatch({selection:r,effects:[hd(t,n),o.scrollToMatch(r.main,t)],userEvent:"select.search"}),ed(t),!0}),Qf=Kf((t,{query:e})=>{let i=e.matchAll(t.state,1e3);return!(!i||!i.length)&&(t.dispatch({selection:ue.create(i.map(t=>ue.range(t.from,t.to))),userEvent:"select.search.matches"}),!0)}),Gf=Kf((t,{query:e})=>{let{state:i}=t,{from:s,to:n}=i.selection.main;if(i.readOnly)return!1;let r=e.nextMatch(i,s,s);if(!r)return!1;let o,l,a=r,h=[],c=[];a.precise?a.from==s&&a.to==n&&(l=i.toText(e.getReplacement(a)),h.push({from:a.from,to:a.to,insert:l}),a=e.nextMatch(i,a.from,a.to),c.push(jo.announce.of(i.phrase("replaced match on line $",i.doc.lineAt(s).number)+"."))):a=e.nextMatch(i,a.from,a.to);let u=t.state.changes(h);return a&&(o=ue.single(a.from,a.to).map(u),c.push(hd(t,a)),c.push(i.facet(Rf).scrollToMatch(o.main,t))),t.dispatch({changes:u,selection:o,effects:c,userEvent:"input.replace"}),!0}),Xf=Kf((t,{query:e})=>{if(t.state.readOnly)return!1;let i=[];for(let s of e.matchAll(t.state,1e9)){let{from:t,to:n,precise:r}=s;r&&i.push({from:t,to:n,insert:e.getReplacement(s)})}if(!i.length)return!1;let s=t.state.phrase("replaced $ matches",i.length)+".";return t.dispatch({changes:i,effects:jo.announce.of(s),userEvent:"input.replace.all"}),!0});function Jf(t){return t.state.facet(Rf).createPanel(t)}function Zf(t,e){var i,s,n,r,o;let l=t.selection.main,a=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=t.facet(Rf);return new Pf({search:(null!==(i=null==e?void 0:e.literal)&&void 0!==i?i:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:null!==(s=null==e?void 0:e.caseSensitive)&&void 0!==s?s:h.caseSensitive,literal:null!==(n=null==e?void 0:e.literal)&&void 0!==n?n:h.literal,regexp:null!==(r=null==e?void 0:e.regexp)&&void 0!==r?r:h.regexp,wholeWord:null!==(o=null==e?void 0:e.wholeWord)&&void 0!==o?o:h.wholeWord})}function td(t){let e=aa(t,Jf);return e&&e.dom.querySelector("[main-field]")}function ed(t){let e=td(t);e&&e==t.root.activeElement&&e.select()}const id=t=>{let e=t.state.field(zf,!1);if(e&&e.panel){let i=td(t);if(i&&i!=t.root.activeElement){let s=Zf(t.state,e.query.spec);s.valid&&t.dispatch({effects:Vf.of(s)}),i.focus(),i.select()}}else t.dispatch({effects:[Ff.of(!0),e?Vf.of(Zf(t.state,e.query.spec)):$e.appendConfig.of(ud)]});return!0},sd=t=>{let e=t.state.field(zf,!1);if(!e||!e.panel)return!1;let i=aa(t,Jf);return i&&i.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:Ff.of(!1)}),!0},nd=[{key:"Mod-f",run:id,scope:"editor search-panel"},{key:"F3",run:Uf,shift:Yf,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Uf,shift:Yf,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:sd,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:t,dispatch:e})=>{let i=t.selection;if(i.ranges.length>1||i.main.empty)return!1;let{from:s,to:n}=i.main,r=[],o=0;for(let e=new pf(t.doc,t.sliceDoc(s,n));!e.next().done;){if(r.length>1e3)return!1;e.value.from==s&&(o=r.length),r.push(ue.range(e.value.from,e.value.to))}return e(t.update({selection:ue.create(r,o),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:t=>{let{state:e}=t,i=String(e.doc.lineAt(t.state.selection.main.head).number),{close:s,result:n}=da(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:i},focus:!0,submitLabel:e.phrase("go")});return n.then(i=>{let n=i&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(i.elements.line.value);if(!n)return void t.dispatch({effects:s});let r=e.doc.lineAt(e.selection.main.head),[,o,l,a,h]=n,c=a?+a.slice(1):0,u=l?+l:r.number;if(l&&h){let t=u/100;o&&(t=t*("-"==o?-1:1)+r.number/e.doc.lines),u=Math.round(e.doc.lines*t)}else l&&o&&(u=u*("-"==o?-1:1)+r.number);let f=e.doc.line(Math.max(1,Math.min(e.doc.lines,u))),d=ue.cursor(f.from+Math.max(0,Math.min(c,f.length)));t.dispatch({effects:[s,jo.scrollIntoView(d.from,{y:"center"})],selection:d})}),!0}},{key:"Mod-d",run:({state:t,dispatch:e})=>{let{ranges:i}=t.selection;if(i.some(t=>t.from===t.to))return(({state:t,dispatch:e})=>{let{selection:i}=t,s=ue.create(i.ranges.map(e=>t.wordAt(e.head)||ue.cursor(e.head)),i.mainIndex);return!s.eq(i)&&(e(t.update({selection:s})),!0)})({state:t,dispatch:e});let s=t.sliceDoc(i[0].from,i[0].to);if(t.selection.ranges.some(e=>t.sliceDoc(e.from,e.to)!=s))return!1;let n=function(t,e){let{main:i,ranges:s}=t.selection,n=t.wordAt(i.head),r=n&&n.from==i.from&&n.to==i.to;for(let i=!1,n=new pf(t.doc,e,s[s.length-1].to);;){if(n.next(),!n.done){if(i&&s.some(t=>t.from==n.value.from))continue;if(r){let e=t.wordAt(n.value.from);if(!e||e.from!=n.value.from||e.to!=n.value.to)continue}return n.value}if(i)return null;n=new pf(t.doc,e,0,Math.max(0,s[s.length-1].from-1)),i=!0}}(t,s);return!!n&&(e(t.update({selection:t.selection.addRange(ue.range(n.from,n.to),!1),effects:jo.scrollIntoView(n.to)})),!0)},preventDefault:!0}];class rd{constructor(t){this.view=t;let e=this.query=t.state.field(zf).query.spec;function i(t,e,i){return Ii("button",{class:"cm-button",name:t,onclick:e,type:"button"},i)}this.commit=this.commit.bind(this),this.searchField=Ii("input",{value:e.search,placeholder:od(t,"Find"),"aria-label":od(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ii("input",{value:e.replace,placeholder:od(t,"Replace"),"aria-label":od(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ii("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=Ii("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=Ii("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit}),this.dom=Ii("div",{onkeydown:t=>this.keydown(t),class:"cm-search"},[this.searchField,i("next",()=>Uf(t),[od(t,"next")]),i("prev",()=>Yf(t),[od(t,"previous")]),i("select",()=>Qf(t),[od(t,"all")]),Ii("label",null,[this.caseField,od(t,"match case")]),Ii("label",null,[this.reField,od(t,"regexp")]),Ii("label",null,[this.wordField,od(t,"by word")]),...t.state.readOnly?[]:[Ii("br"),this.replaceField,i("replace",()=>Gf(t),[od(t,"replace")]),i("replaceAll",()=>Xf(t),[od(t,"replace all")])],Ii("button",{name:"close",onclick:()=>sd(t),"aria-label":od(t,"close"),type:"button"},["×"])])}commit(){let t=new Pf({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:Vf.of(t)}))}keydown(t){var e,i,s;e=this.view,i=t,s="search-panel",rl(el(e.state),i,e,s)?t.preventDefault():13==t.keyCode&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?Yf:Uf)(this.view)):13==t.keyCode&&t.target==this.replaceField&&(t.preventDefault(),Gf(this.view))}update(t){for(let e of t.transactions)for(let t of e.effects)t.is(Vf)&&!t.value.eq(this.query)&&this.setQuery(t.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Rf).top}}function od(t,e){return t.state.phrase(e)}const ld=30,ad=/[\s\.,:;?!]/;function hd(t,{from:e,to:i}){let s=t.state.doc.lineAt(e),n=t.state.doc.lineAt(i).to,r=Math.max(s.from,e-ld),o=Math.min(n,i+ld),l=t.state.sliceDoc(r,o);if(r!=s.from)for(let t=0;tl.length-ld;t--)if(!ad.test(l[t-1])&&ad.test(l[t])){l=l.slice(0,t);break}return jo.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${s.number}.`)}const cd=jo.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),ud=[zf,Oe.low(jf),cd];class fd{constructor(t,e,i,s){this.state=t,this.pos=e,this.explicit=i,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=Ya(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),s=e.text.slice(i-e.from,this.pos-e.from),n=s.search(vd(t,!1));return n<0?null:{from:i+n,to:this.pos,text:s.slice(n)}}get aborted(){return null==this.abortListeners}addEventListener(t,e,i){"abort"==t&&this.abortListeners&&(this.abortListeners.push(e),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function dd(t){let e=Object.keys(t).join(""),i=/\w/.test(e);return i&&(e=e.replace(/\w/g,"")),`[${i?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function pd(t){let e=t.map(t=>"string"==typeof t?{label:t}:t),[i,s]=e.every(t=>/^\w+$/.test(t.label))?[/\w*$/,/\w+$/]:function(t){let e=Object.create(null),i=Object.create(null);for(let{label:s}of t){e[s[0]]=!0;for(let t=1;t{let n=t.matchBefore(s);return n||t.explicit?{from:n?n.from:t.pos,options:e,validFor:i}:null}}class md{constructor(t,e,i,s){this.completion=t,this.source=e,this.match=i,this.score=s}}function gd(t){return t.selection.main.from}function vd(t,e){var i;let{source:s}=t,n=e&&"^"!=s[0],r="$"!=s[s.length-1];return n||r?new RegExp(`${n?"^":""}(?:${s})${r?"$":""}`,null!==(i=t.flags)&&void 0!==i?i:t.ignoreCase?"i":""):t}const wd=ze.define();function bd(t,e,i,s){let{main:n}=t.selection,r=i-n.from,o=s-n.from;return{...t.changeByRange(l=>{if(l!=n&&i!=s&&t.sliceDoc(l.from+r,l.from+o)!=t.sliceDoc(i,s))return{range:l};let a=t.toText(e);return{changes:{from:l.from+r,to:s==n.from?l.to:l.from+o,insert:a},range:ue.cursor(l.from+r+a.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const yd=new WeakMap;function xd(t){if(!Array.isArray(t))return t;let e=yd.get(t);return e||yd.set(t,e=pd(t)),e}const kd=$e.define(),Sd=$e.define();class Cd{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e=48&&a<=57||a>=97&&a<=122?2:a>=65&&a<=90?1:0:(w=Jt(a))!=w.toLowerCase()?1:w!=w.toUpperCase()?2:0;(!s||1==b&&m||0==v&&0!=b)&&(e[c]==a||i[c]==a&&(u=!0)?r[c++]=s:r.length&&(g=!1)),v=b,s+=Zt(a)}return c==l&&0==r[0]&&g?this.result((u?-200:0)-100,r,t):f==l&&0==d?this.ret(-200-t.length+(p==t.length?0:-100),[0,p]):o>-1?this.ret(-700-t.length,[o,o+this.pattern.length]):f==l?this.ret(-900-t.length,[d,p]):c==l?this.result((u?-200:0)-100-700+(g?0:-1100),r,t):2==e.length?null:this.result((s[0]?-700:0)-200-1100,s,t)}result(t,e,i){let s=[],n=0;for(let t of e){let e=t+(this.astral?Zt(Xt(i,t)):1);n&&s[n-1]==t?s[n-1]=e:(s[n++]=t,s[n++]=e)}return this.ret(t-i.length,s)}}class Ad{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.lengthsi(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Td,filterStrict:!1,compareCompletions:(t,e)=>(t.sortText||t.label).localeCompare(e.sortText||e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>i=>Od(t(i),e(i)),optionClass:(t,e)=>i=>Od(t(i),e(i)),addToOptions:(t,e)=>t.concat(e),filterStrict:(t,e)=>t||e})});function Od(t,e){return t?e?t+" "+e:t:e}function Td(t,e,i,s,n,r){let o,l,a=t.textDirection==Es.RTL,h=a,c=!1,u="top",f=e.left-n.left,d=n.right-e.right,p=s.right-s.left,m=s.bottom-s.top;if(h&&f=m||t>e.top?o=i.bottom-e.top:(u="bottom",o=e.bottom-i.top)}return{style:`${u}: ${o/((e.bottom-e.top)/r.offsetHeight)}px; max-width: ${l/((e.right-e.left)/r.offsetWidth)}px`,class:"cm-completionInfo-"+(c?a?"left-narrow":"right-narrow":h?"left":"right")}}const Dd=$e.define();function Rd(t,e,i){if(t<=i)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let t=Math.floor(e/i);return{from:t*i,to:(t+1)*i}}let s=Math.ceil((t-e)/i);return{from:t-s*i,to:t-(s-1)*i}}class Pd{constructor(t,e,i){this.view=t,this.stateField=e,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:t=>this.placeInfo(t),key:this},this.space=null,this.currentClass="";let s=t.state.field(e),{options:n,selected:r}=s.open,o=t.state.facet(Md);this.optionContent=function(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(t){let e=document.createElement("div");return e.classList.add("cm-completionIcon"),t.type&&e.classList.add(...t.type.split(/\s+/g).map(t=>"cm-completionIcon-"+t)),e.setAttribute("aria-hidden","true"),e},position:20}),e.push({render(t,e,i,s){let n=document.createElement("span");n.className="cm-completionLabel";let r=t.displayLabel||t.label,o=0;for(let t=0;to&&n.appendChild(document.createTextNode(r.slice(o,e)));let l=n.appendChild(document.createElement("span"));l.appendChild(document.createTextNode(r.slice(e,i))),l.className="cm-completionMatchedText",o=i}return ot.position-e.position).map(t=>t.render)}(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=Rd(n.length,r,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",i=>{let{options:s}=t.state.field(e).open;for(let e,n=i.target;n&&n!=this.dom;n=n.parentNode)if("LI"==n.nodeName&&(e=/-(\d+)$/.exec(n.id))&&+e[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;null!=e&&(t.dispatch({effects:Dd.of(e)}),i.preventDefault())}}),this.dom.addEventListener("focusout",e=>{let i=t.state.field(this.stateField,!1);i&&i.tooltip&&t.state.facet(Md).closeOnBlur&&e.relatedTarget!=t.contentDOM&&t.dispatch({effects:Sd.of(null)})}),this.showOptions(n,s.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var e;let i=t.state.field(this.stateField),s=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=s){let{options:n,selected:r,disabled:o}=i.open;s.open&&s.open.options==n||(this.range=Rd(n.length,r,t.state.facet(Md).maxRenderedOptions),this.showOptions(n,i.id)),this.updateSel(),o!=(null===(e=s.open)||void 0===e?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let t of this.currentClass.split(" "))t&&this.dom.classList.remove(t);for(let t of e.split(" "))t&&this.dom.classList.add(t);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;(e.selected>-1&&e.selected=this.range.to)&&(this.range=Rd(e.options.length,e.selected,this.view.state.facet(Md).maxRenderedOptions),this.showOptions(e.options,t.id));let i=this.updateSelectedOption(e.selected);if(i){this.destroyInfo();let{completion:s}=e.options[e.selected],{info:n}=s;if(!n)return;let r="string"==typeof n?document.createTextNode(n):n(s);if(!r)return;"then"in r?r.then(e=>{e&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(e,s)}).catch(t=>mn(this.view.state,t,"completion info")):(this.addInfoPane(r,s),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,e){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=t.nodeType)i.appendChild(t),this.infoDestroy=null;else{let{dom:e,destroy:s}=t;i.appendChild(e),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)"LI"==i.nodeName&&i.id?s==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),e=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby")):s--;return e&&function(t,e){let i=t.getBoundingClientRect(),s=e.getBoundingClientRect(),n=i.height/t.offsetHeight;s.topi.bottom&&(t.scrollTop+=(s.bottom-i.bottom)/n)}(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=t.getBoundingClientRect(),n=this.space;if(!n){let t=this.dom.ownerDocument.documentElement;n={left:0,top:0,right:t.clientWidth,bottom:t.clientHeight}}return s.top>Math.min(n.bottom,e.bottom)-10||s.bottom{t.target==s&&t.preventDefault()});let n=null;for(let r=i.from;ri.from||0==i.from))if(n=t,"string"!=typeof a&&a.header)s.appendChild(a.header(a));else{s.appendChild(document.createElement("completion-section")).textContent=t}}const h=s.appendChild(document.createElement("li"));h.id=e+"-"+r,h.setAttribute("role","option");let c=this.optionClass(o);c&&(h.className=c);for(let t of this.optionContent){let e=t(o,this.view.state,this.view,l);e&&h.appendChild(e)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.tonew Pd(i,t,e)}function Ed(t){return 100*(t.boost||0)+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}class Ld{constructor(t,e,i,s,n,r){this.options=t,this.attrs=e,this.tooltip=i,this.timestamp=s,this.selected=n,this.disabled=r}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new Ld(this.options,Hd(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,i,s,n,r){if(s&&!r&&t.some(t=>t.isPending))return s.setDisabled();let o=function(t,e){let i=[],s=null,n=null,r=t=>{i.push(t);let{section:e}=t.completion;if(e){s||(s=[]);let t="string"==typeof e?e:e.name;s.some(e=>e.name==t)||s.push("string"==typeof e?{name:t}:e)}},o=e.facet(Md);for(let s of t)if(s.hasResult()){let t=s.result.getMatch;if(!1===s.result.filter)for(let e of s.result.options)r(new md(e,s.source,t?t(e):[],1e9-i.length));else{let i,l=e.sliceDoc(s.from,s.to),a=o.filterStrict?new Ad(l):new Cd(l);for(let e of s.result.options)if(i=a.match(e.label)){let o=e.displayLabel?t?t(e,i.matched):[]:i.matched,l=i.score+(e.boost||0);if(r(new md(e,s.source,o,l)),"object"==typeof e.section&&"dynamic"===e.section.rank){let{name:t}=e.section;n||(n=Object.create(null)),n[t]=Math.max(l,n[t]||-1e9)}}}}if(s){let t=Object.create(null),e=0,r=(t,e)=>("dynamic"===t.rank&&"dynamic"===e.rank?n[e.name]-n[t.name]:0)||("number"==typeof t.rank?t.rank:1e9)-("number"==typeof e.rank?e.rank:1e9)||(t.namee.score-t.score||h(t.completion,e.completion))){let e=t.completion;!a||a.label!=e.label||a.detail!=e.detail||null!=a.type&&null!=e.type&&a.type!=e.type||a.apply!=e.apply||a.boost!=e.boost?l.push(t):Ed(t.completion)>Ed(a)&&(l[l.length-1]=t),a=t.completion}return l}(t,e);if(!o.length)return s&&t.some(t=>t.isPending)?s.setDisabled():null;let l=e.facet(Md).selectOnOpen?0:-1;if(s&&s.selected!=l&&-1!=s.selected){let t=s.options[s.selected].completion;for(let e=0;ee.hasResult()?Math.min(t,e.from):t,1e8),create:Kd,above:n.aboveCursor},s?s.timestamp:Date.now(),l,!1)}map(t){return new Ld(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Ld(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Nd{constructor(t,e,i){this.active=t,this.id=e,this.open=i}static start(){return new Nd(Vd,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(t){let{state:e}=t,i=e.facet(Md),s=(i.override||e.languageDataAt("autocomplete",gd(e)).map(xd)).map(e=>(this.active.find(t=>t.source==e)||new zd(e,this.active.some(t=>0!=t.state)?1:0)).update(t,i));s.length==this.active.length&&s.every((t,e)=>t==this.active[e])&&(s=this.active);let n=this.open,r=t.effects.some(t=>t.is(_d));n&&t.docChanged&&(n=n.map(t.changes)),t.selection||s.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!function(t,e){if(t==e)return!0;for(let i=0,s=0;;){for(;it.isPending)&&(n=null),!n&&s.every(t=>!t.isPending)&&s.some(t=>t.hasResult())&&(s=s.map(t=>t.hasResult()?new zd(t.source,0):t));for(let e of t.effects)e.is(Dd)&&(n=n&&n.setSelected(e.value,this.id));return s==this.active&&n==this.open?this:new Nd(s,this.id,n)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Id:Wd}}const Id={"aria-autocomplete":"list"},Wd={};function Hd(t,e){let i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(i["aria-activedescendant"]=t+"-"+e),i}const Vd=[];function Fd(t,e){if(t.isUserEvent("input.complete")){let i=t.annotation(wd);if(i&&e.activateOnCompletion(i))return 12}let i=t.isUserEvent("input.type");return i&&e.activateOnTyping?5:i?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class zd{constructor(t,e,i=!1){this.source=t,this.state=e,this.explicit=i}hasResult(){return!1}get isPending(){return 1==this.state}update(t,e){let i=Fd(t,e),s=this;(8&i||16&i&&this.touches(t))&&(s=new zd(s.source,0)),4&i&&0==s.state&&(s=new zd(this.source,1)),s=s.updateFor(t,i);for(let e of t.effects)if(e.is(kd))s=new zd(s.source,1,e.value);else if(e.is(Sd))s=new zd(s.source,0);else if(e.is(_d))for(let t of e.value)t.source==s.source&&(s=t);return s}updateFor(t,e){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(gd(t.state))}}class qd extends zd{constructor(t,e,i,s,n,r){super(t,3,e),this.limit=i,this.result=s,this.from=n,this.to=r}hasResult(){return!0}updateFor(t,e){var i;if(!(3&e))return this.map(t.changes);let s=this.result;s.map&&!t.changes.empty&&(s=s.map(s,t.changes));let n=t.changes.mapPos(this.from),r=t.changes.mapPos(this.to,1),o=gd(t.state);if(o>r||!s||2&e&&(gd(t.startState)==this.from||ot.map(t=>t.map(e))}),$d=xe.define({create:()=>Nd.start(),update:(t,e)=>t.update(e),provide:t=>[Xl.from(t,t=>t.tooltip),jo.contentAttributes.from(t,t=>t.attrs)]});function jd(t,e){const i=e.completion.apply||e.completion.label;let s=t.state.field($d).active.find(t=>t.source==e.source);return s instanceof qd&&("string"==typeof i?t.dispatch({...bd(t.state,i,s.from,s.to),annotations:wd.of(e.completion)}):i(t,e.completion,s.from,s.to),!0)}const Kd=Bd($d,jd);function Ud(t,e="option"){return i=>{let s=i.state.field($d,!1);if(!s||!s.open||s.open.disabled||Date.now()-s.open.timestamp-1?s.open.selected+r*(t?1:-1):t?0:o-1;return l<0?l="page"==e?0:o-1:l>=o&&(l="page"==e?o-1:0),i.dispatch({effects:Dd.of(l)}),!0}}const Yd=t=>!!t.state.field($d,!1)&&(t.dispatch({effects:kd.of(!0)}),!0);class Qd{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const Gd=bn.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field($d).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field($d),i=t.state.facet(Md);if(!t.selectionSet&&!t.docChanged&&t.startState.field($d)==e)return;let s=t.transactions.some(t=>{let e=Fd(t,i);return 8&e||(t.selection||t.docChanged)&&!(3&e)});for(let e=0;e50&&Date.now()-i.time>1e3){for(let t of i.context.abortListeners)try{t()}catch(t){mn(this.view.state,t)}i.context.abortListeners=null,this.running.splice(e--,1)}else i.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(t=>t.effects.some(t=>t.is(kd)))&&(this.pendingStart=!0);let n=this.pendingStart?50:i.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(t=>t.isPending&&!this.running.some(e=>e.active.source==t.source))?setTimeout(()=>this.startUpdate(),n):-1,0!=this.composing)for(let e of t.transactions)e.isUserEvent("input.type")?this.composing=2:2==this.composing&&e.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field($d);for(let t of e.active)t.isPending&&!this.running.some(e=>e.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Md).updateSyncTime))}startQuery(t){let{state:e}=this.view,i=gd(e),s=new fd(e,i,t.explicit,this.view),n=new Qd(t,s);this.running.push(n),Promise.resolve(t.source(s)).then(t=>{n.context.aborted||(n.done=t||null,this.scheduleAccept())},t=>{this.view.dispatch({effects:Sd.of(null)}),mn(this.view.state,t)})}scheduleAccept(){this.running.every(t=>void 0!==t.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Md).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],i=this.view.state.facet(Md),s=this.view.state.field($d);for(let n=0;nt.source==r.active.source);if(o&&o.isPending)if(null==r.done){let t=new zd(r.active.source,0);for(let e of r.updates)t=t.update(e,i);t.isPending||e.push(t)}else this.startQuery(o)}(e.length||s.open&&s.open.disabled)&&this.view.dispatch({effects:_d.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field($d,!1);if(e&&e.tooltip&&this.view.state.facet(Md).closeOnBlur){let i=e.open&&ra(this.view,e.open.tooltip);i&&i.dom.contains(t.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:Sd.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:kd.of(!1)}),20),this.composing=0}}}),Xd="object"==typeof navigator&&/Win/.test(navigator.platform),Jd=Oe.highest(jo.domEventHandlers({keydown(t,e){let i=e.state.field($d,!1);if(!i||!i.open||i.open.disabled||i.open.selected<0||t.key.length>1||t.ctrlKey&&(!Xd||!t.altKey)||t.metaKey)return!1;let s=i.open.options[i.open.selected],n=i.active.find(t=>t.source==s.source),r=s.completion.commitCharacters||n.result.commitCharacters;return r&&r.indexOf(t.key)>-1&&jd(e,s),!1}})),Zd=jo.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});const tp={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},ep=$e.define({map(t,e){let i=e.mapPos(t,-1,ee.TrackAfter);return i??void 0}}),ip=new class extends ni{};ip.startSide=1,ip.endSide=-1;const sp=xe.define({create:()=>hi.empty,update(t,e){if(t=t.map(e.changes),e.selection){let i=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:t=>t>=i.from&&t<=i.to})}for(let i of e.effects)i.is(ep)&&(t=t.update({add:[ip.range(i.value,i.value+1)]}));return t}});const np="()[]{}<>«»»«[]{}";function rp(t){for(let e=0;e<16;e+=2)if(np.charCodeAt(e)==t)return np.charAt(e+1);return Jt(t<128?t:t+1)}function op(t,e){return t.languageDataAt("closeBrackets",e)[0]||tp}const lp="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),ap=jo.inputHandler.of((t,e,i,s)=>{if((lp?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let n=t.state.selection.main;if(s.length>2||2==s.length&&1==Zt(Xt(s,0))||e!=n.from||i!=n.to)return!1;let r=function(t,e){let i=op(t,t.selection.main.head),s=i.brackets||tp.brackets;for(let n of s){let r=rp(Xt(n,0));if(e==n)return r==n?pp(t,n,s.indexOf(n+n+n)>-1,i):fp(t,n,r,i.before||tp.before);if(e==r&&cp(t,t.selection.main.from))return dp(t,n,r)}return null}(t.state,s);return!!r&&(t.dispatch(r),!0)}),hp=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=op(t,t.selection.main.head).brackets||tp.brackets,s=null,n=t.changeByRange(e=>{if(e.empty){let s=function(t,e){let i=t.sliceString(e-2,e);return Zt(Xt(i,0))==i.length?i:i.slice(1)}(t.doc,e.head);for(let n of i)if(n==s&&up(t.doc,e.head)==rp(Xt(n,0)))return{changes:{from:e.head-n.length,to:e.head+n.length},range:ue.cursor(e.head-n.length)}}return{range:s=e}});return s||e(t.update(n,{scrollIntoView:!0,userEvent:"delete.backward"})),!s}}];function cp(t,e){let i=!1;return t.field(sp).between(0,t.doc.length,t=>{t==e&&(i=!0)}),i}function up(t,e){let i=t.sliceString(e,e+2);return i.slice(0,Zt(Xt(i,0)))}function fp(t,e,i,s){let n=null,r=t.changeByRange(r=>{if(!r.empty)return{changes:[{insert:e,from:r.from},{insert:i,from:r.to}],effects:ep.of(r.to+e.length),range:ue.range(r.anchor+e.length,r.head+e.length)};let o=up(t.doc,r.head);return!o||/\s/.test(o)||s.indexOf(o)>-1?{changes:{insert:e+i,from:r.head},effects:ep.of(r.head+e.length),range:ue.cursor(r.head+e.length)}:{range:n=r}});return n?null:t.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function dp(t,e,i){let s=null,n=t.changeByRange(e=>e.empty&&up(t.doc,e.head)==i?{changes:{from:e.head,to:e.head+i.length,insert:i},range:ue.cursor(e.head+i.length)}:s={range:e});return s?null:t.update(n,{scrollIntoView:!0,userEvent:"input.type"})}function pp(t,e,i,s){let n=s.stringPrefixes||tp.stringPrefixes,r=null,o=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:e,from:s.to}],effects:ep.of(s.to+e.length),range:ue.range(s.anchor+e.length,s.head+e.length)};let o,l=s.head,a=up(t.doc,l);if(a==e){if(mp(t,l))return{changes:{insert:e+e,from:l},effects:ep.of(l+e.length),range:ue.cursor(l+e.length)};if(cp(t,l)){let s=i&&t.sliceDoc(l,l+3*e.length)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+s.length,insert:s},range:ue.cursor(l+s.length)}}}else{if(i&&t.sliceDoc(l-2*e.length,l)==e+e&&(o=gp(t,l-2*e.length,n))>-1&&mp(t,o))return{changes:{insert:e+e+e+e,from:l},effects:ep.of(l+e.length),range:ue.cursor(l+e.length)};if(t.charCategorizer(l)(a)!=Je.Word&&gp(t,l,n)>-1&&!function(t,e,i,s){let n=Ya(t).resolveInner(e,-1),r=s.reduce((t,e)=>Math.max(t,e.length),0);for(let o=0;o<5;o++){let o=t.sliceDoc(n.from,Math.min(n.to,n.from+i.length+r)),l=o.indexOf(i);if(!l||l>-1&&s.indexOf(o.slice(0,l))>-1){let e=n.firstChild;for(;e&&e.from==n.from&&e.to-e.from>i.length+l;){if(t.sliceDoc(e.to-i.length,e.to)==i)return!1;e=e.firstChild}return!0}let a=n.to==e&&n.parent;if(!a)break;n=a}return!1}(t,l,e,n))return{changes:{insert:e+e,from:l},effects:ep.of(l+e.length),range:ue.cursor(l+e.length)}}return{range:r=s}});return r?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function mp(t,e){let i=Ya(t).resolveInner(e+1);return i.parent&&i.from==e}function gp(t,e,i){let s=t.charCategorizer(e);if(s(t.sliceDoc(e-1,e))!=Je.Word)return e;for(let n of i){let i=e-n.length;if(t.sliceDoc(i,e)==n&&s(t.sliceDoc(i-1,i))!=Je.Word)return i}return-1}function vp(t={}){return[Jd,$d,Md.of(t),Gd,bp,Zd]}const wp=[{key:"Ctrl-Space",run:Yd},{mac:"Alt-`",run:Yd},{mac:"Alt-i",run:Yd},{key:"Escape",run:t=>{let e=t.state.field($d,!1);return!(!e||!e.active.some(t=>0!=t.state))&&(t.dispatch({effects:Sd.of(null)}),!0)}},{key:"ArrowDown",run:Ud(!0)},{key:"ArrowUp",run:Ud(!1)},{key:"PageDown",run:Ud(!0,"page")},{key:"PageUp",run:Ud(!1,"page")},{key:"Enter",run:t=>{let e=t.state.field($d,!1);return!(t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.facet(Md).defaultKeymap?[wp]:[]));class yp{constructor(t,e,i){this.from=t,this.to=e,this.diagnostic=i}}class xp{constructor(t,e,i){this.diagnostics=t,this.panel=e,this.selected=i}static init(t,e,i){let s=i.facet(Lp).markerFilter;s&&(t=s(t,i));let n=t.slice().sort((t,e)=>t.from-e.from||t.to-e.to),r=new ui,o=[],l=0,a=i.doc.iter(),h=0,c=i.doc.length;for(let t=0;;){let e,i,s=t==n.length?null:n[t];if(!s&&!o.length)break;if(o.length)e=l,i=o.reduce((t,e)=>Math.min(t,e.to),s&&s.from>e?s.from:1e8);else{if(e=s.from,e>c)break;i=s.to,o.push(s),t++}for(;ts.from||s.to==e)){i=Math.min(s.from,i);break}o.push(s),t++,i=Math.min(s.to,i)}i=Math.min(i,c);let u=!1;if(o.some(t=>t.from==e&&(t.to==i||i==c))&&(u=e==i,!u&&i-e<10)){let t=e-(h+a.value.length);t>0&&(a.next(t),h=e);for(let t=e;;){if(t>=i){u=!0;break}if(!a.lineBreak&&h+a.value.length>t)break;t=h+a.value.length,h+=a.value.length,a.next()}}let f=jp(o);if(u)r.add(e,e,ss.widget({widget:new Hp(f),diagnostics:o.slice()}));else{let t=o.reduce((t,e)=>e.markClass?t+" "+e.markClass:t,"");r.add(e,i,ss.mark({class:"cm-lintRange cm-lintRange-"+f+t,diagnostics:o.slice(),inclusiveEnd:o.some(t=>t.to>i)}))}if(l=i,l==c)break;for(let t=0;t{if(!(e&&n.diagnostics.indexOf(e)<0))if(s){if(n.diagnostics.indexOf(s.diagnostic)<0)return!1;s=new yp(s.from,i,s.diagnostic)}else s=new yp(t,i,e||n.diagnostics[0])}),s}function Sp(t,e){let i=e.pos,s=e.end||i,n=t.state.facet(Lp).hideOn(t,i,s);if(null!=n)return n;let r=t.startState.doc.lineAt(e.pos);return!(!t.effects.some(t=>t.is(Ap))&&!t.changes.touchesRange(r.from,Math.max(r.to,s)))}function Cp(t,e){return t.field(Tp,!1)?e:e.concat($e.appendConfig.of(Up))}const Ap=$e.define(),Mp=$e.define(),Op=$e.define(),Tp=xe.define({create:()=>new xp(ss.none,null,null),update(t,e){if(e.docChanged&&t.diagnostics.size){let i=t.diagnostics.map(e.changes),s=null,n=t.panel;if(t.selected){let n=e.changes.mapPos(t.selected.from,1);s=kp(i,t.selected.diagnostic,n)||kp(i,null,n)}!i.size&&n&&e.state.facet(Lp).autoPanel&&(n=null),t=new xp(i,n,s)}for(let i of e.effects)if(i.is(Ap)){let s=e.state.facet(Lp).autoPanel?i.value.length?Fp.open:null:t.panel;t=xp.init(i.value,s,e.state)}else i.is(Mp)?t=new xp(t.diagnostics,i.value?Fp.open:null,t.selected):i.is(Op)&&(t=new xp(t.diagnostics,t.panel,i.value));return t},provide:t=>[fa.from(t,t=>t.panel),jo.decorations.from(t,t=>t.diagnostics)]});const Dp=ss.mark({class:"cm-lintRange cm-lintRange-active"});function Rp(t,e,i){let s,{diagnostics:n}=t.state.field(Tp),r=-1,o=-1;n.between(e-(i<0?1:0),e+(i>0?1:0),(t,n,{spec:l})=>{if(e>=t&&e<=n&&(t==n||(e>t||i>0)&&(e({dom:Pp(t,s)})}:null}function Pp(t,e){return Ii("ul",{class:"cm-tooltip-lint"},e.map(e=>Wp(t,e,!1)))}const Bp=t=>{let e=t.state.field(Tp,!1);return!(!e||!e.panel)&&(t.dispatch({effects:Mp.of(!1)}),!0)},Ep=[{key:"Mod-Shift-m",run:t=>{let e=t.state.field(Tp,!1);e&&e.panel||t.dispatch({effects:Cp(t.state,[Mp.of(!0)])});let i=aa(t,Fp.open);return i&&i.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:t=>{let e=t.state.field(Tp,!1);if(!e)return!1;let i=t.state.selection.main,s=kp(e.diagnostics,null,i.to+1);return!(!s&&(s=kp(e.diagnostics,null,0),!s||s.from==i.from&&s.to==i.to))&&(t.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0}),function(t,e,i,s={}){var n;let r=t.state.facet(ea).map(e=>t.plugin(e)).filter(t=>!!t);if(s.tooltip&&s.tooltip.active){let t=r.find(t=>t.field==s.tooltip.active);t&&(r=[t])}for(let o of r)o.activateHover(t,e,i,null!==(n=s.until)&&void 0!==n?n:()=>!1)}(t,s.from,1,{tooltip:Kp,until:t=>t.docChanged||t.newSelection.main.heads.to}),!0)}}];const Lp=pe.define({combine:t=>({sources:t.map(t=>t.source).filter(t=>null!=t),...si(t.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Np,tooltipFilter:Np,needsRefresh:(t,e)=>t?e?i=>t(i)||e(i):t:e,hideOn:(t,e)=>t?e?(i,s,n)=>t(i,s,n)||e(i,s,n):t:e,autoPanel:(t,e)=>t||e})})});function Np(t,e){return t?e?(i,s)=>e(t(i,s),s):t:e}function Ip(t){let e=[];if(t)t:for(let{name:i}of t){for(let t=0;tt.toLowerCase()==s.toLowerCase())){e.push(s);continue t}}e.push("")}return e}function Wp(t,e,i){var s;let n=i?Ip(e.actions):[];return Ii("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Ii("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),null===(s=e.actions)||void 0===s?void 0:s.map((i,s)=>{let r=!1,o=s=>{if(s.preventDefault(),r)return;r=!0;let n=kp(t.state.field(Tp).diagnostics,e);n&&i.apply(t,n.from,n.to)},{name:l}=i,a=n[s]?l.indexOf(n[s]):-1,h=a<0?l:[l.slice(0,a),Ii("u",l.slice(a,a+1)),l.slice(a+1)];return Ii("button",{type:"button",class:"cm-diagnosticAction"+(i.markClass?" "+i.markClass:""),onclick:o,onmousedown:o,"aria-label":` Action: ${l}${a<0?"":` (access key "${n[s]})"`}.`},h)}),e.source&&Ii("div",{class:"cm-diagnosticSource"},e.source))}class Hp extends es{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Ii("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Vp{constructor(t,e){this.diagnostic=e,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=Wp(t,e,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Fp{constructor(t){this.view=t,this.items=[];this.list=Ii("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:e=>{if(!(e.ctrlKey||e.altKey||e.metaKey)){if(27==e.keyCode)Bp(this.view),this.view.focus();else if(38==e.keyCode||33==e.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==e.keyCode||34==e.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==e.keyCode)this.moveSelection(0);else if(35==e.keyCode)this.moveSelection(this.items.length-1);else if(13==e.keyCode)this.view.focus();else{if(!(e.keyCode>=65&&e.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:i}=this.items[this.selectedIndex],s=Ip(i.actions);for(let n=0;n{for(let e=0;eBp(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Tp).selected;if(!t)return-1;for(let e=0;e{for(let t of l.diagnostics){if(r.has(t))continue;r.add(t);let o,l=-1;for(let e=i;ei&&(this.items.splice(i,l-i),s=!0)),e&&o.diagnostic==e.diagnostic?o.dom.hasAttribute("aria-selected")||(o.dom.setAttribute("aria-selected","true"),n=o):o.dom.hasAttribute("aria-selected")&&o.dom.removeAttribute("aria-selected"),i++}});i({sel:n.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:t,panel:e})=>{let i=e.height/this.list.offsetHeight;t.tope.bottom&&(this.list.scrollTop+=(t.bottom-e.bottom)/i)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let t=this.list.firstChild;function e(){let e=t;t=e.nextSibling,e.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;t!=i.dom;)e();t=i.dom.nextSibling}else this.list.insertBefore(i.dom,t);for(;t;)e()}moveSelection(t){if(this.selectedIndex<0)return;let e=kp(this.view.state.field(Tp).diagnostics,this.items[t].diagnostic);e&&this.view.dispatch({selection:{anchor:e.from,head:e.to},scrollIntoView:!0,effects:Op.of(e)})}static open(t){return new Fp(t)}}function zp(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function qp(t){return zp(``,'width="6" height="3"')}const _p=jo.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:qp("#f11")},".cm-lintRange-warning":{backgroundImage:qp("orange")},".cm-lintRange-info":{backgroundImage:qp("#999")},".cm-lintRange-hint":{backgroundImage:qp("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function $p(t){return"error"==t?4:"warning"==t?3:"info"==t?2:1}function jp(t){let e="hint",i=1;for(let s of t){let t=$p(s.severity);t>i&&(i=t,e=s.severity)}return e}const Kp=na(Rp,{hideOn:Sp}),Up=[Tp,jo.decorations.compute([Tp],t=>{let{selected:e,panel:i}=t.field(Tp);return e&&i&&e.from!=e.to?ss.set([Dp.range(e.from,e.to)]):ss.none}),Kp,_p];const Yp=(()=>[Wa(),Fa,Dl(),Gc(),qh(),dl(),[yl,xl],ii.allowMultipleSelections.of(!0),ii.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let i=t.newDoc,{head:s}=t.newSelection.main,n=i.lineAt(s);if(s>n.from+200)return t;let r=i.sliceString(n.from,s);if(!e.some(t=>t.test(r)))return t;let{state:o}=t,l=-1,a=[];for(let{head:t}of o.selection.ranges){let e=o.doc.lineAt(t);if(e.from==l)continue;l=e.from;let i=hh(o,e.from);if(null==i)continue;let s=/^\s*/.exec(e.text)[0],n=ah(o,i);s!=n&&a.push({from:e.from,to:e.from+s.length,insert:n})}return a.length?[t,{changes:a,sequential:!0}]:t}),Yh(Xh,{fallback:!0}),oc(),[ap,sp],vp(),Hl(),zl(),Ll,Cf(),Zo.of([...hp,...ff,...nd,...du,...Eh,...wp,...Ep])])(),Qp={init(){const t=[Yp,new nh(bc),ii.readOnly.of(!0),Ic,jo.theme({"&":{height:"600px"}})];document.addEventListener("DOMContentLoaded",function(){if(void 0===CLD_METADATA)return;const e=document.getElementById("meta-data"),i=JSON.stringify(CLD_METADATA,null," ");new jo({parent:e,doc:i,extensions:t})})}};Qp.init()})(); //# sourceMappingURL=syntax-highlight.js.map \ No newline at end of file diff --git a/js/terms-order.asset.php b/js/terms-order.asset.php index 0ceaa2d40..e3e088c88 100644 --- a/js/terms-order.asset.php +++ b/js/terms-order.asset.php @@ -1 +1,6 @@ - array(), 'version' => '2f7f1b83c7516fc1c316'); + array( + + ), + 'version' => '2f7f1b83c7516fc1c316' +); diff --git a/js/video-init.asset.php b/js/video-init.asset.php index b2d759a22..8ce9037ec 100644 --- a/js/video-init.asset.php +++ b/js/video-init.asset.php @@ -1 +1,6 @@ - array(), 'version' => 'd6d2d0466119a6a1f919'); + array( + + ), + 'version' => 'd6d2d0466119a6a1f919' +); From 65d6116b36a072b57823d9dfb987a06e7e20ebe1 Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Tue, 27 Oct 2026 12:35:49 +0530 Subject: [PATCH 71/80] fix(e2e): Parse srcset with commas in Cloudinary URLs Cloudinary transformation segments such as w_800,h_600 contain commas, so splitting srcset on every comma broke each candidate into pieces. Parse candidates by their trailing descriptor instead and expose the descriptor through parseSrcset(). --- tests/e2e/utils/delivery.js | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/tests/e2e/utils/delivery.js b/tests/e2e/utils/delivery.js index 7f82c3bf0..0616278ed 100644 --- a/tests/e2e/utils/delivery.js +++ b/tests/e2e/utils/delivery.js @@ -28,22 +28,45 @@ function expectCloudinaryUrl( rawUrl, expectedCloud ) { } /** - * Split a `srcset` attribute into its candidate URLs. + * Parse a `srcset` attribute into its candidates. + * + * Cloudinary URLs carry commas inside the transformation segment + * (`w_800,h_600,c_scale`), so splitting on `,` breaks them apart. A + * candidate ends at its descriptor, or at a comma followed by whitespace + * when it has none. * * @param {string|null} srcset The raw attribute value. - * @return {string[]} Candidate URLs, without width/density descriptors. + * @return {{ url: string, descriptor: string }[]} Candidates in source order. */ -function srcsetUrls( srcset ) { +function parseSrcset( srcset ) { if ( ! srcset ) { return []; } - return srcset - .split( ',' ) - .map( ( candidate ) => candidate.trim().split( /\s+/ )[ 0 ] ) - .filter( Boolean ); + const candidates = []; + const pattern = /\s*(\S+?)(?:\s+(\d+(?:\.\d+)?[wx]))?\s*(?:,(?=\s)|,?$)/gy; + let match; + while ( pattern.lastIndex < srcset.length ) { + match = pattern.exec( srcset ); + if ( ! match || ! match[ 0 ] ) { + break; + } + candidates.push( { url: match[ 1 ], descriptor: match[ 2 ] || '' } ); + } + return candidates; +} + +/** + * Split a `srcset` attribute into its candidate URLs. + * + * @param {string|null} srcset The raw attribute value. + * @return {string[]} Candidate URLs, without width/density descriptors. + */ +function srcsetUrls( srcset ) { + return parseSrcset( srcset ).map( ( candidate ) => candidate.url ); } module.exports = { expectCloudinaryUrl, + parseSrcset, srcsetUrls, }; From 107b3d359c03b707c809b5c9c13746e94ca8eda7 Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Tue, 27 Oct 2026 12:35:51 +0530 Subject: [PATCH 72/80] test(e2e): Add breakpoints and lazy load spec Cover the responsive breakpoints and lazy load delivery settings on a synced image: - min/max/step produce the matching srcset width entries - lazy load renders the SVG placeholder, data attributes and the CLDLB loader config with the blur placeholder - turning either setting off removes its markup --- .../cloudinary-breakpoints-lazy-load.spec.js | 389 ++++++++++++++++++ 1 file changed, 389 insertions(+) create mode 100644 tests/e2e/cloudinary-breakpoints-lazy-load.spec.js diff --git a/tests/e2e/cloudinary-breakpoints-lazy-load.spec.js b/tests/e2e/cloudinary-breakpoints-lazy-load.spec.js new file mode 100644 index 000000000..70843277b --- /dev/null +++ b/tests/e2e/cloudinary-breakpoints-lazy-load.spec.js @@ -0,0 +1,389 @@ +/** + * External dependencies + */ +const fs = require( 'fs' ); +const path = require( 'path' ); +const { test, expect } = require( './fixtures' ); + +/** + * Internal dependencies + */ +const { ensureCloudinaryConnected } = require( './utils/connection' ); +const { + expectCloudinaryUrl, + parseSrcset, + srcsetUrls, +} = require( './utils/delivery' ); +const { wpCli, wpEvalFile } = require( './utils/wizard' ); + +const FIXTURE_PATH = path.join( __dirname, 'fixtures', 'test-image.jpg' ); + +/** + * Intrinsic width of the fixture image. + * + * @type {number} + */ +const FIXTURE_WIDTH = 1200; + +/** + * Breakpoint settings that give widths core WordPress never produces for a + * 1200x900 image (its sizes are 1200, 1024, 768 and 300). A width from this + * set in `srcset` can only come from the plugin's breakpoints. + * + * @type {{ max_width: number, min_width: number, pixel_step: number }} + */ +const BREAKPOINTS = { + max_width: 1100, + min_width: 500, + pixel_step: 300, +}; + +/** + * Widths `Responsive_Breakpoints::apply_breakpoints()` builds for + * BREAKPOINTS: the image's own width, then max down to min in steps. + * + * @type {number[]} + */ +const EXPECTED_WIDTHS = [ FIXTURE_WIDTH, 1100, 800, 500 ]; + +/** + * Every setting the spec writes. Pinned in each test so the result does not + * depend on the order the tests run in or on state left by other specs. + * + * @type {string[]} + */ +const MANAGED_SETTINGS = [ + 'enable_breakpoints', + 'use_lazy_load', + 'lazy_placeholder', + 'max_width', + 'min_width', + 'pixel_step', +]; + +let cloudName; + +/** @type {Record|null} */ +let previousSettings = null; + +/** + * Objects created in beforeAll and removed in afterAll. + * + * @type {{ postId: number, attachmentId: number, postLink: string }|null} + */ +let created = null; + +/** + * Save plugin settings through the settings API and return the old values. + * + * @param {Record} values Setting slug to value. + * @return {Record} Setting slug to the value before the write. + */ +function saveSettings( values ) { + return JSON.parse( + wpEvalFile( ` + $settings = get_plugin_instance()->settings; + $previous = array(); + foreach ( json_decode( '${ JSON.stringify( + values + ) }', true ) as $slug => $value ) { + $setting = $settings->get_setting( $slug ); + $previous[ $slug ] = $setting->get_value(); + $setting->save_value( $value ); + } + echo wp_json_encode( $previous ); + ` ) + ); +} + +/** + * Read the current value of the managed settings. + * + * @return {Record} Setting slug to value. + */ +function readSettings() { + return JSON.parse( + wpEvalFile( ` + $settings = get_plugin_instance()->settings; + $values = array(); + foreach ( json_decode( '${ JSON.stringify( + MANAGED_SETTINGS + ) }', true ) as $slug ) { + $values[ $slug ] = $settings->get_setting( $slug )->get_value(); + } + echo wp_json_encode( $values ); + ` ) + ); +} + +/** + * Apply the breakpoint and lazy-load toggles, with the fixed breakpoint + * range and the blur placeholder. + * + * @param {Object} options + * @param {boolean} options.breakpoints Enable responsive breakpoints. + * @param {boolean} options.lazyLoad Enable lazy loading. + */ +function configure( { breakpoints, lazyLoad } ) { + saveSettings( { + ...BREAKPOINTS, + enable_breakpoints: breakpoints ? 'on' : 'off', + use_lazy_load: lazyLoad ? 'on' : 'off', + lazy_placeholder: 'blur', + } ); +} + +/** + * Parse the width descriptors out of a `srcset` attribute. + * + * @param {string|null} srcset The raw attribute value. + * @return {number[]} Widths in source order. + */ +function srcsetWidths( srcset ) { + return parseSrcset( srcset ) + .map( ( candidate ) => candidate.descriptor ) + .filter( ( descriptor ) => /^\d+w$/.test( descriptor ) ) + .map( ( descriptor ) => parseInt( descriptor, 10 ) ); +} + +/** + * Load the post with JavaScript disabled and return the attributes of the + * inline image as the server rendered them. + * + * The lazy-load script rewrites `src` and `srcset` once it runs, so the + * server markup can only be read reliably without it. + * + * @param {import('@playwright/test').Browser} browser + * @param {string} baseURL + * @return {Promise<{ attrs: Record, html: string }>} Image attributes and the page HTML. + */ +async function serverMarkup( browser, baseURL ) { + const context = await browser.newContext( { + baseURL, + javaScriptEnabled: false, + } ); + try { + const page = await context.newPage(); + await page.goto( created.postLink ); + const img = page + .locator( `.wp-block-image img.wp-image-${ created.attachmentId }` ) + .first(); + await expect( + img, + 'inline image block should render in post content' + ).toBeAttached(); + + const attrs = await img.evaluate( ( el ) => + Object.fromEntries( + [ ...el.attributes ].map( ( a ) => [ a.name, a.value ] ) + ) + ); + return { attrs, html: await page.content() }; + } finally { + await context.close(); + } +} + +// @serial: needs real credentials in `cloudinary_connect` for `wp cloudinary +// sync`, while every analytics spec overwrites that option with fake ones. +test.describe( + 'Cloudinary responsive breakpoints and lazy load', + { tag: '@serial' }, + () => { + test.beforeAll( async ( { requestUtils } ) => { + ( { cloudName } = ensureCloudinaryConnected() ); + previousSettings = readSettings(); + + // A timestamped filename gives every run a fresh public ID, + // so no CDN cache from an earlier run can interfere. + const media = await requestUtils.rest( { + method: 'POST', + path: '/wp/v2/media', + headers: { + 'Content-Type': 'image/jpeg', + 'Content-Disposition': `attachment; filename="breakpoints-${ Date.now() }.jpg"`, + }, + data: fs.readFileSync( FIXTURE_PATH ), + } ); + + const content = + `\n` + + `
\n` + + ``; + + const post = await requestUtils.rest( { + method: 'POST', + path: '/wp/v2/posts', + data: { + status: 'publish', + title: `Cloudinary breakpoints e2e ${ Date.now() }`, + content, + }, + } ); + + created = { + postId: post.id, + attachmentId: media.id, + postLink: post.link, + }; + + // Same reason as the image delivery spec: sync synchronously + // instead of waiting for the auto-sync queue. + wpCli( [ 'cloudinary', 'sync' ] ); + } ); + + test.afterAll( () => { + if ( previousSettings ) { + saveSettings( previousSettings ); + previousSettings = null; + } + if ( ! created ) { + return; + } + const { postId, attachmentId } = created; + created = null; + + // WP-CLI rather than REST for the same reason as the image + // delivery spec: `force=true` on a `?rest_route=` URL is fragile. + for ( const id of [ postId, attachmentId ] ) { + try { + wpCli( [ 'post', 'delete', String( id ), '--force' ] ); + } catch ( e ) { + console.warn( + `Cleanup of post ${ id } failed:`, + e.message + ); + } + } + } ); + + test( 'configured min/max/step produce matching srcset widths', async ( { + browser, + baseURL, + } ) => { + // Breakpoints are only written to `srcset` on the server when + // lazy loading is off; with lazy load on, the script picks + // the size at runtime instead. + configure( { breakpoints: true, lazyLoad: false } ); + + const { attrs } = await serverMarkup( browser, baseURL ); + + expect( + attrs[ 'data-responsive' ], + 'breakpoints should mark the image as responsive' + ).toBeDefined(); + expect( srcsetWidths( attrs.srcset ) ).toEqual( EXPECTED_WIDTHS ); + + const urls = srcsetUrls( attrs.srcset ); + expect( urls ).toHaveLength( EXPECTED_WIDTHS.length ); + for ( const [ i, url ] of urls.entries() ) { + expectCloudinaryUrl( url, cloudName ); + // The first candidate is the original `src`; the rest + // carry the breakpoint width as a transformation. + if ( i > 0 ) { + expect( url, `transformation of ${ url }` ).toContain( + `w_${ EXPECTED_WIDTHS[ i ] }` + ); + } + } + + expect( attrs.sizes ).toBe( + `(max-width: ${ FIXTURE_WIDTH }px) 100vw, ${ FIXTURE_WIDTH }px` + ); + } ); + + test( 'disabling breakpoints removes the breakpoint srcset', async ( { + browser, + baseURL, + } ) => { + configure( { breakpoints: false, lazyLoad: false } ); + + const { attrs } = await serverMarkup( browser, baseURL ); + + expect( + attrs[ 'data-responsive' ], + 'the responsive marker should be gone' + ).toBeUndefined(); + + // Core may still emit its own srcset from the registered + // image sizes. None of the breakpoint-only widths may appear. + const widths = srcsetWidths( attrs.srcset ); + for ( const width of EXPECTED_WIDTHS.slice( 1 ) ) { + expect( + widths, + `srcset should not contain breakpoint width ${ width }w` + ).not.toContain( width ); + } + } ); + + test( 'lazy load renders the placeholder markup', async ( { + browser, + baseURL, + page, + } ) => { + configure( { breakpoints: true, lazyLoad: true } ); + + const { attrs, html } = await serverMarkup( browser, baseURL ); + + expect( attrs[ 'data-cloudinary' ] ).toBe( 'lazy' ); + expect( + attrs.src, + 'src should be the inline SVG placeholder' + ).toMatch( /^data:image\/svg\+xml/ ); + expect( attrs[ 'data-size' ] ).toMatch( /^\d+ \d+$/ ); + expect( attrs.onload ).toContain( 'CLDBind' ); + expect( attrs[ 'data-public-id' ] ).toBeTruthy(); + expect( attrs[ 'data-delivery' ] ).toBe( 'upload' ); + + // The breakpoint srcset is not rendered on the server; the + // script sizes the image at runtime from data-responsive. + expect( attrs.srcset ).toBeUndefined(); + expect( attrs[ 'data-responsive' ] ).toBeDefined(); + + // The inline loader config carries the blur placeholder + // transformation. + const config = /var CLDLB = (\{.*?\});/.exec( html ); + expect( + config, + 'the CLDLB loader config should be printed' + ).not.toBeNull(); + const parsed = JSON.parse( config[ 1 ] ); + expect( parsed.use_lazy_load ).toBe( 'on' ); + expect( parsed.lazy_placeholder ).toBe( 'blur' ); + expect( parsed.placeholder ).toContain( 'e_blur:2000' ); + + // With JavaScript on, the script swaps in the Cloudinary URL + // once the image is in view. + await page.goto( created.postLink ); + const img = page + .locator( + `.wp-block-image img.wp-image-${ created.attachmentId }` + ) + .first(); + await img.scrollIntoViewIfNeeded(); + await expect( img ).toHaveAttribute( + 'src', + /^https:\/\/res\.cloudinary\.com\// + ); + expectCloudinaryUrl( await img.getAttribute( 'src' ), cloudName ); + } ); + + test( 'disabling lazy load removes the placeholder markup', async ( { + browser, + baseURL, + } ) => { + configure( { breakpoints: false, lazyLoad: false } ); + + const { attrs, html } = await serverMarkup( browser, baseURL ); + + expect( attrs[ 'data-cloudinary' ] ).toBeUndefined(); + expect( attrs[ 'data-size' ] ).toBeUndefined(); + expect( attrs.onload || '' ).not.toContain( 'CLDBind' ); + expect( attrs[ 'data-srcset' ] ).toBeUndefined(); + expect( html ).not.toContain( 'var CLDLB' ); + + // The real Cloudinary URL is in `src` straight from the server. + expectCloudinaryUrl( attrs.src, cloudName ); + } ); + } +); From 63da4198215969a0eca0a4ebaa9521e4b3bc25a4 Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Mon, 2 Nov 2026 19:48:11 +0530 Subject: [PATCH 73/80] fix(e2e): Parse srcset with the HTML parsing rule The regex only ended a candidate at a comma followed by whitespace or at the end of the string, and quietly returned what it had so far when it did not match. Valid input such as "a.jpg 1x,b.jpg 2x" gave an empty list, which made srcset checks pass without checking anything. Read a URL as a run of non-whitespace characters, as the HTML spec does, so commas inside Cloudinary URLs still stay part of the URL. --- tests/e2e/utils/delivery.js | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/tests/e2e/utils/delivery.js b/tests/e2e/utils/delivery.js index 0616278ed..db53d43c8 100644 --- a/tests/e2e/utils/delivery.js +++ b/tests/e2e/utils/delivery.js @@ -30,27 +30,35 @@ function expectCloudinaryUrl( rawUrl, expectedCloud ) { /** * Parse a `srcset` attribute into its candidates. * - * Cloudinary URLs carry commas inside the transformation segment - * (`w_800,h_600,c_scale`), so splitting on `,` breaks them apart. A - * candidate ends at its descriptor, or at a comma followed by whitespace - * when it has none. + * Follows the HTML parsing rule: a URL is a run of non-whitespace + * characters, and trailing commas on it end the candidate. Otherwise the + * descriptor runs up to the next comma. Commas inside a URL, such as in a + * Cloudinary transformation segment (`w_800,h_600,c_scale`), stay part of + * the URL. * * @param {string|null} srcset The raw attribute value. * @return {{ url: string, descriptor: string }[]} Candidates in source order. */ function parseSrcset( srcset ) { - if ( ! srcset ) { - return []; - } const candidates = []; - const pattern = /\s*(\S+?)(?:\s+(\d+(?:\.\d+)?[wx]))?\s*(?:,(?=\s)|,?$)/gy; - let match; - while ( pattern.lastIndex < srcset.length ) { - match = pattern.exec( srcset ); - if ( ! match || ! match[ 0 ] ) { - break; + const input = srcset || ''; + const urlPattern = /[\s,]*(\S+)/y; + const descriptorPattern = /\s*([^,]*?)\s*(?:,|$)/y; + for ( + let urlMatch = urlPattern.exec( input ); + urlMatch; + urlMatch = urlPattern.exec( input ) + ) { + let url = urlMatch[ 1 ]; + let descriptor = ''; + if ( url.endsWith( ',' ) ) { + url = url.replace( /,+$/, '' ); + } else { + descriptorPattern.lastIndex = urlPattern.lastIndex; + descriptor = descriptorPattern.exec( input )[ 1 ]; + urlPattern.lastIndex = descriptorPattern.lastIndex; } - candidates.push( { url: match[ 1 ], descriptor: match[ 2 ] || '' } ); + candidates.push( { url, descriptor } ); } return candidates; } From c90d1d636e031948aced12f0b9be22f111f439c7 Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Mon, 2 Nov 2026 19:48:13 +0530 Subject: [PATCH 74/80] test(e2e): Share settings helpers and tighten checks - Move saveSettings() and readSettings() to tests/e2e/utils/settings.js and base64-encode the JSON, so a quote in a value cannot break the PHP string. - Match the breakpoint w_ parameter exactly. - Check that every width left after breakpoints are off is a registered image size. - Stop the CLDLB regex at the end of the line. - Explain why the lazy load test also turns breakpoints off. --- .../cloudinary-breakpoints-lazy-load.spec.js | 90 +++++++++---------- .../cloudinary-global-transformations.spec.js | 41 +-------- tests/e2e/cloudinary-svg-delivery.spec.js | 27 +----- tests/e2e/utils/settings.js | 67 ++++++++++++++ 4 files changed, 112 insertions(+), 113 deletions(-) create mode 100644 tests/e2e/utils/settings.js diff --git a/tests/e2e/cloudinary-breakpoints-lazy-load.spec.js b/tests/e2e/cloudinary-breakpoints-lazy-load.spec.js index 70843277b..364e920ef 100644 --- a/tests/e2e/cloudinary-breakpoints-lazy-load.spec.js +++ b/tests/e2e/cloudinary-breakpoints-lazy-load.spec.js @@ -14,6 +14,7 @@ const { parseSrcset, srcsetUrls, } = require( './utils/delivery' ); +const { readSettings, saveSettings } = require( './utils/settings' ); const { wpCli, wpEvalFile } = require( './utils/wizard' ); const FIXTURE_PATH = path.join( __dirname, 'fixtures', 'test-image.jpg' ); @@ -73,49 +74,6 @@ let previousSettings = null; */ let created = null; -/** - * Save plugin settings through the settings API and return the old values. - * - * @param {Record} values Setting slug to value. - * @return {Record} Setting slug to the value before the write. - */ -function saveSettings( values ) { - return JSON.parse( - wpEvalFile( ` - $settings = get_plugin_instance()->settings; - $previous = array(); - foreach ( json_decode( '${ JSON.stringify( - values - ) }', true ) as $slug => $value ) { - $setting = $settings->get_setting( $slug ); - $previous[ $slug ] = $setting->get_value(); - $setting->save_value( $value ); - } - echo wp_json_encode( $previous ); - ` ) - ); -} - -/** - * Read the current value of the managed settings. - * - * @return {Record} Setting slug to value. - */ -function readSettings() { - return JSON.parse( - wpEvalFile( ` - $settings = get_plugin_instance()->settings; - $values = array(); - foreach ( json_decode( '${ JSON.stringify( - MANAGED_SETTINGS - ) }', true ) as $slug ) { - $values[ $slug ] = $settings->get_setting( $slug )->get_value(); - } - echo wp_json_encode( $values ); - ` ) - ); -} - /** * Apply the breakpoint and lazy-load toggles, with the fixed breakpoint * range and the blur placeholder. @@ -146,6 +104,26 @@ function srcsetWidths( srcset ) { .map( ( descriptor ) => parseInt( descriptor, 10 ) ); } +/** + * Widths of the image sizes WordPress registered for an attachment, + * including the full size. + * + * @param {number} attachmentId Attachment ID. + * @return {number[]} Widths in pixels. + */ +function attachmentWidths( attachmentId ) { + return JSON.parse( + wpEvalFile( ` + $meta = wp_get_attachment_metadata( ${ Number( attachmentId ) } ); + $widths = array( (int) $meta['width'] ); + foreach ( $meta['sizes'] as $size ) { + $widths[] = (int) $size['width']; + } + echo wp_json_encode( $widths ); + ` ) + ); +} + /** * Load the post with JavaScript disabled and return the attributes of the * inline image as the server rendered them. @@ -192,7 +170,7 @@ test.describe( () => { test.beforeAll( async ( { requestUtils } ) => { ( { cloudName } = ensureCloudinaryConnected() ); - previousSettings = readSettings(); + previousSettings = readSettings( MANAGED_SETTINGS ); // A timestamped filename gives every run a fresh public ID, // so no CDN cache from an earlier run can interfere. @@ -281,8 +259,8 @@ test.describe( // The first candidate is the original `src`; the rest // carry the breakpoint width as a transformation. if ( i > 0 ) { - expect( url, `transformation of ${ url }` ).toContain( - `w_${ EXPECTED_WIDTHS[ i ] }` + expect( url, `transformation of ${ url }` ).toMatch( + new RegExp( `[/,]w_${ EXPECTED_WIDTHS[ i ] }[,/]` ) ); } } @@ -305,9 +283,21 @@ test.describe( 'the responsive marker should be gone' ).toBeUndefined(); - // Core may still emit its own srcset from the registered - // image sizes. None of the breakpoint-only widths may appear. + // WordPress still writes its own srcset from the registered + // image sizes. Every width must be one of those sizes, so none + // of the breakpoint-only widths can appear. const widths = srcsetWidths( attrs.srcset ); + expect( + widths.length, + 'WordPress should still write its own srcset' + ).toBeGreaterThan( 0 ); + const sizeWidths = attachmentWidths( created.attachmentId ); + for ( const width of widths ) { + expect( + sizeWidths, + `srcset width ${ width }w should be a registered image size` + ).toContain( width ); + } for ( const width of EXPECTED_WIDTHS.slice( 1 ) ) { expect( widths, @@ -342,7 +332,7 @@ test.describe( // The inline loader config carries the blur placeholder // transformation. - const config = /var CLDLB = (\{.*?\});/.exec( html ); + const config = /var CLDLB = (\{[^\n]*?\});/.exec( html ); expect( config, 'the CLDLB loader config should be printed' @@ -372,6 +362,8 @@ test.describe( browser, baseURL, } ) => { + // Breakpoints are off too, so `src` is the plain delivery URL + // rather than one the breakpoints feature sized. configure( { breakpoints: false, lazyLoad: false } ); const { attrs, html } = await serverMarkup( browser, baseURL ); diff --git a/tests/e2e/cloudinary-global-transformations.spec.js b/tests/e2e/cloudinary-global-transformations.spec.js index 705a14e9a..6cf8caf8e 100644 --- a/tests/e2e/cloudinary-global-transformations.spec.js +++ b/tests/e2e/cloudinary-global-transformations.spec.js @@ -10,7 +10,8 @@ const { test, expect } = require( './fixtures' ); */ const { ensureCloudinaryConnected } = require( './utils/connection' ); const { expectCloudinaryUrl } = require( './utils/delivery' ); -const { wpCli, wpEvalFile } = require( './utils/wizard' ); +const { readSettings, saveSettings } = require( './utils/settings' ); +const { wpCli } = require( './utils/wizard' ); const FIXTURE_PATH = path.join( __dirname, 'fixtures', 'test-image.jpg' ); @@ -59,42 +60,6 @@ let created = null; */ let createdIds = []; -/** - * Save plugin settings through the settings API. - * - * @param {Record} values Setting slug to value. - */ -function saveSettings( values ) { - wpEvalFile( ` - $settings = get_plugin_instance()->settings; - foreach ( json_decode( '${ JSON.stringify( - values - ) }', true ) as $slug => $value ) { - $settings->get_setting( $slug )->save_value( $value ); - } - ` ); -} - -/** - * Read the current value of the managed settings. - * - * @return {Record} Setting slug to value. - */ -function readSettings() { - return JSON.parse( - wpEvalFile( ` - $settings = get_plugin_instance()->settings; - $values = array(); - foreach ( json_decode( '${ JSON.stringify( - MANAGED_SETTINGS - ) }', true ) as $slug ) { - $values[ $slug ] = $settings->get_setting( $slug )->get_value(); - } - echo wp_json_encode( $values ); - ` ) - ); -} - /** * Upload the fixture, embed it in a published post and sync it. * @@ -214,7 +179,7 @@ test.describe( () => { test.beforeAll( async ( { requestUtils } ) => { ( { cloudName } = ensureCloudinaryConnected() ); - previousSettings = readSettings(); + previousSettings = readSettings( MANAGED_SETTINGS ); saveSettings( BASE_SETTINGS ); created = await uploadSyncedImagePost( requestUtils ); } ); diff --git a/tests/e2e/cloudinary-svg-delivery.spec.js b/tests/e2e/cloudinary-svg-delivery.spec.js index 7d86990ef..40df62a7a 100644 --- a/tests/e2e/cloudinary-svg-delivery.spec.js +++ b/tests/e2e/cloudinary-svg-delivery.spec.js @@ -10,6 +10,7 @@ const { test, expect } = require( './fixtures' ); */ const { ensureCloudinaryConnected } = require( './utils/connection' ); const { expectCloudinaryUrl } = require( './utils/delivery' ); +const { saveSettings } = require( './utils/settings' ); const { wpCli, wpEvalFile } = require( './utils/wizard' ); const VALID_FIXTURE = path.join( __dirname, 'fixtures', 'svg-valid.svg' ); @@ -44,32 +45,6 @@ let previousSettings = null; */ let createdIds = []; -/** - * Save plugin settings and return their previous values. - * - * Goes through the settings API rather than `wp option patch` so the values - * land in the same place the settings screen saves them. - * - * @param {Record} values Setting slug to value. - * @return {Record} Setting slug to the value before the write. - */ -function saveSettings( values ) { - return JSON.parse( - wpEvalFile( ` - $settings = get_plugin_instance()->settings; - $previous = array(); - foreach ( json_decode( '${ JSON.stringify( - values - ) }', true ) as $slug => $value ) { - $setting = $settings->get_setting( $slug ); - $previous[ $slug ] = $setting->get_value(); - $setting->save_value( $value ); - } - echo wp_json_encode( $previous ); - ` ) - ); -} - /** * Upload an SVG fixture, embed it in a published post and sync it. * diff --git a/tests/e2e/utils/settings.js b/tests/e2e/utils/settings.js new file mode 100644 index 000000000..3c6720d29 --- /dev/null +++ b/tests/e2e/utils/settings.js @@ -0,0 +1,67 @@ +/** + * Read and write plugin settings from e2e specs. + * + * Goes through the plugin's settings API rather than `wp option patch`, so + * the values land in the same place the settings screen saves them. + */ + +const { wpEvalFile } = require( './wizard' ); + +/** + * Encode a value as a PHP expression that decodes it back. + * + * The JSON is base64-encoded, so quotes and backslashes in the values + * cannot break out of the PHP string. + * + * @param {unknown} value Any JSON-serializable value. + * @return {string} PHP expression. + */ +function phpJson( value ) { + const encoded = Buffer.from( JSON.stringify( value ) ).toString( 'base64' ); + return `json_decode( base64_decode( '${ encoded }' ), true )`; +} + +/** + * Save plugin settings and return their previous values. + * + * @param {Record} values Setting slug to value. + * @return {Record} Setting slug to the value before the write. + */ +function saveSettings( values ) { + return JSON.parse( + wpEvalFile( ` + $settings = get_plugin_instance()->settings; + $previous = array(); + foreach ( ${ phpJson( values ) } as $slug => $value ) { + $setting = $settings->get_setting( $slug ); + $previous[ $slug ] = $setting->get_value(); + $setting->save_value( $value ); + } + echo wp_json_encode( $previous ); + ` ) + ); +} + +/** + * Read the current value of plugin settings. + * + * @param {string[]} slugs Setting slugs. + * @return {Record} Setting slug to value. + */ +function readSettings( slugs ) { + return JSON.parse( + wpEvalFile( ` + $settings = get_plugin_instance()->settings; + $values = array(); + foreach ( ${ phpJson( slugs ) } as $slug ) { + $values[ $slug ] = $settings->get_setting( $slug )->get_value(); + } + echo wp_json_encode( $values ); + ` ) + ); +} + +module.exports = { + readSettings, + saveSettings, +}; From 1a8f5fb897c3e3af47bdf3967b3307c321dcf89d Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Tue, 3 Nov 2026 15:01:07 +0100 Subject: [PATCH 75/80] fix: Report failed DAM imports instead of claiming success download_asset() returns a WP_Error when the download fails, but import_asset() only caught exceptions, so the error was dropped and the REST endpoint answered with success. The editor got a broken attachment with no file, and handle_failed_download() never ran. - import_asset() now returns the download error, so the attachment is deleted and the error is sent to the media modal. - handle_failed_download() logs the attachment ID, public_id and error to the plugin debug log and the PHP error log. - download_asset() deletes the file it primed for the download when the request fails or the response isn't a 200, instead of leaving an empty file in the uploads folder. --- php/sync/class-download-sync.php | 20 +- tests/phpunit/tests/test-download-sync.php | 260 +++++++++++++++++++++ 2 files changed, 279 insertions(+), 1 deletion(-) create mode 100644 tests/phpunit/tests/test-download-sync.php diff --git a/php/sync/class-download-sync.php b/php/sync/class-download-sync.php index b949f8be8..986e4ef01 100644 --- a/php/sync/class-download-sync.php +++ b/php/sync/class-download-sync.php @@ -97,7 +97,15 @@ public function rest_can_upload_files( \WP_REST_Request $request ) { // phpcs:ig * @param string $error The error text to return. */ public function handle_failed_download( $attachment_id, $error ) { - // @todo: Place a handler to catch the error for logging. + $message = sprintf( + 'Cloudinary: failed to import asset into attachment %d (public_id: %s). Deleting the attachment. Error: %s', + (int) $attachment_id, + (string) $this->media->get_public_id( $attachment_id ), + (string) $error + ); + Utils::log( $message, 'download-sync-failed' ); + error_log( $message ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log + // Delete attachment temp. wp_delete_attachment( $attachment_id, true ); @@ -170,9 +178,14 @@ public function download_asset( $attachment_id, $source = null, $date = null ) { ); if ( is_wp_error( $response ) ) { + wp_delete_file( $upload['file'] ); + return $response; } if ( 200 !== $response['response']['code'] ) { + // The error body has been streamed into the primed file, which is never attached. Remove it. + wp_delete_file( $upload['file'] ); + $header_error = wp_remote_retrieve_header( $response, 'x-cld-error' ); if ( ! empty( $header_error ) ) { $error = $header_error; @@ -244,6 +257,11 @@ public function import_asset( $attachment_id, $file_path, $transformations = nul return new \WP_Error( 'download_error', $e->getMessage() ); } + // download_asset() returns its errors rather than throwing them. + if ( is_wp_error( $upload ) ) { + return $upload; + } + $attachment = wp_prepare_attachment_for_js( $attachment_id ); // Do transformations. diff --git a/tests/phpunit/tests/test-download-sync.php b/tests/phpunit/tests/test-download-sync.php new file mode 100644 index 000000000..a6b0994ad --- /dev/null +++ b/tests/phpunit/tests/test-download-sync.php @@ -0,0 +1,260 @@ +error_log_file ) { + ini_set( 'error_log', (string) $this->previous_error_log ); // phpcs:ignore WordPress.PHP.IniSet.Risky + wp_delete_file( $this->error_log_file ); + $this->error_log_file = null; + } + + parent::tear_down(); + } + + /** + * Build a fully wired Download_Sync instance, reusing the plugin's real components. + * + * @return Download_Sync + */ + protected function get_download_sync() { + $download_sync = new Download_Sync( \Cloudinary\get_plugin_instance() ); + $download_sync->setup(); + + return $download_sync; + } + + /** + * Create an attachment with no file, the way the media library import creates one before + * the asset is downloaded. + * + * @return int + */ + protected function create_pending_attachment() { + $attachment_id = self::factory()->attachment->create( + array( + 'post_mime_type' => 'image/jpeg', + 'post_title' => 'sample', + ) + ); + \Cloudinary\get_plugin_instance()->get_component( 'media' )->update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], 'folder/sample' ); + + return $attachment_id; + } + + /** + * Make every HTTP request return the given response. + * + * @param array|WP_Error $response The response to return. + * + * @return void + */ + protected function mock_http_response( $response ) { + add_filter( + 'pre_http_request', + static function () use ( $response ) { + return $response; + } + ); + } + + /** + * Build an HTTP response array with an empty body. + * + * @param int $code The HTTP status code. + * @param array $headers The response headers. + * + * @return array + */ + protected function http_response( $code, $headers = array() ) { + return array( + 'headers' => $headers, + 'body' => '', + 'response' => array( + 'code' => $code, + 'message' => get_status_header_desc( $code ), + ), + 'cookies' => array(), + 'filename' => null, + ); + } + + /** + * List the files in the current uploads folder, where download_asset() primes its file. + * + * @return string[] + */ + protected function get_upload_files() { + $files = glob( trailingslashit( wp_upload_dir()['path'] ) . '*' ); + + return false === $files ? array() : $files; + } + + /** + * Send PHP's error log to a temporary file for the duration of the test. + * + * @return void + */ + protected function capture_error_log() { + $this->error_log_file = wp_tempnam( 'cloudinary-error-log' ); + $this->previous_error_log = ini_set( 'error_log', $this->error_log_file ); // phpcs:ignore WordPress.PHP.IniSet.Risky + } + + /** + * A non-200 response returns the Cloudinary error header as a WP_Error. + * + * @return void + */ + public function test_download_asset_returns_error_on_non_200_response() { + $attachment_id = $this->create_pending_attachment(); + $this->mock_http_response( $this->http_response( 401, array( 'x-cld-error' => 'deny or ACL failure' ) ) ); + + $result = $this->get_download_sync()->download_asset( $attachment_id, self::SOURCE_URL ); + + $this->assertWPError( $result ); + $this->assertSame( 'deny or ACL failure', $result->get_error_message() ); + $this->assertEmpty( get_attached_file( $attachment_id ) ); + } + + /** + * A non-200 response without a Cloudinary error header returns a generic error. + * + * @return void + */ + public function test_download_asset_returns_generic_error_without_error_header() { + $attachment_id = $this->create_pending_attachment(); + $this->mock_http_response( $this->http_response( 503 ) ); + + $result = $this->get_download_sync()->download_asset( $attachment_id, self::SOURCE_URL ); + + $this->assertWPError( $result ); + $this->assertSame( 'Could not download the Cloudinary asset.', $result->get_error_message() ); + } + + /** + * A non-200 response does not leave the primed file in the uploads folder. + * + * @return void + */ + public function test_download_asset_removes_primed_file_on_non_200_response() { + $attachment_id = $this->create_pending_attachment(); + $this->mock_http_response( $this->http_response( 401 ) ); + $files_before = $this->get_upload_files(); + + $this->get_download_sync()->download_asset( $attachment_id, self::SOURCE_URL ); + + $this->assertSame( $files_before, $this->get_upload_files() ); + } + + /** + * A transport error is returned as is, and does not leave the primed file behind. + * + * @return void + */ + public function test_download_asset_returns_transport_error_and_removes_primed_file() { + $attachment_id = $this->create_pending_attachment(); + $this->mock_http_response( new WP_Error( 'http_request_failed', 'Could not resolve host' ) ); + $files_before = $this->get_upload_files(); + + $result = $this->get_download_sync()->download_asset( $attachment_id, self::SOURCE_URL ); + + $this->assertWPError( $result ); + $this->assertSame( 'http_request_failed', $result->get_error_code() ); + $this->assertSame( $files_before, $this->get_upload_files() ); + } + + /** + * import_asset() returns the download error instead of reporting success. + * + * @return void + */ + public function test_import_asset_returns_download_error() { + $attachment_id = $this->create_pending_attachment(); + $this->mock_http_response( $this->http_response( 401, array( 'x-cld-error' => 'deny or ACL failure' ) ) ); + + $result = $this->get_download_sync()->import_asset( $attachment_id, self::SOURCE_URL, array() ); + + $this->assertWPError( $result ); + $this->assertSame( 'deny or ACL failure', $result->get_error_message() ); + } + + /** + * handle_failed_download() logs the failure, deletes the attachment and sends the error. + * + * @return void + */ + public function test_handle_failed_download_logs_deletes_and_sends_error() { + $attachment_id = $this->create_pending_attachment(); + $this->capture_error_log(); + + // wp_send_json_error() ends the request through wp_die(); make that throw instead. + add_filter( 'wp_doing_ajax', '__return_true' ); + add_filter( + 'wp_die_ajax_handler', + static function () { + return static function () { + throw new WPDieException( 'wp_die called' ); + }; + }, + PHP_INT_MAX + ); + $this->expectOutputString( '{"success":false,"data":"deny or ACL failure"}' ); + + try { + $this->get_download_sync()->handle_failed_download( $attachment_id, 'deny or ACL failure' ); + $this->fail( 'handle_failed_download() should end the request.' ); + } catch ( WPDieException $e ) { + // Expected: the JSON error has been sent. + unset( $e ); + } + + $this->assertNull( get_post( $attachment_id ) ); + + $log = (string) file_get_contents( $this->error_log_file ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents + $this->assertStringContainsString( 'failed to import asset into attachment ' . $attachment_id, $log ); + $this->assertStringContainsString( 'public_id: folder/sample', $log ); + $this->assertStringContainsString( 'Error: deny or ACL failure', $log ); + } +} From 253f3c93ec45b2c424c526214985c6e8c3eb2540 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Wed, 4 Nov 2026 09:00:36 +0100 Subject: [PATCH 76/80] fix: Restrict the asset download endpoint to editable attachments The endpoint only required the upload_files capability and used the posted attachment ID as is. Now that a failed download deletes the attachment, any user able to upload files could delete any attachment by posting its ID with a URL that can't be downloaded. - The endpoint now requires the attachment to exist and the user to be able to edit it. - A failed download only deletes an attachment that has no file yet and that the user can delete. - The logged public_id is read from the stored meta, instead of one generated when it's missing. - The error, which can come from a remote response header, is sanitized before it's logged or returned. - The primed file is also removed when an exception is thrown during the download. --- php/sync/class-download-sync.php | 59 ++++- tests/phpunit/tests/test-download-sync.php | 269 +++++++++++++++++++-- 2 files changed, 292 insertions(+), 36 deletions(-) diff --git a/php/sync/class-download-sync.php b/php/sync/class-download-sync.php index 986e4ef01..a421fb2de 100644 --- a/php/sync/class-download-sync.php +++ b/php/sync/class-download-sync.php @@ -78,41 +78,74 @@ public function rest_endpoints( $endpoints ) { /** * Admin permission callback. * + * The user must be allowed to download assets, and to edit the attachment the asset is + * downloaded into: the endpoint replaces that attachment's file, and deletes the + * attachment if the download fails. + * * Explicitly defined to allow easier testability. * * @param \WP_REST_Request $request The request. * * @return bool */ - public function rest_can_upload_files( \WP_REST_Request $request ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found + public function rest_can_upload_files( \WP_REST_Request $request ) { // This would have been from an ajax call. Therefore verify based on capability. - return Utils::user_can( 'manage_assets', 'upload_files', 'download' ); + if ( ! Utils::user_can( 'manage_assets', 'upload_files', 'download' ) ) { + return false; + } + + $attachment_id = absint( $request->get_param( 'attachment_id' ) ); + + return $attachment_id + && 'attachment' === get_post_type( $attachment_id ) + && current_user_can( 'edit_post', $attachment_id ); } /** * Handle a failed download by deleting the temp attachment and returning the error in json. * + * Only an attachment that is still waiting for its first download is deleted: it has no + * file yet, and the current user is allowed to delete it. + * * @param int $attachment_id The attachment ID. * @param string $error The error text to return. */ public function handle_failed_download( $attachment_id, $error ) { + $attachment_id = absint( $attachment_id ); + // The error can come from a response header of the remote server. + $error = sanitize_text_field( (string) $error ); + $delete = $this->is_pending_download( $attachment_id ) && current_user_can( 'delete_post', $attachment_id ); + $message = sprintf( - 'Cloudinary: failed to import asset into attachment %d (public_id: %s). Deleting the attachment. Error: %s', - (int) $attachment_id, - (string) $this->media->get_public_id( $attachment_id ), - (string) $error + 'Cloudinary: failed to import asset into attachment %d (public_id: %s). %s Error: %s', + $attachment_id, + (string) $this->media->get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ), + $delete ? 'Deleting the attachment.' : 'Keeping the attachment.', + $error ); Utils::log( $message, 'download-sync-failed' ); error_log( $message ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log - // Delete attachment temp. - wp_delete_attachment( $attachment_id, true ); + if ( $delete ) { + wp_delete_attachment( $attachment_id, true ); + } - // Send error. + // Send error. The media modal expects the admin-ajax response format. wp_send_json_error( $error ); } + /** + * Check if an attachment is still waiting for its first download, i.e. has no file yet. + * + * @param int $attachment_id The attachment ID. + * + * @return bool + */ + protected function is_pending_download( $attachment_id ) { + return 'attachment' === get_post_type( $attachment_id ) && empty( get_post_meta( $attachment_id, '_wp_attached_file', true ) ); + } + /** * Download attachment from Cloudinary via REST API. * @@ -122,7 +155,7 @@ public function handle_failed_download( $attachment_id, $error ) { */ public function rest_download_asset( \WP_REST_Request $request ) { - $attachment_id = $request->get_param( 'attachment_id' ); + $attachment_id = absint( $request->get_param( 'attachment_id' ) ); $file_path = $request->get_param( 'src' ); $transformations = (array) $request->get_param( 'transformations' ); @@ -161,6 +194,7 @@ public function download_asset( $attachment_id, $source = null, $date = null ) { } else { $file_name = wp_basename( strtok( $source, '?' ) ); } + $upload = array(); try { // Prime a file to stream to. $upload = wp_upload_bits( $file_name, null, 'temp', $date ); @@ -218,6 +252,11 @@ public function download_asset( $attachment_id, $source = null, $date = null ) { $this->sync->add_to_sync( $attachment_id ); // Update storage and other sync types. } } catch ( \Exception $e ) { + // Remove the primed file, unless it already became the attachment's file. + if ( ! empty( $upload['file'] ) && get_attached_file( $attachment_id ) !== $upload['file'] ) { + wp_delete_file( $upload['file'] ); + } + return new \WP_Error( 'download_error', $e->getMessage() ); } diff --git a/tests/phpunit/tests/test-download-sync.php b/tests/phpunit/tests/test-download-sync.php index a6b0994ad..2d87685e3 100644 --- a/tests/phpunit/tests/test-download-sync.php +++ b/tests/phpunit/tests/test-download-sync.php @@ -2,9 +2,12 @@ /** * Tests for Cloudinary\Sync\Download_Sync. * - * These cover how a failed download from Cloudinary is reported: download_asset() and - * import_asset() must return the error rather than report success, must not leave the primed - * file behind, and handle_failed_download() must log the failure before deleting the attachment. + * These cover the asset download endpoint used by the media library import: + * - a failed download is returned as an error instead of reported as a success, and does not + * leave the primed file behind; + * - handle_failed_download() logs the failure, and only deletes an attachment that is still + * waiting for its first download and that the current user can delete; + * - the endpoint is only available for an attachment the current user can edit. * * HTTP requests are short-circuited with the pre_http_request filter, so no request leaves the * test environment. @@ -12,11 +15,12 @@ * @package Cloudinary */ +use Cloudinary\REST_API; use Cloudinary\Sync; use Cloudinary\Sync\Download_Sync; /** - * Covers the failure paths of Download_Sync. + * Covers the failure paths and permissions of Download_Sync. */ class Test_Download_Sync extends WP_UnitTestCase { @@ -25,6 +29,20 @@ class Test_Download_Sync extends WP_UnitTestCase { */ const SOURCE_URL = 'https://res.cloudinary.com/demo/image/upload/e_sepia/v1/folder/sample.jpg'; + /** + * An administrator. + * + * @var int + */ + protected static $admin_id; + + /** + * An author, who can upload files and edit or delete only their own attachments. + * + * @var int + */ + protected static $author_id; + /** * Path to the temporary PHP error log used by a test, if any. * @@ -40,7 +58,19 @@ class Test_Download_Sync extends WP_UnitTestCase { protected $previous_error_log; /** - * Restore the PHP error log and remove the temporary log file. + * Create the users once for all tests. + * + * @param WP_UnitTest_Factory $factory The test factory. + * + * @return void + */ + public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { + self::$admin_id = $factory->user->create( array( 'role' => 'administrator' ) ); + self::$author_id = $factory->user->create( array( 'role' => 'author' ) ); + } + + /** + * Restore the PHP error log, remove the temporary log file and reset the REST server. * * @return void */ @@ -51,6 +81,9 @@ public function tear_down() { $this->error_log_file = null; } + global $wp_rest_server; + $wp_rest_server = null; + parent::tear_down(); } @@ -70,13 +103,16 @@ protected function get_download_sync() { * Create an attachment with no file, the way the media library import creates one before * the asset is downloaded. * + * @param int $author_id The attachment author. + * * @return int */ - protected function create_pending_attachment() { + protected function create_pending_attachment( $author_id = 0 ) { $attachment_id = self::factory()->attachment->create( array( 'post_mime_type' => 'image/jpeg', 'post_title' => 'sample', + 'post_author' => $author_id ? $author_id : self::$admin_id, ) ); \Cloudinary\get_plugin_instance()->get_component( 'media' )->update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], 'folder/sample' ); @@ -142,6 +178,60 @@ protected function capture_error_log() { $this->previous_error_log = ini_set( 'error_log', $this->error_log_file ); // phpcs:ignore WordPress.PHP.IniSet.Risky } + /** + * Read the temporary PHP error log. + * + * @return string + */ + protected function get_error_log() { + return (string) file_get_contents( $this->error_log_file ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents + } + + /** + * Call handle_failed_download(), which ends the request through wp_send_json_error(). + * + * @param int $attachment_id The attachment ID. + * @param string $error The error. + * + * @return void + */ + protected function call_handle_failed_download( $attachment_id, $error ) { + // wp_send_json_error() ends the request through wp_die(); make that throw instead. + add_filter( 'wp_doing_ajax', '__return_true' ); + add_filter( + 'wp_die_ajax_handler', + static function () { + return static function () { + throw new WPDieException( 'wp_die called' ); + }; + }, + PHP_INT_MAX + ); + + try { + $this->get_download_sync()->handle_failed_download( $attachment_id, $error ); + $this->fail( 'handle_failed_download() should end the request.' ); + } catch ( WPDieException $e ) { + // Expected: the JSON error has been sent. + unset( $e ); + } + } + + /** + * Build a request to the asset download endpoint. + * + * @param int $attachment_id The attachment ID. + * + * @return WP_REST_Request + */ + protected function asset_request( $attachment_id ) { + $request = new WP_REST_Request( 'POST', '/' . REST_API::BASE . '/asset' ); + $request->set_param( 'attachment_id', $attachment_id ); + $request->set_param( 'src', self::SOURCE_URL ); + + return $request; + } + /** * A non-200 response returns the Cloudinary error header as a WP_Error. * @@ -205,6 +295,29 @@ public function test_download_asset_returns_transport_error_and_removes_primed_f $this->assertSame( $files_before, $this->get_upload_files() ); } + /** + * An exception thrown during the download is returned as an error, and does not leave the + * primed file behind. + * + * @return void + */ + public function test_download_asset_removes_primed_file_on_exception() { + $attachment_id = $this->create_pending_attachment(); + add_filter( + 'pre_http_request', + static function () { + throw new Exception( 'Unexpected failure' ); + } + ); + $files_before = $this->get_upload_files(); + + $result = $this->get_download_sync()->download_asset( $attachment_id, self::SOURCE_URL ); + + $this->assertWPError( $result ); + $this->assertSame( 'Unexpected failure', $result->get_error_message() ); + $this->assertSame( $files_before, $this->get_upload_files() ); + } + /** * import_asset() returns the download error instead of reporting success. * @@ -226,35 +339,139 @@ public function test_import_asset_returns_download_error() { * @return void */ public function test_handle_failed_download_logs_deletes_and_sends_error() { + wp_set_current_user( self::$admin_id ); $attachment_id = $this->create_pending_attachment(); $this->capture_error_log(); - - // wp_send_json_error() ends the request through wp_die(); make that throw instead. - add_filter( 'wp_doing_ajax', '__return_true' ); - add_filter( - 'wp_die_ajax_handler', - static function () { - return static function () { - throw new WPDieException( 'wp_die called' ); - }; - }, - PHP_INT_MAX - ); $this->expectOutputString( '{"success":false,"data":"deny or ACL failure"}' ); - try { - $this->get_download_sync()->handle_failed_download( $attachment_id, 'deny or ACL failure' ); - $this->fail( 'handle_failed_download() should end the request.' ); - } catch ( WPDieException $e ) { - // Expected: the JSON error has been sent. - unset( $e ); - } + $this->call_handle_failed_download( $attachment_id, 'deny or ACL failure' ); $this->assertNull( get_post( $attachment_id ) ); - $log = (string) file_get_contents( $this->error_log_file ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents + $log = $this->get_error_log(); $this->assertStringContainsString( 'failed to import asset into attachment ' . $attachment_id, $log ); $this->assertStringContainsString( 'public_id: folder/sample', $log ); + $this->assertStringContainsString( 'Deleting the attachment.', $log ); $this->assertStringContainsString( 'Error: deny or ACL failure', $log ); } + + /** + * An author can import into, and so delete on failure, the attachment they just created. + * + * @return void + */ + public function test_handle_failed_download_deletes_own_pending_attachment_as_author() { + wp_set_current_user( self::$author_id ); + $attachment_id = $this->create_pending_attachment( self::$author_id ); + $this->capture_error_log(); + $this->expectOutputRegex( '/"success":false/' ); + + $this->call_handle_failed_download( $attachment_id, 'deny or ACL failure' ); + + $this->assertNull( get_post( $attachment_id ) ); + } + + /** + * An attachment that already has a file is not deleted. + * + * @return void + */ + public function test_handle_failed_download_keeps_attachment_with_a_file() { + wp_set_current_user( self::$admin_id ); + $attachment_id = $this->create_pending_attachment(); + update_post_meta( $attachment_id, '_wp_attached_file', '2026/11/sample.jpg' ); + $this->capture_error_log(); + $this->expectOutputRegex( '/"success":false/' ); + + $this->call_handle_failed_download( $attachment_id, 'deny or ACL failure' ); + + $this->assertNotNull( get_post( $attachment_id ) ); + $this->assertStringContainsString( 'Keeping the attachment.', $this->get_error_log() ); + } + + /** + * An attachment the current user cannot delete is not deleted. + * + * @return void + */ + public function test_handle_failed_download_keeps_attachment_user_cannot_delete() { + wp_set_current_user( self::$author_id ); + $attachment_id = $this->create_pending_attachment( self::$admin_id ); + $this->capture_error_log(); + $this->expectOutputRegex( '/"success":false/' ); + + $this->call_handle_failed_download( $attachment_id, 'deny or ACL failure' ); + + $this->assertNotNull( get_post( $attachment_id ) ); + } + + /** + * An error from the remote server can't add lines to the log. + * + * @return void + */ + public function test_handle_failed_download_sanitizes_logged_error() { + wp_set_current_user( self::$admin_id ); + $attachment_id = $this->create_pending_attachment(); + $this->capture_error_log(); + $this->expectOutputString( '{"success":false,"data":"deny Cloudinary: forged line"}' ); + + $this->call_handle_failed_download( $attachment_id, "deny\nCloudinary: forged line" ); + + $this->assertSame( 1, substr_count( trim( $this->get_error_log() ), "\n" ) + 1 ); + } + + /** + * The endpoint is available for an attachment the user can edit. + * + * @return void + */ + public function test_permission_allows_editable_attachment() { + wp_set_current_user( self::$author_id ); + $attachment_id = $this->create_pending_attachment( self::$author_id ); + + $this->assertTrue( $this->get_download_sync()->rest_can_upload_files( $this->asset_request( $attachment_id ) ) ); + } + + /** + * The endpoint is not available for another user's attachment the user can't edit. + * + * @return void + */ + public function test_permission_denies_attachment_user_cannot_edit() { + wp_set_current_user( self::$author_id ); + $attachment_id = $this->create_pending_attachment( self::$admin_id ); + + $this->assertFalse( $this->get_download_sync()->rest_can_upload_files( $this->asset_request( $attachment_id ) ) ); + } + + /** + * The endpoint is not available without a valid attachment. + * + * @return void + */ + public function test_permission_denies_missing_or_non_attachment_id() { + wp_set_current_user( self::$admin_id ); + $post_id = self::factory()->post->create(); + $download_sync = $this->get_download_sync(); + + $this->assertFalse( $download_sync->rest_can_upload_files( $this->asset_request( 0 ) ) ); + $this->assertFalse( $download_sync->rest_can_upload_files( $this->asset_request( $post_id ) ) ); + } + + /** + * Through the REST route, an author can't make another user's attachment be deleted. + * + * @return void + */ + public function test_rest_route_rejects_attachment_user_cannot_edit() { + wp_set_current_user( self::$author_id ); + $attachment_id = $this->create_pending_attachment( self::$admin_id ); + $this->mock_http_response( $this->http_response( 401 ) ); + + $response = rest_get_server()->dispatch( $this->asset_request( $attachment_id ) ); + + $this->assertSame( 403, $response->get_status() ); + $this->assertNotNull( get_post( $attachment_id ) ); + } } From 66388845f31740be5f21be2dfeb10c007b5cbba0 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Wed, 4 Nov 2026 09:21:22 +0100 Subject: [PATCH 77/80] fix: Keep the Cloudinary asset when cleaning up a failed import Deleting the attachment of a failed import also ran the delete sync, which sends a destroy request for the asset on Cloudinary: a new import already counts as synced before its file is downloaded. The request currently fails because the attachment has no resource type yet, but the source asset the user picked must never be at risk. The cleanup now deletes the attachment in WordPress only. The exception cleanup in download_asset() also uses a flag to know whether the primed file became the attachment's file, instead of comparing paths that a filter can rewrite. --- php/sync/class-download-sync.php | 31 ++++++++++++-- tests/phpunit/tests/test-download-sync.php | 48 ++++++++++++++++++++++ 2 files changed, 76 insertions(+), 3 deletions(-) diff --git a/php/sync/class-download-sync.php b/php/sync/class-download-sync.php index a421fb2de..c1fa49f96 100644 --- a/php/sync/class-download-sync.php +++ b/php/sync/class-download-sync.php @@ -128,13 +128,36 @@ public function handle_failed_download( $attachment_id, $error ) { error_log( $message ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log if ( $delete ) { - wp_delete_attachment( $attachment_id, true ); + $this->delete_local_attachment( $attachment_id ); } // Send error. The media modal expects the admin-ajax response format. wp_send_json_error( $error ); } + /** + * Delete an attachment in WordPress only. + * + * Deleting an attachment normally also deletes its asset on Cloudinary. A failed import must + * leave that asset alone: it's the source the user picked in the media library, not a copy + * made by the import. + * + * @param int $attachment_id The attachment ID. + */ + protected function delete_local_attachment( $attachment_id ) { + $callback = array( $this->sync->managers['delete'], 'delete_asset' ); + $priority = has_action( 'delete_attachment', $callback ); + if ( false !== $priority ) { + remove_action( 'delete_attachment', $callback, $priority ); + } + + wp_delete_attachment( $attachment_id, true ); + + if ( false !== $priority ) { + add_action( 'delete_attachment', $callback, $priority ); + } + } + /** * Check if an attachment is still waiting for its first download, i.e. has no file yet. * @@ -194,7 +217,8 @@ public function download_asset( $attachment_id, $source = null, $date = null ) { } else { $file_name = wp_basename( strtok( $source, '?' ) ); } - $upload = array(); + $upload = array(); + $attached = false; try { // Prime a file to stream to. $upload = wp_upload_bits( $file_name, null, 'temp', $date ); @@ -232,6 +256,7 @@ public function download_asset( $attachment_id, $source = null, $date = null ) { // Prepare the asset. update_attached_file( $attachment_id, $upload['file'] ); + $attached = true; wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $upload['file'] ) ); @@ -253,7 +278,7 @@ public function download_asset( $attachment_id, $source = null, $date = null ) { } } catch ( \Exception $e ) { // Remove the primed file, unless it already became the attachment's file. - if ( ! empty( $upload['file'] ) && get_attached_file( $attachment_id ) !== $upload['file'] ) { + if ( ! $attached && ! empty( $upload['file'] ) ) { wp_delete_file( $upload['file'] ); } diff --git a/tests/phpunit/tests/test-download-sync.php b/tests/phpunit/tests/test-download-sync.php index 2d87685e3..bf628ac96 100644 --- a/tests/phpunit/tests/test-download-sync.php +++ b/tests/phpunit/tests/test-download-sync.php @@ -355,6 +355,54 @@ public function test_handle_failed_download_logs_deletes_and_sends_error() { $this->assertStringContainsString( 'Error: deny or ACL failure', $log ); } + /** + * Deleting the attachment of a failed import leaves the asset on Cloudinary alone. + * + * @return void + */ + public function test_handle_failed_download_does_not_delete_asset_on_cloudinary() { + wp_set_current_user( self::$admin_id ); + $attachment_id = $this->create_pending_attachment(); + $this->capture_error_log(); + $this->expectOutputRegex( '/"success":false/' ); + + // Make sure the hook that deletes assets on Cloudinary is registered, as on a connected site. + $delete_sync = \Cloudinary\get_plugin_instance()->get_component( 'sync' )->managers['delete']; + $callback = array( $delete_sync, 'delete_asset' ); + if ( false === has_action( 'delete_attachment', $callback ) ) { + $delete_sync->setup(); + } + $priority = has_action( 'delete_attachment', $callback ); + + // Record whether the hook is still attached while the attachment is deleted, and any request. + $hooked_during_delete = null; + add_action( + 'delete_attachment', + static function () use ( &$hooked_during_delete, $callback ) { + $hooked_during_delete = has_action( 'delete_attachment', $callback ); + }, + 1 + ); + $requests = array(); + add_filter( + 'pre_http_request', + static function ( $pre, $args, $url ) use ( &$requests ) { + $requests[] = $url; + + return new WP_Error( 'http_request_blocked', 'Blocked in tests.' ); + }, + 10, + 3 + ); + + $this->call_handle_failed_download( $attachment_id, 'deny or ACL failure' ); + + $this->assertNull( get_post( $attachment_id ) ); + $this->assertFalse( $hooked_during_delete ); + $this->assertSame( array(), $requests ); + $this->assertSame( $priority, has_action( 'delete_attachment', $callback ) ); + } + /** * An author can import into, and so delete on failure, the attachment they just created. * From 037ff8b52e965d026ae4d0f488daf6725ddcee96 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Wed, 4 Nov 2026 09:36:44 +0100 Subject: [PATCH 78/80] fix: Handle import errors on the Cloudinary DAM page The DAM page called the asset download endpoint after every insert, including assets already in the Media Library, which have no attachment to download into. The endpoint now rejects that request, and with no error handler the import progress never cleared. A failed download was also shown as a success. - Only call the download endpoint for new assets, as the media modal does. - Show the error when the download fails or the request is rejected. - Always clear the import progress. --- js/cloudinary.js | 2 +- src/js/components/media-library.js | 75 +++++++++++++++++++++++------- 2 files changed, 58 insertions(+), 19 deletions(-) diff --git a/js/cloudinary.js b/js/cloudinary.js index aaaccd21b..7f89ee4de 100644 --- a/js/cloudinary.js +++ b/js/cloudinary.js @@ -1,2 +1,2 @@ -(()=>{var t={951(t,e){var i,n,s,o;o=function(){var t="BKMGTPEZY".split("");function e(t,e){return t&&t.toLowerCase()===e.toLowerCase()}return function(i,n){return i="number"==typeof i?i:0,(n=n||{}).fixed="number"==typeof n.fixed?n.fixed:2,n.spacer="string"==typeof n.spacer?n.spacer:" ",n.calculate=function(t){var s=e(t,"si")?["k","B"]:["K","iB"],o=e(t,"si")?1e3:1024,r=Math.log(i)/Math.log(o)|0,a=i/Math.pow(o,r),l=a.toFixed(n.fixed);return r-1<3&&!e(t,"si")&&e(t,"jedec")&&(s[1]="B"),{suffix:r?(s[0]+"MGTPEZY")[r-1]+s[1]:1==(0|l)?"Byte":"Bytes",magnitude:r,result:a,fixed:l,bits:{result:a/8,fixed:(a/8).toFixed(n.fixed)}}},n.to=function(n,s){var o=e(s,"si")?1e3:1024,r=t.indexOf("string"==typeof n?n[0].toUpperCase():"B"),a=i;if(-1===r||0===r)return a.toFixed(2);for(;r>0;r--)a/=o;return a.toFixed(2)},n.human=function(t){var e=n.calculate(t);return e.fixed+n.spacer+e.suffix},n}},t.exports?t.exports=o():(n=[],void 0===(s="function"==typeof(i=o)?i.apply(e,n):i)||(t.exports=s))},998(t,e){var i,n,s;n=[],i=function(){"use strict";function t(t,e){var i,s,o;for(i=1,s=arguments.length;i>1].factor>t?s=e-1:n=e;return i[n]},r.prototype.parse=function(t,e){var i=t.match(this._regexp);if(null!==i){var s,o=i[3];if(n(this._prefixes,o))s=this._prefixes[o];else{if(e||(o=o.toLowerCase(),!n(this._lcPrefixes,o)))return;o=this._lcPrefixes[o],s=this._prefixes[o]}var r=+i[2];return void 0!==i[1]&&(r=-r),{factor:s,prefix:o,unit:i[4],value:r}}};var a={binary:r.create(",Ki,Mi,Gi,Ti,Pi,Ei,Zi,Yi".split(","),1024),SI:r.create("q,r,y,z,a,f,p,n,µ,m,,k,M,G,T,P,E,Z,Y,R,Q".split(","),1e3,-10)},l=t({},a.binary._prefixes),c=a.SI._prefixes;for(var h in c)c[h]>=1&&(l[h]=c[h]);var d=new r(l),u={maxDecimals:2,separator:" ",unit:""},f={rounding:"round",scale:"SI",strict:!1};function p(t,e){var n=i(e,u,"decimals"),s=E(t,e,void 0!==n?n:i(e,u,"maxDecimals"));t=void 0!==n?s.value.toFixed(n):String(s.value);var o=s.prefix+i(e,u,"unit");return""===o?t:t+i(e,u,"separator")+o}var g={scale:"binary",unit:"B"};function m(e,i){return p(e,void 0===i?g:t({},g,i))}function b(t,e){return x(_(t,e))}var v={scale:d,unit:"B"};function y(e,i){return x(w(e,void 0===i?v:t({},v,i),!0))}function x(t){var e=String(t.value).split(".")[1];if(void 0!==e&&-1===e.indexOf("e")){var i=Math.pow(10,e.length),n=Math.round(t.value*i)*t.factor;if(n%1==0&&Math.abs(n)<=s)return n/i}return t.value*t.factor}function _(t,e){return w(t,e,!1)}function w(t,e,n){if("string"!=typeof t)throw new TypeError("str must be a string");var s=o(a,i(e,f,"scale"));if(void 0===s)throw new Error("missing scale");var r=i(e,f,"strict"),l=i(e,f,"unit");if(void 0!==l){var c=(t=t.trim()).slice(-l.length);""!==l&&(c===l||n&&!r&&c.toLowerCase()===l.toLowerCase())?t=t.slice(0,-l.length):l=""}var h=s.parse(t,r);if(void 0===h||void 0!==l&&""!==h.unit)throw new Error("cannot parse str");return void 0!==l&&(h.unit=l),h}var k={ceil:function(t){return Math.ceil(+t.toPrecision(15))},floor:function(t){return Math.floor(+t.toPrecision(15))},round:Math.round},S={ceil:"floor",floor:"ceil"};function M(t,e){return t<10*e?10:1}function O(t,e){return E(t,e,i(e,f,"maxDecimals"))}function E(t,e,s){if("number"!=typeof t||t!=t)throw new TypeError("value must be a number");if(0===t)return{value:0,prefix:""};if(!isFinite(t))return{value:t,prefix:""};var r=t<0;r&&(t=-t);var l=o(a,i(e,f,"scale"));if(void 0===l)throw new Error("missing scale");var c=i(e,f,"rounding");if(!n(k,c))throw new Error("invalid rounding");r&&n(S,c)&&(c=S[c]);var h,d=k[c],u="auto"===s;void 0===s||u||(h=Math.pow(10,s));var p,g=i(e,f,"prefix");if(void 0!==g){if(!n(l._prefixes,g))throw new Error("invalid prefix");p=l._prefixes[g]}else{var m=l.findPrefix(t);if(void 0!==s)do{p=m.factor,u&&(h=M(t,p));var b=p/h;t=d(t/b)*b}while((m=l.findPrefix(t)).factor!==p);else p=m.factor;g=m.prefix}return u&&(h=M(t,p)),t=void 0===h?t/p:d(t*h/p)/h,{prefix:g,value:r?-t:t}}return p.bytes=m,p.parse=b,b.bytes=y,b.raw=_,p.raw=O,p.Scale=r,p},void 0===(s="function"==typeof i?i.apply(e,n):i)||(t.exports=s)},336(t){var e,i="loading"in HTMLImageElement.prototype,n="loading"in HTMLIFrameElement.prototype,s="onscroll"in window;function o(t){var e,i,n=[];"picture"===t.parentNode.tagName.toLowerCase()&&((i=(e=t.parentNode).querySelector("source[data-lazy-remove]"))&&e.removeChild(i),n=Array.prototype.slice.call(t.parentNode.querySelectorAll("source"))),n.push(t),n.forEach(function(t){t.hasAttribute("data-lazy-srcset")&&(t.setAttribute("srcset",t.getAttribute("data-lazy-srcset")),t.removeAttribute("data-lazy-srcset"))}),t.setAttribute("src",t.getAttribute("data-lazy-src")),t.removeAttribute("data-lazy-src")}function r(t){var o=document.createElement("div");for(o.innerHTML=function(t){var o=t.textContent||t.innerHTML,r="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 "+((o.match(/width=['"](\d+)['"]/)||!1)[1]||1)+" "+((o.match(/height=['"](\d+)['"]/)||!1)[1]||1)+"%27%3E%3C/svg%3E";return(/\n-1}function zt(t,e){var i=this.__data__,n=te(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this}function Bt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e1?i[s-1]:void 0,r=s>2?i[2]:void 0;for(o=t.length>3&&"function"==typeof o?(s--,o):void 0,r&&ke(i[0],i[1],r)&&(o=s<3?void 0:o,s=1),e=Object(e);++n-1&&t%1==0&&t0){if(++e>=o)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function De(t){if(null!=t){try{return ot.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ie(t,e){return t===e||t!=t&&e!=e}var Re=se(function(){return arguments}())?se:function(t){return He(t)&&rt.call(t,"callee")&&!bt.call(t,"callee")},je=Array.isArray;function Fe(t){return null!=t&&We(t.length)&&!Ne(t)}function ze(t){return He(t)&&Fe(t)}var Be=_t||Ke;function Ne(t){if(!Ve(t))return!1;var e=ne(t);return e==p||e==g||e==h||e==x}function We(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Ve(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function He(t){return null!=t&&"object"==typeof t}function $e(t){if(!He(t)||ne(t)!=y)return!1;var e=gt(t);if(null===e)return!0;var i=rt.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&ot.call(i)==ct}var Ue=X?K(X):re;function qe(t){return ge(t,Ye(t))}function Ye(t){return Fe(t)?Kt(t,!0):ae(t)}var Xe=me(function(t,e,i){le(t,e,i)});function Je(t){return function(){return t}}function Ge(t){return t}function Ke(){return!1}e.exports=Xe}).call(this)}).call(this,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,i,n){var s,o;s=self,o=function(){return function(){"use strict";var t={720:function(t,e,i){i.r(e),i.d(e,{Scene:function(){return ae},Tweenable:function(){return Mt},interpolate:function(){return ee},processTweens:function(){return bt},setBezierFunction:function(){return H},shouldScheduleUpdate:function(){return xt},tween:function(){return Ot},unsetBezierFunction:function(){return $}});var n={};i.r(n),i.d(n,{bounce:function(){return R},bouncePast:function(){return j},easeFrom:function(){return z},easeFromTo:function(){return F},easeInBack:function(){return A},easeInCirc:function(){return S},easeInCubic:function(){return c},easeInExpo:function(){return _},easeInOutBack:function(){return C},easeInOutCirc:function(){return O},easeInOutCubic:function(){return d},easeInOutExpo:function(){return k},easeInOutQuad:function(){return l},easeInOutQuart:function(){return p},easeInOutQuint:function(){return b},easeInOutSine:function(){return x},easeInQuad:function(){return r},easeInQuart:function(){return u},easeInQuint:function(){return g},easeInSine:function(){return v},easeOutBack:function(){return T},easeOutBounce:function(){return E},easeOutCirc:function(){return M},easeOutCubic:function(){return h},easeOutExpo:function(){return w},easeOutQuad:function(){return a},easeOutQuart:function(){return f},easeOutQuint:function(){return m},easeOutSine:function(){return y},easeTo:function(){return B},elastic:function(){return P},linear:function(){return o},swingFrom:function(){return D},swingFromTo:function(){return L},swingTo:function(){return I}});var s={};i.r(s),i.d(s,{afterTween:function(){return Jt},beforeTween:function(){return Xt},doesApply:function(){return qt},tweenCreated:function(){return Yt}});var o=function(t){return t},r=function(t){return Math.pow(t,2)},a=function(t){return-(Math.pow(t-1,2)-1)},l=function(t){return(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2)},c=function(t){return Math.pow(t,3)},h=function(t){return Math.pow(t-1,3)+1},d=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)},u=function(t){return Math.pow(t,4)},f=function(t){return-(Math.pow(t-1,4)-1)},p=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},g=function(t){return Math.pow(t,5)},m=function(t){return Math.pow(t-1,5)+1},b=function(t){return(t/=.5)<1?.5*Math.pow(t,5):.5*(Math.pow(t-2,5)+2)},v=function(t){return 1-Math.cos(t*(Math.PI/2))},y=function(t){return Math.sin(t*(Math.PI/2))},x=function(t){return-.5*(Math.cos(Math.PI*t)-1)},_=function(t){return 0===t?0:Math.pow(2,10*(t-1))},w=function(t){return 1===t?1:1-Math.pow(2,-10*t)},k=function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},S=function(t){return-(Math.sqrt(1-t*t)-1)},M=function(t){return Math.sqrt(1-Math.pow(t-1,2))},O=function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},E=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},A=function(t){var e=1.70158;return t*t*((e+1)*t-e)},T=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},C=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},P=function(t){return-1*Math.pow(4,-8*t)*Math.sin((6*t-1)*(2*Math.PI)/2)+1},L=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},D=function(t){var e=1.70158;return t*t*((e+1)*t-e)},I=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},R=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},j=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?2-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?2-(7.5625*(t-=2.25/2.75)*t+.9375):2-(7.5625*(t-=2.625/2.75)*t+.984375)},F=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},z=function(t){return Math.pow(t,4)},B=function(t){return Math.pow(t,.25)};function N(t,e,i,n,s,o){var r,a,l,c,h,d=0,u=0,f=0,p=function(t){return((d*t+u)*t+f)*t},g=function(t){return(3*d*t+2*u)*t+f},m=function(t){return t>=0?t:0-t};return d=1-(f=3*e)-(u=3*(n-e)-f),l=1-(h=3*i)-(c=3*(s-i)-h),r=t,a=function(t){return 1/(200*t)}(o),function(t){return((l*t+c)*t+h)*t}(function(t,e){var i,n,s,o,r,a;for(s=t,a=0;a<8;a++){if(o=p(s)-t,m(o)(n=1))return n;for(;io?i=s:n=s,s=.5*(n-i)+i}return s}(r,a))}var W,V=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.25,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.25,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.75,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.75;return function(s){return N(s,t,e,i,n,1)}},H=function(t,e,i,n,s){var o=V(e,i,n,s);return o.displayName=t,o.x1=e,o.y1=i,o.x2=n,o.y2=s,Mt.formulas[t]=o},$=function(t){return delete Mt.formulas[t]};function U(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function q(t,e){for(var i=0;it.length)&&(e=t.length);for(var i=0,n=new Array(e);ia?a:e;t._hasEnded=l>=a;var c=o-(a-l),h=t._filters.length>0;if(t._hasEnded)return t._render(r,t._data,c),t.stop(!0);h&&t._applyFilter(rt),l1&&void 0!==arguments[1]?arguments[1]:it,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Array.isArray(e))return V.apply(void 0,X(e));var n=Y(e);if(pt[e])return pt[e];if(n===ct||n===lt)for(var s in t)i[s]=e;else for(var o in t)i[o]=e[o]||it;return i},kt=function(t){t===ut?(ut=t._next)?ut._previous=null:ft=null:t===ft?(ft=t._previous)?ft._next=null:ut=null:(tt=t._previous,et=t._next,tt._next=et,et._previous=tt),t._previous=t._next=null},St="function"==typeof Promise?Promise:null;W=Symbol.toStringTag;var Mt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;U(this,t),Q(this,W,"Promise"),this._config={},this._data={},this._delay=0,this._filters=[],this._next=null,this._previous=null,this._timestamp=null,this._hasEnded=!1,this._resolve=null,this._reject=null,this._currentState=e||{},this._originalState={},this._targetState={},this._start=dt,this._render=dt,this._promiseCtor=St,i&&this.setConfig(i)}var e;return e=[{key:"_applyFilter",value:function(t){for(var e=this._filters.length;e>0;e--){var i=this._filters[e-e][t];i&&i(this)}}},{key:"tween",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return this._isPlaying&&this.stop(),!e&&this._config||this.setConfig(e),this._pausedAtTime=null,this._timestamp=t.now(),this._start(this.get(),this._data),this._delay&&this._render(this._currentState,this._data,0),this._resume(this._timestamp)}},{key:"setConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this._config;for(var n in e)i[n]=e[n];var s=i.promise,o=void 0===s?this._promiseCtor:s,r=i.start,a=void 0===r?dt:r,l=i.finish,c=i.render,h=void 0===c?this._config.step||dt:c,d=i.step,u=void 0===d?dt:d;this._data=i.data||i.attachment||this._data,this._isPlaying=!1,this._pausedAtTime=null,this._scheduleId=null,this._delay=e.delay||0,this._start=a,this._render=h||u,this._duration=i.duration||500,this._promiseCtor=o,l&&(this._resolve=l);var f=e.from,p=e.to,g=void 0===p?{}:p,m=this._currentState,b=this._originalState,v=this._targetState;for(var y in f)m[y]=f[y];var x=!1;for(var _ in m){var w=m[_];x||Y(w)!==ct||(x=!0),b[_]=w,v[_]=g.hasOwnProperty(_)?g[_]:w}if(this._easing=wt(this._currentState,i.easing,this._easing),this._filters.length=0,x){for(var k in t.filters)t.filters[k].doesApply(this)&&this._filters.push(t.filters[k]);this._applyFilter(at)}return this}},{key:"then",value:function(t,e){var i=this;return this._promise=new this._promiseCtor(function(t,e){i._resolve=t,i._reject=e}),this._promise.then(t,e)}},{key:"catch",value:function(t){return this.then().catch(t)}},{key:"finally",value:function(t){return this.then().finally(t)}},{key:"get",value:function(){return K({},this._currentState)}},{key:"set",value:function(t){this._currentState=t}},{key:"pause",value:function(){if(this._isPlaying)return this._pausedAtTime=t.now(),this._isPlaying=!1,kt(this),this}},{key:"resume",value:function(){return this._resume()}},{key:"_resume",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.now();return null===this._timestamp?this.tween():this._isPlaying?this._promise:(this._pausedAtTime&&(this._timestamp+=e-this._pausedAtTime,this._pausedAtTime=null),this._isPlaying=!0,null===ut?(ut=this,ft=this):(this._previous=ft,ft._next=this,ft=this),this)}},{key:"seek",value:function(e){e=Math.max(e,0);var i=t.now();return this._timestamp+e===0||(this._timestamp=i-e,mt(this,i)),this}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._isPlaying)return this;this._isPlaying=!1,kt(this);var e=this._filters.length>0;return t&&(e&&this._applyFilter(rt),gt(1,this._currentState,this._originalState,this._targetState,1,0,this._easing),e&&(this._applyFilter(st),this._applyFilter(ot))),this._resolve&&this._resolve({data:this._data,state:this._currentState,tweenable:this}),this._resolve=null,this._reject=null,this}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._currentState,i=this._data;return this._isPlaying?(this._reject&&this._reject({data:i,state:e,tweenable:this}),this._resolve=null,this._reject=null,this.stop(t)):this}},{key:"isPlaying",value:function(){return this._isPlaying}},{key:"hasEnded",value:function(){return this._hasEnded}},{key:"setScheduleFunction",value:function(e){t.setScheduleFunction(e)}},{key:"data",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t&&(this._data=K({},t)),this._data}},{key:"dispose",value:function(){for(var t in this)delete this[t]}}],e&&q(t.prototype,e),t}();function Ot(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new Mt;return e.tween(t),e.tweenable=e,e}Q(Mt,"now",function(){return Z}),Q(Mt,"setScheduleFunction",function(t){return ht=t}),Q(Mt,"filters",{}),Q(Mt,"formulas",pt),xt(!0);var Et,At,Tt=/(\d|-|\.)/,Ct=/([^\-0-9.]+)/g,Pt=/[0-9.-]+/g,Lt=(Et=Pt.source,At=/,\s*/.source,new RegExp("rgba?\\(".concat(Et).concat(At).concat(Et).concat(At).concat(Et,"(").concat(At).concat(Et,")?\\)"),"g")),Dt=/^.*\(/,It=/#([0-9]|[a-f]){3,6}/gi,Rt="VAL",jt=function(t,e){return t.map(function(t,i){return"_".concat(e,"_").concat(i)})};function Ft(t){return parseInt(t,16)}var zt=function(t){return"rgb(".concat((e=t,3===(e=e.replace(/#/,"")).length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[Ft(e.substr(0,2)),Ft(e.substr(2,2)),Ft(e.substr(4,2))]).join(","),")");var e},Bt=function(t,e,i){var n=e.match(t),s=e.replace(t,Rt);return n&&n.forEach(function(t){return s=s.replace(Rt,i(t))}),s},Nt=function(t){for(var e in t){var i=t[e];"string"==typeof i&&i.match(It)&&(t[e]=Bt(It,i,zt))}},Wt=function(t){var e=t.match(Pt),i=e.slice(0,3).map(Math.floor),n=t.match(Dt)[0];if(3===e.length)return"".concat(n).concat(i.join(","),")");if(4===e.length)return"".concat(n).concat(i.join(","),",").concat(e[3],")");throw new Error("Invalid rgbChunk: ".concat(t))},Vt=function(t){return t.match(Pt)},Ht=function(t,e){var i={};return e.forEach(function(e){i[e]=t[e],delete t[e]}),i},$t=function(t,e){return e.map(function(e){return t[e]})},Ut=function(t,e){return e.forEach(function(e){return t=t.replace(Rt,+e.toFixed(4))}),t},qt=function(t){for(var e in t._currentState)if("string"==typeof t._currentState[e])return!0;return!1};function Yt(t){var e=t._currentState;[e,t._originalState,t._targetState].forEach(Nt),t._tokenData=function(t){var e,i,n={};for(var s in t){var o=t[s];"string"==typeof o&&(n[s]={formatString:(e=o,i=void 0,i=e.match(Ct),i?(1===i.length||e.charAt(0).match(Tt))&&i.unshift(""):i=["",""],i.join(Rt)),chunkNames:jt(Vt(o),s)})}return n}(e)}function Xt(t){var e=t._currentState,i=t._originalState,n=t._targetState,s=t._easing,o=t._tokenData;!function(t,e){var i=function(i){var n=e[i].chunkNames,s=t[i];if("string"==typeof s){var o=s.split(" "),r=o[o.length-1];n.forEach(function(e,i){return t[e]=o[i]||r})}else n.forEach(function(e){return t[e]=s});delete t[i]};for(var n in e)i(n)}(s,o),[e,i,n].forEach(function(t){return function(t,e){var i=function(i){Vt(t[i]).forEach(function(n,s){return t[e[i].chunkNames[s]]=+n}),delete t[i]};for(var n in e)i(n)}(t,o)})}function Jt(t){var e=t._currentState,i=t._originalState,n=t._targetState,s=t._easing,o=t._tokenData;[e,i,n].forEach(function(t){return function(t,e){for(var i in e){var n=e[i],s=n.chunkNames,o=n.formatString,r=Ut(o,$t(Ht(t,s),s));t[i]=Bt(Lt,r,Wt)}}(t,o)}),function(t,e){for(var i in e){var n=e[i].chunkNames,s=t[n[0]];t[i]="string"==typeof s?n.map(function(e){var i=t[e];return delete t[e],i}).join(" "):s}}(s,o)}function Gt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function Kt(t){for(var e=1;e4&&void 0!==arguments[4]?arguments[4]:0,o=Kt({},t),r=wt(t,n);for(var a in Zt._filters.length=0,Zt.set({}),Zt._currentState=o,Zt._originalState=t,Zt._targetState=e,Zt._easing=r,te)te[a].doesApply(Zt)&&Zt._filters.push(te[a]);Zt._applyFilter("tweenCreated"),Zt._applyFilter("beforeTween");var l=gt(i,o,t,e,1,s,r);return Zt._applyFilter("afterTween"),l};function ie(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);it.strokeWidth&&(e=t.trailWidth);var i=50-e/2;return s.render(this._pathTemplate,{radius:i,"2radius":2*i})},o.prototype._trailString=function(t){return this._pathString(t)},e.exports=o},{"./shape":8,"./utils":10}],4:[function(t,e,i){var n=t("./shape"),s=t("./utils"),o=function(t,e){this._pathTemplate=e.vertical?"M {center},100 L {center},0":"M 0,{center} L 100,{center}",n.apply(this,arguments)};o.prototype=new n,o.prototype.constructor=o,o.prototype._initializeSvg=function(t,e){var i=e.vertical?"0 0 "+e.strokeWidth+" 100":"0 0 100 "+e.strokeWidth;t.setAttribute("viewBox",i),t.setAttribute("preserveAspectRatio","none")},o.prototype._pathString=function(t){return s.render(this._pathTemplate,{center:t.strokeWidth/2})},o.prototype._trailString=function(t){return this._pathString(t)},e.exports=o},{"./shape":8,"./utils":10}],5:[function(t,e,i){e.exports={Line:t("./line"),Circle:t("./circle"),SemiCircle:t("./semicircle"),Square:t("./square"),Path:t("./path"),Shape:t("./shape"),utils:t("./utils")}},{"./circle":3,"./line":4,"./path":6,"./semicircle":7,"./shape":8,"./square":9,"./utils":10}],6:[function(t,e,i){var n=t("shifty"),s=t("./utils"),o=n.Tweenable,r={easeIn:"easeInCubic",easeOut:"easeOutCubic",easeInOut:"easeInOutCubic"},a=function t(e,i){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");var n;i=s.extend({delay:0,duration:800,easing:"linear",from:{},to:{},step:function(){}},i),n=s.isString(e)?document.querySelector(e):e,this.path=n,this._opts=i,this._tweenable=null;var o=this.path.getTotalLength();this.path.style.strokeDasharray=o+" "+o,this.set(0)};a.prototype.value=function(){var t=this._getComputedDashOffset(),e=this.path.getTotalLength();return parseFloat((1-t/e).toFixed(6),10)},a.prototype.set=function(t){this.stop(),this.path.style.strokeDashoffset=this._progressToOffset(t);var e=this._opts.step;if(s.isFunction(e)){var i=this._easing(this._opts.easing);e(this._calculateTo(t,i),this._opts.shape||this,this._opts.attachment)}},a.prototype.stop=function(){this._stopTween(),this.path.style.strokeDashoffset=this._getComputedDashOffset()},a.prototype.animate=function(t,e,i){e=e||{},s.isFunction(e)&&(i=e,e={});var n=s.extend({},e),r=s.extend({},this._opts);e=s.extend(r,e);var a=this._easing(e.easing),l=this._resolveFromAndTo(t,a,n);this.stop(),this.path.getBoundingClientRect();var c=this._getComputedDashOffset(),h=this._progressToOffset(t),d=this;this._tweenable=new o,this._tweenable.tween({from:s.extend({offset:c},l.from),to:s.extend({offset:h},l.to),duration:e.duration,delay:e.delay,easing:a,step:function(t){d.path.style.strokeDashoffset=t.offset;var i=e.shape||d;e.step(t,i,e.attachment)}}).then(function(t){s.isFunction(i)&&i()}).catch(function(t){throw console.error("Error in tweening:",t),t})},a.prototype._getComputedDashOffset=function(){var t=window.getComputedStyle(this.path,null);return parseFloat(t.getPropertyValue("stroke-dashoffset"),10)},a.prototype._progressToOffset=function(t){var e=this.path.getTotalLength();return e-t*e},a.prototype._resolveFromAndTo=function(t,e,i){return i.from&&i.to?{from:i.from,to:i.to}:{from:this._calculateFrom(e),to:this._calculateTo(t,e)}},a.prototype._calculateFrom=function(t){return n.interpolate(this._opts.from,this._opts.to,this.value(),t)},a.prototype._calculateTo=function(t,e){return n.interpolate(this._opts.from,this._opts.to,t,e)},a.prototype._stopTween=function(){null!==this._tweenable&&(this._tweenable.stop(!0),this._tweenable=null)},a.prototype._easing=function(t){return r.hasOwnProperty(t)?r[t]:t},e.exports=a},{"./utils":10,shifty:2}],7:[function(t,e,i){var n=t("./shape"),s=t("./circle"),o=t("./utils"),r=function(t,e){this._pathTemplate="M 50,50 m -{radius},0 a {radius},{radius} 0 1 1 {2radius},0",this.containerAspectRatio=2,n.apply(this,arguments)};r.prototype=new n,r.prototype.constructor=r,r.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 50")},r.prototype._initializeTextContainer=function(t,e,i){t.text.style&&(i.style.top="auto",i.style.bottom="0",t.text.alignToBottom?o.setStyle(i,"transform","translate(-50%, 0)"):o.setStyle(i,"transform","translate(-50%, 50%)"))},r.prototype._pathString=s.prototype._pathString,r.prototype._trailString=s.prototype._trailString,e.exports=r},{"./circle":3,"./shape":8,"./utils":10}],8:[function(t,e,i){var n=t("./path"),s=t("./utils"),o="Object is destroyed",r=function t(e,i){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");if(0!==arguments.length){this._opts=s.extend({color:"#555",strokeWidth:1,trailColor:null,trailWidth:null,fill:null,text:{style:{color:null,position:"absolute",left:"50%",top:"50%",padding:0,margin:0,transform:{prefix:!0,value:"translate(-50%, -50%)"}},autoStyleContainer:!0,alignToBottom:!0,value:null,className:"progressbar-text"},svgStyle:{display:"block",width:"100%"},warnings:!1},i,!0),s.isObject(i)&&void 0!==i.svgStyle&&(this._opts.svgStyle=i.svgStyle),s.isObject(i)&&s.isObject(i.text)&&void 0!==i.text.style&&(this._opts.text.style=i.text.style);var o,r=this._createSvgView(this._opts);if(!(o=s.isString(e)?document.querySelector(e):e))throw new Error("Container does not exist: "+e);this._container=o,this._container.appendChild(r.svg),this._opts.warnings&&this._warnContainerAspectRatio(this._container),this._opts.svgStyle&&s.setStyles(r.svg,this._opts.svgStyle),this.svg=r.svg,this.path=r.path,this.trail=r.trail,this.text=null;var a=s.extend({attachment:void 0,shape:this},this._opts);this._progressPath=new n(r.path,a),s.isObject(this._opts.text)&&null!==this._opts.text.value&&this.setText(this._opts.text.value)}};r.prototype.animate=function(t,e,i){if(null===this._progressPath)throw new Error(o);this._progressPath.animate(t,e,i)},r.prototype.stop=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath.stop()},r.prototype.pause=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.pause()},r.prototype.resume=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.resume()},r.prototype.destroy=function(){if(null===this._progressPath)throw new Error(o);this.stop(),this.svg.parentNode.removeChild(this.svg),this.svg=null,this.path=null,this.trail=null,this._progressPath=null,null!==this.text&&(this.text.parentNode.removeChild(this.text),this.text=null)},r.prototype.set=function(t){if(null===this._progressPath)throw new Error(o);this._progressPath.set(t)},r.prototype.value=function(){if(null===this._progressPath)throw new Error(o);return void 0===this._progressPath?0:this._progressPath.value()},r.prototype.setText=function(t){if(null===this._progressPath)throw new Error(o);null===this.text&&(this.text=this._createTextContainer(this._opts,this._container),this._container.appendChild(this.text)),s.isObject(t)?(s.removeChildren(this.text),this.text.appendChild(t)):this.text.innerHTML=t},r.prototype._createSvgView=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");this._initializeSvg(e,t);var i=null;(t.trailColor||t.trailWidth)&&(i=this._createTrail(t),e.appendChild(i));var n=this._createPath(t);return e.appendChild(n),{svg:e,path:n,trail:i}},r.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 100")},r.prototype._createPath=function(t){var e=this._pathString(t);return this._createPathElement(e,t)},r.prototype._createTrail=function(t){var e=this._trailString(t),i=s.extend({},t);return i.trailColor||(i.trailColor="#eee"),i.trailWidth||(i.trailWidth=i.strokeWidth),i.color=i.trailColor,i.strokeWidth=i.trailWidth,i.fill=null,this._createPathElement(e,i)},r.prototype._createPathElement=function(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",t),i.setAttribute("stroke",e.color),i.setAttribute("stroke-width",e.strokeWidth),e.fill?i.setAttribute("fill",e.fill):i.setAttribute("fill-opacity","0"),i},r.prototype._createTextContainer=function(t,e){var i=document.createElement("div");i.className=t.text.className;var n=t.text.style;return n&&(t.text.autoStyleContainer&&(e.style.position="relative"),s.setStyles(i,n),n.color||(i.style.color=t.color)),this._initializeTextContainer(t,e,i),i},r.prototype._initializeTextContainer=function(t,e,i){},r.prototype._pathString=function(t){throw new Error("Override this function for each progress bar")},r.prototype._trailString=function(t){throw new Error("Override this function for each progress bar")},r.prototype._warnContainerAspectRatio=function(t){if(this.containerAspectRatio){var e=window.getComputedStyle(t,null),i=parseFloat(e.getPropertyValue("width"),10),n=parseFloat(e.getPropertyValue("height"),10);s.floatEquals(this.containerAspectRatio,i/n)||(console.warn("Incorrect aspect ratio of container","#"+t.id,"detected:",e.getPropertyValue("width")+"(width)","/",e.getPropertyValue("height")+"(height)","=",i/n),console.warn("Aspect ratio of should be",this.containerAspectRatio))}},e.exports=r},{"./path":6,"./utils":10}],9:[function(t,e,i){var n=t("./shape"),s=t("./utils"),o=function(t,e){this._pathTemplate="M 0,{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{strokeWidth}",this._trailTemplate="M {startMargin},{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{halfOfStrokeWidth}",n.apply(this,arguments)};o.prototype=new n,o.prototype.constructor=o,o.prototype._pathString=function(t){var e=100-t.strokeWidth/2;return s.render(this._pathTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2})},o.prototype._trailString=function(t){var e=100-t.strokeWidth/2;return s.render(this._trailTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2,startMargin:t.strokeWidth/2-t.trailWidth/2})},e.exports=o},{"./shape":8,"./utils":10}],10:[function(t,e,i){var n=t("lodash.merge"),s="Webkit Moz O ms".split(" "),o=.001;function r(t,e){var i=t;for(var n in e)if(e.hasOwnProperty(n)){var s=e[n],o=new RegExp("\\{"+n+"\\}","g");i=i.replace(o,s)}return i}function a(t,e,i){for(var n=t.style,o=0;oo[0];break;case"lt":i=this.value{const e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.hasOwn(t,e),(()=>{let t;globalThis.importScripts&&(t=globalThis.location+"");const e=globalThis.document;if(!t&&e&&("SCRIPT"===e.currentScript?.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){const i=e.getElementsByTagName("script");if(i.length){let e=i.length-1;for(;e>-1&&(!t||!/^https?:/.test(t));)t=i[e--].src}}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),i.p=t})(),(()=>{"use strict";i(336),i(712),i(544);const t={sample:{image:document.getElementById("transformation-sample-image"),video:document.getElementById("transformation-sample-video")},preview:{image:document.getElementById("sample-image"),video:document.getElementById("sample-video")},fields:document.getElementsByClassName("cld-ui-input"),button:{image:document.getElementById("refresh-image-preview"),video:document.getElementById("refresh-video-preview")},spinner:{image:document.getElementById("image-loader"),video:document.getElementById("video-loader")},optimization:{image:document.getElementById("image_settings.image_optimization"),video:document.getElementById("video_settings.video_optimization")},error_container:document.getElementById("cld-preview-error"),activeItem:null,elements:{image:[],video:[]},_placeItem(t){null!==t&&(t.style.display="block",t.style.visibility="visible",t.style.position="absolute",t.style.top=t.parentElement.clientHeight/2-t.clientHeight/2+"px",t.style.left=t.parentElement.clientWidth/2-t.clientWidth/2+"px")},_setLoading(t){this.sample[t]&&(this.button[t].style.display="block",this._placeItem(this.button[t]),this.preview[t].style.opacity="0.1")},_build(t){if(!this.sample[t])return;this.sample[t].innerHTML="",this.elements[t]=[];for(const e of this.fields){if(t!==e.dataset.context||e.dataset.disabled&&"true"===e.dataset.disabled)continue;let i=e.value.trim();if(i.length){if("select-one"===e.type){if("none"===i||!1===this.optimization[t].checked)continue;i=e.dataset.meta+"_"+i}else t=e.dataset.context,e.dataset.meta&&(i=e.dataset.meta+"_"+i),e.dataset.suffix&&(i+=e.dataset.suffix),i=this._transformations(i,t,!0);i&&this.elements[t].push(i)}}let e="";this.elements[t].length&&(e="/"+this._getGlobalTransformationElements(t).replace(/ /g,"%20")),this.sample[t].textContent=e,this.sample[t].parentElement.href="https://res.cloudinary.com/demo/"+this.sample[t].parentElement.innerText.trim().replace("../","").replace(/ /g,"%20")},_clearLoading(t){this.spinner[t].style.visibility="hidden",this.activeItem=null,this.preview[t].style.opacity=1},_refresh(t,e){if(t&&t.preventDefault(),!this.sample[e])return;const i=this,n=CLD_GLOBAL_TRANSFORMATIONS[e].preview_url+this._getGlobalTransformationElements(e)+CLD_GLOBAL_TRANSFORMATIONS[e].file;if(this.button[e].style.display="none",this._placeItem(this.spinner[e]),"image"===e){const t=new Image;t.onload=function(){i.preview[e].src=this.src,i._clearLoading(e),i.error_container&&(i.error_container.style.display="none"),t.remove()},t.onerror=function(){const t=i.elements[e].includes("f_mp4");i.error_container&&(i.error_container.style.display="block",t?(i.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[e].warning.replace("%s","f_mp4"),i.error_container.classList.replace("settings-alert-error","settings-alert-warning")):(i.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[e].error,i.error_container.classList.replace("settings-alert-warning","settings-alert-error"))),i._clearLoading(e)},t.src=n}else{const t=i._transformations(i._getGlobalTransformationElements(e),e);samplePlayer.source({publicId:"sailing_boat",transformation:t}),i._clearLoading(e)}},_getGlobalTransformationElements(t){let e=[];return e.push(this.elements[t].slice(0,2).join(",")),e.push(this.elements[t].slice(2).join(",")),e=e.filter(t=>t).join("/"),e},_transformations(t,e,i=!1){const n=CLD_GLOBAL_TRANSFORMATIONS[e].valid_types;let s=null;const o=t.split("/"),r=[];for(let t=0;t":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},n=["(","?"],s={")":["("],":":["?","?:"]},o=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var r={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,i){if(t)throw e;return i}};function a(t){var i=function(t){for(var i,r,a,l,c=[],h=[];i=t.match(o);){for(r=i[0],(a=t.substr(0,i.index).trim())&&c.push(a);l=h.pop();){if(s[r]){if(s[r][0]===l){r=s[r][1]||r;break}}else if(n.indexOf(l)>=0||e[l]1===t?0:1},d=/^i18n\.(n?gettext|has_translation)(_|$)/;var u=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var f=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var p=function(t,e){return function(i,n,s,o=10){const r=t[e];if(!f(i))return;if(!u(n))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof o)return void console.error("If specified, the hook priority must be a number.");const a={callback:s,priority:o,namespace:n};if(r[i]){const t=r[i].handlers;let e;for(e=t.length;e>0&&!(o>=t[e-1].priority);e--);e===t.length?t[e]=a:t.splice(e,0,a),r.__current.forEach(t=>{t.name===i&&t.currentIndex>=e&&t.currentIndex++})}else r[i]={handlers:[a],runs:0};"hookAdded"!==i&&t.doAction("hookAdded",i,n,s,o)}};var g=function(t,e,i=!1){return function(n,s){const o=t[e];if(!f(n))return;if(!i&&!u(s))return;if(!o[n])return 0;let r=0;if(i)r=o[n].handlers.length,o[n]={runs:o[n].runs,handlers:[]};else{const t=o[n].handlers;for(let e=t.length-1;e>=0;e--)t[e].namespace===s&&(t.splice(e,1),r++,o.__current.forEach(t=>{t.name===n&&t.currentIndex>=e&&t.currentIndex--}))}return"hookRemoved"!==n&&t.doAction("hookRemoved",n,s),r}};var m=function(t,e){return function(i,n){const s=t[e];return void 0!==n?i in s&&s[i].handlers.some(t=>t.namespace===n):i in s}};var b=function(t,e,i,n){return function(s,...o){const r=t[e];r[s]||(r[s]={handlers:[],runs:0}),r[s].runs++;const a=r[s].handlers;if(!a||!a.length)return i?o[0]:void 0;const l={name:s,currentIndex:0};return(n?async function(){try{r.__current.add(l);let t=i?o[0]:void 0;for(;l.currentIndex0:Array.from(n.__current).some(t=>t.name===i)}};var x=function(t,e){return function(i){const n=t[e];if(f(i))return n[i]&&n[i].runs?n[i].runs:0}},_=class{actions;filters;addAction;addFilter;removeAction;removeFilter;hasAction;hasFilter;removeAllActions;removeAllFilters;doAction;doActionAsync;applyFilters;applyFiltersAsync;currentAction;currentFilter;doingAction;doingFilter;didAction;didFilter;constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=p(this,"actions"),this.addFilter=p(this,"filters"),this.removeAction=g(this,"actions"),this.removeFilter=g(this,"filters"),this.hasAction=m(this,"actions"),this.hasFilter=m(this,"filters"),this.removeAllActions=g(this,"actions",!0),this.removeAllFilters=g(this,"filters",!0),this.doAction=b(this,"actions",!1,!1),this.doActionAsync=b(this,"actions",!1,!0),this.applyFilters=b(this,"filters",!0,!1),this.applyFiltersAsync=b(this,"filters",!0,!0),this.currentAction=v(this,"actions"),this.currentFilter=v(this,"filters"),this.doingAction=y(this,"actions"),this.doingFilter=y(this,"filters"),this.didAction=x(this,"actions"),this.didFilter=x(this,"filters")}};var w=function(){return new _}(),{addAction:k,addFilter:S,removeAction:M,removeFilter:O,hasAction:E,hasFilter:A,removeAllActions:T,removeAllFilters:C,doAction:P,doActionAsync:L,applyFilters:D,applyFiltersAsync:I,currentAction:R,currentFilter:j,doingAction:F,doingFilter:z,didAction:B,didFilter:N,actions:W,filters:V}=w,H=((t,e,i)=>{const n=new c({}),s=new Set,o=()=>{s.forEach(t=>t())},r=(t,e="default")=>{n.data[e]={...n.data[e],...t},n.data[e][""]={...h,...n.data[e]?.[""]},delete n.pluralForms[e]},a=(t,e)=>{r(t,e),o()},l=(t="default",e,i,s,o)=>(n.data[t]||r(void 0,t),n.dcnpgettext(t,e,i,s,o)),u=t=>t||"default",f=(t,e,n)=>{let s=l(n,e,t);return i?(s=i.applyFilters("i18n.gettext_with_context",s,t,e,n),i.applyFilters("i18n.gettext_with_context_"+u(n),s,t,e,n)):s};if(t&&a(t,e),i){const t=t=>{d.test(t)&&o()};i.addAction("hookAdded","core/i18n",t),i.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:(t="default")=>n.data[t],setLocaleData:a,addLocaleData:(t,e="default")=>{n.data[e]={...n.data[e],...t,"":{...h,...n.data[e]?.[""],...t?.[""]}},delete n.pluralForms[e],o()},resetLocaleData:(t,e)=>{n.data={},n.pluralForms={},a(t,e)},subscribe:t=>(s.add(t),()=>s.delete(t)),__:(t,e)=>{let n=l(e,void 0,t);return i?(n=i.applyFilters("i18n.gettext",n,t,e),i.applyFilters("i18n.gettext_"+u(e),n,t,e)):n},_x:f,_n:(t,e,n,s)=>{let o=l(s,void 0,t,e,n);return i?(o=i.applyFilters("i18n.ngettext",o,t,e,n,s),i.applyFilters("i18n.ngettext_"+u(s),o,t,e,n,s)):o},_nx:(t,e,n,s,o)=>{let r=l(o,s,t,e,n);return i?(r=i.applyFilters("i18n.ngettext_with_context",r,t,e,n,s,o),i.applyFilters("i18n.ngettext_with_context_"+u(o),r,t,e,n,s,o)):r},isRTL:()=>"rtl"===f("ltr","text direction"),hasTranslation:(t,e,s)=>{const o=e?e+""+t:t;let r=!!n.data?.[s??"default"]?.[o];return i&&(r=i.applyFilters("i18n.has_translation",r,t,e,s),r=i.applyFilters("i18n.has_translation_"+u(s),r,t,e,s)),r}}})(void 0,void 0,w),$=(H.getLocaleData.bind(H),H.setLocaleData.bind(H),H.resetLocaleData.bind(H),H.subscribe.bind(H),H.__.bind(H)),U=(H._x.bind(H),H._n.bind(H),H._nx.bind(H),H.isRTL.bind(H),H.hasTranslation.bind(H),["@wordpress/admin-ui","@wordpress/api-fetch","@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/boot","@wordpress/commands","@wordpress/compose","@wordpress/connectors","@wordpress/workflows","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/font-list-route","@wordpress/format-library","@wordpress/patterns","@wordpress/preferences","@wordpress/rich-text","@wordpress/route","@wordpress/router","@wordpress/routes","@wordpress/storybook","@wordpress/sync","@wordpress/theme","@wordpress/dataviews","@wordpress/fields","@wordpress/lazy-editor","@wordpress/media-editor","@wordpress/media-utils","@wordpress/upload-media","@wordpress/global-styles-engine","@wordpress/global-styles-ui","@wordpress/ui","@wordpress/views","@wordpress/widget-dashboard"]);function q(t,e){if(!t)throw new Error("Cannot lock an undefined object.");const i=t;J in i||(i[J]={}),X.set(i[J],e)}function Y(t){if(!t)throw new Error("Cannot unlock an undefined object.");const e=t;if(!(J in e))throw new Error("Cannot unlock an object that was not locked before. ");return X.get(e[J])}var X=new WeakMap,J=Symbol("Private API ID");var{lock:G,unlock:K}=((t,e)=>{if(!U.includes(e))throw new Error(`You tried to opt-in to unstable APIs as module "${e}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress."!==t)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return{lock:q,unlock:Y}})("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/api-fetch");var Q=function(t){const e=(t,i)=>{const{headers:n={}}=t;for(const s in n)if("x-wp-nonce"===s.toLowerCase()&&n[s]===e.nonce)return i(t);return i({...t,headers:{...n,"X-WP-Nonce":e.nonce}})};return e.nonce=t,e},Z=(t,e)=>{let i,n,s=t.path;return"string"==typeof t.namespace&&"string"==typeof t.endpoint&&(i=t.namespace.replace(/^\/|\/$/g,""),n=t.endpoint.replace(/^\//,""),s=n?i+"/"+n:i),delete t.namespace,delete t.endpoint,e({...t,path:s})},tt=t=>(e,i)=>Z(e,e=>{let n,s=e.url,o=e.path;return"string"==typeof o&&(n=t,-1!==t.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(o=o.replace("?","&")),s=n+o),i({...e,url:s})});function et(t){try{return decodeURIComponent(t)}catch{return t}}function it(t){const e=t.indexOf("?");if(-1===e)return t;const i=t.slice(0,e),n=t.slice(e+1);return n?i+"?"+n.split("&").map(t=>t.split("=")).map(t=>t.map(et)).sort((t,e)=>t[0].localeCompare(e[0])).map(t=>t.map(encodeURIComponent)).map(t=>t.join("=")).join("&"):i}function nt(t){return(function(t){let e;try{e=new URL(t,"http://example.com").search.substring(1)}catch{}if(e)return e}(t)||"").replace(/\+/g,"%20").split("&").reduce((t,e)=>{const i=e.indexOf("="),n=-1!==i,s=et(n?e.slice(0,i):e);if(s){const o=n?et(e.slice(i+1)):"";!function(t,e,i){const n=e.length,s=n-1;for(let o=0;o{"link"===e.toLowerCase()&&(t.headers[e]=i.replace(/<([^>]+)>/,(t,e)=>`<${encodeURI(e)}>`))}),Promise.resolve(e?t.body:new window.Response(JSON.stringify(t.body),{status:200,statusText:"OK",headers:t.headers}))}}var ct=function(t){const{OPTIONS:e={},...i}=Object.fromEntries(Object.entries(t).map(([t,e])=>[it(t),e])),n=new Set(Object.keys(i)),s=new Set(Object.keys(e));let o=!1;const r=(t,r)=>{const{parse:a=!0}=t;let l=t.path;if(!l&&t.url){const{rest_route:e,...i}=nt(t.url);"string"==typeof e&&(l=ot(e,i))}if("string"!=typeof l)return r(t);const c=t.method||"GET",h=it(l);if("GET"===c&&i[h]){const t=i[h];return o||delete i[h],n.delete(h),lt(t,!!a)}if("OPTIONS"===c&&e[h]){const t=e[h];return o||delete e[h],s.delete(h),lt(t,!!a)}return r(t)};return r[rt]=()=>{o=!0},r[at]=()=>{const t=[...Array.from(n,t=>`GET ${t}`),...Array.from(s,t=>`OPTIONS ${t}`)];t.length?console.warn("[api-fetch][preload] Some preloads were never consumed:",t):console.log("[api-fetch][preload] All preloads consumed."),n.clear(),s.clear();for(const t of Object.keys(i))delete i[t];for(const t of Object.keys(e))delete e[t]},r},ht=({path:t,url:e,...i},n)=>({...i,url:e&&ot(e,n),path:t&&ot(t,n)}),dt=t=>t.json?t.json():Promise.reject(t),ut=t=>{const{next:e}=(t=>{if(!t)return{};const e=t.match(/<([^>]+)>; rel="next"/);return e?{next:e[1]}:{}})(t.headers.get("link"));return e},ft=async(t,e)=>{if(!1===t.parse)return e(t);if(!(t=>{const e=!!t.path&&-1!==t.path.indexOf("per_page=-1"),i=!!t.url&&-1!==t.url.indexOf("per_page=-1");return e||i})(t))return e(t);const i=await Pt({...ht(t,{per_page:100}),parse:!1}),n=await dt(i);if(!Array.isArray(n))return n;let s=ut(i);if(!s)return n;let o=[].concat(n);for(;s;){const e=await Pt({...t,path:void 0,url:s,parse:!1}),i=await dt(e);o=o.concat(i),s=ut(e)}return o},pt=new Set(["PATCH","PUT","DELETE"]),gt="GET",mt=(t,e)=>{const{method:i=gt}=t;return pt.has(i.toUpperCase())&&(t={...t,headers:{"Content-Type":"application/json",...t.headers,"X-HTTP-Method-Override":i},method:"POST"}),e(t)};function bt(t,e){return nt(t)[e]}function vt(t,e){return void 0!==bt(t,e)}async function yt(t,e=!1){try{if("function"!=typeof t.text)return await t.json();const i=await t.text();return e&&""===i?null:JSON.parse(i)}catch{throw{code:"invalid_json",message:$("The response is not a valid JSON response.")}}}async function xt(t,e=!0){return e?204===t.status?null:await yt(t,!0):t}async function _t(t,e=!0){if(!e)throw t;throw await yt(t)}var wt=(t,e)=>{if(!function(t){const e=!!t.method&&"POST"===t.method;return(!!t.path&&-1!==t.path.indexOf("/wp/v2/media")||!!t.url&&-1!==t.url.indexOf("/wp/v2/media"))&&e}(t))return e(t);let i=0;const n=t=>(i++,e({path:`/wp/v2/media/${t}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>i<5?n(t):(e({path:`/wp/v2/media/${t}?force=true`,method:"DELETE"}),Promise.reject())));return e({...t,parse:!1}).catch(e=>{if(!(e instanceof globalThis.Response))return Promise.reject(e);const i=e.headers.get("x-wp-upload-attachment-id");return e.status>=500&&e.status<600&&i?n(i).catch(()=>!1!==t.parse?Promise.reject({code:"post_process",message:$("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(e)):_t(e,t.parse)}).then(e=>xt(e,t.parse))};function kt(t,...e){const i=t.replace(/^[^#]*/,""),n=(t=t.replace(/#.*/,"")).indexOf("?");if(-1===n)return t+i;const s=nt(t),o=t.substr(0,n);e.forEach(t=>delete s[t]);const r=st(s);return(r?o+"?"+r:o)+i}var St=t=>(e,i)=>{if("string"==typeof e.url){const i=bt(e.url,"wp_theme_preview");void 0===i?e.url=ot(e.url,{wp_theme_preview:t}):""===i&&(e.url=kt(e.url,"wp_theme_preview"))}if("string"==typeof e.path){const i=bt(e.path,"wp_theme_preview");void 0===i?e.path=ot(e.path,{wp_theme_preview:t}):""===i&&(e.path=kt(e.path,"wp_theme_preview"))}return i(e)},Mt={Accept:"application/json, */*;q=0.1"},Ot={credentials:"include"},Et=[(t,e)=>("string"!=typeof t.url||vt(t.url,"_locale")||(t.url=ot(t.url,{_locale:"user"})),"string"!=typeof t.path||vt(t.path,"_locale")||(t.path=ot(t.path,{_locale:"user"})),e(t)),Z,mt,ft];var At=t=>{const{url:e,path:i,data:n,parse:s=!0,...o}=t;let{body:r,headers:a}=t;a={...Mt,...a},n&&(r=JSON.stringify(n),a["Content-Type"]="application/json");return globalThis.fetch(e||i||window.location.href,{...Ot,...o,body:r,headers:a}).then(t=>t.ok?xt(t,s):_t(t,s),t=>{if(t&&"AbortError"===t.name)throw t;if(!globalThis.navigator.onLine)throw{code:"offline_error",message:$("Unable to connect. Please check your Internet connection.")};throw{code:"fetch_error",message:$("Could not get a valid response from the server.")}})},Tt=At;var Ct=t=>Et.reduceRight((t,e)=>i=>e(i,t),Tt)(t).catch(e=>"rest_cookie_invalid_nonce"!==e.code?Promise.reject(e):globalThis.fetch(Ct.nonceEndpoint).then(t=>t.ok?t.text():Promise.reject(e)).then(e=>(Ct.nonceMiddleware.nonce=e,Ct(t))));Ct.use=function(t){Et.unshift(t)},Ct.unregister=function(t){const e=Et.indexOf(t);return-1!==e&&(Et.splice(e,1),!0)},Ct.setFetchHandler=function(t){Tt=t},Ct.defaultFetchHandler=At,Ct.privateApis={},G(Ct.privateApis,{enablePreloadMultiUse:function(){for(const t of Et)t[rt]?.()},clearPreloadedData:function(){for(const t of Et)t[at]?.()}}),Ct.createNonceMiddleware=Q,Ct.createPreloadingMiddleware=ct,Ct.createRootURLMiddleware=tt,Ct.fetchAllMiddleware=ft,Ct.httpV1Middleware=mt,Ct.mediaUploadMiddleware=wt,Ct.createThemePreviewMiddleware=St;var Pt=Ct;const Lt={wpWrap:document.getElementById("wpwrap"),adminbar:document.getElementById("wpadminbar"),wpContent:document.getElementById("wpbody-content"),libraryWrap:document.getElementById("cloudinary-dam"),cloudinaryHeader:document.getElementById("cloudinary-header"),wpFooter:document.getElementById("wpfooter"),importStatus:document.getElementById("import-status"),downloading:{},_init(){const t=this,e=this.libraryWrap,i=this.importStatus;"undefined"!=typeof CLDN&&document.querySelector(CLDN.mloptions.inline_container)&&(Pt.use(Pt.createNonceMiddleware(CLDN.nonce)),cloudinary.openMediaLibrary(CLDN.mloptions,{insertHandler(n){const s=[];for(let o=0;o{o.style.opacity=1},250),Pt({path:cldData.dam.fetch_url,data:{src:n.url,filename:n.filename,attachment_id:n.attachment_id,transformations:n.transformations},method:"POST"}).then(t=>{const n=s[r];delete s[r],n.removeChild(n.firstChild),setTimeout(()=>{n.style.opacity=0,setTimeout(()=>{n.parentNode.removeChild(n),Object.keys(s).length||(e.style.marginRight="0px",i.style.display="none")},1e3)},500)})})}}}),window.addEventListener("resize",function(){t._resize()}),t._resize())},_resize(){this.libraryWrap.style.height=this.wpFooter.offsetTop-this.libraryWrap.offsetTop-this.adminbar.offsetHeight+"px"},makeProgress(t){const e=document.createElement("div"),i=document.createElement("span"),n=document.createElement("span");return e.classList.add("cld-import-item"),i.classList.add("spinner"),n.classList.add("cld-import-item-id"),n.innerText=t.public_id,e.appendChild(i),e.appendChild(n),e}};window.addEventListener("load",()=>Lt._init());const Dt={_init(){const t=this;if("undefined"!=typeof CLDIS){[...document.getElementsByClassName("cld-notice-box")].forEach(e=>{const i=e.getElementsByClassName("notice-dismiss");i.length&&i[0].addEventListener("click",i=>{e.style.height=e.offsetHeight+"px",i.preventDefault(),setTimeout(function(){t._dismiss(e)},5)})})}},_dismiss(t){const e=t.dataset.dismiss,i=parseInt(t.dataset.duration);t.classList.add("dismissed"),t.style.height="0px",setTimeout(function(){t.remove()},400),00&&Nt(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Nt(n.height)/t.offsetHeight||1);var r=(Rt(t)?It(t):window).visualViewport,a=!Vt()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/s,c=(n.top+(a&&r?r.offsetTop:0))/o,h=n.width/s,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function $t(t){var e=It(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ut(t){return t?(t.nodeName||"").toLowerCase():null}function qt(t){return((Rt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Yt(t){return Ht(qt(t)).left+$t(t).scrollLeft}function Xt(t){return It(t).getComputedStyle(t)}function Jt(t){var e=Xt(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function Gt(t,e,i){void 0===i&&(i=!1);var n,s,o=jt(e),r=jt(e)&&function(t){var e=t.getBoundingClientRect(),i=Nt(e.width)/t.offsetWidth||1,n=Nt(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=qt(e),l=Ht(t,r,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!i)&&(("body"!==Ut(e)||Jt(a))&&(c=(n=e)!==It(n)&&jt(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:$t(n)),jt(e)?((h=Ht(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=Yt(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function Kt(t){var e=Ht(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Qt(t){return"html"===Ut(t)?t:t.assignedSlot||t.parentNode||(Ft(t)?t.host:null)||qt(t)}function Zt(t){return["html","body","#document"].indexOf(Ut(t))>=0?t.ownerDocument.body:jt(t)&&Jt(t)?t:Zt(Qt(t))}function te(t,e){var i;void 0===e&&(e=[]);var n=Zt(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=It(n),r=s?[o].concat(o.visualViewport||[],Jt(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(te(Qt(r)))}function ee(t){return["table","td","th"].indexOf(Ut(t))>=0}function ie(t){return jt(t)&&"fixed"!==Xt(t).position?t.offsetParent:null}function ne(t){for(var e=It(t),i=ie(t);i&&ee(i)&&"static"===Xt(i).position;)i=ie(i);return i&&("html"===Ut(i)||"body"===Ut(i)&&"static"===Xt(i).position)?e:i||function(t){var e=/firefox/i.test(Wt());if(/Trident/i.test(Wt())&&jt(t)&&"fixed"===Xt(t).position)return null;var i=Qt(t);for(Ft(i)&&(i=i.host);jt(i)&&["html","body"].indexOf(Ut(i))<0;){var n=Xt(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}var se="top",oe="bottom",re="right",ae="left",le="auto",ce=[se,oe,re,ae],he="start",de="end",ue="viewport",fe="popper",pe=ce.reduce(function(t,e){return t.concat([e+"-"+he,e+"-"+de])},[]),ge=[].concat(ce,[le]).reduce(function(t,e){return t.concat([e,e+"-"+he,e+"-"+de])},[]),me=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function be(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}}),n.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){i.has(t.name)||s(t)}),n}var ve={placement:"bottom",modifiers:[],strategy:"absolute"};function ye(){for(var t=arguments.length,e=new Array(t),i=0;i=0?"x":"y"}function Me(t){var e,i=t.reference,n=t.element,s=t.placement,o=s?we(s):null,r=s?ke(s):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case se:e={x:a,y:i.y-n.height};break;case oe:e={x:a,y:i.y+i.height};break;case re:e={x:i.x+i.width,y:l};break;case ae:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?Se(o):null;if(null!=c){var h="y"===c?"height":"width";switch(r){case he:e[c]=e[c]-(i[h]/2-n[h]/2);break;case de:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}var Oe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ee(t){var e,i=t.popper,n=t.popperRect,s=t.placement,o=t.variation,r=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,d=t.isFixed,u=r.x,f=void 0===u?0:u,p=r.y,g=void 0===p?0:p,m="function"==typeof h?h({x:f,y:g}):{x:f,y:g};f=m.x,g=m.y;var b=r.hasOwnProperty("x"),v=r.hasOwnProperty("y"),y=ae,x=se,_=window;if(c){var w=ne(i),k="clientHeight",S="clientWidth";if(w===It(i)&&"static"!==Xt(w=qt(i)).position&&"absolute"===a&&(k="scrollHeight",S="scrollWidth"),s===se||(s===ae||s===re)&&o===de)x=oe,g-=(d&&w===_&&_.visualViewport?_.visualViewport.height:w[k])-n.height,g*=l?1:-1;if(s===ae||(s===se||s===oe)&&o===de)y=re,f-=(d&&w===_&&_.visualViewport?_.visualViewport.width:w[S])-n.width,f*=l?1:-1}var M,O=Object.assign({position:a},c&&Oe),E=!0===h?function(t,e){var i=t.x,n=t.y,s=e.devicePixelRatio||1;return{x:Nt(i*s)/s||0,y:Nt(n*s)/s||0}}({x:f,y:g},It(i)):{x:f,y:g};return f=E.x,g=E.y,l?Object.assign({},O,((M={})[x]=v?"0":"",M[y]=b?"0":"",M.transform=(_.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",M)):Object.assign({},O,((e={})[x]=v?g+"px":"",e[y]=b?f+"px":"",e.transform="",e))}const Ae={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];jt(s)&&Ut(s)&&(Object.assign(s.style,i),Object.keys(n).forEach(function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(t){var n=e.elements[t],s=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce(function(t,e){return t[e]="",t},{});jt(n)&&Ut(n)&&(Object.assign(n.style,o),Object.keys(s).forEach(function(t){n.removeAttribute(t)}))})}},requires:["computeStyles"]};const Te={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.offset,o=void 0===s?[0,0]:s,r=ge.reduce(function(t,i){return t[i]=function(t,e,i){var n=we(t),s=[ae,se].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[ae,re].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}(i,e.rects,o),t},{}),a=r[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}};var Ce={left:"right",right:"left",bottom:"top",top:"bottom"};function Pe(t){return t.replace(/left|right|bottom|top/g,function(t){return Ce[t]})}var Le={start:"end",end:"start"};function De(t){return t.replace(/start|end/g,function(t){return Le[t]})}function Ie(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Ft(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Re(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function je(t,e,i){return e===ue?Re(function(t,e){var i=It(t),n=qt(t),s=i.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=Vt();(c||!c&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+Yt(t),y:l}}(t,i)):Rt(e)?function(t,e){var i=Ht(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):Re(function(t){var e,i=qt(t),n=$t(t),s=null==(e=t.ownerDocument)?void 0:e.body,o=zt(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=zt(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+Yt(t),l=-n.scrollTop;return"rtl"===Xt(s||i).direction&&(a+=zt(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}(qt(t)))}function Fe(t,e,i,n){var s="clippingParents"===e?function(t){var e=te(Qt(t)),i=["absolute","fixed"].indexOf(Xt(t).position)>=0&&jt(t)?ne(t):t;return Rt(i)?e.filter(function(t){return Rt(t)&&Ie(t,i)&&"body"!==Ut(t)}):[]}(t):[].concat(e),o=[].concat(s,[i]),r=o[0],a=o.reduce(function(e,i){var s=je(t,i,n);return e.top=zt(s.top,e.top),e.right=Bt(s.right,e.right),e.bottom=Bt(s.bottom,e.bottom),e.left=zt(s.left,e.left),e},je(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ze(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Be(t,e){return e.reduce(function(e,i){return e[i]=t,e},{})}function Ne(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=void 0===n?t.placement:n,o=i.strategy,r=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?"clippingParents":a,c=i.rootBoundary,h=void 0===c?ue:c,d=i.elementContext,u=void 0===d?fe:d,f=i.altBoundary,p=void 0!==f&&f,g=i.padding,m=void 0===g?0:g,b=ze("number"!=typeof m?m:Be(m,ce)),v=u===fe?"reference":fe,y=t.rects.popper,x=t.elements[p?v:u],_=Fe(Rt(x)?x:x.contextElement||qt(t.elements.popper),l,h,r),w=Ht(t.elements.reference),k=Me({reference:w,element:y,strategy:"absolute",placement:s}),S=Re(Object.assign({},y,k)),M=u===fe?S:w,O={top:_.top-M.top+b.top,bottom:M.bottom-_.bottom+b.bottom,left:_.left-M.left+b.left,right:M.right-_.right+b.right},E=t.modifiersData.offset;if(u===fe&&E){var A=E[s];Object.keys(O).forEach(function(t){var e=[re,oe].indexOf(t)>=0?1:-1,i=[se,oe].indexOf(t)>=0?"y":"x";O[t]+=A[i]*e})}return O}function We(t,e,i){return zt(t,Bt(e,i))}const Ve={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0!==r&&r,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,u=i.tether,f=void 0===u||u,p=i.tetherOffset,g=void 0===p?0:p,m=Ne(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),b=we(e.placement),v=ke(e.placement),y=!v,x=Se(b),_="x"===x?"y":"x",w=e.modifiersData.popperOffsets,k=e.rects.reference,S=e.rects.popper,M="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,O="number"==typeof M?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),E=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,A={x:0,y:0};if(w){if(o){var T,C="y"===x?se:ae,P="y"===x?oe:re,L="y"===x?"height":"width",D=w[x],I=D+m[C],R=D-m[P],j=f?-S[L]/2:0,F=v===he?k[L]:S[L],z=v===he?-S[L]:-k[L],B=e.elements.arrow,N=f&&B?Kt(B):{width:0,height:0},W=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=W[C],H=W[P],$=We(0,k[L],N[L]),U=y?k[L]/2-j-$-V-O.mainAxis:F-$-V-O.mainAxis,q=y?-k[L]/2+j+$+H+O.mainAxis:z+$+H+O.mainAxis,Y=e.elements.arrow&&ne(e.elements.arrow),X=Y?"y"===x?Y.clientTop||0:Y.clientLeft||0:0,J=null!=(T=null==E?void 0:E[x])?T:0,G=D+q-J,K=We(f?Bt(I,D+U-J-X):I,D,f?zt(R,G):R);w[x]=K,A[x]=K-D}if(a){var Q,Z="x"===x?se:ae,tt="x"===x?oe:re,et=w[_],it="y"===_?"height":"width",nt=et+m[Z],st=et-m[tt],ot=-1!==[se,ae].indexOf(b),rt=null!=(Q=null==E?void 0:E[_])?Q:0,at=ot?nt:et-k[it]-S[it]-rt+O.altAxis,lt=ot?et+k[it]+S[it]-rt-O.altAxis:st,ct=f&&ot?function(t,e,i){var n=We(t,e,i);return n>i?i:n}(at,et,lt):We(f?at:nt,et,f?lt:st);w[_]=ct,A[_]=ct-et}e.modifiersData[n]=A}},requiresIfExists:["offset"]};const He={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,s=t.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,a=we(i.placement),l=Se(a),c=[ae,re].indexOf(a)>=0?"height":"width";if(o&&r){var h=function(t,e){return ze("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Be(t,ce))}(s.padding,i),d=Kt(o),u="y"===l?se:ae,f="y"===l?oe:re,p=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],g=r[l]-i.rects.reference[l],m=ne(o),b=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,v=p/2-g/2,y=h[u],x=b-d[c]-h[f],_=b/2-d[c]/2+v,w=We(y,_,x),k=l;i.modifiersData[n]=((e={})[k]=w,e.centerOffset=w-_,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Ie(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function $e(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Ue(t){return[se,re,oe,ae].some(function(e){return t[e]>=0})}var qe=xe({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,l=It(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(t){t.addEventListener("scroll",i.update,_e)}),a&&l.addEventListener("resize",i.update,_e),function(){o&&c.forEach(function(t){t.removeEventListener("scroll",i.update,_e)}),a&&l.removeEventListener("resize",i.update,_e)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=Me({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:we(e.placement),variation:ke(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Ee(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ee(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},Ae,Te,{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0===r||r,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,u=i.altBoundary,f=i.flipVariations,p=void 0===f||f,g=i.allowedAutoPlacements,m=e.options.placement,b=we(m),v=l||(b===m||!p?[Pe(m)]:function(t){if(we(t)===le)return[];var e=Pe(t);return[De(t),e,De(e)]}(m)),y=[m].concat(v).reduce(function(t,i){return t.concat(we(i)===le?function(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,o=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?ge:l,h=ke(n),d=h?a?pe:pe.filter(function(t){return ke(t)===h}):ce,u=d.filter(function(t){return c.indexOf(t)>=0});0===u.length&&(u=d);var f=u.reduce(function(e,i){return e[i]=Ne(t,{placement:i,boundary:s,rootBoundary:o,padding:r})[we(i)],e},{});return Object.keys(f).sort(function(t,e){return f[t]-f[e]})}(e,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:g}):i)},[]),x=e.rects.reference,_=e.rects.popper,w=new Map,k=!0,S=y[0],M=0;M=0,C=T?"width":"height",P=Ne(e,{placement:O,boundary:h,rootBoundary:d,altBoundary:u,padding:c}),L=T?A?re:ae:A?oe:se;x[C]>_[C]&&(L=Pe(L));var D=Pe(L),I=[];if(o&&I.push(P[E]<=0),a&&I.push(P[L]<=0,P[D]<=0),I.every(function(t){return t})){S=O,k=!1;break}w.set(O,I)}if(k)for(var R=function(t){var e=y.find(function(e){var i=w.get(e);if(i)return i.slice(0,t).every(function(t){return t})});if(e)return S=e,"break"},j=p?3:1;j>0;j--){if("break"===R(j))break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Ve,He,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=Ne(e,{elementContext:"reference"}),a=Ne(e,{altBoundary:!0}),l=$e(r,n),c=$e(a,s,o),h=Ue(l),d=Ue(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}}]}),Ye="tippy-content",Xe="tippy-backdrop",Je="tippy-arrow",Ge="tippy-svg-arrow",Ke={passive:!0,capture:!0},Qe=function(){return document.body};function Ze(t,e,i){if(Array.isArray(t)){var n=t[e];return n??(Array.isArray(i)?i[e]:i)}return t}function ti(t,e){var i={}.toString.call(t);return 0===i.indexOf("[object")&&i.indexOf(e+"]")>-1}function ei(t,e){return"function"==typeof t?t.apply(void 0,e):t}function ii(t,e){return 0===e?t:function(n){clearTimeout(i),i=setTimeout(function(){t(n)},e)};var i}function ni(t){return[].concat(t)}function si(t,e){-1===t.indexOf(e)&&t.push(e)}function oi(t){return t.split("-")[0]}function ri(t){return[].slice.call(t)}function ai(t){return Object.keys(t).reduce(function(e,i){return void 0!==t[i]&&(e[i]=t[i]),e},{})}function li(){return document.createElement("div")}function ci(t){return["Element","Fragment"].some(function(e){return ti(t,e)})}function hi(t){return ti(t,"MouseEvent")}function di(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function ui(t){return ci(t)?[t]:function(t){return ti(t,"NodeList")}(t)?ri(t):Array.isArray(t)?t:ri(document.querySelectorAll(t))}function fi(t,e){t.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function pi(t,e){t.forEach(function(t){t&&t.setAttribute("data-state",e)})}function gi(t){var e,i=ni(t)[0];return null!=i&&null!=(e=i.ownerDocument)&&e.body?i.ownerDocument:document}function mi(t,e,i){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(e){t[n](e,i)})}function bi(t,e){for(var i=e;i;){var n;if(t.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var vi={isTouch:!1},yi=0;function xi(){vi.isTouch||(vi.isTouch=!0,window.performance&&document.addEventListener("mousemove",_i))}function _i(){var t=performance.now();t-yi<20&&(vi.isTouch=!1,document.removeEventListener("mousemove",_i)),yi=t}function wi(){var t=document.activeElement;if(di(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}var ki=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Si={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Mi=Object.assign({appendTo:Qe,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Si,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Oi=Object.keys(Mi);function Ei(t){var e=(t.plugins||[]).reduce(function(e,i){var n,s=i.name,o=i.defaultValue;s&&(e[s]=void 0!==t[s]?t[s]:null!=(n=Mi[s])?n:o);return e},{});return Object.assign({},t,e)}function Ai(t,e){var i=Object.assign({},e,{content:ei(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(Ei(Object.assign({},Mi,{plugins:e}))):Oi).reduce(function(e,i){var n=(t.getAttribute("data-tippy-"+i)||"").trim();if(!n)return e;if("content"===i)e[i]=n;else try{e[i]=JSON.parse(n)}catch(t){e[i]=n}return e},{})}(t,e.plugins));return i.aria=Object.assign({},Mi.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?e.interactive:i.aria.expanded,content:"auto"===i.aria.content?e.interactive?null:"describedby":i.aria.content},i}function Ti(t,e){t.innerHTML=e}function Ci(t){var e=li();return!0===t?e.className=Je:(e.className=Ge,ci(t)?e.appendChild(t):Ti(e,t)),e}function Pi(t,e){ci(e.content)?(Ti(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ti(t,e.content):t.textContent=e.content)}function Li(t){var e=t.firstElementChild,i=ri(e.children);return{box:e,content:i.find(function(t){return t.classList.contains(Ye)}),arrow:i.find(function(t){return t.classList.contains(Je)||t.classList.contains(Ge)}),backdrop:i.find(function(t){return t.classList.contains(Xe)})}}function Di(t){var e=li(),i=li();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=li();function s(i,n){var s=Li(e),o=s.box,r=s.content,a=s.arrow;n.theme?o.setAttribute("data-theme",n.theme):o.removeAttribute("data-theme"),"string"==typeof n.animation?o.setAttribute("data-animation",n.animation):o.removeAttribute("data-animation"),n.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?o.setAttribute("role",n.role):o.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||Pi(r,t.props),n.arrow?a?i.arrow!==n.arrow&&(o.removeChild(a),o.appendChild(Ci(n.arrow))):o.appendChild(Ci(n.arrow)):a&&o.removeChild(a)}return n.className=Ye,n.setAttribute("data-state","hidden"),Pi(n,t.props),e.appendChild(i),i.appendChild(n),s(t.props,t.props),{popper:e,onUpdate:s}}Di.$$tippy=!0;var Ii=1,Ri=[],ji=[];function Fi(t,e){var i,n,s,o,r,a,l,c,h=Ai(t,Object.assign({},Mi,Ei(ai(e)))),d=!1,u=!1,f=!1,p=!1,g=[],m=ii(Y,h.interactiveDebounce),b=Ii++,v=(c=h.plugins).filter(function(t,e){return c.indexOf(t)===e}),y={id:b,reference:t,popper:li(),popperInstance:null,props:h,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(s)},setProps:function(e){0;if(y.state.isDestroyed)return;D("onBeforeUpdate",[y,e]),U();var i=y.props,n=Ai(t,Object.assign({},i,ai(e),{ignoreAttributes:!0}));y.props=n,$(),i.interactiveDebounce!==n.interactiveDebounce&&(j(),m=ii(Y,n.interactiveDebounce));i.triggerTarget&&!n.triggerTarget?ni(i.triggerTarget).forEach(function(t){t.removeAttribute("aria-expanded")}):n.triggerTarget&&t.removeAttribute("aria-expanded");R(),L(),w&&w(i,n);y.popperInstance&&(K(),Z().forEach(function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}));D("onAfterUpdate",[y,e])},setContent:function(t){y.setProps({content:t})},show:function(){0;var t=y.state.isVisible,e=y.state.isDestroyed,i=!y.state.isEnabled,n=vi.isTouch&&!y.props.touch,s=Ze(y.props.duration,0,Mi.duration);if(t||e||i||n)return;if(A().hasAttribute("disabled"))return;if(D("onShow",[y],!1),!1===y.props.onShow(y))return;y.state.isVisible=!0,E()&&(_.style.visibility="visible");L(),N(),y.state.isMounted||(_.style.transition="none");if(E()){var o=C();fi([o.box,o.content],0)}a=function(){var t;if(y.state.isVisible&&!p){if(p=!0,_.offsetHeight,_.style.transition=y.props.moveTransition,E()&&y.props.animation){var e=C(),i=e.box,n=e.content;fi([i,n],s),pi([i,n],"visible")}I(),R(),si(ji,y),null==(t=y.popperInstance)||t.forceUpdate(),D("onMount",[y]),y.props.animation&&E()&&function(t,e){V(t,e)}(s,function(){y.state.isShown=!0,D("onShown",[y])})}},function(){var t,e=y.props.appendTo,i=A();t=y.props.interactive&&e===Qe||"parent"===e?i.parentNode:ei(e,[i]);t.contains(_)||t.appendChild(_);y.state.isMounted=!0,K(),!1}()},hide:function(){0;var t=!y.state.isVisible,e=y.state.isDestroyed,i=!y.state.isEnabled,n=Ze(y.props.duration,1,Mi.duration);if(t||e||i)return;if(D("onHide",[y],!1),!1===y.props.onHide(y))return;y.state.isVisible=!1,y.state.isShown=!1,p=!1,d=!1,E()&&(_.style.visibility="hidden");if(j(),W(),L(!0),E()){var s=C(),o=s.box,r=s.content;y.props.animation&&(fi([o,r],n),pi([o,r],"hidden"))}I(),R(),y.props.animation?E()&&function(t,e){V(t,function(){!y.state.isVisible&&_.parentNode&&_.parentNode.contains(_)&&e()})}(n,y.unmount):y.unmount()},hideWithInteractivity:function(t){0;T().addEventListener("mousemove",m),si(Ri,m),m(t)},enable:function(){y.state.isEnabled=!0},disable:function(){y.hide(),y.state.isEnabled=!1},unmount:function(){0;y.state.isVisible&&y.hide();if(!y.state.isMounted)return;Q(),Z().forEach(function(t){t._tippy.unmount()}),_.parentNode&&_.parentNode.removeChild(_);ji=ji.filter(function(t){return t!==y}),y.state.isMounted=!1,D("onHidden",[y])},destroy:function(){0;if(y.state.isDestroyed)return;y.clearDelayTimeouts(),y.unmount(),U(),delete t._tippy,y.state.isDestroyed=!0,D("onDestroy",[y])}};if(!h.render)return y;var x=h.render(y),_=x.popper,w=x.onUpdate;_.setAttribute("data-tippy-root",""),_.id="tippy-"+y.id,y.popper=_,t._tippy=y,_._tippy=y;var k=v.map(function(t){return t.fn(y)}),S=t.hasAttribute("aria-expanded");return $(),R(),L(),D("onCreate",[y]),h.showOnCreate&&tt(),_.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),_.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&T().addEventListener("mousemove",m)}),y;function M(){var t=y.props.touch;return Array.isArray(t)?t:[t,0]}function O(){return"hold"===M()[0]}function E(){var t;return!(null==(t=y.props.render)||!t.$$tippy)}function A(){return l||t}function T(){var t=A().parentNode;return t?gi(t):document}function C(){return Li(_)}function P(t){return y.state.isMounted&&!y.state.isVisible||vi.isTouch||o&&"focus"===o.type?0:Ze(y.props.delay,t?0:1,Mi.delay)}function L(t){void 0===t&&(t=!1),_.style.pointerEvents=y.props.interactive&&!t?"":"none",_.style.zIndex=""+y.props.zIndex}function D(t,e,i){var n;(void 0===i&&(i=!0),k.forEach(function(i){i[t]&&i[t].apply(i,e)}),i)&&(n=y.props)[t].apply(n,e)}function I(){var e=y.props.aria;if(e.content){var i="aria-"+e.content,n=_.id;ni(y.props.triggerTarget||t).forEach(function(t){var e=t.getAttribute(i);if(y.state.isVisible)t.setAttribute(i,e?e+" "+n:n);else{var s=e&&e.replace(n,"").trim();s?t.setAttribute(i,s):t.removeAttribute(i)}})}}function R(){!S&&y.props.aria.expanded&&ni(y.props.triggerTarget||t).forEach(function(t){y.props.interactive?t.setAttribute("aria-expanded",y.state.isVisible&&t===A()?"true":"false"):t.removeAttribute("aria-expanded")})}function j(){T().removeEventListener("mousemove",m),Ri=Ri.filter(function(t){return t!==m})}function F(e){if(!vi.isTouch||!f&&"mousedown"!==e.type){var i=e.composedPath&&e.composedPath()[0]||e.target;if(!y.props.interactive||!bi(_,i)){if(ni(y.props.triggerTarget||t).some(function(t){return bi(t,i)})){if(vi.isTouch)return;if(y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else D("onClickOutside",[y,e]);!0===y.props.hideOnClick&&(y.clearDelayTimeouts(),y.hide(),u=!0,setTimeout(function(){u=!1}),y.state.isMounted||W())}}}function z(){f=!0}function B(){f=!1}function N(){var t=T();t.addEventListener("mousedown",F,!0),t.addEventListener("touchend",F,Ke),t.addEventListener("touchstart",B,Ke),t.addEventListener("touchmove",z,Ke)}function W(){var t=T();t.removeEventListener("mousedown",F,!0),t.removeEventListener("touchend",F,Ke),t.removeEventListener("touchstart",B,Ke),t.removeEventListener("touchmove",z,Ke)}function V(t,e){var i=C().box;function n(t){t.target===i&&(mi(i,"remove",n),e())}if(0===t)return e();mi(i,"remove",r),mi(i,"add",n),r=n}function H(e,i,n){void 0===n&&(n=!1),ni(y.props.triggerTarget||t).forEach(function(t){t.addEventListener(e,i,n),g.push({node:t,eventType:e,handler:i,options:n})})}function $(){var t;O()&&(H("touchstart",q,{passive:!0}),H("touchend",X,{passive:!0})),(t=y.props.trigger,t.split(/\s+/).filter(Boolean)).forEach(function(t){if("manual"!==t)switch(H(t,q),t){case"mouseenter":H("mouseleave",X);break;case"focus":H(ki?"focusout":"blur",J);break;case"focusin":H("focusout",J)}})}function U(){g.forEach(function(t){var e=t.node,i=t.eventType,n=t.handler,s=t.options;e.removeEventListener(i,n,s)}),g=[]}function q(t){var e,i=!1;if(y.state.isEnabled&&!G(t)&&!u){var n="focus"===(null==(e=o)?void 0:e.type);o=t,l=t.currentTarget,R(),!y.state.isVisible&&hi(t)&&Ri.forEach(function(e){return e(t)}),"click"===t.type&&(y.props.trigger.indexOf("mouseenter")<0||d)&&!1!==y.props.hideOnClick&&y.state.isVisible?i=!0:tt(t),"click"===t.type&&(d=!i),i&&!n&&et(t)}}function Y(t){var e=t.target,i=A().contains(e)||_.contains(e);if("mousemove"!==t.type||!i){var n=Z().concat(_).map(function(t){var e,i=null==(e=t._tippy.popperInstance)?void 0:e.state;return i?{popperRect:t.getBoundingClientRect(),popperState:i,props:h}:null}).filter(Boolean);(function(t,e){var i=e.clientX,n=e.clientY;return t.every(function(t){var e=t.popperRect,s=t.popperState,o=t.props.interactiveBorder,r=oi(s.placement),a=s.modifiersData.offset;if(!a)return!0;var l="bottom"===r?a.top.y:0,c="top"===r?a.bottom.y:0,h="right"===r?a.left.x:0,d="left"===r?a.right.x:0,u=e.top-n+l>o,f=n-e.bottom-c>o,p=e.left-i+h>o,g=i-e.right-d>o;return u||f||p||g})})(n,t)&&(j(),et(t))}}function X(t){G(t)||y.props.trigger.indexOf("click")>=0&&d||(y.props.interactive?y.hideWithInteractivity(t):et(t))}function J(t){y.props.trigger.indexOf("focusin")<0&&t.target!==A()||y.props.interactive&&t.relatedTarget&&_.contains(t.relatedTarget)||et(t)}function G(t){return!!vi.isTouch&&O()!==t.type.indexOf("touch")>=0}function K(){Q();var e=y.props,i=e.popperOptions,n=e.placement,s=e.offset,o=e.getReferenceClientRect,r=e.moveTransition,l=E()?Li(_).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||A()}:t,h={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(E()){var i=C().box;["placement","reference-hidden","escaped"].forEach(function(t){"placement"===t?i.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?i.setAttribute("data-"+t,""):i.removeAttribute("data-"+t)}),e.attributes.popper={}}}},d=[{name:"offset",options:{offset:s}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!r}},h];E()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==i?void 0:i.modifiers)||[]),y.popperInstance=qe(c,_,Object.assign({},i,{placement:n,onFirstUpdate:a,modifiers:d}))}function Q(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function Z(){return ri(_.querySelectorAll("[data-tippy-root]"))}function tt(t){y.clearDelayTimeouts(),t&&D("onTrigger",[y,t]),N();var e=P(!0),n=M(),s=n[0],o=n[1];vi.isTouch&&"hold"===s&&o&&(e=o),e?i=setTimeout(function(){y.show()},e):y.show()}function et(t){if(y.clearDelayTimeouts(),D("onUntrigger",[y,t]),y.state.isVisible){if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&d)){var e=P(!1);e?n=setTimeout(function(){y.state.isVisible&&y.hide()},e):s=requestAnimationFrame(function(){y.hide()})}}else W()}}function zi(t,e){void 0===e&&(e={});var i=Mi.plugins.concat(e.plugins||[]);document.addEventListener("touchstart",xi,Ke),window.addEventListener("blur",wi);var n=Object.assign({},e,{plugins:i}),s=ui(t).reduce(function(t,e){var i=e&&Fi(e,n);return i&&t.push(i),t},[]);return ci(t)?s[0]:s}zi.defaultProps=Mi,zi.setDefaultProps=function(t){Object.keys(t).forEach(function(e){Mi[e]=t[e]})},zi.currentInput=vi;Object.assign({},Ae,{effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow)}});zi.setDefaultProps({render:Di});const Bi=zi;var Ni=i(951),Wi=i.n(Ni);const Vi={controlled:null,bind(t){this.controlled=t,this.controlled.forEach(t=>{this._main(t)}),this._init()},_init(){this.controlled.forEach(t=>{this._checkUp(t)})},_main(t){const e=JSON.parse(t.dataset.main);t.dataset.size&&(t.filesize=parseInt(t.dataset.size,10)),t.mains=e.map(e=>{const i=document.getElementById(e),n=document.getElementById(e+"_size_wrapper");return n&&(i.filesize=0,i.sizespan=n),this._addChild(i,t),i}),this._bindEvents(t),t.mains.forEach(t=>{this._bindEvents(t)})},_bindEvents(t){t.eventBound||(t.addEventListener("click",e=>{const i=e.target;i.elements&&(this._checkDown(i),this._evaluateSize(i)),i.mains&&this._checkUp(t)}),t.eventBound=!0)},_addChild(t,e){const i=t.elements?t.elements:[];-1===i.indexOf(e)&&(i.push(e),t.elements=i)},_removeChild(t,e){const i=t.elements.indexOf(e);-1{e.checked!==t.checked&&(e.checked=t.checked,e.disabled&&(e.checked=!1),e.dispatchEvent(new Event("change")))}),t.elements.forEach(e=>{this._checkDown(e),e.elements||this._checkUp(e,t)}))},_checkUp(t,e){t.mains&&[...t.mains].forEach(t=>{t!==e&&this._evaluateCheckStatus(t),this._checkUp(t),this._evaluateSize(t)})},_evaluateCheckStatus(t){let e=0,i=t.classList.contains("partial");i&&(t.classList.remove("partial"),i=!1),t.elements.forEach(n=>{null!==n.parentNode?(e+=n.checked,n.classList.contains("partial")&&(i=!0)):this._removeChild(t,n)});let n="some";e===t.elements.length?n="on":0===e?n="off":i=!0,i&&t.classList.add("partial");const s="off"!==n;t.checked===s&&t.value===n||(t.value=n,t.checked=s,t.dispatchEvent(new Event("change")))},_evaluateSize(t){if(t.sizespan&&t.elements){t.filesize=0,t.elements.forEach(e=>{e.checked&&(t.filesize+=e.filesize)});let e=null;0Math.max(Math.min(t,i),e);function Xi(t){return Yi(qi(2.55*t),0,255)}function Ji(t){return Yi(qi(255*t),0,255)}function Gi(t){return Yi(qi(t/2.55)/100,0,1)}function Ki(t){return Yi(qi(100*t),0,100)}const Qi={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Zi=[..."0123456789ABCDEF"],tn=t=>Zi[15&t],en=t=>Zi[(240&t)>>4]+Zi[15&t],nn=t=>(240&t)>>4==(15&t);function sn(t){var e=(t=>nn(t.r)&&nn(t.g)&&nn(t.b)&&nn(t.a))(t)?tn:en;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const on=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function rn(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function an(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function ln(t,e,i){const n=rn(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function cn(t){const e=t.r/255,i=t.g/255,n=t.b/255,s=Math.max(e,i,n),o=Math.min(e,i,n),r=(s+o)/2;let a,l,c;return s!==o&&(c=s-o,l=r>.5?c/(2-s-o):c/(s+o),a=function(t,e,i,n,s){return t===s?(e-i)/n+(e>16&255,o>>8&255,255&o]}return t}(),mn.transparent=[0,0,0,0]);const e=mn[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const vn=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const yn=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,xn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function _n(t,e,i){if(t){let n=cn(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=dn(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function wn(t,e){return t?Object.assign(e||{},t):t}function kn(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Ji(t[3]))):(e=wn(t,{r:0,g:0,b:0,a:1})).a=Ji(e.a),e}function Sn(t){return"r"===t.charAt(0)?function(t){const e=vn.exec(t);let i,n,s,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?Xi(t):Yi(255*t,0,255)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?Xi(i):Yi(i,0,255)),n=255&(e[4]?Xi(n):Yi(n,0,255)),s=255&(e[6]?Xi(s):Yi(s,0,255)),{r:i,g:n,b:s,a:o}}}(t):fn(t)}class Mn{constructor(t){if(t instanceof Mn)return t;const e=typeof t;let i;var n,s,o;"object"===e?i=kn(t):"string"===e&&(o=(n=t).length,"#"===n[0]&&(4===o||5===o?s={r:255&17*Qi[n[1]],g:255&17*Qi[n[2]],b:255&17*Qi[n[3]],a:5===o?17*Qi[n[4]]:255}:7!==o&&9!==o||(s={r:Qi[n[1]]<<4|Qi[n[2]],g:Qi[n[3]]<<4|Qi[n[4]],b:Qi[n[5]]<<4|Qi[n[6]],a:9===o?Qi[n[7]]<<4|Qi[n[8]]:255})),i=s||bn(t)||Sn(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=wn(this._rgb);return t&&(t.a=Gi(t.a)),t}set rgb(t){this._rgb=kn(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Gi(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?sn(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=cn(t),i=e[0],n=Ki(e[1]),s=Ki(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${Gi(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let s;const o=e===s?.5:e,r=2*o-1,a=i.a-n.a,l=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-l,i.r=255&l*i.r+s*n.r+.5,i.g=255&l*i.g+s*n.g+.5,i.b=255&l*i.b+s*n.b+.5,i.a=o*i.a+(1-o)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const n=xn(Gi(t.r)),s=xn(Gi(t.g)),o=xn(Gi(t.b));return{r:Ji(yn(n+i*(xn(Gi(e.r))-n))),g:Ji(yn(s+i*(xn(Gi(e.g))-s))),b:Ji(yn(o+i*(xn(Gi(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Mn(this.rgb)}alpha(t){return this._rgb.a=Ji(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=qi(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return _n(this._rgb,2,t),this}darken(t){return _n(this._rgb,2,-t),this}saturate(t){return _n(this._rgb,1,t),this}desaturate(t){return _n(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=cn(t);i[0]=un(i[0]+e),i=dn(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function On(){}const En=(()=>{let t=0;return()=>t++})();function An(t){return null==t}function Tn(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function Cn(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function Pn(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function Ln(t,e){return Pn(t)?t:e}function Dn(t,e){return void 0===t?e:t}const In=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Rn(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function jn(t,e,i,n){let s,o,r;if(Tn(t))if(o=t.length,n)for(s=o-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;st,x:t=>t.x,y:t=>t.y};function Un(t,e){const i=$n[e]||($n[e]=function(t){const e=function(t){const e=t.split("."),i=[];let n="";for(const t of e)n+=t,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function qn(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Yn=t=>void 0!==t,Xn=t=>"function"==typeof t,Jn=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};const Gn=Math.PI,Kn=2*Gn,Qn=Kn+Gn,Zn=Number.POSITIVE_INFINITY,ts=Gn/180,es=Gn/2,is=Gn/4,ns=2*Gn/3,ss=Math.log10,os=Math.sign;function rs(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function xs(t,e,i){i=i||(i=>t[i]1;)n=o+s>>1,i(n)?o=n:s=n;return{lo:o,hi:s}}const _s=(t,e,i,n)=>xs(t,i,n?n=>{const s=t[n][e];return st[n][e]xs(t,i,n=>t[n][e]>=i);const ks=["push","pop","shift","splice","unshift"];function Ss(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(ks.forEach(e=>{delete t[e]}),delete t._chartjs)}function Ms(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Os="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Es(t,e){let i=[],n=!1;return function(...s){i=s,n||(n=!0,Os.call(window,()=>{n=!1,t.apply(e,i)}))}}const As=t=>"start"===t?"left":"end"===t?"right":"center",Ts=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function Cs(t,e,i){const n=e.length;let s=0,o=n;if(t._sorted){const{iScale:r,vScale:a,_parsed:l}=t,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,h=r.axis,{min:d,max:u,minDefined:f,maxDefined:p}=r.getUserBounds();if(f){if(s=Math.min(_s(l,h,d).lo,i?n:_s(e,h,r.getPixelForValue(d)).lo),c){const t=l.slice(0,s+1).reverse().findIndex(t=>!An(t[a.axis]));s-=Math.max(0,t)}s=vs(s,0,n-1)}if(p){let t=Math.max(_s(l,r.axis,u,!0).hi+1,i?0:_s(e,h,r.getPixelForValue(u),!0).hi+1);if(c){const e=l.slice(t-1).findIndex(t=>!An(t[a.axis]));t+=Math.max(0,e)}o=vs(t,s,n)-s}else o=n-s}return{start:s,count:o}}function Ps(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const o=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),o}const Ls=t=>0===t||1===t,Ds=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*Kn/i),Is=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*Kn/i)+1,Rs={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*es),easeOutSine:t=>Math.sin(t*es),easeInOutSine:t=>-.5*(Math.cos(Gn*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Ls(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Ls(t)?t:Ds(t,.075,.3),easeOutElastic:t=>Ls(t)?t:Is(t,.075,.3),easeInOutElastic(t){const e=.1125;return Ls(t)?t:t<.5?.5*Ds(2*t,e,.45):.5+.5*Is(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Rs.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*Rs.easeInBounce(2*t):.5*Rs.easeOutBounce(2*t-1)+.5};function js(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Fs(t){return js(t)?t:new Mn(t)}function zs(t){return js(t)?t:new Mn(t).saturate(.5).darken(.1).hexString()}const Bs=["x","y","borderWidth","radius","tension"],Ns=["color","borderColor","backgroundColor"];const Ws=new Map;function Vs(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=Ws.get(i);return n||(n=new Intl.NumberFormat(t,e),Ws.set(i,n)),n}(e,i).format(t)}const Hs={values:t=>Tn(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let s,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(s="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const r=ss(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Vs(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(ss(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?Hs.numeric.call(this,t,e,i):""}};var $s={formatters:Hs};const Us=Object.create(null),qs=Object.create(null);function Ys(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>zs(e.backgroundColor),this.hoverBorderColor=(t,e)=>zs(e.borderColor),this.hoverColor=(t,e)=>zs(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Xs(this,t,e)}get(t){return Ys(this,t)}describe(t,e){return Xs(qs,t,e)}override(t,e){return Xs(Us,t,e)}route(t,e,i,n){const s=Ys(this,t),o=Ys(this,i),r="_"+e;Object.defineProperties(s,{[r]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=o[n];return Cn(t)?Object.assign({},e,t):Dn(t,e)},set(t){this[r]=t}}})}apply(t){t.forEach(t=>t(this))}}var Gs=new Js({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Ns},numbers:{type:"number",properties:Bs}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:$s.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function Ks(t,e,i,n,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,i.push(s)),o>n&&(n=o),n}function Qs(t,e,i,n){let s=(n=n||{}).data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},o=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const a=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function no(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==o.strokeColor;let l,c;for(t.save(),t.font=s.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),An(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l+t||0;function bo(t,e){const i={},n=Cn(e),s=n?Object.keys(e):e,o=Cn(t)?n?i=>Dn(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of s)i[t]=mo(o(t));return i}function vo(t){return bo(t,{top:"y",right:"x",bottom:"y",left:"x"})}function yo(t){return bo(t,["topLeft","topRight","bottomLeft","bottomRight"])}function xo(t){const e=vo(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function _o(t,e){t=t||{},e=e||Gs.font;let i=Dn(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=Dn(t.style,e.style);n&&!(""+n).match(po)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:Dn(t.family,e.family),lineHeight:go(Dn(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:Dn(t.weight,e.weight),string:""};return s.string=function(t){return!t||An(t.size)||An(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(s),s}function wo(t,e,i,n){let s,o,r,a=!0;for(s=0,o=t.length;st[0]){const o=i||t;void 0===n&&(n=Ro("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:n,_getTarget:s,override:i=>So([i,...t],e,o,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>To(i,n,()=>function(t,e,i,n){let s;for(const o of e)if(s=Ro(Eo(o,t),i),void 0!==s)return Ao(t,s)?Do(i,n,t,s):s}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>jo(t).includes(e),ownKeys:t=>jo(t),set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function Mo(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Oo(t,n),setContext:e=>Mo(t,e,i,n),override:s=>Mo(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>To(t,e,()=>function(t,e,i){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=t;let a=n[e];Xn(a)&&r.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(o,r||n);a.delete(t),Ao(t,l)&&(l=Do(s._scopes,s,t,l));return l}(e,a,t,i));Tn(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=i;if(void 0!==o.index&&n(t))return e[o.index%e.length];if(Cn(e[0])){const i=e,n=s._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=Do(n,s,t,l);e.push(Mo(i,o,r&&r[t],a))}}return e}(e,a,t,r.isIndexable));Ao(e,a)&&(a=Mo(a,s,o&&o[e],r));return a}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function Oo(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:Xn(i)?i:()=>i,isIndexable:Xn(n)?n:()=>n}}const Eo=(t,e)=>t?t+qn(e):e,Ao=(t,e)=>Cn(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function To(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const n=i();return t[e]=n,n}function Co(t,e,i){return Xn(t)?t(e,i):t}const Po=(t,e)=>!0===t?e:"string"==typeof t?Un(e,t):void 0;function Lo(t,e,i,n,s){for(const o of e){const e=Po(i,o);if(e){t.add(e);const o=Co(e._fallback,i,s);if(void 0!==o&&o!==i&&o!==n)return o}else if(!1===e&&void 0!==n&&i!==n)return null}return!1}function Do(t,e,i,n){const s=e._rootScopes,o=Co(e._fallback,i,n),r=[...t,...s],a=new Set;a.add(n);let l=Io(a,r,i,o||i,n);return null!==l&&((void 0===o||o===i||(l=Io(a,r,o,l,n),null!==l))&&So(Array.from(a),[""],s,o,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];if(Tn(s)&&Cn(i))return i;return s||{}}(e,i,n)))}function Io(t,e,i,n,s){for(;i;)i=Lo(t,e,i,n,s);return i}function Ro(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function jo(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function Fo(t,e,i,n){const{iScale:s}=t,{key:o="r"}=this._parsing,r=new Array(n);let a,l,c,h;for(a=0,l=n;ae"x"===t?"y":"x";function Wo(t,e,i,n){const s=t.skip?e:t,o=e,r=i.skip?e:i,a=ps(o,s),l=ps(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function Vo(t,e="x"){const i=No(e),n=t.length,s=Array(n).fill(0),o=Array(n);let r,a,l,c=Bo(t,0);for(r=0;r!t.skip)),"monotone"===e.cubicInterpolationMode)Vo(t,s);else{let i=n?t[t.length-1]:t[0];for(o=0,r=t.length;ot.ownerDocument.defaultView.getComputedStyle(t,null);const Jo=["top","right","bottom","left"];function Go(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const o=Jo[s];n[o]=parseFloat(t[e+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function Ko(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,s=Xo(i),o="border-box"===s.boxSizing,r=Go(s,"padding"),a=Go(s,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:s,offsetY:o}=n;let r,a,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,o,t.target))r=s,a=o;else{const t=e.getBoundingClientRect();r=n.clientX-t.left,a=n.clientY-t.top,l=!0}return{x:r,y:a,box:l}}(t,i),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:p}=e;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/p*i.height/n)}}const Qo=t=>Math.round(10*t)/10;function Zo(t,e,i,n){const s=Xo(t),o=Go(s,"margin"),r=Yo(s.maxWidth,t,"clientWidth")||Zn,a=Yo(s.maxHeight,t,"clientHeight")||Zn,l=function(t,e,i){let n,s;if(void 0===e||void 0===i){const o=t&&qo(t);if(o){const t=o.getBoundingClientRect(),r=Xo(o),a=Go(r,"border","width"),l=Go(r,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=Yo(r.maxWidth,o,"clientWidth"),s=Yo(r.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||Zn,maxHeight:s||Zn}}(t,e,i);let{width:c,height:h}=l;if("content-box"===s.boxSizing){const t=Go(s,"border","width"),e=Go(s,"padding");c-=e.width+t.width,h-=e.height+t.height}c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=Qo(Math.min(c,r,l.maxWidth)),h=Qo(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Qo(c/2));return(void 0!==e||void 0!==i)&&n&&l.height&&h>l.height&&(h=l.height,c=Qo(Math.floor(h*n))),{width:c,height:h}}function tr(t,e,i){const n=e||1,s=Qo(t.height*n),o=Qo(t.width*n);t.height=Qo(t.height),t.width=Qo(t.width);const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||r.height!==s||r.width!==o)&&(t.currentDevicePixelRatio=n,r.height=s,r.width=o,t.ctx.setTransform(n,0,0,n,0,0),!0)}const er=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Uo()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function ir(t,e){const i=function(t,e){return Xo(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function nr(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function sr(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function or(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},r=nr(t,s,i),a=nr(s,o,i),l=nr(o,e,i),c=nr(r,a,i),h=nr(a,l,i);return nr(c,h,i)}function rr(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function ar(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function lr(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function cr(t){return"angle"===t?{between:bs,compare:gs,normalize:ms}:{between:ys,compare:(t,e)=>t-e,normalize:t=>t}}function hr({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:s}}function dr(t,e,i){if(!i)return[t];const{property:n,start:s,end:o}=i,r=e.length,{compare:a,between:l,normalize:c}=cr(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:s,end:o}=i,{between:r,normalize:a}=cr(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cv||l(s,b,g)&&0!==a(s,b),_=()=>!v||0===a(o,g)||l(o,b,g);for(let t=h,i=h;t<=d;++t)m=e[t%r],m.skip||(g=c(m[n]),g!==b&&(v=l(g,s,o),null===y&&x()&&(y=0===a(g,s)?t:i),null!==y&&_()&&(p.push(hr({start:y,end:t,loop:u,count:r,style:f})),y=null),i=t,b=g));return null!==y&&p.push(hr({start:y,end:d,loop:u,count:r,style:f})),p}function ur(t,e){const i=[],n=t.segments;for(let s=0;sn({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Os.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let o,r=s.length-1,a=!1;for(;r>=0;--r)o=s[r],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),a=!0):(s[r]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var yr=new vr;const xr="transparent",_r={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Fs(t||xr),s=n.valid&&Fs(e||xr);return s&&s.valid?s.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class wr{constructor(t,e,i,n){const s=e[i];n=wo([t.to,n,s,t.from]);const o=wo([t.from,s,n]);this._active=!0,this._fn=t.fn||_r[t.type||typeof o],this._easing=Rs[t.easing]||Rs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=wo([t.to,e,n,t.from]),this._from=wo([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||e1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,r,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t{const s=t[n];if(!Cn(s))return;const o={};for(const t of e)o[t]=s[t];(Tn(s.properties)&&s.properties||[n]).forEach(t=>{t!==n&&i.has(t)||i.set(t,o)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),o=Object.keys(e),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const l=o[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=s[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,r);continue}h.cancel()}d&&d.duration?(s[l]=h=new wr(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(yr.add(this._chart,i),!0):void 0}}function Sr(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:n?o:s,end:n?s:o}}function Mr(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=n.length;s0||!i&&e<0)return s.index}return null}function Cr(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,r,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Lr(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i],void 0!==e[n]._visualValues&&void 0!==e[n]._visualValues[i]&&delete e[n]._visualValues[i]}}}const Dr=t=>"reset"===t||"none"===t,Ir=(t,e)=>e?t:Object.assign({},t);class Rr{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Er(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Lr(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=e.xAxisID=Dn(i.xAxisID,Pr(t,"x")),o=e.yAxisID=Dn(i.yAxisID,Pr(t,"y")),r=e.rAxisID=Dn(i.rAxisID,Pr(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,s,o,r),c=e.vAxisID=n(a,o,s,r);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ss(this._data,this),t._stacked&&Lr(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Cn(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:n}=e,s="x"===i.axis?"x":"y",o="x"===n.axis?"x":"y",r=Object.keys(t),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l{const e="_onData"+qn(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const s=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),s}})}))),this._syncList=[],this._data=e}var n,s}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=Er(e.vScale,e),e.stack!==i.stack&&(n=!0,Lr(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&(Cr(this,e._parsed),e._stacked=Er(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=Tn(n[t])?this.parseArrayData(i,n,t,e):Cn(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const s=()=>null===l[r]||d&&l[r]t&&!e.hidden&&e._stacked&&{keys:Mr(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}(r);let d,u;function f(){u=n[d];const e=u[r.axis];return!Pn(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,s,o;for(n=0,s=e.length;n=0&&tthis.getContext(i,n,e),h);return f.$shared&&(f.$shared=a,s[o]=Object.freeze(Ir(f,a))),f}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,o=`animation-${e}`,r=s[o];if(r)return r;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),o=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(o,this.getContext(t,i,e))}const l=new kr(n,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Dr(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(e,s)||s!==n;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:o}}updateElement(t,e,i,n){Dr(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Dr(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,s=e.length,o=Math.min(s,n);o&&this.parse(0,o),s>n?this._insertElements(n,s-n,t):s{for(t.length+=e,r=t.length-1;r>=o;r--)t[r]=t[r-e]};for(a(s),r=t;rt-e))}return t._cache.$bar}(e,t.type);let n,s,o,r,a=e._length;const l=()=>{32767!==o&&-32768!==o&&(Yn(r)&&(a=Math.min(a,Math.abs(o-r)||a)),r=o)};for(n=0,s=i.length;nMath.abs(a)&&(l=a,c=r),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function zr(t,e,i,n){const s=t.iScale,o=t.vScale,r=s.getLabels(),a=s===o,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:n,color:s,useBorderRadius:o,borderRadius:r}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((e,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:e,fillStyle:l.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(a),lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:l.borderWidth,strokeStyle:l.borderColor,textAlign:n,pointStyle:i,borderRadius:o&&(r||l.borderRadius),index:a}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let s,o,r=t=>+i[t];if(Cn(i[t])){const{key:t="value"}=this._parsing;r=e=>+Un(i[e],t)}for(s=t,o=t+e;sbs(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>bs(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),g=f(0,c,d),m=f(es,h,u),b=p(Gn,c,d),v=p(Gn+es,h,u);n=(g-b)/2,s=(m-v)/2,o=-(g+b)/2,r=-(m+v)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}(u,d,a),b=(i.width-o)/f,v=(i.height-o)/p,y=Math.max(Math.min(b,v)/2,0),x=In(this.options.radius,y),_=(x-Math.max(x*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=m*x,n.total=this.calculateTotal(),this.outerRadius=x-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*h,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*s/Kn)}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,r=o.chartArea,a=o.options.animation,l=(r.left+r.right)/2,c=(r.top+r.bottom)/2,h=s&&a.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,{sharedOptions:f,includeOptions:p}=this._getSharedOptions(e,n);let g,m=this._getRotation();for(g=0;g0&&!isNaN(t)?Kn*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=Vs(e._parsed[t],i.options.locale);return{label:n[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,o,r,a;if(!t)for(n=0,s=i.data.datasets.length;n{const o=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:n,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=Vs(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:s}}parseObjectData(t,e,i,n){return Fo.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{const n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(ne.max&&(e.max=n))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),o=(s-Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=s-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,r=o.options.animation,a=this._cachedMeta.rScale,l=a.xCenter,c=a.yCenter,h=a.getIndexAngle(0)-.5*Gn;let d,u=h;const f=360/this.countVisibleElements();for(d=0;d{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?hs(this.resolveDataElementOptions(t,e).angle||i):0}}var qr=Object.freeze({__proto__:null,BarController:class extends Rr{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,n){return zr(t,e,i,n)}parseArrayData(t,e,i,n){return zr(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:s,vScale:o}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,l="x"===s.axis?r:a,c="x"===o.axis?r:a,h=[];let d,u,f,p;for(d=i,u=i+n;dt.controller.options.grouped),s=i.options.stacked,o=[],r=this._cachedMeta.controller.getParsed(e),a=r&&r[i.axis],l=t=>{const e=t._parsed.find(t=>t[i.axis]===a),n=e&&e[t.vScale.axis];if(An(n)||isNaN(n))return!0};for(const i of n)if((void 0===e||!l(i))&&((!1===s||-1===o.indexOf(i.stack)||void 0===s&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Dn("x"===this.chart.options.indexAxis?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const n=this._getStacks(t,i),s=void 0!==e?n.indexOf(e):-1;return-1===s?n.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let s,o;for(s=0,o=e.data.length;s=i?1:-1)}(d,e,r)*o,u===r&&(m-=d/2);const t=e.getPixelForDecimal(0),s=e.getPixelForDecimal(1),l=Math.min(t,s),f=Math.max(t,s);m=Math.max(Math.min(m,f),l),h=m+d,i&&!c&&(a._stacks[e.axis]._visualValues[n]=e.getValueForPixel(h)-e.getValueForPixel(m))}if(m===e.getPixelForValue(r)){const t=os(d)*e.getLineWidthForValue(r)/2;m+=t,d-=t}return{size:d,base:m,head:h,center:h+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,s=n.skipNull,o=Dn(n.maxBarThickness,1/0);let r,a;const l=this._getAxisCount();if(e.grouped){const i=s?this._getStackCount(t):e.stackCount,c="flex"===n.barThickness?function(t,e,i,n){const s=e.pixels,o=s[t];let r=t>0?s[t-1]:null,a=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:s}=e,o=this.getParsed(t),r=n.getLabelForValue(o.x),a=s.getLabelForValue(o.y),l=o._custom;return{label:i[t]||"",value:"("+r+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(e,n),c=o.axis,h=r.axis;for(let d=e;d0&&this.getParsed(e-1);for(let i=0;i=b){v.skip=!0;continue}const x=this.getParsed(i),_=An(x[u]),w=v[d]=o.getPixelForValue(x[d],i),k=v[u]=s||_?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,x,a):x[u],i);v.skip=isNaN(w)||isNaN(k)||_,v.stop=i>0&&Math.abs(x[d]-y[d])>g,p&&(v.parsed=x,v.raw=l.data[i]),h&&(v.options=c||this.resolveDataElementOptions(i,f.active?"active":n)),m||this.updateElement(f,i,v,n),y=x}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends $r{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:Ur,RadarController:class extends Rr{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return Fo.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this._cachedMeta.rScale,o="reset"===n;for(let r=e;r0&&this.getParsed(e-1);for(let c=e;c0&&Math.abs(i[u]-v[u])>m,g&&(p.parsed=i,p.raw=l.data[c]),d&&(p.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),b||this.updateElement(e,c,p,n),v=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const s=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,s,o)/2}}});function Yr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xr{static override(t){Object.assign(Xr.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Yr()}parse(){return Yr()}format(){return Yr()}add(){return Yr()}diff(){return Yr()}startOf(){return Yr()}endOf(){return Yr()}}var Jr=Xr;function Gr(t,e,i,n){const{controller:s,data:o,_sorted:r}=t,a=s._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&"r"!==e&&r&&o.length){const r=a._reversePixels?ws:_s;if(!n){const n=r(o,e,i);if(l){const{vScale:e}=s._cachedMeta,{_parsed:i}=t,o=i.slice(0,n.lo+1).reverse().findIndex(t=>!An(t[e.axis]));n.lo-=Math.max(0,o);const r=i.slice(n.hi).findIndex(t=>!An(t[e.axis]));n.hi+=Math.max(0,r)}return n}if(s._sharedOptions){const t=o[0],n="function"==typeof t.getRange&&t.getRange(e);if(n){const t=r(o,e,i-n),s=r(o,e,i+n);return{lo:t.lo,hi:s.hi}}}}return{lo:0,hi:o.length-1}}function Kr(t,e,i,n,s){const o=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=o.length;t{t[r]&&t[r](e[i],s)&&(o.push({element:t,datasetIndex:n,index:l}),a=a||t.inRange(e.x,e.y,s))}),n&&!a?[]:o}var ia={evaluateInteractionItems:Kr,modes:{index(t,e,i,n){const s=Ko(e,t),o=i.axis||"x",r=i.includeInvisible||!1,a=i.intersect?Qr(t,s,o,n,r):ta(t,s,o,!1,n,r),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,n){const s=Ko(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;let a=i.intersect?Qr(t,s,o,n,r):ta(t,s,o,!1,n,r);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;tQr(t,Ko(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){const s=Ko(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;return ta(t,s,o,i.intersect,n,r)},x:(t,e,i,n)=>ea(t,Ko(e,t),"x",i.intersect,n),y:(t,e,i,n)=>ea(t,Ko(e,t),"y",i.intersect,n)}};const na=["left","top","right","bottom"];function sa(t,e){return t.filter(t=>t.pos===e)}function oa(t,e){return t.filter(t=>-1===na.indexOf(t.pos)&&t.box.axis===e)}function ra(t,e){return t.sort((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function aa(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:s}=i;if(!t||!na.includes(n))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let o,r,a;for(o=0,r=t.length;o{n[t]=Math.max(e[t],i[t])}),n}return n(t?["left","right"]:["top","bottom"])}function ua(t,e,i,n){const s=[];let o,r,a,l,c,h;for(o=0,r=t.length,c=0;ot.box.fullSize),!0),n=ra(sa(e,"left"),!0),s=ra(sa(e,"right")),o=ra(sa(e,"top"),!0),r=ra(sa(e,"bottom")),a=oa(e,"x"),l=oa(e,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:sa(e,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;jn(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},s);ca(u,xo(n));const f=Object.assign({maxPadding:u,w:o,h:r,x:s.left,y:s.top},s),p=aa(l.concat(c),d);ua(a.fullSize,f,d,p),ua(l,f,d,p),ua(c,f,d,p)&&ua(l,f,d,p),function(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),pa(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,pa(a.rightAndBottom,f,d,p),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},jn(a.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class ma{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class ba extends ma{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const va="$chartjs",ya={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xa=t=>null===t||""===t;const _a=!!er&&{passive:!0};function wa(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,_a)}function ka(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Sa(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||ka(i.addedNodes,n),e=e&&!ka(i.removedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function Ma(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||ka(i.removedNodes,n),e=e&&!ka(i.addedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}const Oa=new Map;let Ea=0;function Aa(){const t=window.devicePixelRatio;t!==Ea&&(Ea=t,Oa.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Ta(t,e,i){const n=t.canvas,s=n&&qo(n);if(!s)return;const o=Es((t,e)=>{const n=s.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||o(i,n)});return r.observe(s),function(t,e){Oa.size||window.addEventListener("resize",Aa),Oa.set(t,e)}(t,o),r}function Ca(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Oa.delete(t),Oa.size||window.removeEventListener("resize",Aa)}(t)}function Pa(t,e,i){const n=t.canvas,s=Es(e=>{null!==t.ctx&&i(function(t,e){const i=ya[t.type]||t.type,{x:n,y:s}=Ko(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==s?s:null}}(e,t))},t);return function(t,e,i){t&&t.addEventListener(e,i,_a)}(n,e,s),s}class La extends ma{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),s=t.getAttribute("width");if(t[va]={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",xa(s)){const e=ir(t,"width");void 0!==e&&(t.width=e)}if(xa(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ir(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[va])return!1;const i=e[va].initial;["height","width"].forEach(t=>{const n=i[t];An(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e[va],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:Sa,detach:Ma,resize:Ta}[e]||Pa;n[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:Ca,detach:Ca,resize:Ca}[e]||wa)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Zo(t,e,i,n)}isAttached(t){const e=t&&qo(t);return!(!e||!e.isConnected)}}class Da{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return ls(this.x)&&ls(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}function Ia(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),s=t._maxLength/i;return Math.floor(Math.min(n,s))}(t),s=Math.min(i.maxTicksLimit||n,n),o=i.major.enabled?function(t){const e=[];let i,n;for(i=0,n=t.length;is)return function(t,e,i,n){let s,o=0,r=i[0];for(n=Math.ceil(n),s=0;st-e).pop(),e}(n);for(let t=0,e=o.length-1;ts)return e}return Math.max(s,1)}(o,e,s);if(r>0){let t,i;const n=r>1?Math.round((l-a)/(r-1)):null;for(Ra(e,c,h,An(n)?0:a-n,a),t=0,i=r-1;t"top"===e||"left"===e?t[e]+i:t[e]-i,Fa=(t,e)=>Math.min(e||t,t);function za(t,e){const i=[],n=t.length/e,s=t.length;let o=0;for(;or+a)))return c}function Na(t){return t.drawTicks?t.tickLength:0}function Wa(t,e){if(!t.display)return 0;const i=_o(t.font,e),n=xo(t.padding);return(Tn(t.text)?t.text.length:1)*i.lineHeight+n.height}function Va(t,e,i){let n=As(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Ha extends Da{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=Ln(t,Number.POSITIVE_INFINITY),e=Ln(e,Number.NEGATIVE_INFINITY),i=Ln(i,Number.POSITIVE_INFINITY),n=Ln(n,Number.NEGATIVE_INFINITY),{min:Ln(t,i),max:Ln(e,n),minDefined:Pn(t),maxDefined:Pn(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:s,maxDefined:o}=this.getUserBounds();if(s&&o)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let a=0,l=r.length;an?n:i,n=s&&i>n?i:n,{min:Ln(i,Ln(n,i)),max:Ln(n,Ln(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Rn(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:s}=t,o=In(e,(s-n)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(n,-Math.abs(o)),max:r(s,o)}}(this,s,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=vs(this.chart.width-h,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),h+6>o&&(o=u/(i-(t.offset?.5:1)),r=this.maxHeight-Na(t.grid)-e.padding-Wa(t.title,this.chart.options.font),a=Math.sqrt(h*h+d*d),l=ds(Math.min(Math.asin(vs((c.highest.height+6)/o,-1,1)),Math.asin(vs(r/a,-1,1))-Math.asin(vs(d/a,-1,1)))),l=Math.max(n,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){Rn(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Rn(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const o=Wa(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Na(s)+o):(t.height=this.maxHeight,t.width=Na(s)+o),i.display&&this.ticks.length){const{first:e,last:n,widest:s,highest:o}=this._getLabelSizes(),a=2*i.padding,l=hs(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(r){const e=i.mirror?0:h*s.width+c*o.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:c*s.width+h*o.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:s,padding:o},position:r}=this.options,a=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;a?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?h=t.width:"inner"!==s&&(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-r+o)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-c+o)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+o,this.paddingBottom=n+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Rn(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s({width:o[t]||0,height:r[t]||0});return{first:k(0),last:k(e-1),widest:k(_),highest:k(w),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return vs(this._alignToPixels?Zs(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tr*n?r/i:a/n:a*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:s,position:o,border:r}=n,a=s.offset,l=this.isHorizontal(),c=this.ticks.length+(a?1:0),h=Na(s),d=[],u=r.setContext(this.getContext()),f=u.display?u.width:0,p=f/2,g=function(t){return Zs(i,t,f)};let m,b,v,y,x,_,w,k,S,M,O,E;if("top"===o)m=g(this.bottom),_=this.bottom-h,k=m-p,M=g(t.top)+p,E=t.bottom;else if("bottom"===o)m=g(this.top),M=t.top,E=g(t.bottom)-p,_=m+p,k=this.top+h;else if("left"===o)m=g(this.right),x=this.right-h,w=m-p,S=g(t.left)+p,O=t.right;else if("right"===o)m=g(this.left),S=t.left,O=g(t.right)-p,x=m+p,w=this.left+h;else if("x"===e){if("center"===o)m=g((t.top+t.bottom)/2+.5);else if(Cn(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}M=t.top,E=t.bottom,_=m+p,k=_+h}else if("y"===e){if("center"===o)m=g((t.left+t.right)/2);else if(Cn(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}x=m-p,w=x-h,S=t.left,O=t.right}const A=Dn(n.ticks.maxTicksLimit,c),T=Math.max(1,Math.ceil(c/A));for(b=0;b0&&(o-=n/2)}d={left:o,top:s,width:n+e.width,height:i+e.height,color:t.backdropColor}}g.push({label:y,font:S,textOffset:E,options:{rotation:p,color:i,strokeColor:a,strokeWidth:c,textAlign:u,textBaseline:A,translation:[x,_],backdrop:d}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-hs(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:s}}=this.options,o=t+s,r=this._getLabelSizes().widest.width;let a,l;return"left"===e?n?(l=this.right+s,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l+=r)):(l=this.right-o,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l=this.left)):"right"===e?n?(l=this.left+s,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l-=r)):(l=this.left+o,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:s,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,s,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(e=>e.value===t);if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,o=n.length;s{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,o;for(s=0,o=e.length;s{const n=i.split("."),s=n.pop(),o=[t].concat(n).join("."),r=e[i].split("."),a=r.pop(),l=r.join(".");Gs.route(o,s,l,a)})}(e,t.defaultRoutes);t.descriptors&&Gs.describe(e,t.descriptors)}(t,o,i),this.override&&Gs.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Gs[n]&&(delete Gs[n][i],this.override&&delete Us[i])}}class Ua{constructor(){this.controllers=new $a(Rr,"datasets",!0),this.elements=new $a(Da,"elements"),this.plugins=new $a(Object,"plugins"),this.scales=new $a(Ha,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):jn(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=qn(t);Rn(i["before"+n],[],i),e[t](i),Rn(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Xa(t,e){return e||!1!==t?!0===t?{}:t:null}function Ja(t,{plugin:e,local:i},n,s){const o=t.pluginScopeKeys(e),r=t.getOptionScopes(n,o);return i&&e.defaults&&r.push(e.defaults),t.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ga(t,e){const i=Gs.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Ka(t){if("x"===t||"y"===t||"r"===t)return t}function Qa(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function Za(t,...e){if(Ka(t))return t;for(const i of e){const e=i.axis||Qa(i.position)||t.length>1&&Ka(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function tl(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function el(t,e){const i=Us[t.type]||{scales:{}},n=e.scales||{},s=Ga(t.type,e),o=Object.create(null);return Object.keys(n).forEach(e=>{const r=n[e];if(!Cn(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const a=Za(e,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return tl(t,"x",i[0])||tl(t,"y",i[0])}return{}}(e,t),Gs.scales[r.type]),l=function(t,e){return t===e?"_index_":"_value_"}(a,s),c=i.scales||{};o[e]=Vn(Object.create(null),[{axis:a},r,c[a],c[l]])}),t.data.datasets.forEach(i=>{const s=i.type||t.type,r=i.indexAxis||Ga(s,e),a=(Us[s]||{}).scales||{};Object.keys(a).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),s=i[e+"AxisID"]||e;o[s]=o[s]||Object.create(null),Vn(o[s],[{axis:e},n[s],a[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];Vn(e,[Gs.scales[e.type],Gs.scale])}),o}function il(t){const e=t.options||(t.options={});e.plugins=Dn(e.plugins,{}),e.scales=el(t,e)}function nl(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const sl=new Map,ol=new Set;function rl(t,e){let i=sl.get(t);return i||(i=e(),sl.set(t,i),ol.add(i)),i}const al=(t,e,i)=>{const n=Un(e,i);void 0!==n&&t.add(n)};class ll{constructor(t){this._config=function(t){return(t=t||{}).data=nl(t.data),il(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=nl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),il(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return rl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return rl(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return rl(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return rl(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:s}=this,o=this._cachedScopes(t,i),r=o.get(e);if(r)return r;const a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>al(a,t,e))),e.forEach(t=>al(a,n,t)),e.forEach(t=>al(a,Us[s]||{},t)),e.forEach(t=>al(a,Gs,t)),e.forEach(t=>al(a,qs,t))});const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),ol.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Us[e]||{},Gs.datasets[e]||{},{type:e},Gs,qs]}resolveNamedOptions(t,e,i,n=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=cl(this._resolverCache,t,n);let a=o;if(function(t,e){const{isScriptable:i,isIndexable:n}=Oo(t);for(const s of e){const e=i(s),o=n(s),r=(o||e)&&t[s];if(e&&(Xn(r)||hl(r))||o&&Tn(r))return!0}return!1}(o,e)){s.$shared=!1;a=Mo(o,i=Xn(i)?i():i,this.createResolver(t,i,r))}for(const t of e)s[t]=a[t];return s}createResolver(t,e,i=[""],n){const{resolver:s}=cl(this._resolverCache,t,i);return Cn(e)?Mo(s,e,void 0,n):s}}function cl(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const s=i.join();let o=n.get(s);if(!o){o={resolver:So(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(s,o)}return o}const hl=t=>Cn(t)&&Object.getOwnPropertyNames(t).some(e=>Xn(t[e]));const dl=["top","bottom","left","right","chartArea"];function ul(t,e){return"top"===t||"bottom"===t||-1===dl.indexOf(t)&&"x"===e}function fl(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function pl(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Rn(i&&i.onComplete,[t],e)}function gl(t){const e=t.chart,i=e.options.animation;Rn(i&&i.onProgress,[t],e)}function ml(t){return Uo()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const bl={},vl=t=>{const e=ml(t);return Object.values(bl).filter(t=>t.canvas===e).pop()};function yl(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const o=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=o)}}}class xl{static defaults=Gs;static instances=bl;static overrides=Us;static registry=qa;static version="4.5.1";static getChart=vl;static register(...t){qa.add(...t),_l()}static unregister(...t){qa.remove(...t),_l()}constructor(t,e){const i=this.config=new ll(e),n=ml(t),s=vl(n);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Uo()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?ba:La}(n)),this.platform.updateConfig(i);const r=this.platform.acquireContext(n,o.aspectRatio),a=r&&r.canvas,l=a&&a.height,c=a&&a.width;this.id=En(),this.ctx=r,this.canvas=a,this.width=c,this.height=l,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ya,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),o.resizeDelay||0),this._dataChanges=[],bl[this.id]=this,r&&a?(yr.listen(this,"complete",pl),yr.listen(this,"progress",gl),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:s}=this;return An(t)?e&&s?s:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return qa}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return to(this.canvas,this.ctx),this}stop(){return yr.stop(this),this}resize(t,e){yr.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,t,e,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,tr(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Rn(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){jn(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let s=[];e&&(s=s.concat(Object.keys(e).map(t=>{const i=e[t],n=Za(t,i),s="r"===n,o="x"===n;return{options:i,dposition:s?"chartArea":o?"bottom":"left",dtype:s?"radialLinear":o?"category":"linear"}}))),jn(s,e=>{const s=e.options,o=s.id,r=Za(o,s),a=Dn(s.type,e.dtype);void 0!==s.position&&ul(s.position,r)===ul(e.dposition)||(s.position=e.dposition),n[o]=!0;let l=null;if(o in i&&i[o].type===a)l=i[o];else{l=new(qa.getScale(a))({id:o,type:a,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(s,t)}),jn(n,(t,e)=>{t||delete i[e]}),jn(i,t=>{ga.configure(this,t,t.options),ga.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(fl("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){jn(this.scales,t=>{ga.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);Jn(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e){yl(t,n,"_removeElements"===i?-s:s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;ga.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],jn(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},n=br(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(n&&so(e,n),t.controller.draw(),n&&oo(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return no(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const s=ia.modes[e];return"function"==typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=ko(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,n);Yn(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(s,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),yr.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};jn(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():o()}unbindEvents(){jn(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},jn(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,o,r,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),r=0,a=t.length;r{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!Fn(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=s(e,t),r=i?t:s(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:s}=this,o=e,r=this._getActiveElements(t,n,i,o),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,Rn(s.onHover,[t,r,this],this),a&&Rn(s.onClick,[t,r,this],this));const c=!Fn(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}function _l(){return jn(xl.instances,t=>t._plugins.invalidate())}function wl(t,e,i,n){const s=bo(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(i-e)/2,r=Math.min(o,n*e/2),a=t=>{const e=(i-Math.min(o,t))*n/2;return vs(t,0,Math.min(o,e))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:vs(s.innerStart,0,r),innerEnd:vs(s.innerEnd,0,r)}}function kl(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function Sl(t,e,i,n,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=e,d=Math.max(e.outerRadius+n+i-c,0),u=h>0?h+n+i+c:0;let f=0;const p=s-l;if(n){const t=((h>0?h-n:0)+(d>0?d-n:0))/2;f=(p-(0!==t?p*t/(t+n):p))/2}const g=(p-Math.max(.001,p*d-i/Gn)/d)/2,m=l+g+f,b=s-g-f,{outerStart:v,outerEnd:y,innerStart:x,innerEnd:_}=wl(e,u,d,b-m),w=d-v,k=d-y,S=m+v/w,M=b-y/k,O=u+x,E=u+_,A=m+x/O,T=b-_/E;if(t.beginPath(),o){const e=(S+M)/2;if(t.arc(r,a,d,S,e),t.arc(r,a,d,e,M),y>0){const e=kl(k,M,r,a);t.arc(e.x,e.y,y,M,b+es)}const i=kl(E,b,r,a);if(t.lineTo(i.x,i.y),_>0){const e=kl(E,T,r,a);t.arc(e.x,e.y,_,b+es,T+Math.PI)}const n=(b-_/u+(m+x/u))/2;if(t.arc(r,a,u,b-_/u,n,!0),t.arc(r,a,u,n,m+x/u,!0),x>0){const e=kl(O,A,r,a);t.arc(e.x,e.y,x,A+Math.PI,m-es)}const s=kl(w,m,r,a);if(t.lineTo(s.x,s.y),v>0){const e=kl(w,S,r,a);t.arc(e.x,e.y,v,m-es,S)}}else{t.moveTo(r,a);const e=Math.cos(S)*d+r,i=Math.sin(S)*d+a;t.lineTo(e,i);const n=Math.cos(M)*d+r,s=Math.sin(M)*d+a;t.lineTo(n,s)}t.closePath()}function Ml(t,e,i,n,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=e,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u,borderRadius:f}=l,p="inner"===l.borderAlign;if(!c)return;t.setLineDash(d||[]),t.lineDashOffset=u,p?(t.lineWidth=2*c,t.lineJoin=h||"round"):(t.lineWidth=c,t.lineJoin=h||"bevel");let g=e.endAngle;if(o){Sl(t,e,i,n,g,s);for(let e=0;es?(c=s/l,t.arc(o,r,l,i+c,n-c,!0)):t.arc(o,r,s,i+es,n-es),t.closePath(),t.clip()}(t,e,g),l.selfJoin&&g-r>=Gn&&0===f&&"miter"!==h&&function(t,e,i){const{startAngle:n,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=e,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/r,ms(n-i));if(t.beginPath(),t.arc(s,o,r-c/2,n+d/2,i-d/2),a>0){const e=Math.min(c/a,ms(n-i));t.arc(s,o,a+c/2,i-e/2,n+e/2,!0)}else{const e=Math.min(c/2,r*ms(n-i));if("round"===h)t.arc(s,o,e,i-Gn/2,n+Gn/2,!0);else if("bevel"===h){const r=2*e*e,a=-r*Math.cos(i+Gn/2)+s,l=-r*Math.sin(i+Gn/2)+o,c=r*Math.cos(n+Gn/2)+s,h=r*Math.sin(n+Gn/2)+o;t.lineTo(a,l),t.lineTo(c,h)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}(t,e,g),o||(Sl(t,e,i,n,g,s),t.stroke())}function Ol(t,e,i=e){t.lineCap=Dn(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Dn(i.borderDash,e.borderDash)),t.lineDashOffset=Dn(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Dn(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Dn(i.borderWidth,e.borderWidth),t.strokeStyle=Dn(i.borderColor,e.borderColor)}function El(t,e,i){t.lineTo(i.x,i.y)}function Al(t,e,i={}){const n=t.length,{start:s=0,end:o=n-1}=i,{start:r,end:a}=e,l=Math.max(s,r),c=Math.min(o,a),h=sa&&o>a;return{count:n,start:l,loop:e.loop,ilen:c(r+(c?a-t:t))%o,y=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=s[v(0)],t.moveTo(d.x,d.y)),h=0;h<=a;++h){if(d=s[v(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ip&&(p=i),m=(b*m+e)/++b):(y(),t.lineTo(e,i),u=n,b=0,f=p=i),g=i}y()}function Pl(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?Cl:Tl}const Ll="function"==typeof Path2D;function Dl(t,e,i,n){Ll&&!e.options.segment?function(t,e,i,n){let s=e._path;s||(s=e._path=new Path2D,e.path(s,i,n)&&s.closePath()),Ol(t,e.options),t.stroke(s)}(t,e,i,n):function(t,e,i,n){const{segments:s,options:o}=e,r=Pl(e);for(const a of s)Ol(t,o,a.style),t.beginPath(),r(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}class Il extends Da{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;$o(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const o=!!t._loop,{start:r,end:a}=function(t,e,i,n){let s=0,o=e-1;if(i&&!n)for(;ss&&t[o%e].skip;)o--;return o%=e,{start:s,end:o}}(i,s,o,n);return fr(t,!0===n?[{start:r,end:a,loop:o}]:function(t,e,i,n){const s=t.length,o=[];let r,a=e,l=t[e];for(r=e+1;r<=i;++r){const i=t[r%s];i.skip||i.stop?l.skip||(n=!1,o.push({start:e%s,end:(r-1)%s,loop:n}),e=a=i.stop?r:null):(a=r,l.skip&&(e=r)),l=i}return null!==a&&o.push({start:e%s,end:a%s,loop:n}),o}(i,r,a"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:s,distance:o}=fs(n,{x:t,y:e}),{startAngle:r,endAngle:a,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,u=Dn(h,a-r),f=bs(s,r,a)&&r!==a,p=u>=Kn||f,g=ys(o,l+d,c+d);return p&&g}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:a,spacing:l}=this.options,c=(n+s)/2,h=(o+r+l+a)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/4,s=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>Kn?Math.floor(i/Kn):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*n,Math.sin(r)*n);const a=n*(1-Math.sin(Math.min(Gn,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,n,s){const{fullCircles:o,startAngle:r,circumference:a}=e;let l=e.endAngle;if(o){Sl(t,e,i,n,l,s);for(let e=0;et.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ul(t){return Hl[t%Hl.length]}function ql(t){return $l[t%$l.length]}function Yl(t){let e=0;return(i,n)=>{const s=t.getDatasetMeta(n).controller;s instanceof $r?e=function(t,e){return t.backgroundColor=t.data.map(()=>Ul(e++)),e}(i,e):s instanceof Ur?e=function(t,e){return t.backgroundColor=t.data.map(()=>ql(e++)),e}(i,e):s&&(e=function(t,e){return t.borderColor=Ul(e),t.backgroundColor=ql(e),++e}(i,e))}}function Xl(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var Jl={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:n},options:s}=t.config,{elements:o}=s,r=Xl(n)||(a=s)&&(a.borderColor||a.backgroundColor)||o&&Xl(o)||"rgba(0,0,0,0.1)"!==Gs.borderColor||"rgba(0,0,0,0.1)"!==Gs.backgroundColor;var a;if(!i.forceOverride&&r)return;const l=Yl(t);n.forEach(l)}};function Gl(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Kl(t){t.data.datasets.forEach(t=>{Gl(t)})}var Ql={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Kl(t);const n=t.width;t.data.datasets.forEach((e,s)=>{const{_data:o,indexAxis:r}=e,a=t.getDatasetMeta(s),l=o||e.data;if("y"===wo([r,t.options.indexAxis]))return;if(!a.controller.supportsDecimation)return;const c=t.scales[a.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let{start:h,count:d}=function(t,e){const i=e.length;let n,s=0;const{iScale:o}=t,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(s=vs(_s(e,o.axis,r).lo,0,i-1)),n=c?vs(_s(e,o.axis,a).hi+1,s,i)-s:i-s,{start:s,count:n}}(a,l);if(d<=(i.threshold||4*n))return void Gl(e);let u;switch(An(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":u=function(t,e,i,n,s){const o=s.samples||n;if(o>=i)return t.slice(e,e+i);const r=[],a=(i-2)/(o-2);let l=0;const c=e+i-1;let h,d,u,f,p,g=e;for(r[l++]=t[g],h=0;hu&&(u=f,d=t[n],p=n);r[l++]=d,g=p}return r[l++]=t[c],r}(l,h,d,n,i);break;case"min-max":u=function(t,e,i,n){let s,o,r,a,l,c,h,d,u,f,p=0,g=0;const m=[],b=e+i-1,v=t[e].x,y=t[b].x-v;for(s=e;sf&&(f=a,h=s),p=(g*p+o.x)/++g;else{const i=s-1;if(!An(c)&&!An(h)){const e=Math.min(c,h),n=Math.max(c,h);e!==d&&e!==i&&m.push({...t[e],x:p}),n!==d&&n!==i&&m.push({...t[n],x:p})}s>0&&i!==d&&m.push(t[i]),m.push(o),l=e,g=0,u=f=a,c=h=d=s}}return m}(l,h,d,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=u})},destroy(t){Kl(t)}};function Zl(t,e,i,n){if(n)return;let s=e[t],o=i[t];return"angle"===t&&(s=ms(s),o=ms(o)),{property:t,start:s,end:o}}function tc(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function ec(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function ic(t,e){let i=[],n=!1;return Tn(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:n=null}=t||{},s=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=tc(t,e,s);const r=s[t],a=s[e];null!==n?(o.push({x:r.x,y:n}),o.push({x:a.x,y:n})):null!==i&&(o.push({x:i,y:r.y}),o.push({x:i,y:a.y}))}),o}(t,e),i.length?new Il({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function nc(t){return t&&!1!==t.fill}function sc(t,e,i){let n=t[e].fill;const s=[e];let o;if(!i)return n;for(;!1!==n&&-1===s.indexOf(n);){if(!Pn(n))return n;if(o=t[n],!o)return!1;if(o.visible)return n;s.push(n),n=o.fill}return!1}function oc(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=Dn(i&&i.target,i);void 0===n&&(n=!!e.backgroundColor);if(!1===n||null===n)return!1;if(!0===n)return"origin";return n}(t);if(Cn(n))return!isNaN(n.value)&&n;let s=parseFloat(n);return Pn(s)&&Math.floor(s)===s?function(t,e,i,n){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=n)return!1;return i}(n[0],e,s,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function rc(t,e,i){const n=[];for(let s=0;s=0;--e){const i=s[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),n&&i.fill&&hc(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;nc(i)&&hc(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;nc(n)&&"beforeDatasetDraw"===i.drawTime&&hc(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const bc=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}};class vc extends Da{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Rn(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,n=_o(i.font),s=n.size,o=this._computeTitleHeight(),{boxWidth:r,itemHeight:a}=bc(i,s);let l,c;e.font=n.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(o,s,r,a)+10):(c=this.maxHeight,l=this._fitCols(o,n,r,a)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:s,maxWidth:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],c=n+r;let h=t;s.textAlign="left",s.textBaseline="middle";let d=-1,u=-c;return this.legendItems.forEach((t,f)=>{const p=i+e/2+s.measureText(t.text).width;(0===f||l[l.length-1]+p+2*r>o)&&(h+=c,l[l.length-(f>0?0:1)]=0,u+=c,d++),a[f]={left:0,top:u,row:d,width:p,height:n},l[l.length-1]+=p+r}),h}_fitCols(t,e,i,n){const{ctx:s,maxHeight:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-t;let h=r,d=0,u=0,f=0,p=0;return this.legendItems.forEach((t,o)=>{const{itemWidth:g,itemHeight:m}=function(t,e,i,n,s){const o=function(t,e,i,n){let s=t.text;s&&"string"!=typeof s&&(s=s.reduce((t,e)=>t.length>e.length?t:e));return e+i.size/2+n.measureText(s).width}(n,t,e,i),r=function(t,e,i){let n=t;"string"!=typeof e.text&&(n=yc(e,i));return n}(s,n,e.lineHeight);return{itemWidth:o,itemHeight:r}}(i,e,s,t,n);o>0&&u+m+2*r>c&&(h+=d+r,l.push({width:d,height:u}),f+=d+r,p++,d=u=0),a[o]={left:f,top:u,col:p,width:g,height:m},d=Math.max(d,g),u+=m+r}),h+=d,l.push({width:d,height:u}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:s}}=this,o=rr(s,this.left,this.width);if(this.isHorizontal()){let s=0,r=Ts(i,this.left+n,this.right-this.lineWidths[s]);for(const a of e)s!==a.row&&(s=a.row,r=Ts(i,this.left+n,this.right-this.lineWidths[s])),a.top+=this.top+t+n,a.left=o.leftForLtr(o.x(r),a.width),r+=a.width+n}else{let s=0,r=Ts(i,this.top+t+n,this.bottom-this.columnSizes[s].height);for(const a of e)a.col!==s&&(s=a.col,r=Ts(i,this.top+t+n,this.bottom-this.columnSizes[s].height)),a.top=r,a.left+=this.left+n,a.left=o.leftForLtr(o.x(a.left),a.width),r+=a.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;so(t,this),this._draw(),oo(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:s,labels:o}=t,r=Gs.color,a=rr(t.rtl,this.left,this.width),l=_o(o.font),{padding:c}=o,h=l.size,d=h/2;let u;this.drawTitle(),n.textAlign=a.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:f,boxHeight:p,itemHeight:g}=bc(o,h),m=this.isHorizontal(),b=this._computeTitleHeight();u=m?{x:Ts(s,this.left+c,this.right-i[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:Ts(s,this.top+b+c,this.bottom-e[0].height),line:0},ar(this.ctx,t.textDirection);const v=g+c;this.legendItems.forEach((y,x)=>{n.strokeStyle=y.fontColor,n.fillStyle=y.fontColor;const _=n.measureText(y.text).width,w=a.textAlign(y.textAlign||(y.textAlign=o.textAlign)),k=f+d+_;let S=u.x,M=u.y;a.setWidth(this.width),m?x>0&&S+k+c>this.right&&(M=u.y+=v,u.line++,S=u.x=Ts(s,this.left+c,this.right-i[u.line])):x>0&&M+v>this.bottom&&(S=u.x=S+e[u.line].width+c,u.line++,M=u.y=Ts(s,this.top+b+c,this.bottom-e[u.line].height));if(function(t,e,i){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;n.save();const s=Dn(i.lineWidth,1);if(n.fillStyle=Dn(i.fillStyle,r),n.lineCap=Dn(i.lineCap,"butt"),n.lineDashOffset=Dn(i.lineDashOffset,0),n.lineJoin=Dn(i.lineJoin,"miter"),n.lineWidth=s,n.strokeStyle=Dn(i.strokeStyle,r),n.setLineDash(Dn(i.lineDash,[])),o.usePointStyle){const r={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:s},l=a.xPlus(t,f/2);io(n,r,l,e+d,o.pointStyleWidth&&f)}else{const o=e+Math.max((h-p)/2,0),r=a.leftForLtr(t,f),l=yo(i.borderRadius);n.beginPath(),Object.values(l).some(t=>0!==t)?uo(n,{x:r,y:o,w:f,h:p,radius:l}):n.rect(r,o,f,p),n.fill(),0!==s&&n.stroke()}n.restore()}(a.x(S),M,y),S=((t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e)(w,S+f+d,m?S+k:this.right,t.rtl),function(t,e,i){ho(n,i.text,t,e+g/2,l,{strikethrough:i.hidden,textAlign:a.textAlign(i.textAlign)})}(a.x(S),M,y),m)u.x+=k+c;else if("string"!=typeof y.text){const t=l.lineHeight;u.y+=yc(y,t)+c}else u.y+=v}),lr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=_o(e.font),n=xo(e.padding);if(!e.display)return;const s=rr(t.rtl,this.left,this.width),o=this.ctx,r=e.position,a=i.size/2,l=n.top+a;let c,h=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,h=Ts(t.align,h,this.right-d);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);c=l+Ts(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=Ts(r,h,h+d);o.textAlign=s.textAlign(As(r)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,ho(o,e.text,u,c,i)}_computeTitleHeight(){const t=this.options.title,e=_o(t.font),i=xo(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,s;if(ys(t,this.left,this.right)&&ys(e,this.top,this.bottom))for(s=this.legendHitBoxes,i=0;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const l=t.controller.getStyle(i?0:void 0),c=xo(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:s||l.textAlign,borderRadius:r&&(a||l.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class _c extends Da{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=Tn(i.text)?i.text.length:1;this._padding=xo(i.padding);const s=n*_o(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:s,options:o}=this,r=o.align;let a,l,c,h=0;return this.isHorizontal()?(l=Ts(r,i,s),c=e+t,a=s-i):("left"===o.position?(l=i+t,c=Ts(r,n,e),h=-.5*Gn):(l=s-t,c=Ts(r,e,n),h=.5*Gn),a=n-e),{titleX:l,titleY:c,maxWidth:a,rotation:h}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=_o(e.font),n=i.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:r,rotation:a}=this._drawArgs(n);ho(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:a,textAlign:As(e.align),textBaseline:"middle",translation:[s,o]})}}var wc={id:"title",_element:_c,start(t,e,i){!function(t,e){const i=new _c({ctx:t.ctx,options:e,chart:t});ga.configure(t,i,e),ga.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;ga.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;ga.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const kc=new WeakMap;var Sc={id:"subtitle",start(t,e,i){const n=new _c({ctx:t.ctx,options:i,chart:t});ga.configure(t,n,i),ga.addBox(t,n),kc.set(t,n)},stop(t){ga.removeBox(t,kc.get(t)),kc.delete(t)},beforeUpdate(t,e,i){const n=kc.get(t);ga.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Mc={average(t){if(!t.length)return!1;let e,i,n=new Set,s=0,o=0;for(e=0,i=t.length;et+e)/n.size,y:s/o}},nearest(t,e){if(!t.length)return!1;let i,n,s,o=e.x,r=e.y,a=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i-1?t.split("\n"):t}function Ac(t,e){const{element:i,datasetIndex:n,index:s}=e,o=t.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:t,label:r,parsed:o.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function Tc(t,e){const i=t.chart.ctx,{body:n,footer:s,title:o}=t,{boxWidth:r,boxHeight:a}=e,l=_o(e.bodyFont),c=_o(e.titleFont),h=_o(e.footerFont),d=o.length,u=s.length,f=n.length,p=xo(e.padding);let g=p.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b){g+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing}u&&(g+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let v=0;const y=function(t){m=Math.max(m,i.measureText(t).width+v)};return i.save(),i.font=c.string,jn(t.title,y),i.font=l.string,jn(t.beforeBody.concat(t.afterBody),y),v=e.displayColors?r+2+e.boxPadding:0,jn(n,t=>{jn(t.before,y),jn(t.lines,y),jn(t.after,y)}),v=0,i.font=h.string,jn(t.footer,y),i.restore(),m+=p.width,{width:m,height:g}}function Cc(t,e,i,n){const{x:s,width:o}=i,{width:r,chartArea:{left:a,right:l}}=t;let c="center";return"center"===n?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),function(t,e,i,n){const{x:s,width:o}=n,r=i.caretSize+i.caretPadding;return"left"===t&&s+o+r>e.width||"right"===t&&s-o-r<0||void 0}(c,t,e,i)&&(c="center"),c}function Pc(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Cc(t,e,i,n),yAlign:n}}function Lc(t,e,i,n){const{caretSize:s,caretPadding:o,cornerRadius:r}=t,{xAlign:a,yAlign:l}=i,c=s+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=yo(r);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const g=function(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}(e,l,c);return"center"===l?"left"===a?p+=c:"right"===a&&(p-=c):"left"===a?p-=Math.max(h,u)+s:"right"===a&&(p+=Math.max(d,f)+s),{x:vs(p,0,n.width-e.width),y:vs(g,0,n.height-e.height)}}function Dc(t,e,i){const n=xo(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function Ic(t){return Oc([],Ec(t))}function Rc(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const jc={beforeTitle:On,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex{const e={before:[],lines:[],after:[]},s=Rc(i,t);Oc(e.before,Ec(Fc(s,"beforeLabel",this,t))),Oc(e.lines,Fc(s,"label",this,t)),Oc(e.after,Ec(Fc(s,"afterLabel",this,t))),n.push(e)}),n}getAfterBody(t,e){return Ic(Fc(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=Fc(i,"beforeFooter",this,t),s=Fc(i,"footer",this,t),o=Fc(i,"afterFooter",this,t);let r=[];return r=Oc(r,Ec(n)),r=Oc(r,Ec(s)),r=Oc(r,Ec(o)),r}_createItems(t){const e=this._active,i=this.chart.data,n=[],s=[],o=[];let r,a,l=[];for(r=0,a=e.length;rt.filter(e,n,s,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),jn(l,e=>{const i=Rc(t.callbacks,e);n.push(Fc(i,"labelColor",this,e)),s.push(Fc(i,"labelPointStyle",this,e)),o.push(Fc(i,"labelTextColor",this,e))}),this.labelColors=n,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,o=[];if(n.length){const t=Mc[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Tc(this,i),r=Object.assign({},t,e),a=Pc(this.chart,i,r),l=Lc(i,r,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:h}=yo(r),{x:d,y:u}=t,{width:f,height:p}=e;let g,m,b,v,y,x;return"center"===s?(y=u+p/2,"left"===n?(g=d,m=g-o,v=y+o,x=y-o):(g=d+f,m=g+o,v=y-o,x=y+o),b=g):(m="left"===n?d+Math.max(a,c)+o:"right"===n?d+f-Math.max(l,h)-o:this.caretX,"top"===s?(v=u,y=v-o,g=m-o,b=m+o):(v=u+p,y=v+o,g=m+o,b=m-o),x=v),{x1:g,x2:m,x3:b,y1:v,y2:y,y3:x}}drawTitle(t,e,i){const n=this.title,s=n.length;let o,r,a;if(s){const l=rr(i.rtl,this.x,this.width);for(t.x=Dc(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=_o(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,a=0;a0!==t)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,uo(t,{x:e,y:f,w:l,h:a,radius:r}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),uo(t,{x:i,y:f+1,w:l-2,h:a-2,radius:r}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(e,f,l,a),t.strokeRect(e,f,l,a),t.fillStyle=o.backgroundColor,t.fillRect(i,f+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:l,boxPadding:c}=i,h=_o(i.bodyFont);let d=h.lineHeight,u=0;const f=rr(i.rtl,this.x,this.width),p=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+s},g=f.textAlign(o);let m,b,v,y,x,_,w;for(e.textAlign=o,e.textBaseline="middle",e.font=h.string,t.x=Dc(this,g,i),e.fillStyle=i.bodyColor,jn(this.beforeBody,p),u=r&&"right"!==g?"center"===o?l/2+c:l+2+c:0,y=0,_=n.length;y<_;++y){for(m=n[y],b=this.labelTextColors[y],e.fillStyle=b,jn(m.before,p),v=m.lines,r&&v.length&&(this._drawColorBox(e,t,y,f,i),d=Math.max(h.lineHeight,a)),x=0,w=v.length;x0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=Mc[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Tc(this,t),r=Object.assign({},i,this._size),a=Pc(e,t,r),l=Lc(t,r,a,e);n._to===l.x&&s._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=xo(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,n,e),ar(t,e.textDirection),s.y+=o.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),lr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),s=!Fn(i,n),o=this._positionChanged(n,e);(s||o)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,s=this._active||[],o=this._getActiveElements(t,s,e,i),r=this._positionChanged(o,t),a=e||!Fn(o,s)||r;return a&&(this._active=o,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));const o=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,o=Mc[s.position].call(this,t,e);return!1!==o&&(i!==o.x||n!==o.y)}}var Bc={id:"tooltip",_element:zc,positioners:Mc,afterInit(t,e,i){i&&(t.tooltip=new zc({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:jc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Nc=Object.freeze({__proto__:null,Colors:Jl,Decimation:Ql,Filler:mc,Legend:xc,SubTitle:Sc,Title:wc,Tooltip:Bc});function Wc(t,e,i,n){const s=t.indexOf(e);if(-1===s)return((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n);return s!==t.lastIndexOf(e)?i:s}function Vc(t){const e=this.getLabels();return t>=0&&tf&&(S=as(k*S/f/u)*u),An(a)||(x=Math.pow(10,a),S=Math.ceil(S*x)/x),"ticks"===n?(_=Math.floor(p/S)*S,w=Math.ceil(g/S)*S):(_=p,w=g),m&&b&&s&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((r-o)/s,S/1e3)?(k=Math.round(Math.min((r-o)/S,c)),S=(r-o)/k,_=o,w=r):v?(_=m?o:_,w=b?r:w,k=l-1,S=(w-_)/k):(k=(w-_)/S,k=rs(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const M=Math.max(us(S),us(_));x=Math.pow(10,An(a)?M:a),_=Math.round(_*x)/x,w=Math.round(w*x)/x;let O=0;for(m&&(d&&_!==o?(i.push({value:o}),_r)break;i.push({value:t})}return b&&d&&w!==r?i.length&&rs(i[i.length-1].value,r,$c(r,y,t))?i[i.length-1].value=r:i.push({value:r}):b&&w!==r||i.push({value:w}),i}function $c(t,e,{horizontal:i,minRotation:n}){const s=hs(n),o=(i?Math.sin(s):Math.cos(s))||.001,r=.75*e*(""+t).length;return Math.min(e/o,r)}class Uc extends Ha{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return An(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:s}=this;const o=t=>n=e?n:t,r=t=>s=i?s:t;if(t){const t=os(n),e=os(s);t<0&&e<0?r(0):t>0&&e>0&&o(0)}if(n===s){let e=0===s?1:Math.abs(.05*s);r(s+e),t||o(n-e)}this.min=n,this.max=s}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=Hc({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&cs(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Vs(t,this.chart.options.locale,this.options.ticks.format)}}class qc extends Uc{static id="linear";static defaults={ticks:{callback:$s.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pn(t)?t:0,this.max=Pn(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=hs(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,s.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Yc=t=>Math.floor(ss(t)),Xc=(t,e)=>Math.pow(10,Yc(t)+e);function Jc(t){return 1===t/Math.pow(10,Yc(t))}function Gc(t,e,i){const n=Math.pow(10,i),s=Math.floor(t/n);return Math.ceil(e/n)-s}function Kc(t,{min:e,max:i}){e=Ln(t.min,e);const n=[],s=Yc(e);let o=function(t,e){let i=Yc(e-t);for(;Gc(t,e,i)>10;)i++;for(;Gc(t,e,i)<10;)i--;return Math.min(i,Yc(t))}(e,i),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((e-l)*r)/r,h=Math.floor((e-l)/a/10)*a*10;let d=Math.floor((c-h)/Math.pow(10,o)),u=Ln(t.min,Math.round((l+h+d*Math.pow(10,o))*r)/r);for(;u=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),u=Math.round((l+h+d*Math.pow(10,o))*r)/r;const f=Ln(t.max,u);return n.push({value:f,major:Jc(f),significand:d}),n}class Qc extends Ha{static id="logarithmic";static defaults={ticks:{callback:$s.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Uc.prototype.parse.apply(this,[t,e]);if(0!==i)return Pn(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pn(t)?Math.max(0,t):null,this.max=Pn(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Pn(this._userMin)&&(this.min=t===Xc(this.min,0)?Xc(this.min,-1):Xc(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const s=e=>i=t?i:e,o=t=>n=e?n:t;i===n&&(i<=0?(s(1),o(10)):(s(Xc(i,-1)),o(Xc(n,1)))),i<=0&&s(Xc(n,-1)),n<=0&&o(Xc(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=Kc({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&cs(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":Vs(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ss(t),this._valueRange=ss(this.max)-ss(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ss(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Zc(t){const e=t.ticks;if(e.display&&t.display){const t=xo(e.backdropPadding);return Dn(e.font&&e.font.size,Gs.font.size)+t.height}return 0}function th(t,e,i){return i=Tn(i)?i:[i],{w:Qs(t,e.string,i),h:i.length*e.lineHeight}}function eh(t,e,i,n,s){return t===n||t===s?{start:e-i/2,end:e+i/2}:ts?{start:e-i,end:e}:{start:e,end:e+i}}function ih(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],s=[],o=t._pointLabels.length,r=t.options.pointLabels,a=r.centerPointLabels?Gn/o:0;for(let l=0;le.r&&(a=(n.end-e.r)/o,t.r=Math.max(t.r,e.r+a)),s.starte.b&&(l=(s.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}function sh(t,e,i){const n=t.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=i,l=t.getPointPosition(e,n+s+r,o),c=Math.round(ds(ms(l.angle+es))),h=function(t,e,i){90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e);return t}(l.y,a.h,c),d=function(t){if(0===t||180===t)return"center";if(t<180)return"left";return"right"}(c),u=function(t,e,i){"right"===i?t-=e:"center"===i&&(t-=e/2);return t}(l.x,a.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:u,top:h,right:u+a.w,bottom:h+a.h}}function oh(t,e){if(!e)return!0;const{left:i,top:n,right:s,bottom:o}=t;return!(no({x:i,y:n},e)||no({x:i,y:o},e)||no({x:s,y:n},e)||no({x:s,y:o},e))}function rh(t,e,i){const{left:n,top:s,right:o,bottom:r}=i,{backdropColor:a}=e;if(!An(a)){const i=yo(e.borderRadius),l=xo(e.backdropPadding);t.fillStyle=a;const c=n-l.left,h=s-l.top,d=o-n+l.width,u=r-s+l.height;Object.values(i).some(t=>0!==t)?(t.beginPath(),uo(t,{x:c,y:h,w:d,h:u,radius:i}),t.fill()):t.fillRect(c,h,d,u)}}function ah(t,e,i,n){const{ctx:s}=t;if(i)s.arc(t.xCenter,t.yCenter,e,0,Kn);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let o=1;ot,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=xo(Zc(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Pn(t)&&!isNaN(t)?t:0,this.max=Pn(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Zc(this.options))}generateTickLabels(t){Uc.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{const i=Rn(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?ih(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){return ms(t*(Kn/(this._pointLabels.length||1))+hs(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(An(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(An(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t=0;s--){const e=t._pointLabelItems[s];if(!e.visible)continue;const o=n.setContext(t.getPointLabelContext(s));rh(i,o,e);const r=_o(o.font),{x:a,y:l,textAlign:c}=e;ho(i,t._pointLabels[s],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}(this,o),n.display&&this.ticks.forEach((t,e)=>{if(0!==e||0===e&&this.min<0){a=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),r=n.setContext(i),l=s.setContext(i);!function(t,e,i,n,s){const o=t.ctx,r=e.circular,{color:a,lineWidth:l}=e;!r&&!n||!a||!l||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),ah(t,i,r,n),o.closePath(),o.stroke(),o.restore())}(this,r,a,o,l)}}),i.display){for(t.save(),r=o-1;r>=0;r--){const n=i.setContext(this.getPointLabelContext(r)),{color:s,lineWidth:o}=n;o&&s&&(t.lineWidth=o,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,a=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),l=this.getPointPosition(r,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,r)=>{if(0===r&&this.min>=0&&!e.reverse)return;const a=i.setContext(this.getContext(r)),l=_o(a.font);if(s=this.getDistanceFromCenterForValue(this.ticks[r].value),a.showLabelBackdrop){t.font=l.string,o=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=xo(a.backdropPadding);t.fillRect(-o/2-e.left,-s-l.size/2-e.top,o+e.width,l.size+e.height)}ho(t,n.label,0,-s,l,{color:a.color,strokeColor:a.textStrokeColor,strokeWidth:a.textStrokeWidth})}),t.restore()}drawTitle(){}}const ch={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},hh=Object.keys(ch);function dh(t,e){return t-e}function uh(t,e){if(An(e))return null;const i=t._adapter,{parser:n,round:s,isoWeekday:o}=t._parseOpts;let r=e;return"function"==typeof n&&(r=n(r)),Pn(r)||(r="string"==typeof n?i.parse(r,n):i.parse(r)),null===r?null:(s&&(r="week"!==s||!ls(o)&&!0!==o?i.startOf(r,s):i.startOf(r,"isoWeek",o)),+r)}function fh(t,e,i,n){const s=hh.length;for(let o=hh.indexOf(t);o=e?i[n]:i[s]]=!0}}else t[e]=!0}function gh(t,e,i){const n=[],s={},o=e.length;let r,a;for(r=0;r=0&&(e[l].major=!0);return e}(t,n,s,i):n}class mh extends Ha{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),n=this._adapter=new Jr(t.adapters.date);n.init(e),Vn(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:uh(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:s,minDefined:o,maxDefined:r}=this.getUserBounds();function a(t){o||isNaN(t.min)||(n=Math.min(n,t.min)),r||isNaN(t.max)||(s=Math.max(s,t.max))}o&&r||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=Pn(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),s=Pn(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,s-1),this.max=Math.max(n+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const s=this.min,o=function(t,e,i){let n=0,s=t.length;for(;nn&&t[s-1]>i;)s--;return n>0||s=hh.indexOf(i);o--){const i=hh[o];if(ch[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return hh[i?hh.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=hh.indexOf(t)+1,i=hh.length;e+t.value))}initOffsets(t=[]){let e,i,n=0,s=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),s=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=vs(n,0,o),s=vs(s,0,o),this._offsets={start:n,end:s,factor:1/(n+1+s)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,s=n.time,o=s.unit||fh(s.minUnit,e,i,this._getLabelCapacity(e)),r=Dn(n.ticks.stepSize,1),a="week"===o&&s.isoWeekday,l=ls(a)||!0===a,c={};let h,d,u=e;if(l&&(u=+t.startOf(u,"isoWeek",a)),u=+t.startOf(u,l?"day":o),t.diff(i,e,o)>1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+o);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;h+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,n=this._unit,s=e||i[n];return this._adapter.format(t,s)}_tickFormatFunction(t,e,i,n){const s=this.options,o=s.ticks.callback;if(o)return Rn(o,[t,e,i],this);const r=s.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&r[a],h=l&&r[l],d=i[e],u=l&&h&&d&&d.major;return this._adapter.format(t,n||(u?h:c))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=_s(t,"pos",e)),({pos:n,time:o}=t[a]),({pos:s,time:r}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=_s(t,"time",e)),({time:n,pos:o}=t[a]),({time:s,pos:r}=t[l]));const c=s-n;return c?o+(r-o)*(e-n)/c:o}var vh=Object.freeze({__proto__:null,CategoryScale:class extends Ha{static id="category";static defaults={ticks:{callback:Vc}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(An(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:vs(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:Wc(i,t,Dn(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){return Vc.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:qc,LogarithmicScale:Qc,RadialLinearScale:lh,TimeScale:mh,TimeSeriesScale:class extends mh{static id="timeseries";static defaults=mh.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=bh(e,this.min),this._tableRange=bh(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let o,r,a,l,c;for(o=0,r=t.length;o=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,r=n.length;ot-e)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(bh(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return bh(this._table,i*this._tableRange+this._minPos,!0)}}});const yh=[qr,Vl,Nc,vh];xl.register(...yh);const xh=xl;var _h=i(998),wh=i.n(_h);const kh={data:{},nonce:"",context:null,init(t){this.context=t;const e=t.querySelectorAll("[data-progress]"),i=t.querySelectorAll("[data-chart]");[...e].forEach(t=>{t.dataset.url&&(this.data[t.dataset.url]||(this.data[t.dataset.url]={items:[],poll:null}),this.data[t.dataset.url].items.push(t)),"line"===t.dataset.progress?this.line(t):"circle"===t.dataset.progress&&this.circle(t),this.nonce||(this.nonce=t.dataset?.nonce)});for(const t in this.data)this.getValues(t);[...i].forEach(t=>{const e={labels:JSON.parse(t.dataset.dates),datasets:[{backgroundColor:t.dataset.color,borderColor:t.dataset.color,data:JSON.parse(t.dataset.data),cubicInterpolationMode:"monotone"}]};new xh(t,{type:"line",data:e,options:{responsive:!0,radius:0,interaction:{intersect:!1},plugins:{legend:{display:!1}},scales:{y:{suggestedMin:0,ticks:{color:"#999999",callback:(t,e)=>wh()(t,{decimals:2,scale:"SI"})},grid:{color:"#d3dce3"}},x:{ticks:{color:"#999999"},grid:{color:"#d3dce3"}}}}})})},line(t){new(Ui().Line)(t,{strokeWidth:2,easing:"easeInOut",duration:1400,color:t.dataset.color,trailColor:"#d3dce3",trailWidth:2,svgStyle:{width:"100%",height:"100%",display:"block"}}).animate(t.dataset.value/100)},circle(t){t.dataset.basetext=t.dataset.text,t.dataset.text="";const e=t.dataset.value,i=this;if(t.bar=new(Ui().Circle)(t,{strokeWidth:3,easing:"easeInOut",duration:1400,color:t.dataset.color,trailColor:"#d3dce3",trailWidth:3,svgStyle:null,text:{autoStyleContainer:!1,style:{color:"#222222"}},step(e,n){const s=Math.floor(100*n.value());i.setText(n,parseFloat(s),t.dataset.text)}}),!t.dataset.url){const i=e/100;t.bar.animate(i)}},getValues(t){this.data[t].poll&&(clearTimeout(this.data[t].poll),this.data[t].poll=null),Pt({path:t,method:"GET",headers:{"X-WP-Nonce":this.nonce}}).then(e=>{this.data[t].items.forEach(i=>{void 0!==e[i.dataset.basetext]?i.dataset.text=e[i.dataset.basetext]:i.dataset.text=i.dataset.basetext,i.bar.animate(e[i.dataset.value]),i.dataset.poll&&!this.data[t].poll&&(this.data[t].poll=setTimeout(()=>{this.getValues(t)},1e4))});for(const t in e){const i=this.context.querySelectorAll(`[data-key="${t}"]`),n=this.context.querySelectorAll(`[data-text="${t}"]`);i.forEach(i=>{i.dataset.value=e[t],i.dispatchEvent(new Event("focus"))}),n.forEach(i=>{i.innerText=e[t],i.classList.contains("cld-toggle")&&(e[t]?i.classList.remove("hidden"):i.classList.add("hidden"))})}})},setText(t,e,i){if(!t)return;const n=document.createElement("span"),s=document.createElement("h2"),o=document.createTextNode(i);s.innerText=e+"%",n.appendChild(s),n.appendChild(o),t.setText(n)}},Sh=kh,Mh={key:"_cld_pending_state",data:null,pending:null,changed:!1,previous:{},init(){this.data=cldData.stateData?cldData.stateData:{};let t=localStorage.getItem(this.key);t&&(t=JSON.parse(t),this.data={...this.data,...t},this.sendStates()),this.previous=JSON.stringify(this.data)},_update(){this.pending&&(clearTimeout(this.pending),localStorage.removeItem(this.key)),this.previous!==JSON.stringify(this.data)&&(this.pending=setTimeout(()=>this.sendStates(),2e3),localStorage.setItem(this.key,JSON.stringify(this.data)))},set(t,e){this.data[t]&&this.data[t]===e||(this.data[t]=e,this._update())},get(t){let e=null;return this.data[t]&&(e=this.data[t]),e},sendStates(){fetch(cldData.stateURL,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":cldData.stateNonce},body:JSON.stringify(this.data)}).then(t=>t.json()).then(t=>{t.success&&(this.previous=JSON.stringify(t.state),localStorage.removeItem(this.key))})}},Oh={init(t){[...t.querySelectorAll("[data-remove]")].forEach(t=>{t.addEventListener("click",e=>{if(t.dataset.message&&!confirm(t.dataset.message))return;const i=document.getElementById(t.dataset.remove);i.parentNode.removeChild(i)})})}},Eh={values:{},inputs:{},context:null,init(t){this.context=t;t.querySelectorAll("[data-tags]").forEach(t=>this.bind(t))},bind(t){t.innerText=t.dataset.placeholder;const e=t.dataset.tags,i=document.getElementById(e),n=this.context.querySelectorAll(`[data-tags-delete="${e}"]`);this.values[e]=JSON.parse(i.value),this.inputs[e]=i,t.boundInput=e,t.boundDisplay=this.context.querySelector(`[data-tags-display="${e}"]`),t.boundDisplay.addEventListener("click",e=>{t.focus()}),t.addEventListener("focus",e=>{t.innerText=null}),t.addEventListener("blur",e=>{3{if("Tab"===i.key)3{"Comma"!==e.code&&"Enter"!==e.code&&"Tab"!==e.code&&"Space"!==e.code||(e.preventDefault(),3{t.parentNode.control=t,t.parentNode.style.width=getComputedStyle(t.parentNode).width,t.addEventListener("click",e=>{e.stopPropagation(),this.deleteTag(t)})})},deleteTag(t){const e=t.parentNode,i=e.dataset.inputId,n=this.values[i].indexOf(e.dataset.value);0<=n&&this.values[i].splice(n,1),e.style.width=0,e.style.opacity=0,e.style.padding=0,e.style.margin=0,setTimeout(()=>{e.parentNode.removeChild(e)},500),this.updateInput(i)},captureTag(t,e){if(this[t.dataset.format]&&"string"!=typeof(e=this[t.dataset.format](e)))return t.classList.add("pulse"),void setTimeout(()=>{t.classList.remove("pulse")},1e3);if(!this.validateUnique(t.boundDisplay,e)){const i=this.createTag(e);i.dataset.inputId=t.boundInput,this.values[t.boundInput].push(e),t.innerText=null,t.boundDisplay.insertBefore(i,t),i.style.width=getComputedStyle(i).width,i.style.opacity=1,this.updateInput(t.boundInput)}},createTag(t){const e=document.createElement("span"),i=document.createElement("span"),n=document.createElement("span");return e.classList.add("cld-input-tags-item"),i.classList.add("cld-input-tags-item-text"),n.className="cld-input-tags-item-delete dashicons dashicons-no-alt",n.addEventListener("click",()=>this.deleteTag(n)),i.innerText=t,e.appendChild(i),e.appendChild(n),e.dataset.value=t,e.style.opacity=0,e.control=n,e},validateUnique(t,e){const i=t.querySelector(`[data-value="${e}"]`);let n=!1;return i&&(i.classList.remove("pulse"),i.classList.add("pulse"),setTimeout(()=>{i.classList.remove("pulse")},500),n=!0),n},updateInput(t){this.inputs[t].value=JSON.stringify(this.values[t])},host(t){!1===/^(?:http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)/.test(t)&&(t="https://"+t);let e="";try{e=new URL(t)}catch(t){return t}return decodeURIComponent(e.host)}},Ah=Eh,Th={suffixInputs:null,init(t){this.suffixInputs=t.querySelectorAll("[data-suffix]"),[...this.suffixInputs].forEach(t=>this.bindInput(t))},bindInput(t){const e=document.getElementById(t.dataset.suffix),i=e.dataset.template.split("@value");this.setSuffix(e,i,t.value),t.addEventListener("change",()=>this.setSuffix(e,i,t.value)),t.addEventListener("input",()=>this.setSuffix(e,i,t.value))},setSuffix(t,e,i){t.innerHTML="",t.classList.add("hidden"),-1===["none","off",""].indexOf(i)&&t.classList.remove("hidden");const n=document.createTextNode(e.join(i));t.appendChild(n)}},Ch={wrappers:null,frame:null,error:'data:image/svg+xml;utf8,%26%23x26A0%3B︎',init(t){this.wrappers=t.querySelectorAll(".cld-size-items"),this.wrappers.forEach(t=>{const e=t.querySelectorAll(".cld-size-selector-item");e.forEach(i=>{i.addEventListener("click",()=>{e.forEach(t=>{delete t.dataset.selected}),i.dataset.selected=!0,this.switchSizeContent(t,i.dataset.size)})});const i=t.querySelector(".cld-size-selector-item[data-selected]");i&&this.switchSizeContent(t,i.dataset.size)})},switchSizeContent(t,e){t.querySelectorAll(".cld-size-content").forEach(t=>{t.style.display="none"});const i=t.querySelector(`.cld-size-content[data-size="${e}"]`);i&&(i.style.display="block",this.buildImages(t,i))},buildImages(t,e){const i=t.dataset.base,n=e.querySelector(".regular-text"),s=e.querySelector(".disable-toggle");if(!n||!s)return;const o=e.querySelectorAll("img"),r=n.value.length?n.value.replace(" ",""):n.placeholder;if(o.forEach(t=>{const e=t.dataset.size,o=t.dataset.file;s.checked?(n.disabled=!0,t.src=`${i}/${e}/${o}`):(n.disabled=!1,t.src=`${i}/${e},${r}/${o}`),t.bound||(t.addEventListener("error",()=>{t.src=this.error}),t.bound=!0)}),!n.bound){let i=null;n.addEventListener("input",()=>{i&&clearTimeout(i),i=setTimeout(()=>{this.buildImages(t,e)},1e3)}),n.bound=!0}s.bound||(s.addEventListener("change",()=>{this.buildImages(t,e)}),s.bound=!0);const a=e.querySelector(".clear-crop-input");a&&!a.bound&&(a.addEventListener("click",()=>{n.value="",this.buildImages(t,e)}),a.bound=!0)}},Ph={bindings:{},parent_check_data:{},check_parents:{},_init(t){const e=t.querySelectorAll("[data-condition]"),i=t.querySelectorAll("[data-toggle]"),n=t.querySelectorAll("[data-for]"),s=t.querySelectorAll("[data-tooltip]"),o=t.querySelectorAll("[data-bind-trigger]"),r=t.querySelectorAll("[data-main]"),a=t.querySelectorAll("[data-file]"),l=t.querySelectorAll("[data-auto-suffix]"),c=t.querySelectorAll("[data-confirm]"),h={};Mh.init(),Hi.bind(r),l.forEach(t=>this._autoSuffix(t)),o.forEach(t=>this._trigger(t)),i.forEach(t=>this._toggle(t)),e.forEach(t=>this._bind(t)),n.forEach(t=>this._alias(t)),a.forEach(t=>this._files(t,h)),Bi(s,{theme:"cloudinary",arrow:!1,placement:"bottom-start",aria:{content:"auto",expanded:"auto"},content:t=>document.getElementById(t.dataset.tooltip).innerHTML}),[...o].forEach(t=>{t.dispatchEvent(new Event("input"))}),c.forEach(t=>{t.addEventListener("click",e=>{confirm(t.dataset.confirm)||(e.preventDefault(),e.stopPropagation())})}),Sh.init(t),Oh.init(t),Ah.init(t),Th.init(t),Ch.init(t)},_autoSuffix(t){const e=t.dataset.autoSuffix;let i="";const n=[...e.split(";")].map(t=>0===t.indexOf("*")?(i=t.replace("*",""),i):t);t.addEventListener("change",()=>{const e=t.value.replace(" ",""),s=e.replace(/[^0-9]/g,""),o=e.replace(/[0-9]/g,"").toLowerCase();s&&(-1===n.indexOf(o)?t.value=s+i:t.value=s+o)}),t.dispatchEvent(new Event("change"))},_files(t,e){const i=t.dataset.parent;i&&(this.check_parents[i]=document.getElementById(i),this.parent_check_data[i]||(this.parent_check_data[i]=this.check_parents[i].value?JSON.parse(this.check_parents[i].value):[]),t.addEventListener("change",()=>{const n=this.parent_check_data[i].indexOf(t.value);t.checked?this.parent_check_data[i].push(t.value):this.parent_check_data[i].splice(n,1),e[i]&&clearTimeout(e[i]),e[i]=setTimeout(()=>{this._compileParent(i)},10)}))},_compileParent(t){this.check_parents[t].value=JSON.stringify(this.parent_check_data[t]),this.check_parents[t].dispatchEvent(new Event("change"))},_bind(t){t.condition=JSON.parse(t.dataset.condition);for(const e in t.condition)this.bindings[e]&&this.bindings[e].elements.push(t)},_trigger(t){const e=t.dataset.bindTrigger,i=this;i.bindings[e]={input:t,value:t.value,checked:!0,elements:[]},t.addEventListener("change",function(e){t.dispatchEvent(new Event("input"))}),t.addEventListener("input",function(){if(i.bindings[e].value=t.value,"checkbox"===t.type&&(i.bindings[e].checked=t.checked),"radio"!==t.type||!1!==t.checked)for(const n in i.bindings[e].elements)i.toggle(i.bindings[e].elements[n],t)})},_alias(t){t.addEventListener("click",function(){document.getElementById(t.dataset.for).dispatchEvent(new Event("click"))})},_toggle(t){const e=this,i=document.querySelector('[data-wrap="'+t.dataset.toggle+'"]');if(!i)return;const n=Mh.get(t.id);t.addEventListener("click",function(n){n.stopPropagation();const s=i.classList.contains("open")?"closed":"open";e.toggle(i,t,s)}),n!==t.dataset.state&&this.toggle(i,t,n)},toggle(t,e,i){if(!i){i="open";for(const e in t.condition){let n=this.bindings[e].value;const s=t.condition[e];"boolean"==typeof s&&(n=this.bindings[e].checked),s!==n&&(i="closed")}}"closed"===i?this.close(t,e):this.open(t,e),Mh.set(e.id,i)},open(t,e){const i=t.getElementsByClassName("cld-ui-input");t.classList.remove("closed"),t.classList.add("open"),e&&e.classList.contains("dashicons")&&(e.classList.remove("dashicons-arrow-down-alt2"),e.classList.add("dashicons-arrow-up-alt2")),[...i].forEach(function(t){t.dataset.disabled=!1})},close(t,e){const i=t.getElementsByClassName("cld-ui-input");t.classList.remove("open"),t.classList.add("closed"),e&&e.classList.contains("dashicons")&&(e.classList.remove("dashicons-arrow-up-alt2"),e.classList.add("dashicons-arrow-down-alt2")),[...i].forEach(function(t){t.dataset.disabled=!0})}},Lh=document.querySelectorAll(".cld-settings,.cld-meta-box");Lh.length&&Lh.forEach(t=>{t&&window.addEventListener("load",Ph._init(t))});const Dh={config:null,init(){this.config||"undefined"!=typeof cldData&&cldData.analytics&&cldData.analytics.enabled&&(this.config=cldData.analytics,Pt.use(Pt.createNonceMiddleware(this.config.nonce)))},track(t,e={},i="activation_funnel",n=null){if(this.config||this.init(),this.config&&this.config.enabled&&t)try{Pt({url:this.config.endpoint,method:"POST",data:{event_name:t,event_category:i,funnel_step:n,params:e}}).catch(()=>{})}catch(t){}},trackReliable(t,e={},i="activation_funnel"){if(this.config||this.init(),this.config&&this.config.enabled&&t)if(navigator.sendBeacon)try{const n=this.config.endpoint.includes("?")?"&":"?",s=this.config.endpoint+n+"_wpnonce="+encodeURIComponent(this.config.nonce),o=new Blob([JSON.stringify({event_name:t,event_category:i,funnel_step:null,params:e})],{type:"application/json"});navigator.sendBeacon(s,o)}catch(t){}else this.track(t,e,i)}};window.addEventListener("load",()=>Dh.init());const Ih=Dh,Rh={storageKey:"_cld_wizard",testing:null,connectAttempts:0,startedEntry:!1,startedTracked:!1,next:document.querySelector('[data-navigate="next"]'),back:document.querySelector('[data-navigate="back"]'),lock:document.getElementById("pad-lock"),lockIcon:document.getElementById("lock-icon"),options:document.querySelectorAll('.cld-ui-input[type="checkbox"]'),settings:document.getElementById("optimize"),tabBar:document.getElementById("wizard-tabs"),tracking:document.getElementById("tracking"),complete:document.getElementById("complete-wizard"),tabs:{"tab-1":document.getElementById("tab-icon-1"),"tab-2":document.getElementById("tab-icon-2"),"tab-3":document.getElementById("tab-icon-3")},content:{"tab-1":document.getElementById("tab-1"),"tab-2":document.getElementById("tab-2"),"tab-3":document.getElementById("tab-3"),"tab-4":document.getElementById("tab-4")},connection:{error:document.getElementById("connection-error"),success:document.getElementById("connection-success"),working:document.getElementById("connection-working")},debounceConnect:null,updateConnection:document.getElementById("update-connection"),cancelUpdateConnection:document.getElementById("cancel-update-connection"),config:{},didSave:!1,init(){if(!cldData.wizard)return;this.config=cldData.wizard.config,window.localStorage.getItem(this.storageKey)&&(this.config=JSON.parse(window.localStorage.getItem(this.storageKey))),document.location.hash.length&&this.hashChange(),Pt.use(Pt.createNonceMiddleware(cldData.wizard.saveNonce));const t=document.querySelectorAll("[data-navigate]"),e=document.getElementById("connect.cloudinary_url");this.updateConnection.addEventListener("click",()=>{this.lockNext(),e.parentNode.classList.remove("hidden"),this.cancelUpdateConnection.classList.remove("hidden"),this.updateConnection.classList.add("hidden")}),this.cancelUpdateConnection.addEventListener("click",()=>{this.unlockNext(),e.parentNode.classList.add("hidden"),this.cancelUpdateConnection.classList.add("hidden"),this.updateConnection.classList.remove("hidden"),this.config.cldString=!0,e.value="",this.connection.error.classList.remove("active"),this.connection.success.classList.add("active")}),[...t].forEach(t=>{t.addEventListener("click",()=>{this.navigate(t.dataset.navigate)})}),this.lock.addEventListener("click",()=>{this.lockIcon.classList.toggle("dashicons-unlock"),this.settings.classList.toggle("disabled"),this.options.forEach(t=>{t.disabled=t.disabled?"":"disabled"})}),e.addEventListener("input",t=>{this.lockNext(),this.startedEntry||(this.startedEntry=!0,Ih.track("credentials_entry_started",{},"activation_funnel",3));const i=e.value.replace("CLOUDINARY_URL=","");this.connection.error.classList.remove("active"),this.connection.success.classList.remove("active"),this.connection.working.classList.remove("active"),i.length&&(this.testing=i,this.debounceConnect&&clearTimeout(this.debounceConnect),this.debounceConnect=setTimeout(()=>{const t=this.evaluateConnectionString(i);Ih.track("credentials_format_validated",{format_valid:t,invalid_reason:t?"":this.invalidReason(i)},"activation_funnel",3),t?(this.connection.working.classList.add("active"),this.testConnection(i)):this.connection.error.classList.add("active")},500))}),this.config.cldString&&(e.parentNode.classList.add("hidden"),this.updateConnection.classList.remove("hidden"));const i=document.querySelector('a[href="https://cloudinary.com/signup"]');i&&i.addEventListener("click",()=>{Ih.track("wizard_signup_clicked",{},"activation_funnel",2)}),this.complete&&this.complete.addEventListener("click",()=>{Ih.track("wizard_dashboard_clicked",{},"activation_funnel",7)}),this.getTab(this.config.tab),this.initFeatures(),window.addEventListener("hashchange",t=>{this.hashChange()})},hashChange(){const t=parseInt(document.location.hash.replace("#",""));t&&0t&&this.getTab(t)},initFeatures(){const t=(t,e)=>{Ih.track("wizard_setting_toggled",{setting_key:t,enabled:e},"activation_funnel",4)},e=document.getElementById("media_library");e.checked=this.config.mediaLibrary,e.addEventListener("change",()=>{this.setConfig("mediaLibrary",e.checked),t("media_library",e.checked)});const i=document.getElementById("non_media");i.checked=this.config.nonMedia,i.addEventListener("change",()=>{this.setConfig("nonMedia",i.checked),t("non_media",i.checked)});const n=document.getElementById("advanced");n.checked=this.config.advanced,n.addEventListener("change",()=>{this.setConfig("advanced",n.checked),t("advanced",n.checked)})},getCurrent(){return this.content[`tab-${this.config.tab}`]},hideTabs(){Object.keys(this.content).forEach(t=>{this.hide(this.content[t])})},completeTab(t){this.incompleteTab(),Object.keys(this.tabs).forEach(e=>{const i=parseInt(this.tabs[e].dataset.tab);t>i?this.tabs[e].classList.add("complete"):t===i&&this.tabs[e].classList.add("active")})},incompleteTab(t){Object.keys(this.tabs).forEach(t=>{this.tabs[t].classList.remove("complete","active")})},getCurrentTab(){return this.tabs[`tab-icon-${this.config.tab}`]},getTab(t){if(4===t&&window.localStorage.getItem(this.storageKey)&&!this.didSave)return void this.saveConfig();const e=this.getCurrent(),i=document.getElementById(`tab-${t}`);switch(this.hideTabs(),this.completeTab(t),this.hide(document.getElementById(`tab-${this.config.tab}`)),e.classList.remove("active"),this.show(i),this.show(this.next),this.hide(this.lock),t){case 1:this.hide(this.back),this.unlockNext(),this.startedTracked||(this.startedTracked=!0,this.config.wizardStartedAt||this.setConfig("wizardStartedAt",Date.now()),Ih.track("wizard_started",{entry_point:this.getEntryPoint()},"activation_funnel",2));break;case 2:Ih.track("wizard_connect_viewed",{},"activation_funnel",3),this.show(this.back),this.config.cldString?this.showSuccess():(this.lockNext(),setTimeout(()=>{document.getElementById("connect.cloudinary_url").focus()},0)),this.updateConnection.classList.contains("hidden")&&this.lockNext();break;case 3:if(!this.config.cldString)return void(document.location.hash="1");Ih.track("wizard_settings_viewed",{},"activation_funnel",4),this.show(this.lock),this.show(this.back);break;case 4:if(!this.config.cldString)return void(document.location.hash="1");Ih.track("wizard_completed",{time_to_complete_sec:this.timeToCompleteSec()},"activation_funnel",6),this.hide(this.tabBar),this.hide(this.next),this.hide(this.back)}this.setConfig("tab",t)},navigate(t){"next"===t?this.navigateNext():"back"===t&&this.navigateBack()},navigateBack(){document.location.hash=this.config.tab-1},navigateNext(){document.location.hash=this.config.tab+1},showError(){this.connection.error.classList.add("active"),this.connection.success.classList.remove("active")},showSuccess(){this.connection.error.classList.remove("active"),this.connection.success.classList.add("active")},show(t){t.classList.remove("hidden"),t.style.display=""},hide(t){t.classList.add("hidden"),t.style.display="none"},lockNext(){this.next.disabled="disabled"},unlockNext(){this.next.disabled=""},evaluateConnectionString:t=>new RegExp(/^(?:CLOUDINARY_URL=)?(cloudinary:\/\/){1}(\d*)[:]{1}([^@]*)[@]{1}([^@]*)$/gim).test(t),invalidReason(t){const e=t.replace("CLOUDINARY_URL=","");if(0!==e.indexOf("cloudinary://"))return"missing_scheme";if(-1===e.indexOf("@"))return"missing_cloud_name";const i=e.replace("cloudinary://","").split("@")[0];return-1===i.indexOf(":")?"missing_secret":/^\d+$/.test(i.split(":")[0])?"invalid_format":"invalid_api_key"},getEntryPoint:()=>-1!==document.referrer.indexOf("plugins.php")?"auto_redirect":"menu",timeToCompleteSec(){const t=this.config.wizardStartedAt;return t?Math.max(0,Math.round((Date.now()-t)/1e3)):null},testConnection(t){this.connectAttempts+=1,Ih.track("connection_test_started",{attempt_number:this.connectAttempts},"activation_funnel",3),Pt({path:cldData.wizard.testURL,data:{cloudinary_url:t,attempt_number:this.connectAttempts},method:"POST"}).then(e=>{e.url===this.testing&&(this.connection.working.classList.remove("active"),"connection_error"===e.type?this.showError():"connection_success"===e.type&&(this.showSuccess(),this.unlockNext(),this.setConfig("cldString",t)))})},setConfig(t,e){this.config[t]=e,window.localStorage.setItem(this.storageKey,JSON.stringify(this.config))},saveConfig(){this.lockNext(),this.next.innerText=$("Setting up Cloudinary","cloudinary"),this.didSave=!0,Pt({path:cldData.wizard.saveURL,data:this.config,method:"POST"}).then(t=>{this.next.innerText=$("Next","cloudinary"),this.unlockNext(),this.getTab(4),window.localStorage.removeItem(this.storageKey)}).fail(t=>{this.didSave=!1})}};window.addEventListener("load",()=>Rh.init());const jh={select:document.getElementById("connect.offload"),tooltip:null,descriptions:{},change(){[...this.descriptions].forEach(t=>{t.classList.remove("selected")}),this.tooltip.querySelector("."+this.select.value).classList.add("selected")},addEventListener(){this.select.addEventListener("change",this.change.bind(this))},_init(){this.select&&(this.addEventListener(),this.tooltip=this.select.parentNode.querySelector(".cld-tooltip"),this.descriptions=this.tooltip.querySelectorAll("li"),this.change())}};window.addEventListener("load",()=>jh._init());const Fh={pageReloader:document.getElementById("page-reloader"),init(){if(!cldData.extensions)return;Pt.use(Pt.createNonceMiddleware(cldData.extensions.nonce));[...document.querySelectorAll("[data-extension]")].forEach(t=>{t.addEventListener("change",e=>{t.spinner||(t.spinner=this.createSpinner(),t.parentNode.appendChild(t.spinner)),t.debounce&&clearTimeout(t.debounce),t.debounce=setTimeout(()=>{this.toggleExtension(t),t.debounce=null},1e3)})})},toggleExtension(t){const e=t.dataset.extension,i=t.checked;Ih.track("extension_toggled",{extension_id:e,enabled:i},"features"),Pt({path:cldData.extensions.url,data:{extension:e,enabled:i},method:"POST"}).then(e=>{t.spinner&&(t.parentNode.removeChild(t.spinner),delete t.spinner),Object.keys(e).forEach(t=>{document.querySelectorAll(`[data-text="${t}"]`).forEach(i=>{i.innerText=e[t]})}),this.pageReloader.style.display="block"})},createSpinner(){const t=document.createElement("span");return t.classList.add("spinner"),t.classList.add("cld-extension-spinner"),t}};window.addEventListener("load",()=>Fh.init());const zh={tabButtonSelectors:null,selectedTabID:"",deselectOldTab(){document.getElementById(this.selectedTabID).classList.remove("is-active"),this.filterActive([...this.tabButtonSelectors]).classList.remove("is-active")},selectCurrentTab(t){this.selectedTabID=t.dataset.tab,t.classList.add("is-active"),document.getElementById(this.selectedTabID).classList.add("is-active")},selectTab(t){t.preventDefault(),t.target.classList.contains("is-active")||(this.deselectOldTab(),this.selectCurrentTab(t.target))},filterTabs(){[...this.tabButtonSelectors].forEach(t=>{t.dataset.tab&&t.addEventListener("click",this.selectTab.bind(this))})},filterActive:t=>t.filter(t=>t.classList.contains("is-active")).pop(),init(){this.tabButtonSelectors=document.querySelectorAll(".cld-page-tabs-tab button"),0!==this.tabButtonSelectors.length&&(this.selectCurrentTab(this.filterActive([...this.tabButtonSelectors])),this.filterTabs())}};window.addEventListener("load",()=>zh.init());const Bh={init(){document.querySelectorAll(".cld-special-offer-link").forEach(t=>{t.addEventListener("click",()=>{Ih.track("special_offer_clicked",{offer_id:"small_plan_29"},"settings")})})}};window.addEventListener("load",()=>Bh.init());i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p;window.$=window.jQuery})()})(); +(()=>{var t={951(t,e){var i,n,s,o;o=function(){var t="BKMGTPEZY".split("");function e(t,e){return t&&t.toLowerCase()===e.toLowerCase()}return function(i,n){return i="number"==typeof i?i:0,(n=n||{}).fixed="number"==typeof n.fixed?n.fixed:2,n.spacer="string"==typeof n.spacer?n.spacer:" ",n.calculate=function(t){var s=e(t,"si")?["k","B"]:["K","iB"],o=e(t,"si")?1e3:1024,r=Math.log(i)/Math.log(o)|0,a=i/Math.pow(o,r),l=a.toFixed(n.fixed);return r-1<3&&!e(t,"si")&&e(t,"jedec")&&(s[1]="B"),{suffix:r?(s[0]+"MGTPEZY")[r-1]+s[1]:1==(0|l)?"Byte":"Bytes",magnitude:r,result:a,fixed:l,bits:{result:a/8,fixed:(a/8).toFixed(n.fixed)}}},n.to=function(n,s){var o=e(s,"si")?1e3:1024,r=t.indexOf("string"==typeof n?n[0].toUpperCase():"B"),a=i;if(-1===r||0===r)return a.toFixed(2);for(;r>0;r--)a/=o;return a.toFixed(2)},n.human=function(t){var e=n.calculate(t);return e.fixed+n.spacer+e.suffix},n}},t.exports?t.exports=o():(n=[],void 0===(s="function"==typeof(i=o)?i.apply(e,n):i)||(t.exports=s))},998(t,e){var i,n,s;n=[],i=function(){"use strict";function t(t,e){var i,s,o;for(i=1,s=arguments.length;i>1].factor>t?s=e-1:n=e;return i[n]},r.prototype.parse=function(t,e){var i=t.match(this._regexp);if(null!==i){var s,o=i[3];if(n(this._prefixes,o))s=this._prefixes[o];else{if(e||(o=o.toLowerCase(),!n(this._lcPrefixes,o)))return;o=this._lcPrefixes[o],s=this._prefixes[o]}var r=+i[2];return void 0!==i[1]&&(r=-r),{factor:s,prefix:o,unit:i[4],value:r}}};var a={binary:r.create(",Ki,Mi,Gi,Ti,Pi,Ei,Zi,Yi".split(","),1024),SI:r.create("q,r,y,z,a,f,p,n,µ,m,,k,M,G,T,P,E,Z,Y,R,Q".split(","),1e3,-10)},l=t({},a.binary._prefixes),c=a.SI._prefixes;for(var h in c)c[h]>=1&&(l[h]=c[h]);var d=new r(l),u={maxDecimals:2,separator:" ",unit:""},f={rounding:"round",scale:"SI",strict:!1};function p(t,e){var n=i(e,u,"decimals"),s=E(t,e,void 0!==n?n:i(e,u,"maxDecimals"));t=void 0!==n?s.value.toFixed(n):String(s.value);var o=s.prefix+i(e,u,"unit");return""===o?t:t+i(e,u,"separator")+o}var g={scale:"binary",unit:"B"};function m(e,i){return p(e,void 0===i?g:t({},g,i))}function b(t,e){return x(_(t,e))}var v={scale:d,unit:"B"};function y(e,i){return x(w(e,void 0===i?v:t({},v,i),!0))}function x(t){var e=String(t.value).split(".")[1];if(void 0!==e&&-1===e.indexOf("e")){var i=Math.pow(10,e.length),n=Math.round(t.value*i)*t.factor;if(n%1==0&&Math.abs(n)<=s)return n/i}return t.value*t.factor}function _(t,e){return w(t,e,!1)}function w(t,e,n){if("string"!=typeof t)throw new TypeError("str must be a string");var s=o(a,i(e,f,"scale"));if(void 0===s)throw new Error("missing scale");var r=i(e,f,"strict"),l=i(e,f,"unit");if(void 0!==l){var c=(t=t.trim()).slice(-l.length);""!==l&&(c===l||n&&!r&&c.toLowerCase()===l.toLowerCase())?t=t.slice(0,-l.length):l=""}var h=s.parse(t,r);if(void 0===h||void 0!==l&&""!==h.unit)throw new Error("cannot parse str");return void 0!==l&&(h.unit=l),h}var k={ceil:function(t){return Math.ceil(+t.toPrecision(15))},floor:function(t){return Math.floor(+t.toPrecision(15))},round:Math.round},S={ceil:"floor",floor:"ceil"};function M(t,e){return t<10*e?10:1}function O(t,e){return E(t,e,i(e,f,"maxDecimals"))}function E(t,e,s){if("number"!=typeof t||t!=t)throw new TypeError("value must be a number");if(0===t)return{value:0,prefix:""};if(!isFinite(t))return{value:t,prefix:""};var r=t<0;r&&(t=-t);var l=o(a,i(e,f,"scale"));if(void 0===l)throw new Error("missing scale");var c=i(e,f,"rounding");if(!n(k,c))throw new Error("invalid rounding");r&&n(S,c)&&(c=S[c]);var h,d=k[c],u="auto"===s;void 0===s||u||(h=Math.pow(10,s));var p,g=i(e,f,"prefix");if(void 0!==g){if(!n(l._prefixes,g))throw new Error("invalid prefix");p=l._prefixes[g]}else{var m=l.findPrefix(t);if(void 0!==s)do{p=m.factor,u&&(h=M(t,p));var b=p/h;t=d(t/b)*b}while((m=l.findPrefix(t)).factor!==p);else p=m.factor;g=m.prefix}return u&&(h=M(t,p)),t=void 0===h?t/p:d(t*h/p)/h,{prefix:g,value:r?-t:t}}return p.bytes=m,p.parse=b,b.bytes=y,b.raw=_,p.raw=O,p.Scale=r,p},void 0===(s="function"==typeof i?i.apply(e,n):i)||(t.exports=s)},336(t){var e,i="loading"in HTMLImageElement.prototype,n="loading"in HTMLIFrameElement.prototype,s="onscroll"in window;function o(t){var e,i,n=[];"picture"===t.parentNode.tagName.toLowerCase()&&((i=(e=t.parentNode).querySelector("source[data-lazy-remove]"))&&e.removeChild(i),n=Array.prototype.slice.call(t.parentNode.querySelectorAll("source"))),n.push(t),n.forEach(function(t){t.hasAttribute("data-lazy-srcset")&&(t.setAttribute("srcset",t.getAttribute("data-lazy-srcset")),t.removeAttribute("data-lazy-srcset"))}),t.setAttribute("src",t.getAttribute("data-lazy-src")),t.removeAttribute("data-lazy-src")}function r(t){var o=document.createElement("div");for(o.innerHTML=function(t){var o=t.textContent||t.innerHTML,r="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 "+((o.match(/width=['"](\d+)['"]/)||!1)[1]||1)+" "+((o.match(/height=['"](\d+)['"]/)||!1)[1]||1)+"%27%3E%3C/svg%3E";return(/\n-1}function zt(t,e){var i=this.__data__,n=te(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this}function Bt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e1?i[s-1]:void 0,r=s>2?i[2]:void 0;for(o=t.length>3&&"function"==typeof o?(s--,o):void 0,r&&ke(i[0],i[1],r)&&(o=s<3?void 0:o,s=1),e=Object(e);++n-1&&t%1==0&&t0){if(++e>=o)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function De(t){if(null!=t){try{return ot.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ie(t,e){return t===e||t!=t&&e!=e}var Re=se(function(){return arguments}())?se:function(t){return He(t)&&rt.call(t,"callee")&&!bt.call(t,"callee")},je=Array.isArray;function Fe(t){return null!=t&&We(t.length)&&!Ne(t)}function ze(t){return He(t)&&Fe(t)}var Be=_t||Ke;function Ne(t){if(!Ve(t))return!1;var e=ne(t);return e==p||e==g||e==h||e==x}function We(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Ve(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function He(t){return null!=t&&"object"==typeof t}function $e(t){if(!He(t)||ne(t)!=y)return!1;var e=gt(t);if(null===e)return!0;var i=rt.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&ot.call(i)==ct}var Ue=X?K(X):re;function qe(t){return ge(t,Ye(t))}function Ye(t){return Fe(t)?Kt(t,!0):ae(t)}var Xe=me(function(t,e,i){le(t,e,i)});function Je(t){return function(){return t}}function Ge(t){return t}function Ke(){return!1}e.exports=Xe}).call(this)}).call(this,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,i,n){var s,o;s=self,o=function(){return function(){"use strict";var t={720:function(t,e,i){i.r(e),i.d(e,{Scene:function(){return ae},Tweenable:function(){return Mt},interpolate:function(){return ee},processTweens:function(){return bt},setBezierFunction:function(){return H},shouldScheduleUpdate:function(){return xt},tween:function(){return Ot},unsetBezierFunction:function(){return $}});var n={};i.r(n),i.d(n,{bounce:function(){return R},bouncePast:function(){return j},easeFrom:function(){return z},easeFromTo:function(){return F},easeInBack:function(){return A},easeInCirc:function(){return S},easeInCubic:function(){return c},easeInExpo:function(){return _},easeInOutBack:function(){return C},easeInOutCirc:function(){return O},easeInOutCubic:function(){return d},easeInOutExpo:function(){return k},easeInOutQuad:function(){return l},easeInOutQuart:function(){return p},easeInOutQuint:function(){return b},easeInOutSine:function(){return x},easeInQuad:function(){return r},easeInQuart:function(){return u},easeInQuint:function(){return g},easeInSine:function(){return v},easeOutBack:function(){return T},easeOutBounce:function(){return E},easeOutCirc:function(){return M},easeOutCubic:function(){return h},easeOutExpo:function(){return w},easeOutQuad:function(){return a},easeOutQuart:function(){return f},easeOutQuint:function(){return m},easeOutSine:function(){return y},easeTo:function(){return B},elastic:function(){return P},linear:function(){return o},swingFrom:function(){return D},swingFromTo:function(){return L},swingTo:function(){return I}});var s={};i.r(s),i.d(s,{afterTween:function(){return Jt},beforeTween:function(){return Xt},doesApply:function(){return qt},tweenCreated:function(){return Yt}});var o=function(t){return t},r=function(t){return Math.pow(t,2)},a=function(t){return-(Math.pow(t-1,2)-1)},l=function(t){return(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2)},c=function(t){return Math.pow(t,3)},h=function(t){return Math.pow(t-1,3)+1},d=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)},u=function(t){return Math.pow(t,4)},f=function(t){return-(Math.pow(t-1,4)-1)},p=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},g=function(t){return Math.pow(t,5)},m=function(t){return Math.pow(t-1,5)+1},b=function(t){return(t/=.5)<1?.5*Math.pow(t,5):.5*(Math.pow(t-2,5)+2)},v=function(t){return 1-Math.cos(t*(Math.PI/2))},y=function(t){return Math.sin(t*(Math.PI/2))},x=function(t){return-.5*(Math.cos(Math.PI*t)-1)},_=function(t){return 0===t?0:Math.pow(2,10*(t-1))},w=function(t){return 1===t?1:1-Math.pow(2,-10*t)},k=function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},S=function(t){return-(Math.sqrt(1-t*t)-1)},M=function(t){return Math.sqrt(1-Math.pow(t-1,2))},O=function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},E=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},A=function(t){var e=1.70158;return t*t*((e+1)*t-e)},T=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},C=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},P=function(t){return-1*Math.pow(4,-8*t)*Math.sin((6*t-1)*(2*Math.PI)/2)+1},L=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},D=function(t){var e=1.70158;return t*t*((e+1)*t-e)},I=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},R=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},j=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?2-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?2-(7.5625*(t-=2.25/2.75)*t+.9375):2-(7.5625*(t-=2.625/2.75)*t+.984375)},F=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},z=function(t){return Math.pow(t,4)},B=function(t){return Math.pow(t,.25)};function N(t,e,i,n,s,o){var r,a,l,c,h,d=0,u=0,f=0,p=function(t){return((d*t+u)*t+f)*t},g=function(t){return(3*d*t+2*u)*t+f},m=function(t){return t>=0?t:0-t};return d=1-(f=3*e)-(u=3*(n-e)-f),l=1-(h=3*i)-(c=3*(s-i)-h),r=t,a=function(t){return 1/(200*t)}(o),function(t){return((l*t+c)*t+h)*t}(function(t,e){var i,n,s,o,r,a;for(s=t,a=0;a<8;a++){if(o=p(s)-t,m(o)(n=1))return n;for(;io?i=s:n=s,s=.5*(n-i)+i}return s}(r,a))}var W,V=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.25,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.25,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.75,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.75;return function(s){return N(s,t,e,i,n,1)}},H=function(t,e,i,n,s){var o=V(e,i,n,s);return o.displayName=t,o.x1=e,o.y1=i,o.x2=n,o.y2=s,Mt.formulas[t]=o},$=function(t){return delete Mt.formulas[t]};function U(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function q(t,e){for(var i=0;it.length)&&(e=t.length);for(var i=0,n=new Array(e);ia?a:e;t._hasEnded=l>=a;var c=o-(a-l),h=t._filters.length>0;if(t._hasEnded)return t._render(r,t._data,c),t.stop(!0);h&&t._applyFilter(rt),l1&&void 0!==arguments[1]?arguments[1]:it,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Array.isArray(e))return V.apply(void 0,X(e));var n=Y(e);if(pt[e])return pt[e];if(n===ct||n===lt)for(var s in t)i[s]=e;else for(var o in t)i[o]=e[o]||it;return i},kt=function(t){t===ut?(ut=t._next)?ut._previous=null:ft=null:t===ft?(ft=t._previous)?ft._next=null:ut=null:(tt=t._previous,et=t._next,tt._next=et,et._previous=tt),t._previous=t._next=null},St="function"==typeof Promise?Promise:null;W=Symbol.toStringTag;var Mt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;U(this,t),Q(this,W,"Promise"),this._config={},this._data={},this._delay=0,this._filters=[],this._next=null,this._previous=null,this._timestamp=null,this._hasEnded=!1,this._resolve=null,this._reject=null,this._currentState=e||{},this._originalState={},this._targetState={},this._start=dt,this._render=dt,this._promiseCtor=St,i&&this.setConfig(i)}var e;return e=[{key:"_applyFilter",value:function(t){for(var e=this._filters.length;e>0;e--){var i=this._filters[e-e][t];i&&i(this)}}},{key:"tween",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return this._isPlaying&&this.stop(),!e&&this._config||this.setConfig(e),this._pausedAtTime=null,this._timestamp=t.now(),this._start(this.get(),this._data),this._delay&&this._render(this._currentState,this._data,0),this._resume(this._timestamp)}},{key:"setConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this._config;for(var n in e)i[n]=e[n];var s=i.promise,o=void 0===s?this._promiseCtor:s,r=i.start,a=void 0===r?dt:r,l=i.finish,c=i.render,h=void 0===c?this._config.step||dt:c,d=i.step,u=void 0===d?dt:d;this._data=i.data||i.attachment||this._data,this._isPlaying=!1,this._pausedAtTime=null,this._scheduleId=null,this._delay=e.delay||0,this._start=a,this._render=h||u,this._duration=i.duration||500,this._promiseCtor=o,l&&(this._resolve=l);var f=e.from,p=e.to,g=void 0===p?{}:p,m=this._currentState,b=this._originalState,v=this._targetState;for(var y in f)m[y]=f[y];var x=!1;for(var _ in m){var w=m[_];x||Y(w)!==ct||(x=!0),b[_]=w,v[_]=g.hasOwnProperty(_)?g[_]:w}if(this._easing=wt(this._currentState,i.easing,this._easing),this._filters.length=0,x){for(var k in t.filters)t.filters[k].doesApply(this)&&this._filters.push(t.filters[k]);this._applyFilter(at)}return this}},{key:"then",value:function(t,e){var i=this;return this._promise=new this._promiseCtor(function(t,e){i._resolve=t,i._reject=e}),this._promise.then(t,e)}},{key:"catch",value:function(t){return this.then().catch(t)}},{key:"finally",value:function(t){return this.then().finally(t)}},{key:"get",value:function(){return K({},this._currentState)}},{key:"set",value:function(t){this._currentState=t}},{key:"pause",value:function(){if(this._isPlaying)return this._pausedAtTime=t.now(),this._isPlaying=!1,kt(this),this}},{key:"resume",value:function(){return this._resume()}},{key:"_resume",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.now();return null===this._timestamp?this.tween():this._isPlaying?this._promise:(this._pausedAtTime&&(this._timestamp+=e-this._pausedAtTime,this._pausedAtTime=null),this._isPlaying=!0,null===ut?(ut=this,ft=this):(this._previous=ft,ft._next=this,ft=this),this)}},{key:"seek",value:function(e){e=Math.max(e,0);var i=t.now();return this._timestamp+e===0||(this._timestamp=i-e,mt(this,i)),this}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._isPlaying)return this;this._isPlaying=!1,kt(this);var e=this._filters.length>0;return t&&(e&&this._applyFilter(rt),gt(1,this._currentState,this._originalState,this._targetState,1,0,this._easing),e&&(this._applyFilter(st),this._applyFilter(ot))),this._resolve&&this._resolve({data:this._data,state:this._currentState,tweenable:this}),this._resolve=null,this._reject=null,this}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._currentState,i=this._data;return this._isPlaying?(this._reject&&this._reject({data:i,state:e,tweenable:this}),this._resolve=null,this._reject=null,this.stop(t)):this}},{key:"isPlaying",value:function(){return this._isPlaying}},{key:"hasEnded",value:function(){return this._hasEnded}},{key:"setScheduleFunction",value:function(e){t.setScheduleFunction(e)}},{key:"data",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t&&(this._data=K({},t)),this._data}},{key:"dispose",value:function(){for(var t in this)delete this[t]}}],e&&q(t.prototype,e),t}();function Ot(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new Mt;return e.tween(t),e.tweenable=e,e}Q(Mt,"now",function(){return Z}),Q(Mt,"setScheduleFunction",function(t){return ht=t}),Q(Mt,"filters",{}),Q(Mt,"formulas",pt),xt(!0);var Et,At,Tt=/(\d|-|\.)/,Ct=/([^\-0-9.]+)/g,Pt=/[0-9.-]+/g,Lt=(Et=Pt.source,At=/,\s*/.source,new RegExp("rgba?\\(".concat(Et).concat(At).concat(Et).concat(At).concat(Et,"(").concat(At).concat(Et,")?\\)"),"g")),Dt=/^.*\(/,It=/#([0-9]|[a-f]){3,6}/gi,Rt="VAL",jt=function(t,e){return t.map(function(t,i){return"_".concat(e,"_").concat(i)})};function Ft(t){return parseInt(t,16)}var zt=function(t){return"rgb(".concat((e=t,3===(e=e.replace(/#/,"")).length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[Ft(e.substr(0,2)),Ft(e.substr(2,2)),Ft(e.substr(4,2))]).join(","),")");var e},Bt=function(t,e,i){var n=e.match(t),s=e.replace(t,Rt);return n&&n.forEach(function(t){return s=s.replace(Rt,i(t))}),s},Nt=function(t){for(var e in t){var i=t[e];"string"==typeof i&&i.match(It)&&(t[e]=Bt(It,i,zt))}},Wt=function(t){var e=t.match(Pt),i=e.slice(0,3).map(Math.floor),n=t.match(Dt)[0];if(3===e.length)return"".concat(n).concat(i.join(","),")");if(4===e.length)return"".concat(n).concat(i.join(","),",").concat(e[3],")");throw new Error("Invalid rgbChunk: ".concat(t))},Vt=function(t){return t.match(Pt)},Ht=function(t,e){var i={};return e.forEach(function(e){i[e]=t[e],delete t[e]}),i},$t=function(t,e){return e.map(function(e){return t[e]})},Ut=function(t,e){return e.forEach(function(e){return t=t.replace(Rt,+e.toFixed(4))}),t},qt=function(t){for(var e in t._currentState)if("string"==typeof t._currentState[e])return!0;return!1};function Yt(t){var e=t._currentState;[e,t._originalState,t._targetState].forEach(Nt),t._tokenData=function(t){var e,i,n={};for(var s in t){var o=t[s];"string"==typeof o&&(n[s]={formatString:(e=o,i=void 0,i=e.match(Ct),i?(1===i.length||e.charAt(0).match(Tt))&&i.unshift(""):i=["",""],i.join(Rt)),chunkNames:jt(Vt(o),s)})}return n}(e)}function Xt(t){var e=t._currentState,i=t._originalState,n=t._targetState,s=t._easing,o=t._tokenData;!function(t,e){var i=function(i){var n=e[i].chunkNames,s=t[i];if("string"==typeof s){var o=s.split(" "),r=o[o.length-1];n.forEach(function(e,i){return t[e]=o[i]||r})}else n.forEach(function(e){return t[e]=s});delete t[i]};for(var n in e)i(n)}(s,o),[e,i,n].forEach(function(t){return function(t,e){var i=function(i){Vt(t[i]).forEach(function(n,s){return t[e[i].chunkNames[s]]=+n}),delete t[i]};for(var n in e)i(n)}(t,o)})}function Jt(t){var e=t._currentState,i=t._originalState,n=t._targetState,s=t._easing,o=t._tokenData;[e,i,n].forEach(function(t){return function(t,e){for(var i in e){var n=e[i],s=n.chunkNames,o=n.formatString,r=Ut(o,$t(Ht(t,s),s));t[i]=Bt(Lt,r,Wt)}}(t,o)}),function(t,e){for(var i in e){var n=e[i].chunkNames,s=t[n[0]];t[i]="string"==typeof s?n.map(function(e){var i=t[e];return delete t[e],i}).join(" "):s}}(s,o)}function Gt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function Kt(t){for(var e=1;e4&&void 0!==arguments[4]?arguments[4]:0,o=Kt({},t),r=wt(t,n);for(var a in Zt._filters.length=0,Zt.set({}),Zt._currentState=o,Zt._originalState=t,Zt._targetState=e,Zt._easing=r,te)te[a].doesApply(Zt)&&Zt._filters.push(te[a]);Zt._applyFilter("tweenCreated"),Zt._applyFilter("beforeTween");var l=gt(i,o,t,e,1,s,r);return Zt._applyFilter("afterTween"),l};function ie(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);it.strokeWidth&&(e=t.trailWidth);var i=50-e/2;return s.render(this._pathTemplate,{radius:i,"2radius":2*i})},o.prototype._trailString=function(t){return this._pathString(t)},e.exports=o},{"./shape":8,"./utils":10}],4:[function(t,e,i){var n=t("./shape"),s=t("./utils"),o=function(t,e){this._pathTemplate=e.vertical?"M {center},100 L {center},0":"M 0,{center} L 100,{center}",n.apply(this,arguments)};o.prototype=new n,o.prototype.constructor=o,o.prototype._initializeSvg=function(t,e){var i=e.vertical?"0 0 "+e.strokeWidth+" 100":"0 0 100 "+e.strokeWidth;t.setAttribute("viewBox",i),t.setAttribute("preserveAspectRatio","none")},o.prototype._pathString=function(t){return s.render(this._pathTemplate,{center:t.strokeWidth/2})},o.prototype._trailString=function(t){return this._pathString(t)},e.exports=o},{"./shape":8,"./utils":10}],5:[function(t,e,i){e.exports={Line:t("./line"),Circle:t("./circle"),SemiCircle:t("./semicircle"),Square:t("./square"),Path:t("./path"),Shape:t("./shape"),utils:t("./utils")}},{"./circle":3,"./line":4,"./path":6,"./semicircle":7,"./shape":8,"./square":9,"./utils":10}],6:[function(t,e,i){var n=t("shifty"),s=t("./utils"),o=n.Tweenable,r={easeIn:"easeInCubic",easeOut:"easeOutCubic",easeInOut:"easeInOutCubic"},a=function t(e,i){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");var n;i=s.extend({delay:0,duration:800,easing:"linear",from:{},to:{},step:function(){}},i),n=s.isString(e)?document.querySelector(e):e,this.path=n,this._opts=i,this._tweenable=null;var o=this.path.getTotalLength();this.path.style.strokeDasharray=o+" "+o,this.set(0)};a.prototype.value=function(){var t=this._getComputedDashOffset(),e=this.path.getTotalLength();return parseFloat((1-t/e).toFixed(6),10)},a.prototype.set=function(t){this.stop(),this.path.style.strokeDashoffset=this._progressToOffset(t);var e=this._opts.step;if(s.isFunction(e)){var i=this._easing(this._opts.easing);e(this._calculateTo(t,i),this._opts.shape||this,this._opts.attachment)}},a.prototype.stop=function(){this._stopTween(),this.path.style.strokeDashoffset=this._getComputedDashOffset()},a.prototype.animate=function(t,e,i){e=e||{},s.isFunction(e)&&(i=e,e={});var n=s.extend({},e),r=s.extend({},this._opts);e=s.extend(r,e);var a=this._easing(e.easing),l=this._resolveFromAndTo(t,a,n);this.stop(),this.path.getBoundingClientRect();var c=this._getComputedDashOffset(),h=this._progressToOffset(t),d=this;this._tweenable=new o,this._tweenable.tween({from:s.extend({offset:c},l.from),to:s.extend({offset:h},l.to),duration:e.duration,delay:e.delay,easing:a,step:function(t){d.path.style.strokeDashoffset=t.offset;var i=e.shape||d;e.step(t,i,e.attachment)}}).then(function(t){s.isFunction(i)&&i()}).catch(function(t){throw console.error("Error in tweening:",t),t})},a.prototype._getComputedDashOffset=function(){var t=window.getComputedStyle(this.path,null);return parseFloat(t.getPropertyValue("stroke-dashoffset"),10)},a.prototype._progressToOffset=function(t){var e=this.path.getTotalLength();return e-t*e},a.prototype._resolveFromAndTo=function(t,e,i){return i.from&&i.to?{from:i.from,to:i.to}:{from:this._calculateFrom(e),to:this._calculateTo(t,e)}},a.prototype._calculateFrom=function(t){return n.interpolate(this._opts.from,this._opts.to,this.value(),t)},a.prototype._calculateTo=function(t,e){return n.interpolate(this._opts.from,this._opts.to,t,e)},a.prototype._stopTween=function(){null!==this._tweenable&&(this._tweenable.stop(!0),this._tweenable=null)},a.prototype._easing=function(t){return r.hasOwnProperty(t)?r[t]:t},e.exports=a},{"./utils":10,shifty:2}],7:[function(t,e,i){var n=t("./shape"),s=t("./circle"),o=t("./utils"),r=function(t,e){this._pathTemplate="M 50,50 m -{radius},0 a {radius},{radius} 0 1 1 {2radius},0",this.containerAspectRatio=2,n.apply(this,arguments)};r.prototype=new n,r.prototype.constructor=r,r.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 50")},r.prototype._initializeTextContainer=function(t,e,i){t.text.style&&(i.style.top="auto",i.style.bottom="0",t.text.alignToBottom?o.setStyle(i,"transform","translate(-50%, 0)"):o.setStyle(i,"transform","translate(-50%, 50%)"))},r.prototype._pathString=s.prototype._pathString,r.prototype._trailString=s.prototype._trailString,e.exports=r},{"./circle":3,"./shape":8,"./utils":10}],8:[function(t,e,i){var n=t("./path"),s=t("./utils"),o="Object is destroyed",r=function t(e,i){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");if(0!==arguments.length){this._opts=s.extend({color:"#555",strokeWidth:1,trailColor:null,trailWidth:null,fill:null,text:{style:{color:null,position:"absolute",left:"50%",top:"50%",padding:0,margin:0,transform:{prefix:!0,value:"translate(-50%, -50%)"}},autoStyleContainer:!0,alignToBottom:!0,value:null,className:"progressbar-text"},svgStyle:{display:"block",width:"100%"},warnings:!1},i,!0),s.isObject(i)&&void 0!==i.svgStyle&&(this._opts.svgStyle=i.svgStyle),s.isObject(i)&&s.isObject(i.text)&&void 0!==i.text.style&&(this._opts.text.style=i.text.style);var o,r=this._createSvgView(this._opts);if(!(o=s.isString(e)?document.querySelector(e):e))throw new Error("Container does not exist: "+e);this._container=o,this._container.appendChild(r.svg),this._opts.warnings&&this._warnContainerAspectRatio(this._container),this._opts.svgStyle&&s.setStyles(r.svg,this._opts.svgStyle),this.svg=r.svg,this.path=r.path,this.trail=r.trail,this.text=null;var a=s.extend({attachment:void 0,shape:this},this._opts);this._progressPath=new n(r.path,a),s.isObject(this._opts.text)&&null!==this._opts.text.value&&this.setText(this._opts.text.value)}};r.prototype.animate=function(t,e,i){if(null===this._progressPath)throw new Error(o);this._progressPath.animate(t,e,i)},r.prototype.stop=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath.stop()},r.prototype.pause=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.pause()},r.prototype.resume=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.resume()},r.prototype.destroy=function(){if(null===this._progressPath)throw new Error(o);this.stop(),this.svg.parentNode.removeChild(this.svg),this.svg=null,this.path=null,this.trail=null,this._progressPath=null,null!==this.text&&(this.text.parentNode.removeChild(this.text),this.text=null)},r.prototype.set=function(t){if(null===this._progressPath)throw new Error(o);this._progressPath.set(t)},r.prototype.value=function(){if(null===this._progressPath)throw new Error(o);return void 0===this._progressPath?0:this._progressPath.value()},r.prototype.setText=function(t){if(null===this._progressPath)throw new Error(o);null===this.text&&(this.text=this._createTextContainer(this._opts,this._container),this._container.appendChild(this.text)),s.isObject(t)?(s.removeChildren(this.text),this.text.appendChild(t)):this.text.innerHTML=t},r.prototype._createSvgView=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");this._initializeSvg(e,t);var i=null;(t.trailColor||t.trailWidth)&&(i=this._createTrail(t),e.appendChild(i));var n=this._createPath(t);return e.appendChild(n),{svg:e,path:n,trail:i}},r.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 100")},r.prototype._createPath=function(t){var e=this._pathString(t);return this._createPathElement(e,t)},r.prototype._createTrail=function(t){var e=this._trailString(t),i=s.extend({},t);return i.trailColor||(i.trailColor="#eee"),i.trailWidth||(i.trailWidth=i.strokeWidth),i.color=i.trailColor,i.strokeWidth=i.trailWidth,i.fill=null,this._createPathElement(e,i)},r.prototype._createPathElement=function(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",t),i.setAttribute("stroke",e.color),i.setAttribute("stroke-width",e.strokeWidth),e.fill?i.setAttribute("fill",e.fill):i.setAttribute("fill-opacity","0"),i},r.prototype._createTextContainer=function(t,e){var i=document.createElement("div");i.className=t.text.className;var n=t.text.style;return n&&(t.text.autoStyleContainer&&(e.style.position="relative"),s.setStyles(i,n),n.color||(i.style.color=t.color)),this._initializeTextContainer(t,e,i),i},r.prototype._initializeTextContainer=function(t,e,i){},r.prototype._pathString=function(t){throw new Error("Override this function for each progress bar")},r.prototype._trailString=function(t){throw new Error("Override this function for each progress bar")},r.prototype._warnContainerAspectRatio=function(t){if(this.containerAspectRatio){var e=window.getComputedStyle(t,null),i=parseFloat(e.getPropertyValue("width"),10),n=parseFloat(e.getPropertyValue("height"),10);s.floatEquals(this.containerAspectRatio,i/n)||(console.warn("Incorrect aspect ratio of container","#"+t.id,"detected:",e.getPropertyValue("width")+"(width)","/",e.getPropertyValue("height")+"(height)","=",i/n),console.warn("Aspect ratio of should be",this.containerAspectRatio))}},e.exports=r},{"./path":6,"./utils":10}],9:[function(t,e,i){var n=t("./shape"),s=t("./utils"),o=function(t,e){this._pathTemplate="M 0,{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{strokeWidth}",this._trailTemplate="M {startMargin},{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{halfOfStrokeWidth}",n.apply(this,arguments)};o.prototype=new n,o.prototype.constructor=o,o.prototype._pathString=function(t){var e=100-t.strokeWidth/2;return s.render(this._pathTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2})},o.prototype._trailString=function(t){var e=100-t.strokeWidth/2;return s.render(this._trailTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2,startMargin:t.strokeWidth/2-t.trailWidth/2})},e.exports=o},{"./shape":8,"./utils":10}],10:[function(t,e,i){var n=t("lodash.merge"),s="Webkit Moz O ms".split(" "),o=.001;function r(t,e){var i=t;for(var n in e)if(e.hasOwnProperty(n)){var s=e[n],o=new RegExp("\\{"+n+"\\}","g");i=i.replace(o,s)}return i}function a(t,e,i){for(var n=t.style,o=0;oo[0];break;case"lt":i=this.value{const e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.hasOwn(t,e),(()=>{let t;globalThis.importScripts&&(t=globalThis.location+"");const e=globalThis.document;if(!t&&e&&("SCRIPT"===e.currentScript?.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){const i=e.getElementsByTagName("script");if(i.length){let e=i.length-1;for(;e>-1&&(!t||!/^https?:/.test(t));)t=i[e--].src}}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),i.p=t})(),(()=>{"use strict";i(336),i(712),i(544);const t={sample:{image:document.getElementById("transformation-sample-image"),video:document.getElementById("transformation-sample-video")},preview:{image:document.getElementById("sample-image"),video:document.getElementById("sample-video")},fields:document.getElementsByClassName("cld-ui-input"),button:{image:document.getElementById("refresh-image-preview"),video:document.getElementById("refresh-video-preview")},spinner:{image:document.getElementById("image-loader"),video:document.getElementById("video-loader")},optimization:{image:document.getElementById("image_settings.image_optimization"),video:document.getElementById("video_settings.video_optimization")},error_container:document.getElementById("cld-preview-error"),activeItem:null,elements:{image:[],video:[]},_placeItem(t){null!==t&&(t.style.display="block",t.style.visibility="visible",t.style.position="absolute",t.style.top=t.parentElement.clientHeight/2-t.clientHeight/2+"px",t.style.left=t.parentElement.clientWidth/2-t.clientWidth/2+"px")},_setLoading(t){this.sample[t]&&(this.button[t].style.display="block",this._placeItem(this.button[t]),this.preview[t].style.opacity="0.1")},_build(t){if(!this.sample[t])return;this.sample[t].innerHTML="",this.elements[t]=[];for(const e of this.fields){if(t!==e.dataset.context||e.dataset.disabled&&"true"===e.dataset.disabled)continue;let i=e.value.trim();if(i.length){if("select-one"===e.type){if("none"===i||!1===this.optimization[t].checked)continue;i=e.dataset.meta+"_"+i}else t=e.dataset.context,e.dataset.meta&&(i=e.dataset.meta+"_"+i),e.dataset.suffix&&(i+=e.dataset.suffix),i=this._transformations(i,t,!0);i&&this.elements[t].push(i)}}let e="";this.elements[t].length&&(e="/"+this._getGlobalTransformationElements(t).replace(/ /g,"%20")),this.sample[t].textContent=e,this.sample[t].parentElement.href="https://res.cloudinary.com/demo/"+this.sample[t].parentElement.innerText.trim().replace("../","").replace(/ /g,"%20")},_clearLoading(t){this.spinner[t].style.visibility="hidden",this.activeItem=null,this.preview[t].style.opacity=1},_refresh(t,e){if(t&&t.preventDefault(),!this.sample[e])return;const i=this,n=CLD_GLOBAL_TRANSFORMATIONS[e].preview_url+this._getGlobalTransformationElements(e)+CLD_GLOBAL_TRANSFORMATIONS[e].file;if(this.button[e].style.display="none",this._placeItem(this.spinner[e]),"image"===e){const t=new Image;t.onload=function(){i.preview[e].src=this.src,i._clearLoading(e),i.error_container&&(i.error_container.style.display="none"),t.remove()},t.onerror=function(){const t=i.elements[e].includes("f_mp4");i.error_container&&(i.error_container.style.display="block",t?(i.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[e].warning.replace("%s","f_mp4"),i.error_container.classList.replace("settings-alert-error","settings-alert-warning")):(i.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[e].error,i.error_container.classList.replace("settings-alert-warning","settings-alert-error"))),i._clearLoading(e)},t.src=n}else{const t=i._transformations(i._getGlobalTransformationElements(e),e);samplePlayer.source({publicId:"sailing_boat",transformation:t}),i._clearLoading(e)}},_getGlobalTransformationElements(t){let e=[];return e.push(this.elements[t].slice(0,2).join(",")),e.push(this.elements[t].slice(2).join(",")),e=e.filter(t=>t).join("/"),e},_transformations(t,e,i=!1){const n=CLD_GLOBAL_TRANSFORMATIONS[e].valid_types;let s=null;const o=t.split("/"),r=[];for(let t=0;t":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},n=["(","?"],s={")":["("],":":["?","?:"]},o=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var r={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,i){if(t)throw e;return i}};function a(t){var i=function(t){for(var i,r,a,l,c=[],h=[];i=t.match(o);){for(r=i[0],(a=t.substr(0,i.index).trim())&&c.push(a);l=h.pop();){if(s[r]){if(s[r][0]===l){r=s[r][1]||r;break}}else if(n.indexOf(l)>=0||e[l]1===t?0:1},d=/^i18n\.(n?gettext|has_translation)(_|$)/;var u=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var f=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var p=function(t,e){return function(i,n,s,o=10){const r=t[e];if(!f(i))return;if(!u(n))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof o)return void console.error("If specified, the hook priority must be a number.");const a={callback:s,priority:o,namespace:n};if(r[i]){const t=r[i].handlers;let e;for(e=t.length;e>0&&!(o>=t[e-1].priority);e--);e===t.length?t[e]=a:t.splice(e,0,a),r.__current.forEach(t=>{t.name===i&&t.currentIndex>=e&&t.currentIndex++})}else r[i]={handlers:[a],runs:0};"hookAdded"!==i&&t.doAction("hookAdded",i,n,s,o)}};var g=function(t,e,i=!1){return function(n,s){const o=t[e];if(!f(n))return;if(!i&&!u(s))return;if(!o[n])return 0;let r=0;if(i)r=o[n].handlers.length,o[n]={runs:o[n].runs,handlers:[]};else{const t=o[n].handlers;for(let e=t.length-1;e>=0;e--)t[e].namespace===s&&(t.splice(e,1),r++,o.__current.forEach(t=>{t.name===n&&t.currentIndex>=e&&t.currentIndex--}))}return"hookRemoved"!==n&&t.doAction("hookRemoved",n,s),r}};var m=function(t,e){return function(i,n){const s=t[e];return void 0!==n?i in s&&s[i].handlers.some(t=>t.namespace===n):i in s}};var b=function(t,e,i,n){return function(s,...o){const r=t[e];r[s]||(r[s]={handlers:[],runs:0}),r[s].runs++;const a=r[s].handlers;if(!a||!a.length)return i?o[0]:void 0;const l={name:s,currentIndex:0};return(n?async function(){try{r.__current.add(l);let t=i?o[0]:void 0;for(;l.currentIndex0:Array.from(n.__current).some(t=>t.name===i)}};var x=function(t,e){return function(i){const n=t[e];if(f(i))return n[i]&&n[i].runs?n[i].runs:0}},_=class{actions;filters;addAction;addFilter;removeAction;removeFilter;hasAction;hasFilter;removeAllActions;removeAllFilters;doAction;doActionAsync;applyFilters;applyFiltersAsync;currentAction;currentFilter;doingAction;doingFilter;didAction;didFilter;constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=p(this,"actions"),this.addFilter=p(this,"filters"),this.removeAction=g(this,"actions"),this.removeFilter=g(this,"filters"),this.hasAction=m(this,"actions"),this.hasFilter=m(this,"filters"),this.removeAllActions=g(this,"actions",!0),this.removeAllFilters=g(this,"filters",!0),this.doAction=b(this,"actions",!1,!1),this.doActionAsync=b(this,"actions",!1,!0),this.applyFilters=b(this,"filters",!0,!1),this.applyFiltersAsync=b(this,"filters",!0,!0),this.currentAction=v(this,"actions"),this.currentFilter=v(this,"filters"),this.doingAction=y(this,"actions"),this.doingFilter=y(this,"filters"),this.didAction=x(this,"actions"),this.didFilter=x(this,"filters")}};var w=function(){return new _}(),{addAction:k,addFilter:S,removeAction:M,removeFilter:O,hasAction:E,hasFilter:A,removeAllActions:T,removeAllFilters:C,doAction:P,doActionAsync:L,applyFilters:D,applyFiltersAsync:I,currentAction:R,currentFilter:j,doingAction:F,doingFilter:z,didAction:B,didFilter:N,actions:W,filters:V}=w,H=((t,e,i)=>{const n=new c({}),s=new Set,o=()=>{s.forEach(t=>t())},r=(t,e="default")=>{n.data[e]={...n.data[e],...t},n.data[e][""]={...h,...n.data[e]?.[""]},delete n.pluralForms[e]},a=(t,e)=>{r(t,e),o()},l=(t="default",e,i,s,o)=>(n.data[t]||r(void 0,t),n.dcnpgettext(t,e,i,s,o)),u=t=>t||"default",f=(t,e,n)=>{let s=l(n,e,t);return i?(s=i.applyFilters("i18n.gettext_with_context",s,t,e,n),i.applyFilters("i18n.gettext_with_context_"+u(n),s,t,e,n)):s};if(t&&a(t,e),i){const t=t=>{d.test(t)&&o()};i.addAction("hookAdded","core/i18n",t),i.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:(t="default")=>n.data[t],setLocaleData:a,addLocaleData:(t,e="default")=>{n.data[e]={...n.data[e],...t,"":{...h,...n.data[e]?.[""],...t?.[""]}},delete n.pluralForms[e],o()},resetLocaleData:(t,e)=>{n.data={},n.pluralForms={},a(t,e)},subscribe:t=>(s.add(t),()=>s.delete(t)),__:(t,e)=>{let n=l(e,void 0,t);return i?(n=i.applyFilters("i18n.gettext",n,t,e),i.applyFilters("i18n.gettext_"+u(e),n,t,e)):n},_x:f,_n:(t,e,n,s)=>{let o=l(s,void 0,t,e,n);return i?(o=i.applyFilters("i18n.ngettext",o,t,e,n,s),i.applyFilters("i18n.ngettext_"+u(s),o,t,e,n,s)):o},_nx:(t,e,n,s,o)=>{let r=l(o,s,t,e,n);return i?(r=i.applyFilters("i18n.ngettext_with_context",r,t,e,n,s,o),i.applyFilters("i18n.ngettext_with_context_"+u(o),r,t,e,n,s,o)):r},isRTL:()=>"rtl"===f("ltr","text direction"),hasTranslation:(t,e,s)=>{const o=e?e+""+t:t;let r=!!n.data?.[s??"default"]?.[o];return i&&(r=i.applyFilters("i18n.has_translation",r,t,e,s),r=i.applyFilters("i18n.has_translation_"+u(s),r,t,e,s)),r}}})(void 0,void 0,w),$=(H.getLocaleData.bind(H),H.setLocaleData.bind(H),H.resetLocaleData.bind(H),H.subscribe.bind(H),H.__.bind(H)),U=(H._x.bind(H),H._n.bind(H),H._nx.bind(H),H.isRTL.bind(H),H.hasTranslation.bind(H),["@wordpress/admin-ui","@wordpress/api-fetch","@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/boot","@wordpress/commands","@wordpress/compose","@wordpress/connectors","@wordpress/workflows","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/font-list-route","@wordpress/format-library","@wordpress/patterns","@wordpress/preferences","@wordpress/rich-text","@wordpress/route","@wordpress/router","@wordpress/routes","@wordpress/storybook","@wordpress/sync","@wordpress/theme","@wordpress/dataviews","@wordpress/fields","@wordpress/lazy-editor","@wordpress/media-editor","@wordpress/media-utils","@wordpress/upload-media","@wordpress/global-styles-engine","@wordpress/global-styles-ui","@wordpress/ui","@wordpress/views","@wordpress/widget-dashboard"]);function q(t,e){if(!t)throw new Error("Cannot lock an undefined object.");const i=t;J in i||(i[J]={}),X.set(i[J],e)}function Y(t){if(!t)throw new Error("Cannot unlock an undefined object.");const e=t;if(!(J in e))throw new Error("Cannot unlock an object that was not locked before. ");return X.get(e[J])}var X=new WeakMap,J=Symbol("Private API ID");var{lock:G,unlock:K}=((t,e)=>{if(!U.includes(e))throw new Error(`You tried to opt-in to unstable APIs as module "${e}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress."!==t)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return{lock:q,unlock:Y}})("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/api-fetch");var Q=function(t){const e=(t,i)=>{const{headers:n={}}=t;for(const s in n)if("x-wp-nonce"===s.toLowerCase()&&n[s]===e.nonce)return i(t);return i({...t,headers:{...n,"X-WP-Nonce":e.nonce}})};return e.nonce=t,e},Z=(t,e)=>{let i,n,s=t.path;return"string"==typeof t.namespace&&"string"==typeof t.endpoint&&(i=t.namespace.replace(/^\/|\/$/g,""),n=t.endpoint.replace(/^\//,""),s=n?i+"/"+n:i),delete t.namespace,delete t.endpoint,e({...t,path:s})},tt=t=>(e,i)=>Z(e,e=>{let n,s=e.url,o=e.path;return"string"==typeof o&&(n=t,-1!==t.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(o=o.replace("?","&")),s=n+o),i({...e,url:s})});function et(t){try{return decodeURIComponent(t)}catch{return t}}function it(t){const e=t.indexOf("?");if(-1===e)return t;const i=t.slice(0,e),n=t.slice(e+1);return n?i+"?"+n.split("&").map(t=>t.split("=")).map(t=>t.map(et)).sort((t,e)=>t[0].localeCompare(e[0])).map(t=>t.map(encodeURIComponent)).map(t=>t.join("=")).join("&"):i}function nt(t){return(function(t){let e;try{e=new URL(t,"http://example.com").search.substring(1)}catch{}if(e)return e}(t)||"").replace(/\+/g,"%20").split("&").reduce((t,e)=>{const i=e.indexOf("="),n=-1!==i,s=et(n?e.slice(0,i):e);if(s){const o=n?et(e.slice(i+1)):"";!function(t,e,i){const n=e.length,s=n-1;for(let o=0;o{"link"===e.toLowerCase()&&(t.headers[e]=i.replace(/<([^>]+)>/,(t,e)=>`<${encodeURI(e)}>`))}),Promise.resolve(e?t.body:new window.Response(JSON.stringify(t.body),{status:200,statusText:"OK",headers:t.headers}))}}var ct=function(t){const{OPTIONS:e={},...i}=Object.fromEntries(Object.entries(t).map(([t,e])=>[it(t),e])),n=new Set(Object.keys(i)),s=new Set(Object.keys(e));let o=!1;const r=(t,r)=>{const{parse:a=!0}=t;let l=t.path;if(!l&&t.url){const{rest_route:e,...i}=nt(t.url);"string"==typeof e&&(l=ot(e,i))}if("string"!=typeof l)return r(t);const c=t.method||"GET",h=it(l);if("GET"===c&&i[h]){const t=i[h];return o||delete i[h],n.delete(h),lt(t,!!a)}if("OPTIONS"===c&&e[h]){const t=e[h];return o||delete e[h],s.delete(h),lt(t,!!a)}return r(t)};return r[rt]=()=>{o=!0},r[at]=()=>{const t=[...Array.from(n,t=>`GET ${t}`),...Array.from(s,t=>`OPTIONS ${t}`)];t.length?console.warn("[api-fetch][preload] Some preloads were never consumed:",t):console.log("[api-fetch][preload] All preloads consumed."),n.clear(),s.clear();for(const t of Object.keys(i))delete i[t];for(const t of Object.keys(e))delete e[t]},r},ht=({path:t,url:e,...i},n)=>({...i,url:e&&ot(e,n),path:t&&ot(t,n)}),dt=t=>t.json?t.json():Promise.reject(t),ut=t=>{const{next:e}=(t=>{if(!t)return{};const e=t.match(/<([^>]+)>; rel="next"/);return e?{next:e[1]}:{}})(t.headers.get("link"));return e},ft=async(t,e)=>{if(!1===t.parse)return e(t);if(!(t=>{const e=!!t.path&&-1!==t.path.indexOf("per_page=-1"),i=!!t.url&&-1!==t.url.indexOf("per_page=-1");return e||i})(t))return e(t);const i=await Pt({...ht(t,{per_page:100}),parse:!1}),n=await dt(i);if(!Array.isArray(n))return n;let s=ut(i);if(!s)return n;let o=[].concat(n);for(;s;){const e=await Pt({...t,path:void 0,url:s,parse:!1}),i=await dt(e);o=o.concat(i),s=ut(e)}return o},pt=new Set(["PATCH","PUT","DELETE"]),gt="GET",mt=(t,e)=>{const{method:i=gt}=t;return pt.has(i.toUpperCase())&&(t={...t,headers:{"Content-Type":"application/json",...t.headers,"X-HTTP-Method-Override":i},method:"POST"}),e(t)};function bt(t,e){return nt(t)[e]}function vt(t,e){return void 0!==bt(t,e)}async function yt(t,e=!1){try{if("function"!=typeof t.text)return await t.json();const i=await t.text();return e&&""===i?null:JSON.parse(i)}catch{throw{code:"invalid_json",message:$("The response is not a valid JSON response.")}}}async function xt(t,e=!0){return e?204===t.status?null:await yt(t,!0):t}async function _t(t,e=!0){if(!e)throw t;throw await yt(t)}var wt=(t,e)=>{if(!function(t){const e=!!t.method&&"POST"===t.method;return(!!t.path&&-1!==t.path.indexOf("/wp/v2/media")||!!t.url&&-1!==t.url.indexOf("/wp/v2/media"))&&e}(t))return e(t);let i=0;const n=t=>(i++,e({path:`/wp/v2/media/${t}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>i<5?n(t):(e({path:`/wp/v2/media/${t}?force=true`,method:"DELETE"}),Promise.reject())));return e({...t,parse:!1}).catch(e=>{if(!(e instanceof globalThis.Response))return Promise.reject(e);const i=e.headers.get("x-wp-upload-attachment-id");return e.status>=500&&e.status<600&&i?n(i).catch(()=>!1!==t.parse?Promise.reject({code:"post_process",message:$("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(e)):_t(e,t.parse)}).then(e=>xt(e,t.parse))};function kt(t,...e){const i=t.replace(/^[^#]*/,""),n=(t=t.replace(/#.*/,"")).indexOf("?");if(-1===n)return t+i;const s=nt(t),o=t.substr(0,n);e.forEach(t=>delete s[t]);const r=st(s);return(r?o+"?"+r:o)+i}var St=t=>(e,i)=>{if("string"==typeof e.url){const i=bt(e.url,"wp_theme_preview");void 0===i?e.url=ot(e.url,{wp_theme_preview:t}):""===i&&(e.url=kt(e.url,"wp_theme_preview"))}if("string"==typeof e.path){const i=bt(e.path,"wp_theme_preview");void 0===i?e.path=ot(e.path,{wp_theme_preview:t}):""===i&&(e.path=kt(e.path,"wp_theme_preview"))}return i(e)},Mt={Accept:"application/json, */*;q=0.1"},Ot={credentials:"include"},Et=[(t,e)=>("string"!=typeof t.url||vt(t.url,"_locale")||(t.url=ot(t.url,{_locale:"user"})),"string"!=typeof t.path||vt(t.path,"_locale")||(t.path=ot(t.path,{_locale:"user"})),e(t)),Z,mt,ft];var At=t=>{const{url:e,path:i,data:n,parse:s=!0,...o}=t;let{body:r,headers:a}=t;a={...Mt,...a},n&&(r=JSON.stringify(n),a["Content-Type"]="application/json");return globalThis.fetch(e||i||window.location.href,{...Ot,...o,body:r,headers:a}).then(t=>t.ok?xt(t,s):_t(t,s),t=>{if(t&&"AbortError"===t.name)throw t;if(!globalThis.navigator.onLine)throw{code:"offline_error",message:$("Unable to connect. Please check your Internet connection.")};throw{code:"fetch_error",message:$("Could not get a valid response from the server.")}})},Tt=At;var Ct=t=>Et.reduceRight((t,e)=>i=>e(i,t),Tt)(t).catch(e=>"rest_cookie_invalid_nonce"!==e.code?Promise.reject(e):globalThis.fetch(Ct.nonceEndpoint).then(t=>t.ok?t.text():Promise.reject(e)).then(e=>(Ct.nonceMiddleware.nonce=e,Ct(t))));Ct.use=function(t){Et.unshift(t)},Ct.unregister=function(t){const e=Et.indexOf(t);return-1!==e&&(Et.splice(e,1),!0)},Ct.setFetchHandler=function(t){Tt=t},Ct.defaultFetchHandler=At,Ct.privateApis={},G(Ct.privateApis,{enablePreloadMultiUse:function(){for(const t of Et)t[rt]?.()},clearPreloadedData:function(){for(const t of Et)t[at]?.()}}),Ct.createNonceMiddleware=Q,Ct.createPreloadingMiddleware=ct,Ct.createRootURLMiddleware=tt,Ct.fetchAllMiddleware=ft,Ct.httpV1Middleware=mt,Ct.mediaUploadMiddleware=wt,Ct.createThemePreviewMiddleware=St;var Pt=Ct;const Lt={wpWrap:document.getElementById("wpwrap"),adminbar:document.getElementById("wpadminbar"),wpContent:document.getElementById("wpbody-content"),libraryWrap:document.getElementById("cloudinary-dam"),cloudinaryHeader:document.getElementById("cloudinary-header"),wpFooter:document.getElementById("wpfooter"),importStatus:document.getElementById("import-status"),downloading:{},_init(){const t=this,e=this.libraryWrap,i=this.importStatus;"undefined"!=typeof CLDN&&document.querySelector(CLDN.mloptions.inline_container)&&(Pt.use(Pt.createNonceMiddleware(CLDN.nonce)),cloudinary.openMediaLibrary(CLDN.mloptions,{insertHandler(n){const s=[];for(let o=0;o{o.style.opacity=1},250),void 0!==n.fetch?Pt({path:cldData.dam.fetch_url,data:{src:n.url,filename:n.filename,attachment_id:n.attachment_id,transformations:n.transformations},method:"POST"}).then(e=>{e&&!1===e.success&&t.showError(e.data)}).catch(e=>{t.showError(e&&e.message)}).finally(()=>{t.removeProgress(s,r)}):t.removeProgress(s,r)})}}}),window.addEventListener("resize",function(){t._resize()}),t._resize())},_resize(){this.libraryWrap.style.height=this.wpFooter.offsetTop-this.libraryWrap.offsetTop-this.adminbar.offsetHeight+"px"},removeProgress(t,e){const i=t[e];delete t[e],i.removeChild(i.firstChild),setTimeout(()=>{i.style.opacity=0,setTimeout(()=>{i.parentNode.removeChild(i),Object.keys(t).length||(this.libraryWrap.style.marginRight="0px",this.importStatus.style.display="none")},1e3)},500)},showError(t){window.alert(t||$("Could not import the asset.","cloudinary"))},makeProgress(t){const e=document.createElement("div"),i=document.createElement("span"),n=document.createElement("span");return e.classList.add("cld-import-item"),i.classList.add("spinner"),n.classList.add("cld-import-item-id"),n.innerText=t.public_id,e.appendChild(i),e.appendChild(n),e}};window.addEventListener("load",()=>Lt._init());const Dt={_init(){const t=this;if("undefined"!=typeof CLDIS){[...document.getElementsByClassName("cld-notice-box")].forEach(e=>{const i=e.getElementsByClassName("notice-dismiss");i.length&&i[0].addEventListener("click",i=>{e.style.height=e.offsetHeight+"px",i.preventDefault(),setTimeout(function(){t._dismiss(e)},5)})})}},_dismiss(t){const e=t.dataset.dismiss,i=parseInt(t.dataset.duration);t.classList.add("dismissed"),t.style.height="0px",setTimeout(function(){t.remove()},400),00&&Nt(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Nt(n.height)/t.offsetHeight||1);var r=(Rt(t)?It(t):window).visualViewport,a=!Vt()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/s,c=(n.top+(a&&r?r.offsetTop:0))/o,h=n.width/s,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function $t(t){var e=It(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ut(t){return t?(t.nodeName||"").toLowerCase():null}function qt(t){return((Rt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Yt(t){return Ht(qt(t)).left+$t(t).scrollLeft}function Xt(t){return It(t).getComputedStyle(t)}function Jt(t){var e=Xt(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function Gt(t,e,i){void 0===i&&(i=!1);var n,s,o=jt(e),r=jt(e)&&function(t){var e=t.getBoundingClientRect(),i=Nt(e.width)/t.offsetWidth||1,n=Nt(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=qt(e),l=Ht(t,r,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!i)&&(("body"!==Ut(e)||Jt(a))&&(c=(n=e)!==It(n)&&jt(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:$t(n)),jt(e)?((h=Ht(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=Yt(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function Kt(t){var e=Ht(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Qt(t){return"html"===Ut(t)?t:t.assignedSlot||t.parentNode||(Ft(t)?t.host:null)||qt(t)}function Zt(t){return["html","body","#document"].indexOf(Ut(t))>=0?t.ownerDocument.body:jt(t)&&Jt(t)?t:Zt(Qt(t))}function te(t,e){var i;void 0===e&&(e=[]);var n=Zt(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=It(n),r=s?[o].concat(o.visualViewport||[],Jt(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(te(Qt(r)))}function ee(t){return["table","td","th"].indexOf(Ut(t))>=0}function ie(t){return jt(t)&&"fixed"!==Xt(t).position?t.offsetParent:null}function ne(t){for(var e=It(t),i=ie(t);i&&ee(i)&&"static"===Xt(i).position;)i=ie(i);return i&&("html"===Ut(i)||"body"===Ut(i)&&"static"===Xt(i).position)?e:i||function(t){var e=/firefox/i.test(Wt());if(/Trident/i.test(Wt())&&jt(t)&&"fixed"===Xt(t).position)return null;var i=Qt(t);for(Ft(i)&&(i=i.host);jt(i)&&["html","body"].indexOf(Ut(i))<0;){var n=Xt(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}var se="top",oe="bottom",re="right",ae="left",le="auto",ce=[se,oe,re,ae],he="start",de="end",ue="viewport",fe="popper",pe=ce.reduce(function(t,e){return t.concat([e+"-"+he,e+"-"+de])},[]),ge=[].concat(ce,[le]).reduce(function(t,e){return t.concat([e,e+"-"+he,e+"-"+de])},[]),me=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function be(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}}),n.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){i.has(t.name)||s(t)}),n}var ve={placement:"bottom",modifiers:[],strategy:"absolute"};function ye(){for(var t=arguments.length,e=new Array(t),i=0;i=0?"x":"y"}function Me(t){var e,i=t.reference,n=t.element,s=t.placement,o=s?we(s):null,r=s?ke(s):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case se:e={x:a,y:i.y-n.height};break;case oe:e={x:a,y:i.y+i.height};break;case re:e={x:i.x+i.width,y:l};break;case ae:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?Se(o):null;if(null!=c){var h="y"===c?"height":"width";switch(r){case he:e[c]=e[c]-(i[h]/2-n[h]/2);break;case de:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}var Oe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ee(t){var e,i=t.popper,n=t.popperRect,s=t.placement,o=t.variation,r=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,d=t.isFixed,u=r.x,f=void 0===u?0:u,p=r.y,g=void 0===p?0:p,m="function"==typeof h?h({x:f,y:g}):{x:f,y:g};f=m.x,g=m.y;var b=r.hasOwnProperty("x"),v=r.hasOwnProperty("y"),y=ae,x=se,_=window;if(c){var w=ne(i),k="clientHeight",S="clientWidth";if(w===It(i)&&"static"!==Xt(w=qt(i)).position&&"absolute"===a&&(k="scrollHeight",S="scrollWidth"),s===se||(s===ae||s===re)&&o===de)x=oe,g-=(d&&w===_&&_.visualViewport?_.visualViewport.height:w[k])-n.height,g*=l?1:-1;if(s===ae||(s===se||s===oe)&&o===de)y=re,f-=(d&&w===_&&_.visualViewport?_.visualViewport.width:w[S])-n.width,f*=l?1:-1}var M,O=Object.assign({position:a},c&&Oe),E=!0===h?function(t,e){var i=t.x,n=t.y,s=e.devicePixelRatio||1;return{x:Nt(i*s)/s||0,y:Nt(n*s)/s||0}}({x:f,y:g},It(i)):{x:f,y:g};return f=E.x,g=E.y,l?Object.assign({},O,((M={})[x]=v?"0":"",M[y]=b?"0":"",M.transform=(_.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",M)):Object.assign({},O,((e={})[x]=v?g+"px":"",e[y]=b?f+"px":"",e.transform="",e))}const Ae={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];jt(s)&&Ut(s)&&(Object.assign(s.style,i),Object.keys(n).forEach(function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(t){var n=e.elements[t],s=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce(function(t,e){return t[e]="",t},{});jt(n)&&Ut(n)&&(Object.assign(n.style,o),Object.keys(s).forEach(function(t){n.removeAttribute(t)}))})}},requires:["computeStyles"]};const Te={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.offset,o=void 0===s?[0,0]:s,r=ge.reduce(function(t,i){return t[i]=function(t,e,i){var n=we(t),s=[ae,se].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[ae,re].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}(i,e.rects,o),t},{}),a=r[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}};var Ce={left:"right",right:"left",bottom:"top",top:"bottom"};function Pe(t){return t.replace(/left|right|bottom|top/g,function(t){return Ce[t]})}var Le={start:"end",end:"start"};function De(t){return t.replace(/start|end/g,function(t){return Le[t]})}function Ie(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Ft(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Re(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function je(t,e,i){return e===ue?Re(function(t,e){var i=It(t),n=qt(t),s=i.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=Vt();(c||!c&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+Yt(t),y:l}}(t,i)):Rt(e)?function(t,e){var i=Ht(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):Re(function(t){var e,i=qt(t),n=$t(t),s=null==(e=t.ownerDocument)?void 0:e.body,o=zt(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=zt(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+Yt(t),l=-n.scrollTop;return"rtl"===Xt(s||i).direction&&(a+=zt(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}(qt(t)))}function Fe(t,e,i,n){var s="clippingParents"===e?function(t){var e=te(Qt(t)),i=["absolute","fixed"].indexOf(Xt(t).position)>=0&&jt(t)?ne(t):t;return Rt(i)?e.filter(function(t){return Rt(t)&&Ie(t,i)&&"body"!==Ut(t)}):[]}(t):[].concat(e),o=[].concat(s,[i]),r=o[0],a=o.reduce(function(e,i){var s=je(t,i,n);return e.top=zt(s.top,e.top),e.right=Bt(s.right,e.right),e.bottom=Bt(s.bottom,e.bottom),e.left=zt(s.left,e.left),e},je(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ze(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Be(t,e){return e.reduce(function(e,i){return e[i]=t,e},{})}function Ne(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=void 0===n?t.placement:n,o=i.strategy,r=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?"clippingParents":a,c=i.rootBoundary,h=void 0===c?ue:c,d=i.elementContext,u=void 0===d?fe:d,f=i.altBoundary,p=void 0!==f&&f,g=i.padding,m=void 0===g?0:g,b=ze("number"!=typeof m?m:Be(m,ce)),v=u===fe?"reference":fe,y=t.rects.popper,x=t.elements[p?v:u],_=Fe(Rt(x)?x:x.contextElement||qt(t.elements.popper),l,h,r),w=Ht(t.elements.reference),k=Me({reference:w,element:y,strategy:"absolute",placement:s}),S=Re(Object.assign({},y,k)),M=u===fe?S:w,O={top:_.top-M.top+b.top,bottom:M.bottom-_.bottom+b.bottom,left:_.left-M.left+b.left,right:M.right-_.right+b.right},E=t.modifiersData.offset;if(u===fe&&E){var A=E[s];Object.keys(O).forEach(function(t){var e=[re,oe].indexOf(t)>=0?1:-1,i=[se,oe].indexOf(t)>=0?"y":"x";O[t]+=A[i]*e})}return O}function We(t,e,i){return zt(t,Bt(e,i))}const Ve={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0!==r&&r,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,u=i.tether,f=void 0===u||u,p=i.tetherOffset,g=void 0===p?0:p,m=Ne(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),b=we(e.placement),v=ke(e.placement),y=!v,x=Se(b),_="x"===x?"y":"x",w=e.modifiersData.popperOffsets,k=e.rects.reference,S=e.rects.popper,M="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,O="number"==typeof M?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),E=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,A={x:0,y:0};if(w){if(o){var T,C="y"===x?se:ae,P="y"===x?oe:re,L="y"===x?"height":"width",D=w[x],I=D+m[C],R=D-m[P],j=f?-S[L]/2:0,F=v===he?k[L]:S[L],z=v===he?-S[L]:-k[L],B=e.elements.arrow,N=f&&B?Kt(B):{width:0,height:0},W=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=W[C],H=W[P],$=We(0,k[L],N[L]),U=y?k[L]/2-j-$-V-O.mainAxis:F-$-V-O.mainAxis,q=y?-k[L]/2+j+$+H+O.mainAxis:z+$+H+O.mainAxis,Y=e.elements.arrow&&ne(e.elements.arrow),X=Y?"y"===x?Y.clientTop||0:Y.clientLeft||0:0,J=null!=(T=null==E?void 0:E[x])?T:0,G=D+q-J,K=We(f?Bt(I,D+U-J-X):I,D,f?zt(R,G):R);w[x]=K,A[x]=K-D}if(a){var Q,Z="x"===x?se:ae,tt="x"===x?oe:re,et=w[_],it="y"===_?"height":"width",nt=et+m[Z],st=et-m[tt],ot=-1!==[se,ae].indexOf(b),rt=null!=(Q=null==E?void 0:E[_])?Q:0,at=ot?nt:et-k[it]-S[it]-rt+O.altAxis,lt=ot?et+k[it]+S[it]-rt-O.altAxis:st,ct=f&&ot?function(t,e,i){var n=We(t,e,i);return n>i?i:n}(at,et,lt):We(f?at:nt,et,f?lt:st);w[_]=ct,A[_]=ct-et}e.modifiersData[n]=A}},requiresIfExists:["offset"]};const He={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,s=t.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,a=we(i.placement),l=Se(a),c=[ae,re].indexOf(a)>=0?"height":"width";if(o&&r){var h=function(t,e){return ze("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Be(t,ce))}(s.padding,i),d=Kt(o),u="y"===l?se:ae,f="y"===l?oe:re,p=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],g=r[l]-i.rects.reference[l],m=ne(o),b=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,v=p/2-g/2,y=h[u],x=b-d[c]-h[f],_=b/2-d[c]/2+v,w=We(y,_,x),k=l;i.modifiersData[n]=((e={})[k]=w,e.centerOffset=w-_,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Ie(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function $e(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Ue(t){return[se,re,oe,ae].some(function(e){return t[e]>=0})}var qe=xe({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,l=It(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(t){t.addEventListener("scroll",i.update,_e)}),a&&l.addEventListener("resize",i.update,_e),function(){o&&c.forEach(function(t){t.removeEventListener("scroll",i.update,_e)}),a&&l.removeEventListener("resize",i.update,_e)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=Me({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:we(e.placement),variation:ke(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Ee(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ee(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},Ae,Te,{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0===r||r,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,u=i.altBoundary,f=i.flipVariations,p=void 0===f||f,g=i.allowedAutoPlacements,m=e.options.placement,b=we(m),v=l||(b===m||!p?[Pe(m)]:function(t){if(we(t)===le)return[];var e=Pe(t);return[De(t),e,De(e)]}(m)),y=[m].concat(v).reduce(function(t,i){return t.concat(we(i)===le?function(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,o=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?ge:l,h=ke(n),d=h?a?pe:pe.filter(function(t){return ke(t)===h}):ce,u=d.filter(function(t){return c.indexOf(t)>=0});0===u.length&&(u=d);var f=u.reduce(function(e,i){return e[i]=Ne(t,{placement:i,boundary:s,rootBoundary:o,padding:r})[we(i)],e},{});return Object.keys(f).sort(function(t,e){return f[t]-f[e]})}(e,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:g}):i)},[]),x=e.rects.reference,_=e.rects.popper,w=new Map,k=!0,S=y[0],M=0;M=0,C=T?"width":"height",P=Ne(e,{placement:O,boundary:h,rootBoundary:d,altBoundary:u,padding:c}),L=T?A?re:ae:A?oe:se;x[C]>_[C]&&(L=Pe(L));var D=Pe(L),I=[];if(o&&I.push(P[E]<=0),a&&I.push(P[L]<=0,P[D]<=0),I.every(function(t){return t})){S=O,k=!1;break}w.set(O,I)}if(k)for(var R=function(t){var e=y.find(function(e){var i=w.get(e);if(i)return i.slice(0,t).every(function(t){return t})});if(e)return S=e,"break"},j=p?3:1;j>0;j--){if("break"===R(j))break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Ve,He,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=Ne(e,{elementContext:"reference"}),a=Ne(e,{altBoundary:!0}),l=$e(r,n),c=$e(a,s,o),h=Ue(l),d=Ue(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}}]}),Ye="tippy-content",Xe="tippy-backdrop",Je="tippy-arrow",Ge="tippy-svg-arrow",Ke={passive:!0,capture:!0},Qe=function(){return document.body};function Ze(t,e,i){if(Array.isArray(t)){var n=t[e];return n??(Array.isArray(i)?i[e]:i)}return t}function ti(t,e){var i={}.toString.call(t);return 0===i.indexOf("[object")&&i.indexOf(e+"]")>-1}function ei(t,e){return"function"==typeof t?t.apply(void 0,e):t}function ii(t,e){return 0===e?t:function(n){clearTimeout(i),i=setTimeout(function(){t(n)},e)};var i}function ni(t){return[].concat(t)}function si(t,e){-1===t.indexOf(e)&&t.push(e)}function oi(t){return t.split("-")[0]}function ri(t){return[].slice.call(t)}function ai(t){return Object.keys(t).reduce(function(e,i){return void 0!==t[i]&&(e[i]=t[i]),e},{})}function li(){return document.createElement("div")}function ci(t){return["Element","Fragment"].some(function(e){return ti(t,e)})}function hi(t){return ti(t,"MouseEvent")}function di(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function ui(t){return ci(t)?[t]:function(t){return ti(t,"NodeList")}(t)?ri(t):Array.isArray(t)?t:ri(document.querySelectorAll(t))}function fi(t,e){t.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function pi(t,e){t.forEach(function(t){t&&t.setAttribute("data-state",e)})}function gi(t){var e,i=ni(t)[0];return null!=i&&null!=(e=i.ownerDocument)&&e.body?i.ownerDocument:document}function mi(t,e,i){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(e){t[n](e,i)})}function bi(t,e){for(var i=e;i;){var n;if(t.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var vi={isTouch:!1},yi=0;function xi(){vi.isTouch||(vi.isTouch=!0,window.performance&&document.addEventListener("mousemove",_i))}function _i(){var t=performance.now();t-yi<20&&(vi.isTouch=!1,document.removeEventListener("mousemove",_i)),yi=t}function wi(){var t=document.activeElement;if(di(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}var ki=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Si={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Mi=Object.assign({appendTo:Qe,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Si,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Oi=Object.keys(Mi);function Ei(t){var e=(t.plugins||[]).reduce(function(e,i){var n,s=i.name,o=i.defaultValue;s&&(e[s]=void 0!==t[s]?t[s]:null!=(n=Mi[s])?n:o);return e},{});return Object.assign({},t,e)}function Ai(t,e){var i=Object.assign({},e,{content:ei(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(Ei(Object.assign({},Mi,{plugins:e}))):Oi).reduce(function(e,i){var n=(t.getAttribute("data-tippy-"+i)||"").trim();if(!n)return e;if("content"===i)e[i]=n;else try{e[i]=JSON.parse(n)}catch(t){e[i]=n}return e},{})}(t,e.plugins));return i.aria=Object.assign({},Mi.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?e.interactive:i.aria.expanded,content:"auto"===i.aria.content?e.interactive?null:"describedby":i.aria.content},i}function Ti(t,e){t.innerHTML=e}function Ci(t){var e=li();return!0===t?e.className=Je:(e.className=Ge,ci(t)?e.appendChild(t):Ti(e,t)),e}function Pi(t,e){ci(e.content)?(Ti(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ti(t,e.content):t.textContent=e.content)}function Li(t){var e=t.firstElementChild,i=ri(e.children);return{box:e,content:i.find(function(t){return t.classList.contains(Ye)}),arrow:i.find(function(t){return t.classList.contains(Je)||t.classList.contains(Ge)}),backdrop:i.find(function(t){return t.classList.contains(Xe)})}}function Di(t){var e=li(),i=li();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=li();function s(i,n){var s=Li(e),o=s.box,r=s.content,a=s.arrow;n.theme?o.setAttribute("data-theme",n.theme):o.removeAttribute("data-theme"),"string"==typeof n.animation?o.setAttribute("data-animation",n.animation):o.removeAttribute("data-animation"),n.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?o.setAttribute("role",n.role):o.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||Pi(r,t.props),n.arrow?a?i.arrow!==n.arrow&&(o.removeChild(a),o.appendChild(Ci(n.arrow))):o.appendChild(Ci(n.arrow)):a&&o.removeChild(a)}return n.className=Ye,n.setAttribute("data-state","hidden"),Pi(n,t.props),e.appendChild(i),i.appendChild(n),s(t.props,t.props),{popper:e,onUpdate:s}}Di.$$tippy=!0;var Ii=1,Ri=[],ji=[];function Fi(t,e){var i,n,s,o,r,a,l,c,h=Ai(t,Object.assign({},Mi,Ei(ai(e)))),d=!1,u=!1,f=!1,p=!1,g=[],m=ii(Y,h.interactiveDebounce),b=Ii++,v=(c=h.plugins).filter(function(t,e){return c.indexOf(t)===e}),y={id:b,reference:t,popper:li(),popperInstance:null,props:h,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(s)},setProps:function(e){0;if(y.state.isDestroyed)return;D("onBeforeUpdate",[y,e]),U();var i=y.props,n=Ai(t,Object.assign({},i,ai(e),{ignoreAttributes:!0}));y.props=n,$(),i.interactiveDebounce!==n.interactiveDebounce&&(j(),m=ii(Y,n.interactiveDebounce));i.triggerTarget&&!n.triggerTarget?ni(i.triggerTarget).forEach(function(t){t.removeAttribute("aria-expanded")}):n.triggerTarget&&t.removeAttribute("aria-expanded");R(),L(),w&&w(i,n);y.popperInstance&&(K(),Z().forEach(function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}));D("onAfterUpdate",[y,e])},setContent:function(t){y.setProps({content:t})},show:function(){0;var t=y.state.isVisible,e=y.state.isDestroyed,i=!y.state.isEnabled,n=vi.isTouch&&!y.props.touch,s=Ze(y.props.duration,0,Mi.duration);if(t||e||i||n)return;if(A().hasAttribute("disabled"))return;if(D("onShow",[y],!1),!1===y.props.onShow(y))return;y.state.isVisible=!0,E()&&(_.style.visibility="visible");L(),N(),y.state.isMounted||(_.style.transition="none");if(E()){var o=C();fi([o.box,o.content],0)}a=function(){var t;if(y.state.isVisible&&!p){if(p=!0,_.offsetHeight,_.style.transition=y.props.moveTransition,E()&&y.props.animation){var e=C(),i=e.box,n=e.content;fi([i,n],s),pi([i,n],"visible")}I(),R(),si(ji,y),null==(t=y.popperInstance)||t.forceUpdate(),D("onMount",[y]),y.props.animation&&E()&&function(t,e){V(t,e)}(s,function(){y.state.isShown=!0,D("onShown",[y])})}},function(){var t,e=y.props.appendTo,i=A();t=y.props.interactive&&e===Qe||"parent"===e?i.parentNode:ei(e,[i]);t.contains(_)||t.appendChild(_);y.state.isMounted=!0,K(),!1}()},hide:function(){0;var t=!y.state.isVisible,e=y.state.isDestroyed,i=!y.state.isEnabled,n=Ze(y.props.duration,1,Mi.duration);if(t||e||i)return;if(D("onHide",[y],!1),!1===y.props.onHide(y))return;y.state.isVisible=!1,y.state.isShown=!1,p=!1,d=!1,E()&&(_.style.visibility="hidden");if(j(),W(),L(!0),E()){var s=C(),o=s.box,r=s.content;y.props.animation&&(fi([o,r],n),pi([o,r],"hidden"))}I(),R(),y.props.animation?E()&&function(t,e){V(t,function(){!y.state.isVisible&&_.parentNode&&_.parentNode.contains(_)&&e()})}(n,y.unmount):y.unmount()},hideWithInteractivity:function(t){0;T().addEventListener("mousemove",m),si(Ri,m),m(t)},enable:function(){y.state.isEnabled=!0},disable:function(){y.hide(),y.state.isEnabled=!1},unmount:function(){0;y.state.isVisible&&y.hide();if(!y.state.isMounted)return;Q(),Z().forEach(function(t){t._tippy.unmount()}),_.parentNode&&_.parentNode.removeChild(_);ji=ji.filter(function(t){return t!==y}),y.state.isMounted=!1,D("onHidden",[y])},destroy:function(){0;if(y.state.isDestroyed)return;y.clearDelayTimeouts(),y.unmount(),U(),delete t._tippy,y.state.isDestroyed=!0,D("onDestroy",[y])}};if(!h.render)return y;var x=h.render(y),_=x.popper,w=x.onUpdate;_.setAttribute("data-tippy-root",""),_.id="tippy-"+y.id,y.popper=_,t._tippy=y,_._tippy=y;var k=v.map(function(t){return t.fn(y)}),S=t.hasAttribute("aria-expanded");return $(),R(),L(),D("onCreate",[y]),h.showOnCreate&&tt(),_.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),_.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&T().addEventListener("mousemove",m)}),y;function M(){var t=y.props.touch;return Array.isArray(t)?t:[t,0]}function O(){return"hold"===M()[0]}function E(){var t;return!(null==(t=y.props.render)||!t.$$tippy)}function A(){return l||t}function T(){var t=A().parentNode;return t?gi(t):document}function C(){return Li(_)}function P(t){return y.state.isMounted&&!y.state.isVisible||vi.isTouch||o&&"focus"===o.type?0:Ze(y.props.delay,t?0:1,Mi.delay)}function L(t){void 0===t&&(t=!1),_.style.pointerEvents=y.props.interactive&&!t?"":"none",_.style.zIndex=""+y.props.zIndex}function D(t,e,i){var n;(void 0===i&&(i=!0),k.forEach(function(i){i[t]&&i[t].apply(i,e)}),i)&&(n=y.props)[t].apply(n,e)}function I(){var e=y.props.aria;if(e.content){var i="aria-"+e.content,n=_.id;ni(y.props.triggerTarget||t).forEach(function(t){var e=t.getAttribute(i);if(y.state.isVisible)t.setAttribute(i,e?e+" "+n:n);else{var s=e&&e.replace(n,"").trim();s?t.setAttribute(i,s):t.removeAttribute(i)}})}}function R(){!S&&y.props.aria.expanded&&ni(y.props.triggerTarget||t).forEach(function(t){y.props.interactive?t.setAttribute("aria-expanded",y.state.isVisible&&t===A()?"true":"false"):t.removeAttribute("aria-expanded")})}function j(){T().removeEventListener("mousemove",m),Ri=Ri.filter(function(t){return t!==m})}function F(e){if(!vi.isTouch||!f&&"mousedown"!==e.type){var i=e.composedPath&&e.composedPath()[0]||e.target;if(!y.props.interactive||!bi(_,i)){if(ni(y.props.triggerTarget||t).some(function(t){return bi(t,i)})){if(vi.isTouch)return;if(y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else D("onClickOutside",[y,e]);!0===y.props.hideOnClick&&(y.clearDelayTimeouts(),y.hide(),u=!0,setTimeout(function(){u=!1}),y.state.isMounted||W())}}}function z(){f=!0}function B(){f=!1}function N(){var t=T();t.addEventListener("mousedown",F,!0),t.addEventListener("touchend",F,Ke),t.addEventListener("touchstart",B,Ke),t.addEventListener("touchmove",z,Ke)}function W(){var t=T();t.removeEventListener("mousedown",F,!0),t.removeEventListener("touchend",F,Ke),t.removeEventListener("touchstart",B,Ke),t.removeEventListener("touchmove",z,Ke)}function V(t,e){var i=C().box;function n(t){t.target===i&&(mi(i,"remove",n),e())}if(0===t)return e();mi(i,"remove",r),mi(i,"add",n),r=n}function H(e,i,n){void 0===n&&(n=!1),ni(y.props.triggerTarget||t).forEach(function(t){t.addEventListener(e,i,n),g.push({node:t,eventType:e,handler:i,options:n})})}function $(){var t;O()&&(H("touchstart",q,{passive:!0}),H("touchend",X,{passive:!0})),(t=y.props.trigger,t.split(/\s+/).filter(Boolean)).forEach(function(t){if("manual"!==t)switch(H(t,q),t){case"mouseenter":H("mouseleave",X);break;case"focus":H(ki?"focusout":"blur",J);break;case"focusin":H("focusout",J)}})}function U(){g.forEach(function(t){var e=t.node,i=t.eventType,n=t.handler,s=t.options;e.removeEventListener(i,n,s)}),g=[]}function q(t){var e,i=!1;if(y.state.isEnabled&&!G(t)&&!u){var n="focus"===(null==(e=o)?void 0:e.type);o=t,l=t.currentTarget,R(),!y.state.isVisible&&hi(t)&&Ri.forEach(function(e){return e(t)}),"click"===t.type&&(y.props.trigger.indexOf("mouseenter")<0||d)&&!1!==y.props.hideOnClick&&y.state.isVisible?i=!0:tt(t),"click"===t.type&&(d=!i),i&&!n&&et(t)}}function Y(t){var e=t.target,i=A().contains(e)||_.contains(e);if("mousemove"!==t.type||!i){var n=Z().concat(_).map(function(t){var e,i=null==(e=t._tippy.popperInstance)?void 0:e.state;return i?{popperRect:t.getBoundingClientRect(),popperState:i,props:h}:null}).filter(Boolean);(function(t,e){var i=e.clientX,n=e.clientY;return t.every(function(t){var e=t.popperRect,s=t.popperState,o=t.props.interactiveBorder,r=oi(s.placement),a=s.modifiersData.offset;if(!a)return!0;var l="bottom"===r?a.top.y:0,c="top"===r?a.bottom.y:0,h="right"===r?a.left.x:0,d="left"===r?a.right.x:0,u=e.top-n+l>o,f=n-e.bottom-c>o,p=e.left-i+h>o,g=i-e.right-d>o;return u||f||p||g})})(n,t)&&(j(),et(t))}}function X(t){G(t)||y.props.trigger.indexOf("click")>=0&&d||(y.props.interactive?y.hideWithInteractivity(t):et(t))}function J(t){y.props.trigger.indexOf("focusin")<0&&t.target!==A()||y.props.interactive&&t.relatedTarget&&_.contains(t.relatedTarget)||et(t)}function G(t){return!!vi.isTouch&&O()!==t.type.indexOf("touch")>=0}function K(){Q();var e=y.props,i=e.popperOptions,n=e.placement,s=e.offset,o=e.getReferenceClientRect,r=e.moveTransition,l=E()?Li(_).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||A()}:t,h={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(E()){var i=C().box;["placement","reference-hidden","escaped"].forEach(function(t){"placement"===t?i.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?i.setAttribute("data-"+t,""):i.removeAttribute("data-"+t)}),e.attributes.popper={}}}},d=[{name:"offset",options:{offset:s}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!r}},h];E()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==i?void 0:i.modifiers)||[]),y.popperInstance=qe(c,_,Object.assign({},i,{placement:n,onFirstUpdate:a,modifiers:d}))}function Q(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function Z(){return ri(_.querySelectorAll("[data-tippy-root]"))}function tt(t){y.clearDelayTimeouts(),t&&D("onTrigger",[y,t]),N();var e=P(!0),n=M(),s=n[0],o=n[1];vi.isTouch&&"hold"===s&&o&&(e=o),e?i=setTimeout(function(){y.show()},e):y.show()}function et(t){if(y.clearDelayTimeouts(),D("onUntrigger",[y,t]),y.state.isVisible){if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&d)){var e=P(!1);e?n=setTimeout(function(){y.state.isVisible&&y.hide()},e):s=requestAnimationFrame(function(){y.hide()})}}else W()}}function zi(t,e){void 0===e&&(e={});var i=Mi.plugins.concat(e.plugins||[]);document.addEventListener("touchstart",xi,Ke),window.addEventListener("blur",wi);var n=Object.assign({},e,{plugins:i}),s=ui(t).reduce(function(t,e){var i=e&&Fi(e,n);return i&&t.push(i),t},[]);return ci(t)?s[0]:s}zi.defaultProps=Mi,zi.setDefaultProps=function(t){Object.keys(t).forEach(function(e){Mi[e]=t[e]})},zi.currentInput=vi;Object.assign({},Ae,{effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow)}});zi.setDefaultProps({render:Di});const Bi=zi;var Ni=i(951),Wi=i.n(Ni);const Vi={controlled:null,bind(t){this.controlled=t,this.controlled.forEach(t=>{this._main(t)}),this._init()},_init(){this.controlled.forEach(t=>{this._checkUp(t)})},_main(t){const e=JSON.parse(t.dataset.main);t.dataset.size&&(t.filesize=parseInt(t.dataset.size,10)),t.mains=e.map(e=>{const i=document.getElementById(e),n=document.getElementById(e+"_size_wrapper");return n&&(i.filesize=0,i.sizespan=n),this._addChild(i,t),i}),this._bindEvents(t),t.mains.forEach(t=>{this._bindEvents(t)})},_bindEvents(t){t.eventBound||(t.addEventListener("click",e=>{const i=e.target;i.elements&&(this._checkDown(i),this._evaluateSize(i)),i.mains&&this._checkUp(t)}),t.eventBound=!0)},_addChild(t,e){const i=t.elements?t.elements:[];-1===i.indexOf(e)&&(i.push(e),t.elements=i)},_removeChild(t,e){const i=t.elements.indexOf(e);-1{e.checked!==t.checked&&(e.checked=t.checked,e.disabled&&(e.checked=!1),e.dispatchEvent(new Event("change")))}),t.elements.forEach(e=>{this._checkDown(e),e.elements||this._checkUp(e,t)}))},_checkUp(t,e){t.mains&&[...t.mains].forEach(t=>{t!==e&&this._evaluateCheckStatus(t),this._checkUp(t),this._evaluateSize(t)})},_evaluateCheckStatus(t){let e=0,i=t.classList.contains("partial");i&&(t.classList.remove("partial"),i=!1),t.elements.forEach(n=>{null!==n.parentNode?(e+=n.checked,n.classList.contains("partial")&&(i=!0)):this._removeChild(t,n)});let n="some";e===t.elements.length?n="on":0===e?n="off":i=!0,i&&t.classList.add("partial");const s="off"!==n;t.checked===s&&t.value===n||(t.value=n,t.checked=s,t.dispatchEvent(new Event("change")))},_evaluateSize(t){if(t.sizespan&&t.elements){t.filesize=0,t.elements.forEach(e=>{e.checked&&(t.filesize+=e.filesize)});let e=null;0Math.max(Math.min(t,i),e);function Xi(t){return Yi(qi(2.55*t),0,255)}function Ji(t){return Yi(qi(255*t),0,255)}function Gi(t){return Yi(qi(t/2.55)/100,0,1)}function Ki(t){return Yi(qi(100*t),0,100)}const Qi={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Zi=[..."0123456789ABCDEF"],tn=t=>Zi[15&t],en=t=>Zi[(240&t)>>4]+Zi[15&t],nn=t=>(240&t)>>4==(15&t);function sn(t){var e=(t=>nn(t.r)&&nn(t.g)&&nn(t.b)&&nn(t.a))(t)?tn:en;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const on=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function rn(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function an(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function ln(t,e,i){const n=rn(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function cn(t){const e=t.r/255,i=t.g/255,n=t.b/255,s=Math.max(e,i,n),o=Math.min(e,i,n),r=(s+o)/2;let a,l,c;return s!==o&&(c=s-o,l=r>.5?c/(2-s-o):c/(s+o),a=function(t,e,i,n,s){return t===s?(e-i)/n+(e>16&255,o>>8&255,255&o]}return t}(),mn.transparent=[0,0,0,0]);const e=mn[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const vn=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const yn=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,xn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function _n(t,e,i){if(t){let n=cn(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=dn(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function wn(t,e){return t?Object.assign(e||{},t):t}function kn(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Ji(t[3]))):(e=wn(t,{r:0,g:0,b:0,a:1})).a=Ji(e.a),e}function Sn(t){return"r"===t.charAt(0)?function(t){const e=vn.exec(t);let i,n,s,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?Xi(t):Yi(255*t,0,255)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?Xi(i):Yi(i,0,255)),n=255&(e[4]?Xi(n):Yi(n,0,255)),s=255&(e[6]?Xi(s):Yi(s,0,255)),{r:i,g:n,b:s,a:o}}}(t):fn(t)}class Mn{constructor(t){if(t instanceof Mn)return t;const e=typeof t;let i;var n,s,o;"object"===e?i=kn(t):"string"===e&&(o=(n=t).length,"#"===n[0]&&(4===o||5===o?s={r:255&17*Qi[n[1]],g:255&17*Qi[n[2]],b:255&17*Qi[n[3]],a:5===o?17*Qi[n[4]]:255}:7!==o&&9!==o||(s={r:Qi[n[1]]<<4|Qi[n[2]],g:Qi[n[3]]<<4|Qi[n[4]],b:Qi[n[5]]<<4|Qi[n[6]],a:9===o?Qi[n[7]]<<4|Qi[n[8]]:255})),i=s||bn(t)||Sn(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=wn(this._rgb);return t&&(t.a=Gi(t.a)),t}set rgb(t){this._rgb=kn(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Gi(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?sn(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=cn(t),i=e[0],n=Ki(e[1]),s=Ki(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${Gi(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let s;const o=e===s?.5:e,r=2*o-1,a=i.a-n.a,l=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-l,i.r=255&l*i.r+s*n.r+.5,i.g=255&l*i.g+s*n.g+.5,i.b=255&l*i.b+s*n.b+.5,i.a=o*i.a+(1-o)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const n=xn(Gi(t.r)),s=xn(Gi(t.g)),o=xn(Gi(t.b));return{r:Ji(yn(n+i*(xn(Gi(e.r))-n))),g:Ji(yn(s+i*(xn(Gi(e.g))-s))),b:Ji(yn(o+i*(xn(Gi(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Mn(this.rgb)}alpha(t){return this._rgb.a=Ji(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=qi(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return _n(this._rgb,2,t),this}darken(t){return _n(this._rgb,2,-t),this}saturate(t){return _n(this._rgb,1,t),this}desaturate(t){return _n(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=cn(t);i[0]=un(i[0]+e),i=dn(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function On(){}const En=(()=>{let t=0;return()=>t++})();function An(t){return null==t}function Tn(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function Cn(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function Pn(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function Ln(t,e){return Pn(t)?t:e}function Dn(t,e){return void 0===t?e:t}const In=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Rn(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function jn(t,e,i,n){let s,o,r;if(Tn(t))if(o=t.length,n)for(s=o-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;st,x:t=>t.x,y:t=>t.y};function Un(t,e){const i=$n[e]||($n[e]=function(t){const e=function(t){const e=t.split("."),i=[];let n="";for(const t of e)n+=t,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function qn(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Yn=t=>void 0!==t,Xn=t=>"function"==typeof t,Jn=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};const Gn=Math.PI,Kn=2*Gn,Qn=Kn+Gn,Zn=Number.POSITIVE_INFINITY,ts=Gn/180,es=Gn/2,is=Gn/4,ns=2*Gn/3,ss=Math.log10,os=Math.sign;function rs(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function xs(t,e,i){i=i||(i=>t[i]1;)n=o+s>>1,i(n)?o=n:s=n;return{lo:o,hi:s}}const _s=(t,e,i,n)=>xs(t,i,n?n=>{const s=t[n][e];return st[n][e]xs(t,i,n=>t[n][e]>=i);const ks=["push","pop","shift","splice","unshift"];function Ss(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(ks.forEach(e=>{delete t[e]}),delete t._chartjs)}function Ms(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Os="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Es(t,e){let i=[],n=!1;return function(...s){i=s,n||(n=!0,Os.call(window,()=>{n=!1,t.apply(e,i)}))}}const As=t=>"start"===t?"left":"end"===t?"right":"center",Ts=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function Cs(t,e,i){const n=e.length;let s=0,o=n;if(t._sorted){const{iScale:r,vScale:a,_parsed:l}=t,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,h=r.axis,{min:d,max:u,minDefined:f,maxDefined:p}=r.getUserBounds();if(f){if(s=Math.min(_s(l,h,d).lo,i?n:_s(e,h,r.getPixelForValue(d)).lo),c){const t=l.slice(0,s+1).reverse().findIndex(t=>!An(t[a.axis]));s-=Math.max(0,t)}s=vs(s,0,n-1)}if(p){let t=Math.max(_s(l,r.axis,u,!0).hi+1,i?0:_s(e,h,r.getPixelForValue(u),!0).hi+1);if(c){const e=l.slice(t-1).findIndex(t=>!An(t[a.axis]));t+=Math.max(0,e)}o=vs(t,s,n)-s}else o=n-s}return{start:s,count:o}}function Ps(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const o=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),o}const Ls=t=>0===t||1===t,Ds=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*Kn/i),Is=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*Kn/i)+1,Rs={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*es),easeOutSine:t=>Math.sin(t*es),easeInOutSine:t=>-.5*(Math.cos(Gn*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Ls(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Ls(t)?t:Ds(t,.075,.3),easeOutElastic:t=>Ls(t)?t:Is(t,.075,.3),easeInOutElastic(t){const e=.1125;return Ls(t)?t:t<.5?.5*Ds(2*t,e,.45):.5+.5*Is(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Rs.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*Rs.easeInBounce(2*t):.5*Rs.easeOutBounce(2*t-1)+.5};function js(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Fs(t){return js(t)?t:new Mn(t)}function zs(t){return js(t)?t:new Mn(t).saturate(.5).darken(.1).hexString()}const Bs=["x","y","borderWidth","radius","tension"],Ns=["color","borderColor","backgroundColor"];const Ws=new Map;function Vs(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=Ws.get(i);return n||(n=new Intl.NumberFormat(t,e),Ws.set(i,n)),n}(e,i).format(t)}const Hs={values:t=>Tn(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let s,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(s="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const r=ss(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Vs(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(ss(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?Hs.numeric.call(this,t,e,i):""}};var $s={formatters:Hs};const Us=Object.create(null),qs=Object.create(null);function Ys(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>zs(e.backgroundColor),this.hoverBorderColor=(t,e)=>zs(e.borderColor),this.hoverColor=(t,e)=>zs(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Xs(this,t,e)}get(t){return Ys(this,t)}describe(t,e){return Xs(qs,t,e)}override(t,e){return Xs(Us,t,e)}route(t,e,i,n){const s=Ys(this,t),o=Ys(this,i),r="_"+e;Object.defineProperties(s,{[r]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=o[n];return Cn(t)?Object.assign({},e,t):Dn(t,e)},set(t){this[r]=t}}})}apply(t){t.forEach(t=>t(this))}}var Gs=new Js({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Ns},numbers:{type:"number",properties:Bs}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:$s.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function Ks(t,e,i,n,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,i.push(s)),o>n&&(n=o),n}function Qs(t,e,i,n){let s=(n=n||{}).data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},o=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const a=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function no(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==o.strokeColor;let l,c;for(t.save(),t.font=s.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),An(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l+t||0;function bo(t,e){const i={},n=Cn(e),s=n?Object.keys(e):e,o=Cn(t)?n?i=>Dn(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of s)i[t]=mo(o(t));return i}function vo(t){return bo(t,{top:"y",right:"x",bottom:"y",left:"x"})}function yo(t){return bo(t,["topLeft","topRight","bottomLeft","bottomRight"])}function xo(t){const e=vo(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function _o(t,e){t=t||{},e=e||Gs.font;let i=Dn(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=Dn(t.style,e.style);n&&!(""+n).match(po)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:Dn(t.family,e.family),lineHeight:go(Dn(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:Dn(t.weight,e.weight),string:""};return s.string=function(t){return!t||An(t.size)||An(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(s),s}function wo(t,e,i,n){let s,o,r,a=!0;for(s=0,o=t.length;st[0]){const o=i||t;void 0===n&&(n=Ro("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:n,_getTarget:s,override:i=>So([i,...t],e,o,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>To(i,n,()=>function(t,e,i,n){let s;for(const o of e)if(s=Ro(Eo(o,t),i),void 0!==s)return Ao(t,s)?Do(i,n,t,s):s}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>jo(t).includes(e),ownKeys:t=>jo(t),set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function Mo(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Oo(t,n),setContext:e=>Mo(t,e,i,n),override:s=>Mo(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>To(t,e,()=>function(t,e,i){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=t;let a=n[e];Xn(a)&&r.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(o,r||n);a.delete(t),Ao(t,l)&&(l=Do(s._scopes,s,t,l));return l}(e,a,t,i));Tn(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=i;if(void 0!==o.index&&n(t))return e[o.index%e.length];if(Cn(e[0])){const i=e,n=s._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=Do(n,s,t,l);e.push(Mo(i,o,r&&r[t],a))}}return e}(e,a,t,r.isIndexable));Ao(e,a)&&(a=Mo(a,s,o&&o[e],r));return a}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function Oo(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:Xn(i)?i:()=>i,isIndexable:Xn(n)?n:()=>n}}const Eo=(t,e)=>t?t+qn(e):e,Ao=(t,e)=>Cn(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function To(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const n=i();return t[e]=n,n}function Co(t,e,i){return Xn(t)?t(e,i):t}const Po=(t,e)=>!0===t?e:"string"==typeof t?Un(e,t):void 0;function Lo(t,e,i,n,s){for(const o of e){const e=Po(i,o);if(e){t.add(e);const o=Co(e._fallback,i,s);if(void 0!==o&&o!==i&&o!==n)return o}else if(!1===e&&void 0!==n&&i!==n)return null}return!1}function Do(t,e,i,n){const s=e._rootScopes,o=Co(e._fallback,i,n),r=[...t,...s],a=new Set;a.add(n);let l=Io(a,r,i,o||i,n);return null!==l&&((void 0===o||o===i||(l=Io(a,r,o,l,n),null!==l))&&So(Array.from(a),[""],s,o,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];if(Tn(s)&&Cn(i))return i;return s||{}}(e,i,n)))}function Io(t,e,i,n,s){for(;i;)i=Lo(t,e,i,n,s);return i}function Ro(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function jo(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function Fo(t,e,i,n){const{iScale:s}=t,{key:o="r"}=this._parsing,r=new Array(n);let a,l,c,h;for(a=0,l=n;ae"x"===t?"y":"x";function Wo(t,e,i,n){const s=t.skip?e:t,o=e,r=i.skip?e:i,a=ps(o,s),l=ps(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function Vo(t,e="x"){const i=No(e),n=t.length,s=Array(n).fill(0),o=Array(n);let r,a,l,c=Bo(t,0);for(r=0;r!t.skip)),"monotone"===e.cubicInterpolationMode)Vo(t,s);else{let i=n?t[t.length-1]:t[0];for(o=0,r=t.length;ot.ownerDocument.defaultView.getComputedStyle(t,null);const Jo=["top","right","bottom","left"];function Go(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const o=Jo[s];n[o]=parseFloat(t[e+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function Ko(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,s=Xo(i),o="border-box"===s.boxSizing,r=Go(s,"padding"),a=Go(s,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:s,offsetY:o}=n;let r,a,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,o,t.target))r=s,a=o;else{const t=e.getBoundingClientRect();r=n.clientX-t.left,a=n.clientY-t.top,l=!0}return{x:r,y:a,box:l}}(t,i),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:p}=e;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/p*i.height/n)}}const Qo=t=>Math.round(10*t)/10;function Zo(t,e,i,n){const s=Xo(t),o=Go(s,"margin"),r=Yo(s.maxWidth,t,"clientWidth")||Zn,a=Yo(s.maxHeight,t,"clientHeight")||Zn,l=function(t,e,i){let n,s;if(void 0===e||void 0===i){const o=t&&qo(t);if(o){const t=o.getBoundingClientRect(),r=Xo(o),a=Go(r,"border","width"),l=Go(r,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=Yo(r.maxWidth,o,"clientWidth"),s=Yo(r.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||Zn,maxHeight:s||Zn}}(t,e,i);let{width:c,height:h}=l;if("content-box"===s.boxSizing){const t=Go(s,"border","width"),e=Go(s,"padding");c-=e.width+t.width,h-=e.height+t.height}c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=Qo(Math.min(c,r,l.maxWidth)),h=Qo(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Qo(c/2));return(void 0!==e||void 0!==i)&&n&&l.height&&h>l.height&&(h=l.height,c=Qo(Math.floor(h*n))),{width:c,height:h}}function tr(t,e,i){const n=e||1,s=Qo(t.height*n),o=Qo(t.width*n);t.height=Qo(t.height),t.width=Qo(t.width);const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||r.height!==s||r.width!==o)&&(t.currentDevicePixelRatio=n,r.height=s,r.width=o,t.ctx.setTransform(n,0,0,n,0,0),!0)}const er=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Uo()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function ir(t,e){const i=function(t,e){return Xo(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function nr(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function sr(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function or(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},r=nr(t,s,i),a=nr(s,o,i),l=nr(o,e,i),c=nr(r,a,i),h=nr(a,l,i);return nr(c,h,i)}function rr(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function ar(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function lr(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function cr(t){return"angle"===t?{between:bs,compare:gs,normalize:ms}:{between:ys,compare:(t,e)=>t-e,normalize:t=>t}}function hr({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:s}}function dr(t,e,i){if(!i)return[t];const{property:n,start:s,end:o}=i,r=e.length,{compare:a,between:l,normalize:c}=cr(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:s,end:o}=i,{between:r,normalize:a}=cr(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cv||l(s,b,g)&&0!==a(s,b),_=()=>!v||0===a(o,g)||l(o,b,g);for(let t=h,i=h;t<=d;++t)m=e[t%r],m.skip||(g=c(m[n]),g!==b&&(v=l(g,s,o),null===y&&x()&&(y=0===a(g,s)?t:i),null!==y&&_()&&(p.push(hr({start:y,end:t,loop:u,count:r,style:f})),y=null),i=t,b=g));return null!==y&&p.push(hr({start:y,end:d,loop:u,count:r,style:f})),p}function ur(t,e){const i=[],n=t.segments;for(let s=0;sn({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Os.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let o,r=s.length-1,a=!1;for(;r>=0;--r)o=s[r],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),a=!0):(s[r]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var yr=new vr;const xr="transparent",_r={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Fs(t||xr),s=n.valid&&Fs(e||xr);return s&&s.valid?s.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class wr{constructor(t,e,i,n){const s=e[i];n=wo([t.to,n,s,t.from]);const o=wo([t.from,s,n]);this._active=!0,this._fn=t.fn||_r[t.type||typeof o],this._easing=Rs[t.easing]||Rs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=wo([t.to,e,n,t.from]),this._from=wo([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||e1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,r,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t{const s=t[n];if(!Cn(s))return;const o={};for(const t of e)o[t]=s[t];(Tn(s.properties)&&s.properties||[n]).forEach(t=>{t!==n&&i.has(t)||i.set(t,o)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),o=Object.keys(e),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const l=o[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=s[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,r);continue}h.cancel()}d&&d.duration?(s[l]=h=new wr(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(yr.add(this._chart,i),!0):void 0}}function Sr(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:n?o:s,end:n?s:o}}function Mr(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=n.length;s0||!i&&e<0)return s.index}return null}function Cr(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,r,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Lr(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i],void 0!==e[n]._visualValues&&void 0!==e[n]._visualValues[i]&&delete e[n]._visualValues[i]}}}const Dr=t=>"reset"===t||"none"===t,Ir=(t,e)=>e?t:Object.assign({},t);class Rr{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Er(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Lr(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=e.xAxisID=Dn(i.xAxisID,Pr(t,"x")),o=e.yAxisID=Dn(i.yAxisID,Pr(t,"y")),r=e.rAxisID=Dn(i.rAxisID,Pr(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,s,o,r),c=e.vAxisID=n(a,o,s,r);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ss(this._data,this),t._stacked&&Lr(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Cn(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:n}=e,s="x"===i.axis?"x":"y",o="x"===n.axis?"x":"y",r=Object.keys(t),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l{const e="_onData"+qn(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const s=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),s}})}))),this._syncList=[],this._data=e}var n,s}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=Er(e.vScale,e),e.stack!==i.stack&&(n=!0,Lr(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&(Cr(this,e._parsed),e._stacked=Er(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=Tn(n[t])?this.parseArrayData(i,n,t,e):Cn(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const s=()=>null===l[r]||d&&l[r]t&&!e.hidden&&e._stacked&&{keys:Mr(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}(r);let d,u;function f(){u=n[d];const e=u[r.axis];return!Pn(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,s,o;for(n=0,s=e.length;n=0&&tthis.getContext(i,n,e),h);return f.$shared&&(f.$shared=a,s[o]=Object.freeze(Ir(f,a))),f}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,o=`animation-${e}`,r=s[o];if(r)return r;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),o=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(o,this.getContext(t,i,e))}const l=new kr(n,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Dr(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(e,s)||s!==n;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:o}}updateElement(t,e,i,n){Dr(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Dr(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,s=e.length,o=Math.min(s,n);o&&this.parse(0,o),s>n?this._insertElements(n,s-n,t):s{for(t.length+=e,r=t.length-1;r>=o;r--)t[r]=t[r-e]};for(a(s),r=t;rt-e))}return t._cache.$bar}(e,t.type);let n,s,o,r,a=e._length;const l=()=>{32767!==o&&-32768!==o&&(Yn(r)&&(a=Math.min(a,Math.abs(o-r)||a)),r=o)};for(n=0,s=i.length;nMath.abs(a)&&(l=a,c=r),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function zr(t,e,i,n){const s=t.iScale,o=t.vScale,r=s.getLabels(),a=s===o,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:n,color:s,useBorderRadius:o,borderRadius:r}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((e,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:e,fillStyle:l.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(a),lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:l.borderWidth,strokeStyle:l.borderColor,textAlign:n,pointStyle:i,borderRadius:o&&(r||l.borderRadius),index:a}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let s,o,r=t=>+i[t];if(Cn(i[t])){const{key:t="value"}=this._parsing;r=e=>+Un(i[e],t)}for(s=t,o=t+e;sbs(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>bs(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),g=f(0,c,d),m=f(es,h,u),b=p(Gn,c,d),v=p(Gn+es,h,u);n=(g-b)/2,s=(m-v)/2,o=-(g+b)/2,r=-(m+v)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}(u,d,a),b=(i.width-o)/f,v=(i.height-o)/p,y=Math.max(Math.min(b,v)/2,0),x=In(this.options.radius,y),_=(x-Math.max(x*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=m*x,n.total=this.calculateTotal(),this.outerRadius=x-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*h,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*s/Kn)}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,r=o.chartArea,a=o.options.animation,l=(r.left+r.right)/2,c=(r.top+r.bottom)/2,h=s&&a.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,{sharedOptions:f,includeOptions:p}=this._getSharedOptions(e,n);let g,m=this._getRotation();for(g=0;g0&&!isNaN(t)?Kn*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=Vs(e._parsed[t],i.options.locale);return{label:n[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,o,r,a;if(!t)for(n=0,s=i.data.datasets.length;n{const o=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:n,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=Vs(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:s}}parseObjectData(t,e,i,n){return Fo.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{const n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(ne.max&&(e.max=n))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),o=(s-Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=s-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,r=o.options.animation,a=this._cachedMeta.rScale,l=a.xCenter,c=a.yCenter,h=a.getIndexAngle(0)-.5*Gn;let d,u=h;const f=360/this.countVisibleElements();for(d=0;d{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?hs(this.resolveDataElementOptions(t,e).angle||i):0}}var qr=Object.freeze({__proto__:null,BarController:class extends Rr{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,n){return zr(t,e,i,n)}parseArrayData(t,e,i,n){return zr(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:s,vScale:o}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,l="x"===s.axis?r:a,c="x"===o.axis?r:a,h=[];let d,u,f,p;for(d=i,u=i+n;dt.controller.options.grouped),s=i.options.stacked,o=[],r=this._cachedMeta.controller.getParsed(e),a=r&&r[i.axis],l=t=>{const e=t._parsed.find(t=>t[i.axis]===a),n=e&&e[t.vScale.axis];if(An(n)||isNaN(n))return!0};for(const i of n)if((void 0===e||!l(i))&&((!1===s||-1===o.indexOf(i.stack)||void 0===s&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Dn("x"===this.chart.options.indexAxis?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const n=this._getStacks(t,i),s=void 0!==e?n.indexOf(e):-1;return-1===s?n.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let s,o;for(s=0,o=e.data.length;s=i?1:-1)}(d,e,r)*o,u===r&&(m-=d/2);const t=e.getPixelForDecimal(0),s=e.getPixelForDecimal(1),l=Math.min(t,s),f=Math.max(t,s);m=Math.max(Math.min(m,f),l),h=m+d,i&&!c&&(a._stacks[e.axis]._visualValues[n]=e.getValueForPixel(h)-e.getValueForPixel(m))}if(m===e.getPixelForValue(r)){const t=os(d)*e.getLineWidthForValue(r)/2;m+=t,d-=t}return{size:d,base:m,head:h,center:h+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,s=n.skipNull,o=Dn(n.maxBarThickness,1/0);let r,a;const l=this._getAxisCount();if(e.grouped){const i=s?this._getStackCount(t):e.stackCount,c="flex"===n.barThickness?function(t,e,i,n){const s=e.pixels,o=s[t];let r=t>0?s[t-1]:null,a=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:s}=e,o=this.getParsed(t),r=n.getLabelForValue(o.x),a=s.getLabelForValue(o.y),l=o._custom;return{label:i[t]||"",value:"("+r+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(e,n),c=o.axis,h=r.axis;for(let d=e;d0&&this.getParsed(e-1);for(let i=0;i=b){v.skip=!0;continue}const x=this.getParsed(i),_=An(x[u]),w=v[d]=o.getPixelForValue(x[d],i),k=v[u]=s||_?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,x,a):x[u],i);v.skip=isNaN(w)||isNaN(k)||_,v.stop=i>0&&Math.abs(x[d]-y[d])>g,p&&(v.parsed=x,v.raw=l.data[i]),h&&(v.options=c||this.resolveDataElementOptions(i,f.active?"active":n)),m||this.updateElement(f,i,v,n),y=x}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends $r{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:Ur,RadarController:class extends Rr{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return Fo.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this._cachedMeta.rScale,o="reset"===n;for(let r=e;r0&&this.getParsed(e-1);for(let c=e;c0&&Math.abs(i[u]-v[u])>m,g&&(p.parsed=i,p.raw=l.data[c]),d&&(p.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),b||this.updateElement(e,c,p,n),v=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const s=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,s,o)/2}}});function Yr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xr{static override(t){Object.assign(Xr.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Yr()}parse(){return Yr()}format(){return Yr()}add(){return Yr()}diff(){return Yr()}startOf(){return Yr()}endOf(){return Yr()}}var Jr=Xr;function Gr(t,e,i,n){const{controller:s,data:o,_sorted:r}=t,a=s._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&"r"!==e&&r&&o.length){const r=a._reversePixels?ws:_s;if(!n){const n=r(o,e,i);if(l){const{vScale:e}=s._cachedMeta,{_parsed:i}=t,o=i.slice(0,n.lo+1).reverse().findIndex(t=>!An(t[e.axis]));n.lo-=Math.max(0,o);const r=i.slice(n.hi).findIndex(t=>!An(t[e.axis]));n.hi+=Math.max(0,r)}return n}if(s._sharedOptions){const t=o[0],n="function"==typeof t.getRange&&t.getRange(e);if(n){const t=r(o,e,i-n),s=r(o,e,i+n);return{lo:t.lo,hi:s.hi}}}}return{lo:0,hi:o.length-1}}function Kr(t,e,i,n,s){const o=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=o.length;t{t[r]&&t[r](e[i],s)&&(o.push({element:t,datasetIndex:n,index:l}),a=a||t.inRange(e.x,e.y,s))}),n&&!a?[]:o}var ia={evaluateInteractionItems:Kr,modes:{index(t,e,i,n){const s=Ko(e,t),o=i.axis||"x",r=i.includeInvisible||!1,a=i.intersect?Qr(t,s,o,n,r):ta(t,s,o,!1,n,r),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,n){const s=Ko(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;let a=i.intersect?Qr(t,s,o,n,r):ta(t,s,o,!1,n,r);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;tQr(t,Ko(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){const s=Ko(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;return ta(t,s,o,i.intersect,n,r)},x:(t,e,i,n)=>ea(t,Ko(e,t),"x",i.intersect,n),y:(t,e,i,n)=>ea(t,Ko(e,t),"y",i.intersect,n)}};const na=["left","top","right","bottom"];function sa(t,e){return t.filter(t=>t.pos===e)}function oa(t,e){return t.filter(t=>-1===na.indexOf(t.pos)&&t.box.axis===e)}function ra(t,e){return t.sort((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function aa(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:s}=i;if(!t||!na.includes(n))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let o,r,a;for(o=0,r=t.length;o{n[t]=Math.max(e[t],i[t])}),n}return n(t?["left","right"]:["top","bottom"])}function ua(t,e,i,n){const s=[];let o,r,a,l,c,h;for(o=0,r=t.length,c=0;ot.box.fullSize),!0),n=ra(sa(e,"left"),!0),s=ra(sa(e,"right")),o=ra(sa(e,"top"),!0),r=ra(sa(e,"bottom")),a=oa(e,"x"),l=oa(e,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:sa(e,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;jn(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},s);ca(u,xo(n));const f=Object.assign({maxPadding:u,w:o,h:r,x:s.left,y:s.top},s),p=aa(l.concat(c),d);ua(a.fullSize,f,d,p),ua(l,f,d,p),ua(c,f,d,p)&&ua(l,f,d,p),function(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),pa(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,pa(a.rightAndBottom,f,d,p),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},jn(a.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class ma{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class ba extends ma{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const va="$chartjs",ya={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xa=t=>null===t||""===t;const _a=!!er&&{passive:!0};function wa(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,_a)}function ka(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Sa(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||ka(i.addedNodes,n),e=e&&!ka(i.removedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function Ma(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||ka(i.removedNodes,n),e=e&&!ka(i.addedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}const Oa=new Map;let Ea=0;function Aa(){const t=window.devicePixelRatio;t!==Ea&&(Ea=t,Oa.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Ta(t,e,i){const n=t.canvas,s=n&&qo(n);if(!s)return;const o=Es((t,e)=>{const n=s.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||o(i,n)});return r.observe(s),function(t,e){Oa.size||window.addEventListener("resize",Aa),Oa.set(t,e)}(t,o),r}function Ca(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Oa.delete(t),Oa.size||window.removeEventListener("resize",Aa)}(t)}function Pa(t,e,i){const n=t.canvas,s=Es(e=>{null!==t.ctx&&i(function(t,e){const i=ya[t.type]||t.type,{x:n,y:s}=Ko(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==s?s:null}}(e,t))},t);return function(t,e,i){t&&t.addEventListener(e,i,_a)}(n,e,s),s}class La extends ma{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),s=t.getAttribute("width");if(t[va]={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",xa(s)){const e=ir(t,"width");void 0!==e&&(t.width=e)}if(xa(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ir(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[va])return!1;const i=e[va].initial;["height","width"].forEach(t=>{const n=i[t];An(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e[va],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:Sa,detach:Ma,resize:Ta}[e]||Pa;n[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:Ca,detach:Ca,resize:Ca}[e]||wa)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Zo(t,e,i,n)}isAttached(t){const e=t&&qo(t);return!(!e||!e.isConnected)}}class Da{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return ls(this.x)&&ls(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}function Ia(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),s=t._maxLength/i;return Math.floor(Math.min(n,s))}(t),s=Math.min(i.maxTicksLimit||n,n),o=i.major.enabled?function(t){const e=[];let i,n;for(i=0,n=t.length;is)return function(t,e,i,n){let s,o=0,r=i[0];for(n=Math.ceil(n),s=0;st-e).pop(),e}(n);for(let t=0,e=o.length-1;ts)return e}return Math.max(s,1)}(o,e,s);if(r>0){let t,i;const n=r>1?Math.round((l-a)/(r-1)):null;for(Ra(e,c,h,An(n)?0:a-n,a),t=0,i=r-1;t"top"===e||"left"===e?t[e]+i:t[e]-i,Fa=(t,e)=>Math.min(e||t,t);function za(t,e){const i=[],n=t.length/e,s=t.length;let o=0;for(;or+a)))return c}function Na(t){return t.drawTicks?t.tickLength:0}function Wa(t,e){if(!t.display)return 0;const i=_o(t.font,e),n=xo(t.padding);return(Tn(t.text)?t.text.length:1)*i.lineHeight+n.height}function Va(t,e,i){let n=As(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Ha extends Da{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=Ln(t,Number.POSITIVE_INFINITY),e=Ln(e,Number.NEGATIVE_INFINITY),i=Ln(i,Number.POSITIVE_INFINITY),n=Ln(n,Number.NEGATIVE_INFINITY),{min:Ln(t,i),max:Ln(e,n),minDefined:Pn(t),maxDefined:Pn(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:s,maxDefined:o}=this.getUserBounds();if(s&&o)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let a=0,l=r.length;an?n:i,n=s&&i>n?i:n,{min:Ln(i,Ln(n,i)),max:Ln(n,Ln(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Rn(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:s}=t,o=In(e,(s-n)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(n,-Math.abs(o)),max:r(s,o)}}(this,s,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=vs(this.chart.width-h,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),h+6>o&&(o=u/(i-(t.offset?.5:1)),r=this.maxHeight-Na(t.grid)-e.padding-Wa(t.title,this.chart.options.font),a=Math.sqrt(h*h+d*d),l=ds(Math.min(Math.asin(vs((c.highest.height+6)/o,-1,1)),Math.asin(vs(r/a,-1,1))-Math.asin(vs(d/a,-1,1)))),l=Math.max(n,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){Rn(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Rn(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const o=Wa(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Na(s)+o):(t.height=this.maxHeight,t.width=Na(s)+o),i.display&&this.ticks.length){const{first:e,last:n,widest:s,highest:o}=this._getLabelSizes(),a=2*i.padding,l=hs(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(r){const e=i.mirror?0:h*s.width+c*o.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:c*s.width+h*o.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:s,padding:o},position:r}=this.options,a=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;a?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?h=t.width:"inner"!==s&&(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-r+o)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-c+o)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+o,this.paddingBottom=n+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Rn(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s({width:o[t]||0,height:r[t]||0});return{first:k(0),last:k(e-1),widest:k(_),highest:k(w),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return vs(this._alignToPixels?Zs(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tr*n?r/i:a/n:a*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:s,position:o,border:r}=n,a=s.offset,l=this.isHorizontal(),c=this.ticks.length+(a?1:0),h=Na(s),d=[],u=r.setContext(this.getContext()),f=u.display?u.width:0,p=f/2,g=function(t){return Zs(i,t,f)};let m,b,v,y,x,_,w,k,S,M,O,E;if("top"===o)m=g(this.bottom),_=this.bottom-h,k=m-p,M=g(t.top)+p,E=t.bottom;else if("bottom"===o)m=g(this.top),M=t.top,E=g(t.bottom)-p,_=m+p,k=this.top+h;else if("left"===o)m=g(this.right),x=this.right-h,w=m-p,S=g(t.left)+p,O=t.right;else if("right"===o)m=g(this.left),S=t.left,O=g(t.right)-p,x=m+p,w=this.left+h;else if("x"===e){if("center"===o)m=g((t.top+t.bottom)/2+.5);else if(Cn(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}M=t.top,E=t.bottom,_=m+p,k=_+h}else if("y"===e){if("center"===o)m=g((t.left+t.right)/2);else if(Cn(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}x=m-p,w=x-h,S=t.left,O=t.right}const A=Dn(n.ticks.maxTicksLimit,c),T=Math.max(1,Math.ceil(c/A));for(b=0;b0&&(o-=n/2)}d={left:o,top:s,width:n+e.width,height:i+e.height,color:t.backdropColor}}g.push({label:y,font:S,textOffset:E,options:{rotation:p,color:i,strokeColor:a,strokeWidth:c,textAlign:u,textBaseline:A,translation:[x,_],backdrop:d}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-hs(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:s}}=this.options,o=t+s,r=this._getLabelSizes().widest.width;let a,l;return"left"===e?n?(l=this.right+s,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l+=r)):(l=this.right-o,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l=this.left)):"right"===e?n?(l=this.left+s,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l-=r)):(l=this.left+o,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:s,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,s,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(e=>e.value===t);if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,o=n.length;s{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,o;for(s=0,o=e.length;s{const n=i.split("."),s=n.pop(),o=[t].concat(n).join("."),r=e[i].split("."),a=r.pop(),l=r.join(".");Gs.route(o,s,l,a)})}(e,t.defaultRoutes);t.descriptors&&Gs.describe(e,t.descriptors)}(t,o,i),this.override&&Gs.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Gs[n]&&(delete Gs[n][i],this.override&&delete Us[i])}}class Ua{constructor(){this.controllers=new $a(Rr,"datasets",!0),this.elements=new $a(Da,"elements"),this.plugins=new $a(Object,"plugins"),this.scales=new $a(Ha,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):jn(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=qn(t);Rn(i["before"+n],[],i),e[t](i),Rn(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Xa(t,e){return e||!1!==t?!0===t?{}:t:null}function Ja(t,{plugin:e,local:i},n,s){const o=t.pluginScopeKeys(e),r=t.getOptionScopes(n,o);return i&&e.defaults&&r.push(e.defaults),t.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ga(t,e){const i=Gs.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Ka(t){if("x"===t||"y"===t||"r"===t)return t}function Qa(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function Za(t,...e){if(Ka(t))return t;for(const i of e){const e=i.axis||Qa(i.position)||t.length>1&&Ka(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function tl(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function el(t,e){const i=Us[t.type]||{scales:{}},n=e.scales||{},s=Ga(t.type,e),o=Object.create(null);return Object.keys(n).forEach(e=>{const r=n[e];if(!Cn(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const a=Za(e,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return tl(t,"x",i[0])||tl(t,"y",i[0])}return{}}(e,t),Gs.scales[r.type]),l=function(t,e){return t===e?"_index_":"_value_"}(a,s),c=i.scales||{};o[e]=Vn(Object.create(null),[{axis:a},r,c[a],c[l]])}),t.data.datasets.forEach(i=>{const s=i.type||t.type,r=i.indexAxis||Ga(s,e),a=(Us[s]||{}).scales||{};Object.keys(a).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),s=i[e+"AxisID"]||e;o[s]=o[s]||Object.create(null),Vn(o[s],[{axis:e},n[s],a[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];Vn(e,[Gs.scales[e.type],Gs.scale])}),o}function il(t){const e=t.options||(t.options={});e.plugins=Dn(e.plugins,{}),e.scales=el(t,e)}function nl(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const sl=new Map,ol=new Set;function rl(t,e){let i=sl.get(t);return i||(i=e(),sl.set(t,i),ol.add(i)),i}const al=(t,e,i)=>{const n=Un(e,i);void 0!==n&&t.add(n)};class ll{constructor(t){this._config=function(t){return(t=t||{}).data=nl(t.data),il(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=nl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),il(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return rl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return rl(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return rl(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return rl(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:s}=this,o=this._cachedScopes(t,i),r=o.get(e);if(r)return r;const a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>al(a,t,e))),e.forEach(t=>al(a,n,t)),e.forEach(t=>al(a,Us[s]||{},t)),e.forEach(t=>al(a,Gs,t)),e.forEach(t=>al(a,qs,t))});const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),ol.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Us[e]||{},Gs.datasets[e]||{},{type:e},Gs,qs]}resolveNamedOptions(t,e,i,n=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=cl(this._resolverCache,t,n);let a=o;if(function(t,e){const{isScriptable:i,isIndexable:n}=Oo(t);for(const s of e){const e=i(s),o=n(s),r=(o||e)&&t[s];if(e&&(Xn(r)||hl(r))||o&&Tn(r))return!0}return!1}(o,e)){s.$shared=!1;a=Mo(o,i=Xn(i)?i():i,this.createResolver(t,i,r))}for(const t of e)s[t]=a[t];return s}createResolver(t,e,i=[""],n){const{resolver:s}=cl(this._resolverCache,t,i);return Cn(e)?Mo(s,e,void 0,n):s}}function cl(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const s=i.join();let o=n.get(s);if(!o){o={resolver:So(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(s,o)}return o}const hl=t=>Cn(t)&&Object.getOwnPropertyNames(t).some(e=>Xn(t[e]));const dl=["top","bottom","left","right","chartArea"];function ul(t,e){return"top"===t||"bottom"===t||-1===dl.indexOf(t)&&"x"===e}function fl(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function pl(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Rn(i&&i.onComplete,[t],e)}function gl(t){const e=t.chart,i=e.options.animation;Rn(i&&i.onProgress,[t],e)}function ml(t){return Uo()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const bl={},vl=t=>{const e=ml(t);return Object.values(bl).filter(t=>t.canvas===e).pop()};function yl(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const o=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=o)}}}class xl{static defaults=Gs;static instances=bl;static overrides=Us;static registry=qa;static version="4.5.1";static getChart=vl;static register(...t){qa.add(...t),_l()}static unregister(...t){qa.remove(...t),_l()}constructor(t,e){const i=this.config=new ll(e),n=ml(t),s=vl(n);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Uo()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?ba:La}(n)),this.platform.updateConfig(i);const r=this.platform.acquireContext(n,o.aspectRatio),a=r&&r.canvas,l=a&&a.height,c=a&&a.width;this.id=En(),this.ctx=r,this.canvas=a,this.width=c,this.height=l,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ya,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),o.resizeDelay||0),this._dataChanges=[],bl[this.id]=this,r&&a?(yr.listen(this,"complete",pl),yr.listen(this,"progress",gl),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:s}=this;return An(t)?e&&s?s:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return qa}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return to(this.canvas,this.ctx),this}stop(){return yr.stop(this),this}resize(t,e){yr.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,t,e,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,tr(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Rn(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){jn(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let s=[];e&&(s=s.concat(Object.keys(e).map(t=>{const i=e[t],n=Za(t,i),s="r"===n,o="x"===n;return{options:i,dposition:s?"chartArea":o?"bottom":"left",dtype:s?"radialLinear":o?"category":"linear"}}))),jn(s,e=>{const s=e.options,o=s.id,r=Za(o,s),a=Dn(s.type,e.dtype);void 0!==s.position&&ul(s.position,r)===ul(e.dposition)||(s.position=e.dposition),n[o]=!0;let l=null;if(o in i&&i[o].type===a)l=i[o];else{l=new(qa.getScale(a))({id:o,type:a,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(s,t)}),jn(n,(t,e)=>{t||delete i[e]}),jn(i,t=>{ga.configure(this,t,t.options),ga.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(fl("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){jn(this.scales,t=>{ga.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);Jn(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e){yl(t,n,"_removeElements"===i?-s:s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;ga.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],jn(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},n=br(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(n&&so(e,n),t.controller.draw(),n&&oo(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return no(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const s=ia.modes[e];return"function"==typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=ko(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,n);Yn(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(s,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),yr.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};jn(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():o()}unbindEvents(){jn(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},jn(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,o,r,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),r=0,a=t.length;r{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!Fn(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=s(e,t),r=i?t:s(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:s}=this,o=e,r=this._getActiveElements(t,n,i,o),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,Rn(s.onHover,[t,r,this],this),a&&Rn(s.onClick,[t,r,this],this));const c=!Fn(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}function _l(){return jn(xl.instances,t=>t._plugins.invalidate())}function wl(t,e,i,n){const s=bo(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(i-e)/2,r=Math.min(o,n*e/2),a=t=>{const e=(i-Math.min(o,t))*n/2;return vs(t,0,Math.min(o,e))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:vs(s.innerStart,0,r),innerEnd:vs(s.innerEnd,0,r)}}function kl(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function Sl(t,e,i,n,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=e,d=Math.max(e.outerRadius+n+i-c,0),u=h>0?h+n+i+c:0;let f=0;const p=s-l;if(n){const t=((h>0?h-n:0)+(d>0?d-n:0))/2;f=(p-(0!==t?p*t/(t+n):p))/2}const g=(p-Math.max(.001,p*d-i/Gn)/d)/2,m=l+g+f,b=s-g-f,{outerStart:v,outerEnd:y,innerStart:x,innerEnd:_}=wl(e,u,d,b-m),w=d-v,k=d-y,S=m+v/w,M=b-y/k,O=u+x,E=u+_,A=m+x/O,T=b-_/E;if(t.beginPath(),o){const e=(S+M)/2;if(t.arc(r,a,d,S,e),t.arc(r,a,d,e,M),y>0){const e=kl(k,M,r,a);t.arc(e.x,e.y,y,M,b+es)}const i=kl(E,b,r,a);if(t.lineTo(i.x,i.y),_>0){const e=kl(E,T,r,a);t.arc(e.x,e.y,_,b+es,T+Math.PI)}const n=(b-_/u+(m+x/u))/2;if(t.arc(r,a,u,b-_/u,n,!0),t.arc(r,a,u,n,m+x/u,!0),x>0){const e=kl(O,A,r,a);t.arc(e.x,e.y,x,A+Math.PI,m-es)}const s=kl(w,m,r,a);if(t.lineTo(s.x,s.y),v>0){const e=kl(w,S,r,a);t.arc(e.x,e.y,v,m-es,S)}}else{t.moveTo(r,a);const e=Math.cos(S)*d+r,i=Math.sin(S)*d+a;t.lineTo(e,i);const n=Math.cos(M)*d+r,s=Math.sin(M)*d+a;t.lineTo(n,s)}t.closePath()}function Ml(t,e,i,n,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=e,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u,borderRadius:f}=l,p="inner"===l.borderAlign;if(!c)return;t.setLineDash(d||[]),t.lineDashOffset=u,p?(t.lineWidth=2*c,t.lineJoin=h||"round"):(t.lineWidth=c,t.lineJoin=h||"bevel");let g=e.endAngle;if(o){Sl(t,e,i,n,g,s);for(let e=0;es?(c=s/l,t.arc(o,r,l,i+c,n-c,!0)):t.arc(o,r,s,i+es,n-es),t.closePath(),t.clip()}(t,e,g),l.selfJoin&&g-r>=Gn&&0===f&&"miter"!==h&&function(t,e,i){const{startAngle:n,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=e,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/r,ms(n-i));if(t.beginPath(),t.arc(s,o,r-c/2,n+d/2,i-d/2),a>0){const e=Math.min(c/a,ms(n-i));t.arc(s,o,a+c/2,i-e/2,n+e/2,!0)}else{const e=Math.min(c/2,r*ms(n-i));if("round"===h)t.arc(s,o,e,i-Gn/2,n+Gn/2,!0);else if("bevel"===h){const r=2*e*e,a=-r*Math.cos(i+Gn/2)+s,l=-r*Math.sin(i+Gn/2)+o,c=r*Math.cos(n+Gn/2)+s,h=r*Math.sin(n+Gn/2)+o;t.lineTo(a,l),t.lineTo(c,h)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}(t,e,g),o||(Sl(t,e,i,n,g,s),t.stroke())}function Ol(t,e,i=e){t.lineCap=Dn(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Dn(i.borderDash,e.borderDash)),t.lineDashOffset=Dn(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Dn(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Dn(i.borderWidth,e.borderWidth),t.strokeStyle=Dn(i.borderColor,e.borderColor)}function El(t,e,i){t.lineTo(i.x,i.y)}function Al(t,e,i={}){const n=t.length,{start:s=0,end:o=n-1}=i,{start:r,end:a}=e,l=Math.max(s,r),c=Math.min(o,a),h=sa&&o>a;return{count:n,start:l,loop:e.loop,ilen:c(r+(c?a-t:t))%o,y=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=s[v(0)],t.moveTo(d.x,d.y)),h=0;h<=a;++h){if(d=s[v(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ip&&(p=i),m=(b*m+e)/++b):(y(),t.lineTo(e,i),u=n,b=0,f=p=i),g=i}y()}function Pl(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?Cl:Tl}const Ll="function"==typeof Path2D;function Dl(t,e,i,n){Ll&&!e.options.segment?function(t,e,i,n){let s=e._path;s||(s=e._path=new Path2D,e.path(s,i,n)&&s.closePath()),Ol(t,e.options),t.stroke(s)}(t,e,i,n):function(t,e,i,n){const{segments:s,options:o}=e,r=Pl(e);for(const a of s)Ol(t,o,a.style),t.beginPath(),r(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}class Il extends Da{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;$o(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const o=!!t._loop,{start:r,end:a}=function(t,e,i,n){let s=0,o=e-1;if(i&&!n)for(;ss&&t[o%e].skip;)o--;return o%=e,{start:s,end:o}}(i,s,o,n);return fr(t,!0===n?[{start:r,end:a,loop:o}]:function(t,e,i,n){const s=t.length,o=[];let r,a=e,l=t[e];for(r=e+1;r<=i;++r){const i=t[r%s];i.skip||i.stop?l.skip||(n=!1,o.push({start:e%s,end:(r-1)%s,loop:n}),e=a=i.stop?r:null):(a=r,l.skip&&(e=r)),l=i}return null!==a&&o.push({start:e%s,end:a%s,loop:n}),o}(i,r,a"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:s,distance:o}=fs(n,{x:t,y:e}),{startAngle:r,endAngle:a,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,u=Dn(h,a-r),f=bs(s,r,a)&&r!==a,p=u>=Kn||f,g=ys(o,l+d,c+d);return p&&g}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:a,spacing:l}=this.options,c=(n+s)/2,h=(o+r+l+a)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/4,s=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>Kn?Math.floor(i/Kn):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*n,Math.sin(r)*n);const a=n*(1-Math.sin(Math.min(Gn,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,n,s){const{fullCircles:o,startAngle:r,circumference:a}=e;let l=e.endAngle;if(o){Sl(t,e,i,n,l,s);for(let e=0;et.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ul(t){return Hl[t%Hl.length]}function ql(t){return $l[t%$l.length]}function Yl(t){let e=0;return(i,n)=>{const s=t.getDatasetMeta(n).controller;s instanceof $r?e=function(t,e){return t.backgroundColor=t.data.map(()=>Ul(e++)),e}(i,e):s instanceof Ur?e=function(t,e){return t.backgroundColor=t.data.map(()=>ql(e++)),e}(i,e):s&&(e=function(t,e){return t.borderColor=Ul(e),t.backgroundColor=ql(e),++e}(i,e))}}function Xl(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var Jl={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:n},options:s}=t.config,{elements:o}=s,r=Xl(n)||(a=s)&&(a.borderColor||a.backgroundColor)||o&&Xl(o)||"rgba(0,0,0,0.1)"!==Gs.borderColor||"rgba(0,0,0,0.1)"!==Gs.backgroundColor;var a;if(!i.forceOverride&&r)return;const l=Yl(t);n.forEach(l)}};function Gl(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Kl(t){t.data.datasets.forEach(t=>{Gl(t)})}var Ql={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Kl(t);const n=t.width;t.data.datasets.forEach((e,s)=>{const{_data:o,indexAxis:r}=e,a=t.getDatasetMeta(s),l=o||e.data;if("y"===wo([r,t.options.indexAxis]))return;if(!a.controller.supportsDecimation)return;const c=t.scales[a.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let{start:h,count:d}=function(t,e){const i=e.length;let n,s=0;const{iScale:o}=t,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(s=vs(_s(e,o.axis,r).lo,0,i-1)),n=c?vs(_s(e,o.axis,a).hi+1,s,i)-s:i-s,{start:s,count:n}}(a,l);if(d<=(i.threshold||4*n))return void Gl(e);let u;switch(An(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":u=function(t,e,i,n,s){const o=s.samples||n;if(o>=i)return t.slice(e,e+i);const r=[],a=(i-2)/(o-2);let l=0;const c=e+i-1;let h,d,u,f,p,g=e;for(r[l++]=t[g],h=0;hu&&(u=f,d=t[n],p=n);r[l++]=d,g=p}return r[l++]=t[c],r}(l,h,d,n,i);break;case"min-max":u=function(t,e,i,n){let s,o,r,a,l,c,h,d,u,f,p=0,g=0;const m=[],b=e+i-1,v=t[e].x,y=t[b].x-v;for(s=e;sf&&(f=a,h=s),p=(g*p+o.x)/++g;else{const i=s-1;if(!An(c)&&!An(h)){const e=Math.min(c,h),n=Math.max(c,h);e!==d&&e!==i&&m.push({...t[e],x:p}),n!==d&&n!==i&&m.push({...t[n],x:p})}s>0&&i!==d&&m.push(t[i]),m.push(o),l=e,g=0,u=f=a,c=h=d=s}}return m}(l,h,d,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=u})},destroy(t){Kl(t)}};function Zl(t,e,i,n){if(n)return;let s=e[t],o=i[t];return"angle"===t&&(s=ms(s),o=ms(o)),{property:t,start:s,end:o}}function tc(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function ec(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function ic(t,e){let i=[],n=!1;return Tn(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:n=null}=t||{},s=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=tc(t,e,s);const r=s[t],a=s[e];null!==n?(o.push({x:r.x,y:n}),o.push({x:a.x,y:n})):null!==i&&(o.push({x:i,y:r.y}),o.push({x:i,y:a.y}))}),o}(t,e),i.length?new Il({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function nc(t){return t&&!1!==t.fill}function sc(t,e,i){let n=t[e].fill;const s=[e];let o;if(!i)return n;for(;!1!==n&&-1===s.indexOf(n);){if(!Pn(n))return n;if(o=t[n],!o)return!1;if(o.visible)return n;s.push(n),n=o.fill}return!1}function oc(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=Dn(i&&i.target,i);void 0===n&&(n=!!e.backgroundColor);if(!1===n||null===n)return!1;if(!0===n)return"origin";return n}(t);if(Cn(n))return!isNaN(n.value)&&n;let s=parseFloat(n);return Pn(s)&&Math.floor(s)===s?function(t,e,i,n){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=n)return!1;return i}(n[0],e,s,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function rc(t,e,i){const n=[];for(let s=0;s=0;--e){const i=s[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),n&&i.fill&&hc(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;nc(i)&&hc(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;nc(n)&&"beforeDatasetDraw"===i.drawTime&&hc(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const bc=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}};class vc extends Da{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Rn(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,n=_o(i.font),s=n.size,o=this._computeTitleHeight(),{boxWidth:r,itemHeight:a}=bc(i,s);let l,c;e.font=n.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(o,s,r,a)+10):(c=this.maxHeight,l=this._fitCols(o,n,r,a)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:s,maxWidth:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],c=n+r;let h=t;s.textAlign="left",s.textBaseline="middle";let d=-1,u=-c;return this.legendItems.forEach((t,f)=>{const p=i+e/2+s.measureText(t.text).width;(0===f||l[l.length-1]+p+2*r>o)&&(h+=c,l[l.length-(f>0?0:1)]=0,u+=c,d++),a[f]={left:0,top:u,row:d,width:p,height:n},l[l.length-1]+=p+r}),h}_fitCols(t,e,i,n){const{ctx:s,maxHeight:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-t;let h=r,d=0,u=0,f=0,p=0;return this.legendItems.forEach((t,o)=>{const{itemWidth:g,itemHeight:m}=function(t,e,i,n,s){const o=function(t,e,i,n){let s=t.text;s&&"string"!=typeof s&&(s=s.reduce((t,e)=>t.length>e.length?t:e));return e+i.size/2+n.measureText(s).width}(n,t,e,i),r=function(t,e,i){let n=t;"string"!=typeof e.text&&(n=yc(e,i));return n}(s,n,e.lineHeight);return{itemWidth:o,itemHeight:r}}(i,e,s,t,n);o>0&&u+m+2*r>c&&(h+=d+r,l.push({width:d,height:u}),f+=d+r,p++,d=u=0),a[o]={left:f,top:u,col:p,width:g,height:m},d=Math.max(d,g),u+=m+r}),h+=d,l.push({width:d,height:u}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:s}}=this,o=rr(s,this.left,this.width);if(this.isHorizontal()){let s=0,r=Ts(i,this.left+n,this.right-this.lineWidths[s]);for(const a of e)s!==a.row&&(s=a.row,r=Ts(i,this.left+n,this.right-this.lineWidths[s])),a.top+=this.top+t+n,a.left=o.leftForLtr(o.x(r),a.width),r+=a.width+n}else{let s=0,r=Ts(i,this.top+t+n,this.bottom-this.columnSizes[s].height);for(const a of e)a.col!==s&&(s=a.col,r=Ts(i,this.top+t+n,this.bottom-this.columnSizes[s].height)),a.top=r,a.left+=this.left+n,a.left=o.leftForLtr(o.x(a.left),a.width),r+=a.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;so(t,this),this._draw(),oo(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:s,labels:o}=t,r=Gs.color,a=rr(t.rtl,this.left,this.width),l=_o(o.font),{padding:c}=o,h=l.size,d=h/2;let u;this.drawTitle(),n.textAlign=a.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:f,boxHeight:p,itemHeight:g}=bc(o,h),m=this.isHorizontal(),b=this._computeTitleHeight();u=m?{x:Ts(s,this.left+c,this.right-i[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:Ts(s,this.top+b+c,this.bottom-e[0].height),line:0},ar(this.ctx,t.textDirection);const v=g+c;this.legendItems.forEach((y,x)=>{n.strokeStyle=y.fontColor,n.fillStyle=y.fontColor;const _=n.measureText(y.text).width,w=a.textAlign(y.textAlign||(y.textAlign=o.textAlign)),k=f+d+_;let S=u.x,M=u.y;a.setWidth(this.width),m?x>0&&S+k+c>this.right&&(M=u.y+=v,u.line++,S=u.x=Ts(s,this.left+c,this.right-i[u.line])):x>0&&M+v>this.bottom&&(S=u.x=S+e[u.line].width+c,u.line++,M=u.y=Ts(s,this.top+b+c,this.bottom-e[u.line].height));if(function(t,e,i){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;n.save();const s=Dn(i.lineWidth,1);if(n.fillStyle=Dn(i.fillStyle,r),n.lineCap=Dn(i.lineCap,"butt"),n.lineDashOffset=Dn(i.lineDashOffset,0),n.lineJoin=Dn(i.lineJoin,"miter"),n.lineWidth=s,n.strokeStyle=Dn(i.strokeStyle,r),n.setLineDash(Dn(i.lineDash,[])),o.usePointStyle){const r={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:s},l=a.xPlus(t,f/2);io(n,r,l,e+d,o.pointStyleWidth&&f)}else{const o=e+Math.max((h-p)/2,0),r=a.leftForLtr(t,f),l=yo(i.borderRadius);n.beginPath(),Object.values(l).some(t=>0!==t)?uo(n,{x:r,y:o,w:f,h:p,radius:l}):n.rect(r,o,f,p),n.fill(),0!==s&&n.stroke()}n.restore()}(a.x(S),M,y),S=((t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e)(w,S+f+d,m?S+k:this.right,t.rtl),function(t,e,i){ho(n,i.text,t,e+g/2,l,{strikethrough:i.hidden,textAlign:a.textAlign(i.textAlign)})}(a.x(S),M,y),m)u.x+=k+c;else if("string"!=typeof y.text){const t=l.lineHeight;u.y+=yc(y,t)+c}else u.y+=v}),lr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=_o(e.font),n=xo(e.padding);if(!e.display)return;const s=rr(t.rtl,this.left,this.width),o=this.ctx,r=e.position,a=i.size/2,l=n.top+a;let c,h=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,h=Ts(t.align,h,this.right-d);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);c=l+Ts(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=Ts(r,h,h+d);o.textAlign=s.textAlign(As(r)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,ho(o,e.text,u,c,i)}_computeTitleHeight(){const t=this.options.title,e=_o(t.font),i=xo(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,s;if(ys(t,this.left,this.right)&&ys(e,this.top,this.bottom))for(s=this.legendHitBoxes,i=0;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const l=t.controller.getStyle(i?0:void 0),c=xo(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:s||l.textAlign,borderRadius:r&&(a||l.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class _c extends Da{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=Tn(i.text)?i.text.length:1;this._padding=xo(i.padding);const s=n*_o(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:s,options:o}=this,r=o.align;let a,l,c,h=0;return this.isHorizontal()?(l=Ts(r,i,s),c=e+t,a=s-i):("left"===o.position?(l=i+t,c=Ts(r,n,e),h=-.5*Gn):(l=s-t,c=Ts(r,e,n),h=.5*Gn),a=n-e),{titleX:l,titleY:c,maxWidth:a,rotation:h}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=_o(e.font),n=i.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:r,rotation:a}=this._drawArgs(n);ho(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:a,textAlign:As(e.align),textBaseline:"middle",translation:[s,o]})}}var wc={id:"title",_element:_c,start(t,e,i){!function(t,e){const i=new _c({ctx:t.ctx,options:e,chart:t});ga.configure(t,i,e),ga.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;ga.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;ga.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const kc=new WeakMap;var Sc={id:"subtitle",start(t,e,i){const n=new _c({ctx:t.ctx,options:i,chart:t});ga.configure(t,n,i),ga.addBox(t,n),kc.set(t,n)},stop(t){ga.removeBox(t,kc.get(t)),kc.delete(t)},beforeUpdate(t,e,i){const n=kc.get(t);ga.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Mc={average(t){if(!t.length)return!1;let e,i,n=new Set,s=0,o=0;for(e=0,i=t.length;et+e)/n.size,y:s/o}},nearest(t,e){if(!t.length)return!1;let i,n,s,o=e.x,r=e.y,a=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i-1?t.split("\n"):t}function Ac(t,e){const{element:i,datasetIndex:n,index:s}=e,o=t.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:t,label:r,parsed:o.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function Tc(t,e){const i=t.chart.ctx,{body:n,footer:s,title:o}=t,{boxWidth:r,boxHeight:a}=e,l=_o(e.bodyFont),c=_o(e.titleFont),h=_o(e.footerFont),d=o.length,u=s.length,f=n.length,p=xo(e.padding);let g=p.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b){g+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing}u&&(g+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let v=0;const y=function(t){m=Math.max(m,i.measureText(t).width+v)};return i.save(),i.font=c.string,jn(t.title,y),i.font=l.string,jn(t.beforeBody.concat(t.afterBody),y),v=e.displayColors?r+2+e.boxPadding:0,jn(n,t=>{jn(t.before,y),jn(t.lines,y),jn(t.after,y)}),v=0,i.font=h.string,jn(t.footer,y),i.restore(),m+=p.width,{width:m,height:g}}function Cc(t,e,i,n){const{x:s,width:o}=i,{width:r,chartArea:{left:a,right:l}}=t;let c="center";return"center"===n?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),function(t,e,i,n){const{x:s,width:o}=n,r=i.caretSize+i.caretPadding;return"left"===t&&s+o+r>e.width||"right"===t&&s-o-r<0||void 0}(c,t,e,i)&&(c="center"),c}function Pc(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Cc(t,e,i,n),yAlign:n}}function Lc(t,e,i,n){const{caretSize:s,caretPadding:o,cornerRadius:r}=t,{xAlign:a,yAlign:l}=i,c=s+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=yo(r);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const g=function(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}(e,l,c);return"center"===l?"left"===a?p+=c:"right"===a&&(p-=c):"left"===a?p-=Math.max(h,u)+s:"right"===a&&(p+=Math.max(d,f)+s),{x:vs(p,0,n.width-e.width),y:vs(g,0,n.height-e.height)}}function Dc(t,e,i){const n=xo(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function Ic(t){return Oc([],Ec(t))}function Rc(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const jc={beforeTitle:On,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex{const e={before:[],lines:[],after:[]},s=Rc(i,t);Oc(e.before,Ec(Fc(s,"beforeLabel",this,t))),Oc(e.lines,Fc(s,"label",this,t)),Oc(e.after,Ec(Fc(s,"afterLabel",this,t))),n.push(e)}),n}getAfterBody(t,e){return Ic(Fc(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=Fc(i,"beforeFooter",this,t),s=Fc(i,"footer",this,t),o=Fc(i,"afterFooter",this,t);let r=[];return r=Oc(r,Ec(n)),r=Oc(r,Ec(s)),r=Oc(r,Ec(o)),r}_createItems(t){const e=this._active,i=this.chart.data,n=[],s=[],o=[];let r,a,l=[];for(r=0,a=e.length;rt.filter(e,n,s,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),jn(l,e=>{const i=Rc(t.callbacks,e);n.push(Fc(i,"labelColor",this,e)),s.push(Fc(i,"labelPointStyle",this,e)),o.push(Fc(i,"labelTextColor",this,e))}),this.labelColors=n,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,o=[];if(n.length){const t=Mc[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Tc(this,i),r=Object.assign({},t,e),a=Pc(this.chart,i,r),l=Lc(i,r,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:h}=yo(r),{x:d,y:u}=t,{width:f,height:p}=e;let g,m,b,v,y,x;return"center"===s?(y=u+p/2,"left"===n?(g=d,m=g-o,v=y+o,x=y-o):(g=d+f,m=g+o,v=y-o,x=y+o),b=g):(m="left"===n?d+Math.max(a,c)+o:"right"===n?d+f-Math.max(l,h)-o:this.caretX,"top"===s?(v=u,y=v-o,g=m-o,b=m+o):(v=u+p,y=v+o,g=m+o,b=m-o),x=v),{x1:g,x2:m,x3:b,y1:v,y2:y,y3:x}}drawTitle(t,e,i){const n=this.title,s=n.length;let o,r,a;if(s){const l=rr(i.rtl,this.x,this.width);for(t.x=Dc(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=_o(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,a=0;a0!==t)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,uo(t,{x:e,y:f,w:l,h:a,radius:r}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),uo(t,{x:i,y:f+1,w:l-2,h:a-2,radius:r}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(e,f,l,a),t.strokeRect(e,f,l,a),t.fillStyle=o.backgroundColor,t.fillRect(i,f+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:l,boxPadding:c}=i,h=_o(i.bodyFont);let d=h.lineHeight,u=0;const f=rr(i.rtl,this.x,this.width),p=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+s},g=f.textAlign(o);let m,b,v,y,x,_,w;for(e.textAlign=o,e.textBaseline="middle",e.font=h.string,t.x=Dc(this,g,i),e.fillStyle=i.bodyColor,jn(this.beforeBody,p),u=r&&"right"!==g?"center"===o?l/2+c:l+2+c:0,y=0,_=n.length;y<_;++y){for(m=n[y],b=this.labelTextColors[y],e.fillStyle=b,jn(m.before,p),v=m.lines,r&&v.length&&(this._drawColorBox(e,t,y,f,i),d=Math.max(h.lineHeight,a)),x=0,w=v.length;x0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=Mc[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Tc(this,t),r=Object.assign({},i,this._size),a=Pc(e,t,r),l=Lc(t,r,a,e);n._to===l.x&&s._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=xo(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,n,e),ar(t,e.textDirection),s.y+=o.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),lr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),s=!Fn(i,n),o=this._positionChanged(n,e);(s||o)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,s=this._active||[],o=this._getActiveElements(t,s,e,i),r=this._positionChanged(o,t),a=e||!Fn(o,s)||r;return a&&(this._active=o,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));const o=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,o=Mc[s.position].call(this,t,e);return!1!==o&&(i!==o.x||n!==o.y)}}var Bc={id:"tooltip",_element:zc,positioners:Mc,afterInit(t,e,i){i&&(t.tooltip=new zc({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:jc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Nc=Object.freeze({__proto__:null,Colors:Jl,Decimation:Ql,Filler:mc,Legend:xc,SubTitle:Sc,Title:wc,Tooltip:Bc});function Wc(t,e,i,n){const s=t.indexOf(e);if(-1===s)return((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n);return s!==t.lastIndexOf(e)?i:s}function Vc(t){const e=this.getLabels();return t>=0&&tf&&(S=as(k*S/f/u)*u),An(a)||(x=Math.pow(10,a),S=Math.ceil(S*x)/x),"ticks"===n?(_=Math.floor(p/S)*S,w=Math.ceil(g/S)*S):(_=p,w=g),m&&b&&s&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((r-o)/s,S/1e3)?(k=Math.round(Math.min((r-o)/S,c)),S=(r-o)/k,_=o,w=r):v?(_=m?o:_,w=b?r:w,k=l-1,S=(w-_)/k):(k=(w-_)/S,k=rs(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const M=Math.max(us(S),us(_));x=Math.pow(10,An(a)?M:a),_=Math.round(_*x)/x,w=Math.round(w*x)/x;let O=0;for(m&&(d&&_!==o?(i.push({value:o}),_r)break;i.push({value:t})}return b&&d&&w!==r?i.length&&rs(i[i.length-1].value,r,$c(r,y,t))?i[i.length-1].value=r:i.push({value:r}):b&&w!==r||i.push({value:w}),i}function $c(t,e,{horizontal:i,minRotation:n}){const s=hs(n),o=(i?Math.sin(s):Math.cos(s))||.001,r=.75*e*(""+t).length;return Math.min(e/o,r)}class Uc extends Ha{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return An(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:s}=this;const o=t=>n=e?n:t,r=t=>s=i?s:t;if(t){const t=os(n),e=os(s);t<0&&e<0?r(0):t>0&&e>0&&o(0)}if(n===s){let e=0===s?1:Math.abs(.05*s);r(s+e),t||o(n-e)}this.min=n,this.max=s}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=Hc({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&cs(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Vs(t,this.chart.options.locale,this.options.ticks.format)}}class qc extends Uc{static id="linear";static defaults={ticks:{callback:$s.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pn(t)?t:0,this.max=Pn(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=hs(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,s.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Yc=t=>Math.floor(ss(t)),Xc=(t,e)=>Math.pow(10,Yc(t)+e);function Jc(t){return 1===t/Math.pow(10,Yc(t))}function Gc(t,e,i){const n=Math.pow(10,i),s=Math.floor(t/n);return Math.ceil(e/n)-s}function Kc(t,{min:e,max:i}){e=Ln(t.min,e);const n=[],s=Yc(e);let o=function(t,e){let i=Yc(e-t);for(;Gc(t,e,i)>10;)i++;for(;Gc(t,e,i)<10;)i--;return Math.min(i,Yc(t))}(e,i),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((e-l)*r)/r,h=Math.floor((e-l)/a/10)*a*10;let d=Math.floor((c-h)/Math.pow(10,o)),u=Ln(t.min,Math.round((l+h+d*Math.pow(10,o))*r)/r);for(;u=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),u=Math.round((l+h+d*Math.pow(10,o))*r)/r;const f=Ln(t.max,u);return n.push({value:f,major:Jc(f),significand:d}),n}class Qc extends Ha{static id="logarithmic";static defaults={ticks:{callback:$s.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Uc.prototype.parse.apply(this,[t,e]);if(0!==i)return Pn(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pn(t)?Math.max(0,t):null,this.max=Pn(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Pn(this._userMin)&&(this.min=t===Xc(this.min,0)?Xc(this.min,-1):Xc(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const s=e=>i=t?i:e,o=t=>n=e?n:t;i===n&&(i<=0?(s(1),o(10)):(s(Xc(i,-1)),o(Xc(n,1)))),i<=0&&s(Xc(n,-1)),n<=0&&o(Xc(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=Kc({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&cs(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":Vs(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ss(t),this._valueRange=ss(this.max)-ss(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ss(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Zc(t){const e=t.ticks;if(e.display&&t.display){const t=xo(e.backdropPadding);return Dn(e.font&&e.font.size,Gs.font.size)+t.height}return 0}function th(t,e,i){return i=Tn(i)?i:[i],{w:Qs(t,e.string,i),h:i.length*e.lineHeight}}function eh(t,e,i,n,s){return t===n||t===s?{start:e-i/2,end:e+i/2}:ts?{start:e-i,end:e}:{start:e,end:e+i}}function ih(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],s=[],o=t._pointLabels.length,r=t.options.pointLabels,a=r.centerPointLabels?Gn/o:0;for(let l=0;le.r&&(a=(n.end-e.r)/o,t.r=Math.max(t.r,e.r+a)),s.starte.b&&(l=(s.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}function sh(t,e,i){const n=t.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=i,l=t.getPointPosition(e,n+s+r,o),c=Math.round(ds(ms(l.angle+es))),h=function(t,e,i){90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e);return t}(l.y,a.h,c),d=function(t){if(0===t||180===t)return"center";if(t<180)return"left";return"right"}(c),u=function(t,e,i){"right"===i?t-=e:"center"===i&&(t-=e/2);return t}(l.x,a.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:u,top:h,right:u+a.w,bottom:h+a.h}}function oh(t,e){if(!e)return!0;const{left:i,top:n,right:s,bottom:o}=t;return!(no({x:i,y:n},e)||no({x:i,y:o},e)||no({x:s,y:n},e)||no({x:s,y:o},e))}function rh(t,e,i){const{left:n,top:s,right:o,bottom:r}=i,{backdropColor:a}=e;if(!An(a)){const i=yo(e.borderRadius),l=xo(e.backdropPadding);t.fillStyle=a;const c=n-l.left,h=s-l.top,d=o-n+l.width,u=r-s+l.height;Object.values(i).some(t=>0!==t)?(t.beginPath(),uo(t,{x:c,y:h,w:d,h:u,radius:i}),t.fill()):t.fillRect(c,h,d,u)}}function ah(t,e,i,n){const{ctx:s}=t;if(i)s.arc(t.xCenter,t.yCenter,e,0,Kn);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let o=1;ot,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=xo(Zc(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Pn(t)&&!isNaN(t)?t:0,this.max=Pn(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Zc(this.options))}generateTickLabels(t){Uc.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{const i=Rn(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?ih(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){return ms(t*(Kn/(this._pointLabels.length||1))+hs(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(An(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(An(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t=0;s--){const e=t._pointLabelItems[s];if(!e.visible)continue;const o=n.setContext(t.getPointLabelContext(s));rh(i,o,e);const r=_o(o.font),{x:a,y:l,textAlign:c}=e;ho(i,t._pointLabels[s],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}(this,o),n.display&&this.ticks.forEach((t,e)=>{if(0!==e||0===e&&this.min<0){a=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),r=n.setContext(i),l=s.setContext(i);!function(t,e,i,n,s){const o=t.ctx,r=e.circular,{color:a,lineWidth:l}=e;!r&&!n||!a||!l||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),ah(t,i,r,n),o.closePath(),o.stroke(),o.restore())}(this,r,a,o,l)}}),i.display){for(t.save(),r=o-1;r>=0;r--){const n=i.setContext(this.getPointLabelContext(r)),{color:s,lineWidth:o}=n;o&&s&&(t.lineWidth=o,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,a=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),l=this.getPointPosition(r,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,r)=>{if(0===r&&this.min>=0&&!e.reverse)return;const a=i.setContext(this.getContext(r)),l=_o(a.font);if(s=this.getDistanceFromCenterForValue(this.ticks[r].value),a.showLabelBackdrop){t.font=l.string,o=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=xo(a.backdropPadding);t.fillRect(-o/2-e.left,-s-l.size/2-e.top,o+e.width,l.size+e.height)}ho(t,n.label,0,-s,l,{color:a.color,strokeColor:a.textStrokeColor,strokeWidth:a.textStrokeWidth})}),t.restore()}drawTitle(){}}const ch={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},hh=Object.keys(ch);function dh(t,e){return t-e}function uh(t,e){if(An(e))return null;const i=t._adapter,{parser:n,round:s,isoWeekday:o}=t._parseOpts;let r=e;return"function"==typeof n&&(r=n(r)),Pn(r)||(r="string"==typeof n?i.parse(r,n):i.parse(r)),null===r?null:(s&&(r="week"!==s||!ls(o)&&!0!==o?i.startOf(r,s):i.startOf(r,"isoWeek",o)),+r)}function fh(t,e,i,n){const s=hh.length;for(let o=hh.indexOf(t);o=e?i[n]:i[s]]=!0}}else t[e]=!0}function gh(t,e,i){const n=[],s={},o=e.length;let r,a;for(r=0;r=0&&(e[l].major=!0);return e}(t,n,s,i):n}class mh extends Ha{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),n=this._adapter=new Jr(t.adapters.date);n.init(e),Vn(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:uh(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:s,minDefined:o,maxDefined:r}=this.getUserBounds();function a(t){o||isNaN(t.min)||(n=Math.min(n,t.min)),r||isNaN(t.max)||(s=Math.max(s,t.max))}o&&r||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=Pn(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),s=Pn(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,s-1),this.max=Math.max(n+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const s=this.min,o=function(t,e,i){let n=0,s=t.length;for(;nn&&t[s-1]>i;)s--;return n>0||s=hh.indexOf(i);o--){const i=hh[o];if(ch[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return hh[i?hh.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=hh.indexOf(t)+1,i=hh.length;e+t.value))}initOffsets(t=[]){let e,i,n=0,s=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),s=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=vs(n,0,o),s=vs(s,0,o),this._offsets={start:n,end:s,factor:1/(n+1+s)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,s=n.time,o=s.unit||fh(s.minUnit,e,i,this._getLabelCapacity(e)),r=Dn(n.ticks.stepSize,1),a="week"===o&&s.isoWeekday,l=ls(a)||!0===a,c={};let h,d,u=e;if(l&&(u=+t.startOf(u,"isoWeek",a)),u=+t.startOf(u,l?"day":o),t.diff(i,e,o)>1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+o);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;h+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,n=this._unit,s=e||i[n];return this._adapter.format(t,s)}_tickFormatFunction(t,e,i,n){const s=this.options,o=s.ticks.callback;if(o)return Rn(o,[t,e,i],this);const r=s.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&r[a],h=l&&r[l],d=i[e],u=l&&h&&d&&d.major;return this._adapter.format(t,n||(u?h:c))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=_s(t,"pos",e)),({pos:n,time:o}=t[a]),({pos:s,time:r}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=_s(t,"time",e)),({time:n,pos:o}=t[a]),({time:s,pos:r}=t[l]));const c=s-n;return c?o+(r-o)*(e-n)/c:o}var vh=Object.freeze({__proto__:null,CategoryScale:class extends Ha{static id="category";static defaults={ticks:{callback:Vc}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(An(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:vs(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:Wc(i,t,Dn(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){return Vc.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:qc,LogarithmicScale:Qc,RadialLinearScale:lh,TimeScale:mh,TimeSeriesScale:class extends mh{static id="timeseries";static defaults=mh.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=bh(e,this.min),this._tableRange=bh(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let o,r,a,l,c;for(o=0,r=t.length;o=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,r=n.length;ot-e)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(bh(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return bh(this._table,i*this._tableRange+this._minPos,!0)}}});const yh=[qr,Vl,Nc,vh];xl.register(...yh);const xh=xl;var _h=i(998),wh=i.n(_h);const kh={data:{},nonce:"",context:null,init(t){this.context=t;const e=t.querySelectorAll("[data-progress]"),i=t.querySelectorAll("[data-chart]");[...e].forEach(t=>{t.dataset.url&&(this.data[t.dataset.url]||(this.data[t.dataset.url]={items:[],poll:null}),this.data[t.dataset.url].items.push(t)),"line"===t.dataset.progress?this.line(t):"circle"===t.dataset.progress&&this.circle(t),this.nonce||(this.nonce=t.dataset?.nonce)});for(const t in this.data)this.getValues(t);[...i].forEach(t=>{const e={labels:JSON.parse(t.dataset.dates),datasets:[{backgroundColor:t.dataset.color,borderColor:t.dataset.color,data:JSON.parse(t.dataset.data),cubicInterpolationMode:"monotone"}]};new xh(t,{type:"line",data:e,options:{responsive:!0,radius:0,interaction:{intersect:!1},plugins:{legend:{display:!1}},scales:{y:{suggestedMin:0,ticks:{color:"#999999",callback:(t,e)=>wh()(t,{decimals:2,scale:"SI"})},grid:{color:"#d3dce3"}},x:{ticks:{color:"#999999"},grid:{color:"#d3dce3"}}}}})})},line(t){new(Ui().Line)(t,{strokeWidth:2,easing:"easeInOut",duration:1400,color:t.dataset.color,trailColor:"#d3dce3",trailWidth:2,svgStyle:{width:"100%",height:"100%",display:"block"}}).animate(t.dataset.value/100)},circle(t){t.dataset.basetext=t.dataset.text,t.dataset.text="";const e=t.dataset.value,i=this;if(t.bar=new(Ui().Circle)(t,{strokeWidth:3,easing:"easeInOut",duration:1400,color:t.dataset.color,trailColor:"#d3dce3",trailWidth:3,svgStyle:null,text:{autoStyleContainer:!1,style:{color:"#222222"}},step(e,n){const s=Math.floor(100*n.value());i.setText(n,parseFloat(s),t.dataset.text)}}),!t.dataset.url){const i=e/100;t.bar.animate(i)}},getValues(t){this.data[t].poll&&(clearTimeout(this.data[t].poll),this.data[t].poll=null),Pt({path:t,method:"GET",headers:{"X-WP-Nonce":this.nonce}}).then(e=>{this.data[t].items.forEach(i=>{void 0!==e[i.dataset.basetext]?i.dataset.text=e[i.dataset.basetext]:i.dataset.text=i.dataset.basetext,i.bar.animate(e[i.dataset.value]),i.dataset.poll&&!this.data[t].poll&&(this.data[t].poll=setTimeout(()=>{this.getValues(t)},1e4))});for(const t in e){const i=this.context.querySelectorAll(`[data-key="${t}"]`),n=this.context.querySelectorAll(`[data-text="${t}"]`);i.forEach(i=>{i.dataset.value=e[t],i.dispatchEvent(new Event("focus"))}),n.forEach(i=>{i.innerText=e[t],i.classList.contains("cld-toggle")&&(e[t]?i.classList.remove("hidden"):i.classList.add("hidden"))})}})},setText(t,e,i){if(!t)return;const n=document.createElement("span"),s=document.createElement("h2"),o=document.createTextNode(i);s.innerText=e+"%",n.appendChild(s),n.appendChild(o),t.setText(n)}},Sh=kh,Mh={key:"_cld_pending_state",data:null,pending:null,changed:!1,previous:{},init(){this.data=cldData.stateData?cldData.stateData:{};let t=localStorage.getItem(this.key);t&&(t=JSON.parse(t),this.data={...this.data,...t},this.sendStates()),this.previous=JSON.stringify(this.data)},_update(){this.pending&&(clearTimeout(this.pending),localStorage.removeItem(this.key)),this.previous!==JSON.stringify(this.data)&&(this.pending=setTimeout(()=>this.sendStates(),2e3),localStorage.setItem(this.key,JSON.stringify(this.data)))},set(t,e){this.data[t]&&this.data[t]===e||(this.data[t]=e,this._update())},get(t){let e=null;return this.data[t]&&(e=this.data[t]),e},sendStates(){fetch(cldData.stateURL,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":cldData.stateNonce},body:JSON.stringify(this.data)}).then(t=>t.json()).then(t=>{t.success&&(this.previous=JSON.stringify(t.state),localStorage.removeItem(this.key))})}},Oh={init(t){[...t.querySelectorAll("[data-remove]")].forEach(t=>{t.addEventListener("click",e=>{if(t.dataset.message&&!confirm(t.dataset.message))return;const i=document.getElementById(t.dataset.remove);i.parentNode.removeChild(i)})})}},Eh={values:{},inputs:{},context:null,init(t){this.context=t;t.querySelectorAll("[data-tags]").forEach(t=>this.bind(t))},bind(t){t.innerText=t.dataset.placeholder;const e=t.dataset.tags,i=document.getElementById(e),n=this.context.querySelectorAll(`[data-tags-delete="${e}"]`);this.values[e]=JSON.parse(i.value),this.inputs[e]=i,t.boundInput=e,t.boundDisplay=this.context.querySelector(`[data-tags-display="${e}"]`),t.boundDisplay.addEventListener("click",e=>{t.focus()}),t.addEventListener("focus",e=>{t.innerText=null}),t.addEventListener("blur",e=>{3{if("Tab"===i.key)3{"Comma"!==e.code&&"Enter"!==e.code&&"Tab"!==e.code&&"Space"!==e.code||(e.preventDefault(),3{t.parentNode.control=t,t.parentNode.style.width=getComputedStyle(t.parentNode).width,t.addEventListener("click",e=>{e.stopPropagation(),this.deleteTag(t)})})},deleteTag(t){const e=t.parentNode,i=e.dataset.inputId,n=this.values[i].indexOf(e.dataset.value);0<=n&&this.values[i].splice(n,1),e.style.width=0,e.style.opacity=0,e.style.padding=0,e.style.margin=0,setTimeout(()=>{e.parentNode.removeChild(e)},500),this.updateInput(i)},captureTag(t,e){if(this[t.dataset.format]&&"string"!=typeof(e=this[t.dataset.format](e)))return t.classList.add("pulse"),void setTimeout(()=>{t.classList.remove("pulse")},1e3);if(!this.validateUnique(t.boundDisplay,e)){const i=this.createTag(e);i.dataset.inputId=t.boundInput,this.values[t.boundInput].push(e),t.innerText=null,t.boundDisplay.insertBefore(i,t),i.style.width=getComputedStyle(i).width,i.style.opacity=1,this.updateInput(t.boundInput)}},createTag(t){const e=document.createElement("span"),i=document.createElement("span"),n=document.createElement("span");return e.classList.add("cld-input-tags-item"),i.classList.add("cld-input-tags-item-text"),n.className="cld-input-tags-item-delete dashicons dashicons-no-alt",n.addEventListener("click",()=>this.deleteTag(n)),i.innerText=t,e.appendChild(i),e.appendChild(n),e.dataset.value=t,e.style.opacity=0,e.control=n,e},validateUnique(t,e){const i=t.querySelector(`[data-value="${e}"]`);let n=!1;return i&&(i.classList.remove("pulse"),i.classList.add("pulse"),setTimeout(()=>{i.classList.remove("pulse")},500),n=!0),n},updateInput(t){this.inputs[t].value=JSON.stringify(this.values[t])},host(t){!1===/^(?:http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)/.test(t)&&(t="https://"+t);let e="";try{e=new URL(t)}catch(t){return t}return decodeURIComponent(e.host)}},Ah=Eh,Th={suffixInputs:null,init(t){this.suffixInputs=t.querySelectorAll("[data-suffix]"),[...this.suffixInputs].forEach(t=>this.bindInput(t))},bindInput(t){const e=document.getElementById(t.dataset.suffix),i=e.dataset.template.split("@value");this.setSuffix(e,i,t.value),t.addEventListener("change",()=>this.setSuffix(e,i,t.value)),t.addEventListener("input",()=>this.setSuffix(e,i,t.value))},setSuffix(t,e,i){t.innerHTML="",t.classList.add("hidden"),-1===["none","off",""].indexOf(i)&&t.classList.remove("hidden");const n=document.createTextNode(e.join(i));t.appendChild(n)}},Ch={wrappers:null,frame:null,error:'data:image/svg+xml;utf8,%26%23x26A0%3B︎',init(t){this.wrappers=t.querySelectorAll(".cld-size-items"),this.wrappers.forEach(t=>{const e=t.querySelectorAll(".cld-size-selector-item");e.forEach(i=>{i.addEventListener("click",()=>{e.forEach(t=>{delete t.dataset.selected}),i.dataset.selected=!0,this.switchSizeContent(t,i.dataset.size)})});const i=t.querySelector(".cld-size-selector-item[data-selected]");i&&this.switchSizeContent(t,i.dataset.size)})},switchSizeContent(t,e){t.querySelectorAll(".cld-size-content").forEach(t=>{t.style.display="none"});const i=t.querySelector(`.cld-size-content[data-size="${e}"]`);i&&(i.style.display="block",this.buildImages(t,i))},buildImages(t,e){const i=t.dataset.base,n=e.querySelector(".regular-text"),s=e.querySelector(".disable-toggle");if(!n||!s)return;const o=e.querySelectorAll("img"),r=n.value.length?n.value.replace(" ",""):n.placeholder;if(o.forEach(t=>{const e=t.dataset.size,o=t.dataset.file;s.checked?(n.disabled=!0,t.src=`${i}/${e}/${o}`):(n.disabled=!1,t.src=`${i}/${e},${r}/${o}`),t.bound||(t.addEventListener("error",()=>{t.src=this.error}),t.bound=!0)}),!n.bound){let i=null;n.addEventListener("input",()=>{i&&clearTimeout(i),i=setTimeout(()=>{this.buildImages(t,e)},1e3)}),n.bound=!0}s.bound||(s.addEventListener("change",()=>{this.buildImages(t,e)}),s.bound=!0);const a=e.querySelector(".clear-crop-input");a&&!a.bound&&(a.addEventListener("click",()=>{n.value="",this.buildImages(t,e)}),a.bound=!0)}},Ph={bindings:{},parent_check_data:{},check_parents:{},_init(t){const e=t.querySelectorAll("[data-condition]"),i=t.querySelectorAll("[data-toggle]"),n=t.querySelectorAll("[data-for]"),s=t.querySelectorAll("[data-tooltip]"),o=t.querySelectorAll("[data-bind-trigger]"),r=t.querySelectorAll("[data-main]"),a=t.querySelectorAll("[data-file]"),l=t.querySelectorAll("[data-auto-suffix]"),c=t.querySelectorAll("[data-confirm]"),h={};Mh.init(),Hi.bind(r),l.forEach(t=>this._autoSuffix(t)),o.forEach(t=>this._trigger(t)),i.forEach(t=>this._toggle(t)),e.forEach(t=>this._bind(t)),n.forEach(t=>this._alias(t)),a.forEach(t=>this._files(t,h)),Bi(s,{theme:"cloudinary",arrow:!1,placement:"bottom-start",aria:{content:"auto",expanded:"auto"},content:t=>document.getElementById(t.dataset.tooltip).innerHTML}),[...o].forEach(t=>{t.dispatchEvent(new Event("input"))}),c.forEach(t=>{t.addEventListener("click",e=>{confirm(t.dataset.confirm)||(e.preventDefault(),e.stopPropagation())})}),Sh.init(t),Oh.init(t),Ah.init(t),Th.init(t),Ch.init(t)},_autoSuffix(t){const e=t.dataset.autoSuffix;let i="";const n=[...e.split(";")].map(t=>0===t.indexOf("*")?(i=t.replace("*",""),i):t);t.addEventListener("change",()=>{const e=t.value.replace(" ",""),s=e.replace(/[^0-9]/g,""),o=e.replace(/[0-9]/g,"").toLowerCase();s&&(-1===n.indexOf(o)?t.value=s+i:t.value=s+o)}),t.dispatchEvent(new Event("change"))},_files(t,e){const i=t.dataset.parent;i&&(this.check_parents[i]=document.getElementById(i),this.parent_check_data[i]||(this.parent_check_data[i]=this.check_parents[i].value?JSON.parse(this.check_parents[i].value):[]),t.addEventListener("change",()=>{const n=this.parent_check_data[i].indexOf(t.value);t.checked?this.parent_check_data[i].push(t.value):this.parent_check_data[i].splice(n,1),e[i]&&clearTimeout(e[i]),e[i]=setTimeout(()=>{this._compileParent(i)},10)}))},_compileParent(t){this.check_parents[t].value=JSON.stringify(this.parent_check_data[t]),this.check_parents[t].dispatchEvent(new Event("change"))},_bind(t){t.condition=JSON.parse(t.dataset.condition);for(const e in t.condition)this.bindings[e]&&this.bindings[e].elements.push(t)},_trigger(t){const e=t.dataset.bindTrigger,i=this;i.bindings[e]={input:t,value:t.value,checked:!0,elements:[]},t.addEventListener("change",function(e){t.dispatchEvent(new Event("input"))}),t.addEventListener("input",function(){if(i.bindings[e].value=t.value,"checkbox"===t.type&&(i.bindings[e].checked=t.checked),"radio"!==t.type||!1!==t.checked)for(const n in i.bindings[e].elements)i.toggle(i.bindings[e].elements[n],t)})},_alias(t){t.addEventListener("click",function(){document.getElementById(t.dataset.for).dispatchEvent(new Event("click"))})},_toggle(t){const e=this,i=document.querySelector('[data-wrap="'+t.dataset.toggle+'"]');if(!i)return;const n=Mh.get(t.id);t.addEventListener("click",function(n){n.stopPropagation();const s=i.classList.contains("open")?"closed":"open";e.toggle(i,t,s)}),n!==t.dataset.state&&this.toggle(i,t,n)},toggle(t,e,i){if(!i){i="open";for(const e in t.condition){let n=this.bindings[e].value;const s=t.condition[e];"boolean"==typeof s&&(n=this.bindings[e].checked),s!==n&&(i="closed")}}"closed"===i?this.close(t,e):this.open(t,e),Mh.set(e.id,i)},open(t,e){const i=t.getElementsByClassName("cld-ui-input");t.classList.remove("closed"),t.classList.add("open"),e&&e.classList.contains("dashicons")&&(e.classList.remove("dashicons-arrow-down-alt2"),e.classList.add("dashicons-arrow-up-alt2")),[...i].forEach(function(t){t.dataset.disabled=!1})},close(t,e){const i=t.getElementsByClassName("cld-ui-input");t.classList.remove("open"),t.classList.add("closed"),e&&e.classList.contains("dashicons")&&(e.classList.remove("dashicons-arrow-up-alt2"),e.classList.add("dashicons-arrow-down-alt2")),[...i].forEach(function(t){t.dataset.disabled=!0})}},Lh=document.querySelectorAll(".cld-settings,.cld-meta-box");Lh.length&&Lh.forEach(t=>{t&&window.addEventListener("load",Ph._init(t))});const Dh={config:null,init(){this.config||"undefined"!=typeof cldData&&cldData.analytics&&cldData.analytics.enabled&&(this.config=cldData.analytics,Pt.use(Pt.createNonceMiddleware(this.config.nonce)))},track(t,e={},i="activation_funnel",n=null){if(this.config||this.init(),this.config&&this.config.enabled&&t)try{Pt({url:this.config.endpoint,method:"POST",data:{event_name:t,event_category:i,funnel_step:n,params:e}}).catch(()=>{})}catch(t){}},trackReliable(t,e={},i="activation_funnel"){if(this.config||this.init(),this.config&&this.config.enabled&&t)if(navigator.sendBeacon)try{const n=this.config.endpoint.includes("?")?"&":"?",s=this.config.endpoint+n+"_wpnonce="+encodeURIComponent(this.config.nonce),o=new Blob([JSON.stringify({event_name:t,event_category:i,funnel_step:null,params:e})],{type:"application/json"});navigator.sendBeacon(s,o)}catch(t){}else this.track(t,e,i)}};window.addEventListener("load",()=>Dh.init());const Ih=Dh,Rh={storageKey:"_cld_wizard",testing:null,connectAttempts:0,startedEntry:!1,startedTracked:!1,next:document.querySelector('[data-navigate="next"]'),back:document.querySelector('[data-navigate="back"]'),lock:document.getElementById("pad-lock"),lockIcon:document.getElementById("lock-icon"),options:document.querySelectorAll('.cld-ui-input[type="checkbox"]'),settings:document.getElementById("optimize"),tabBar:document.getElementById("wizard-tabs"),tracking:document.getElementById("tracking"),complete:document.getElementById("complete-wizard"),tabs:{"tab-1":document.getElementById("tab-icon-1"),"tab-2":document.getElementById("tab-icon-2"),"tab-3":document.getElementById("tab-icon-3")},content:{"tab-1":document.getElementById("tab-1"),"tab-2":document.getElementById("tab-2"),"tab-3":document.getElementById("tab-3"),"tab-4":document.getElementById("tab-4")},connection:{error:document.getElementById("connection-error"),success:document.getElementById("connection-success"),working:document.getElementById("connection-working")},debounceConnect:null,updateConnection:document.getElementById("update-connection"),cancelUpdateConnection:document.getElementById("cancel-update-connection"),config:{},didSave:!1,init(){if(!cldData.wizard)return;this.config=cldData.wizard.config,window.localStorage.getItem(this.storageKey)&&(this.config=JSON.parse(window.localStorage.getItem(this.storageKey))),document.location.hash.length&&this.hashChange(),Pt.use(Pt.createNonceMiddleware(cldData.wizard.saveNonce));const t=document.querySelectorAll("[data-navigate]"),e=document.getElementById("connect.cloudinary_url");this.updateConnection.addEventListener("click",()=>{this.lockNext(),e.parentNode.classList.remove("hidden"),this.cancelUpdateConnection.classList.remove("hidden"),this.updateConnection.classList.add("hidden")}),this.cancelUpdateConnection.addEventListener("click",()=>{this.unlockNext(),e.parentNode.classList.add("hidden"),this.cancelUpdateConnection.classList.add("hidden"),this.updateConnection.classList.remove("hidden"),this.config.cldString=!0,e.value="",this.connection.error.classList.remove("active"),this.connection.success.classList.add("active")}),[...t].forEach(t=>{t.addEventListener("click",()=>{this.navigate(t.dataset.navigate)})}),this.lock.addEventListener("click",()=>{this.lockIcon.classList.toggle("dashicons-unlock"),this.settings.classList.toggle("disabled"),this.options.forEach(t=>{t.disabled=t.disabled?"":"disabled"})}),e.addEventListener("input",t=>{this.lockNext(),this.startedEntry||(this.startedEntry=!0,Ih.track("credentials_entry_started",{},"activation_funnel",3));const i=e.value.replace("CLOUDINARY_URL=","");this.connection.error.classList.remove("active"),this.connection.success.classList.remove("active"),this.connection.working.classList.remove("active"),i.length&&(this.testing=i,this.debounceConnect&&clearTimeout(this.debounceConnect),this.debounceConnect=setTimeout(()=>{const t=this.evaluateConnectionString(i);Ih.track("credentials_format_validated",{format_valid:t,invalid_reason:t?"":this.invalidReason(i)},"activation_funnel",3),t?(this.connection.working.classList.add("active"),this.testConnection(i)):this.connection.error.classList.add("active")},500))}),this.config.cldString&&(e.parentNode.classList.add("hidden"),this.updateConnection.classList.remove("hidden"));const i=document.querySelector('a[href="https://cloudinary.com/signup"]');i&&i.addEventListener("click",()=>{Ih.track("wizard_signup_clicked",{},"activation_funnel",2)}),this.complete&&this.complete.addEventListener("click",()=>{Ih.track("wizard_dashboard_clicked",{},"activation_funnel",7)}),this.getTab(this.config.tab),this.initFeatures(),window.addEventListener("hashchange",t=>{this.hashChange()})},hashChange(){const t=parseInt(document.location.hash.replace("#",""));t&&0t&&this.getTab(t)},initFeatures(){const t=(t,e)=>{Ih.track("wizard_setting_toggled",{setting_key:t,enabled:e},"activation_funnel",4)},e=document.getElementById("media_library");e.checked=this.config.mediaLibrary,e.addEventListener("change",()=>{this.setConfig("mediaLibrary",e.checked),t("media_library",e.checked)});const i=document.getElementById("non_media");i.checked=this.config.nonMedia,i.addEventListener("change",()=>{this.setConfig("nonMedia",i.checked),t("non_media",i.checked)});const n=document.getElementById("advanced");n.checked=this.config.advanced,n.addEventListener("change",()=>{this.setConfig("advanced",n.checked),t("advanced",n.checked)})},getCurrent(){return this.content[`tab-${this.config.tab}`]},hideTabs(){Object.keys(this.content).forEach(t=>{this.hide(this.content[t])})},completeTab(t){this.incompleteTab(),Object.keys(this.tabs).forEach(e=>{const i=parseInt(this.tabs[e].dataset.tab);t>i?this.tabs[e].classList.add("complete"):t===i&&this.tabs[e].classList.add("active")})},incompleteTab(t){Object.keys(this.tabs).forEach(t=>{this.tabs[t].classList.remove("complete","active")})},getCurrentTab(){return this.tabs[`tab-icon-${this.config.tab}`]},getTab(t){if(4===t&&window.localStorage.getItem(this.storageKey)&&!this.didSave)return void this.saveConfig();const e=this.getCurrent(),i=document.getElementById(`tab-${t}`);switch(this.hideTabs(),this.completeTab(t),this.hide(document.getElementById(`tab-${this.config.tab}`)),e.classList.remove("active"),this.show(i),this.show(this.next),this.hide(this.lock),t){case 1:this.hide(this.back),this.unlockNext(),this.startedTracked||(this.startedTracked=!0,this.config.wizardStartedAt||this.setConfig("wizardStartedAt",Date.now()),Ih.track("wizard_started",{entry_point:this.getEntryPoint()},"activation_funnel",2));break;case 2:Ih.track("wizard_connect_viewed",{},"activation_funnel",3),this.show(this.back),this.config.cldString?this.showSuccess():(this.lockNext(),setTimeout(()=>{document.getElementById("connect.cloudinary_url").focus()},0)),this.updateConnection.classList.contains("hidden")&&this.lockNext();break;case 3:if(!this.config.cldString)return void(document.location.hash="1");Ih.track("wizard_settings_viewed",{},"activation_funnel",4),this.show(this.lock),this.show(this.back);break;case 4:if(!this.config.cldString)return void(document.location.hash="1");Ih.track("wizard_completed",{time_to_complete_sec:this.timeToCompleteSec()},"activation_funnel",6),this.hide(this.tabBar),this.hide(this.next),this.hide(this.back)}this.setConfig("tab",t)},navigate(t){"next"===t?this.navigateNext():"back"===t&&this.navigateBack()},navigateBack(){document.location.hash=this.config.tab-1},navigateNext(){document.location.hash=this.config.tab+1},showError(){this.connection.error.classList.add("active"),this.connection.success.classList.remove("active")},showSuccess(){this.connection.error.classList.remove("active"),this.connection.success.classList.add("active")},show(t){t.classList.remove("hidden"),t.style.display=""},hide(t){t.classList.add("hidden"),t.style.display="none"},lockNext(){this.next.disabled="disabled"},unlockNext(){this.next.disabled=""},evaluateConnectionString:t=>new RegExp(/^(?:CLOUDINARY_URL=)?(cloudinary:\/\/){1}(\d*)[:]{1}([^@]*)[@]{1}([^@]*)$/gim).test(t),invalidReason(t){const e=t.replace("CLOUDINARY_URL=","");if(0!==e.indexOf("cloudinary://"))return"missing_scheme";if(-1===e.indexOf("@"))return"missing_cloud_name";const i=e.replace("cloudinary://","").split("@")[0];return-1===i.indexOf(":")?"missing_secret":/^\d+$/.test(i.split(":")[0])?"invalid_format":"invalid_api_key"},getEntryPoint:()=>-1!==document.referrer.indexOf("plugins.php")?"auto_redirect":"menu",timeToCompleteSec(){const t=this.config.wizardStartedAt;return t?Math.max(0,Math.round((Date.now()-t)/1e3)):null},testConnection(t){this.connectAttempts+=1,Ih.track("connection_test_started",{attempt_number:this.connectAttempts},"activation_funnel",3),Pt({path:cldData.wizard.testURL,data:{cloudinary_url:t,attempt_number:this.connectAttempts},method:"POST"}).then(e=>{e.url===this.testing&&(this.connection.working.classList.remove("active"),"connection_error"===e.type?this.showError():"connection_success"===e.type&&(this.showSuccess(),this.unlockNext(),this.setConfig("cldString",t)))})},setConfig(t,e){this.config[t]=e,window.localStorage.setItem(this.storageKey,JSON.stringify(this.config))},saveConfig(){this.lockNext(),this.next.innerText=$("Setting up Cloudinary","cloudinary"),this.didSave=!0,Pt({path:cldData.wizard.saveURL,data:this.config,method:"POST"}).then(t=>{this.next.innerText=$("Next","cloudinary"),this.unlockNext(),this.getTab(4),window.localStorage.removeItem(this.storageKey)}).fail(t=>{this.didSave=!1})}};window.addEventListener("load",()=>Rh.init());const jh={select:document.getElementById("connect.offload"),tooltip:null,descriptions:{},change(){[...this.descriptions].forEach(t=>{t.classList.remove("selected")}),this.tooltip.querySelector("."+this.select.value).classList.add("selected")},addEventListener(){this.select.addEventListener("change",this.change.bind(this))},_init(){this.select&&(this.addEventListener(),this.tooltip=this.select.parentNode.querySelector(".cld-tooltip"),this.descriptions=this.tooltip.querySelectorAll("li"),this.change())}};window.addEventListener("load",()=>jh._init());const Fh={pageReloader:document.getElementById("page-reloader"),init(){if(!cldData.extensions)return;Pt.use(Pt.createNonceMiddleware(cldData.extensions.nonce));[...document.querySelectorAll("[data-extension]")].forEach(t=>{t.addEventListener("change",e=>{t.spinner||(t.spinner=this.createSpinner(),t.parentNode.appendChild(t.spinner)),t.debounce&&clearTimeout(t.debounce),t.debounce=setTimeout(()=>{this.toggleExtension(t),t.debounce=null},1e3)})})},toggleExtension(t){const e=t.dataset.extension,i=t.checked;Ih.track("extension_toggled",{extension_id:e,enabled:i},"features"),Pt({path:cldData.extensions.url,data:{extension:e,enabled:i},method:"POST"}).then(e=>{t.spinner&&(t.parentNode.removeChild(t.spinner),delete t.spinner),Object.keys(e).forEach(t=>{document.querySelectorAll(`[data-text="${t}"]`).forEach(i=>{i.innerText=e[t]})}),this.pageReloader.style.display="block"})},createSpinner(){const t=document.createElement("span");return t.classList.add("spinner"),t.classList.add("cld-extension-spinner"),t}};window.addEventListener("load",()=>Fh.init());const zh={tabButtonSelectors:null,selectedTabID:"",deselectOldTab(){document.getElementById(this.selectedTabID).classList.remove("is-active"),this.filterActive([...this.tabButtonSelectors]).classList.remove("is-active")},selectCurrentTab(t){this.selectedTabID=t.dataset.tab,t.classList.add("is-active"),document.getElementById(this.selectedTabID).classList.add("is-active")},selectTab(t){t.preventDefault(),t.target.classList.contains("is-active")||(this.deselectOldTab(),this.selectCurrentTab(t.target))},filterTabs(){[...this.tabButtonSelectors].forEach(t=>{t.dataset.tab&&t.addEventListener("click",this.selectTab.bind(this))})},filterActive:t=>t.filter(t=>t.classList.contains("is-active")).pop(),init(){this.tabButtonSelectors=document.querySelectorAll(".cld-page-tabs-tab button"),0!==this.tabButtonSelectors.length&&(this.selectCurrentTab(this.filterActive([...this.tabButtonSelectors])),this.filterTabs())}};window.addEventListener("load",()=>zh.init());const Bh={init(){document.querySelectorAll(".cld-special-offer-link").forEach(t=>{t.addEventListener("click",()=>{Ih.track("special_offer_clicked",{offer_id:"small_plan_29"},"settings")})})}};window.addEventListener("load",()=>Bh.init());i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p;window.$=window.jQuery})()})(); //# sourceMappingURL=cloudinary.js.map \ No newline at end of file diff --git a/src/js/components/media-library.js b/src/js/components/media-library.js index 035bcbe07..c72e35a46 100644 --- a/src/js/components/media-library.js +++ b/src/js/components/media-library.js @@ -1,4 +1,5 @@ import apiFetch from '@wordpress/api-fetch'; +import { __ } from '@wordpress/i18n'; const MediaLibrary = { wpWrap: document.getElementById( 'wpwrap' ), @@ -38,6 +39,13 @@ const MediaLibrary = { setTimeout( () => { preview.style.opacity = 1; }, 250 ); + + // Only new assets need downloading, as in the media modal. + if ( typeof asset.fetch === 'undefined' ) { + self.removeProgress( download, index ); + return; + } + apiFetch( { path: cldData.dam.fetch_url, data: { @@ -47,24 +55,24 @@ const MediaLibrary = { transformations: asset.transformations, }, method: 'POST', - } ).then( ( result ) => { - const last = download[ index ]; - delete download[ index ]; - last.removeChild( last.firstChild ); - setTimeout( () => { - last.style.opacity = 0; - setTimeout( () => { - last.parentNode.removeChild( last ); - if ( - ! Object.keys( download ).length - ) { - library.style.marginRight = - '0px'; - status.style.display = 'none'; - } - }, 1000 ); - }, 500 ); - } ); + } ) + .then( ( result ) => { + // A failed download is answered with { success: false, data: error }. + if ( + result && + false === result.success + ) { + self.showError( result.data ); + } + } ) + .catch( ( error ) => { + self.showError( + error && error.message + ); + } ) + .finally( () => { + self.removeProgress( download, index ); + } ); } ); } }, @@ -84,6 +92,37 @@ const MediaLibrary = { this.adminbar.offsetHeight + 'px'; }, + /** + * Fade out and remove an import progress item, and hide the import status when it's the last one. + * + * @param {Object} download The progress items being imported, by index. + * @param {string} index The index of the progress item to remove. + */ + removeProgress( download, index ) { + const last = download[ index ]; + delete download[ index ]; + last.removeChild( last.firstChild ); + setTimeout( () => { + last.style.opacity = 0; + setTimeout( () => { + last.parentNode.removeChild( last ); + if ( ! Object.keys( download ).length ) { + this.libraryWrap.style.marginRight = '0px'; + this.importStatus.style.display = 'none'; + } + }, 1000 ); + }, 500 ); + }, + /** + * Tell the user an asset could not be imported. + * + * @param {string} message The error message. + */ + showError( message ) { + window.alert( + message || __( 'Could not import the asset.', 'cloudinary' ) + ); + }, makeProgress( asset ) { const wrap = document.createElement( 'div' ); const process = document.createElement( 'span' ); From 7805de9937ad9b625a18bcdb84b7095a0b8f1c38 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Thu, 5 Nov 2026 08:48:39 +0100 Subject: [PATCH 79/80] Update i18n --- languages/cloudinary.pot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/languages/cloudinary.pot b/languages/cloudinary.pot index f817bc842..ebba81a7a 100644 --- a/languages/cloudinary.pot +++ b/languages/cloudinary.pot @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Cloudinary STABLETAG\n" "Report-Msgid-Bugs-To: https://github.com/cloudinary/cloudinary_wordpress\n" -"POT-Creation-Date: 2026-10-28 13:54:10+00:00\n" +"POT-Creation-Date: 2026-11-05 07:48:26+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -1046,7 +1046,7 @@ msgid "" "Try again once syncing is complete." msgstr "" -#: php/sync/class-download-sync.php:180 +#: php/sync/class-download-sync.php:251 msgid "Could not download the Cloudinary asset." msgstr "" From 0fb8e4a0cce2fe1250d8c094b73f70a091200a15 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Thu, 5 Nov 2026 09:13:58 +0100 Subject: [PATCH 80/80] Build assets --- css/gallery-ui.css | 4 ++-- js/asset-edit.js | 2 +- js/asset-manager.js | 2 +- js/cloudinary.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/css/gallery-ui.css b/css/gallery-ui.css index d926aa2e1..22a1aa668 100644 --- a/css/gallery-ui.css +++ b/css/gallery-ui.css @@ -1,5 +1,5 @@ -@charset "UTF-8";@media not (prefers-reduced-motion){.components-animate__appear{animation:components-animate__appear-animation .1s cubic-bezier(0,0,.2,1) 0s;animation-fill-mode:forwards}}.components-animate__appear.is-from-top,.components-animate__appear.is-from-top.is-from-left{transform-origin:top left}.components-animate__appear.is-from-top.is-from-right{transform-origin:top right}.components-animate__appear.is-from-bottom,.components-animate__appear.is-from-bottom.is-from-left{transform-origin:bottom left}.components-animate__appear.is-from-bottom.is-from-right{transform-origin:bottom right}@keyframes components-animate__appear-animation{0%{transform:translateY(-2em) scaleY(0) scaleX(0)}to{transform:translateY(0) scaleY(1) scaleX(1)}}@media not (prefers-reduced-motion){.components-animate__slide-in{animation:components-animate__slide-in-animation .1s cubic-bezier(0,0,.2,1);animation-fill-mode:forwards}.components-animate__slide-in.is-from-left{transform:translateX(100%)}.components-animate__slide-in.is-from-right{transform:translateX(-100%)}}@keyframes components-animate__slide-in-animation{to{transform:translateX(0)}}@media not (prefers-reduced-motion){.components-animate__loading{animation:components-animate__loading 1.6s ease-in-out infinite}}@keyframes components-animate__loading{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}.components-autocomplete__popover .components-popover__content{min-width:200px;padding:8px}.components-autocomplete__result.components-button{display:flex;font-weight:var(--wpds-typography-font-weight-default,400);height:auto;min-height:36px;text-align:left;width:100%}.components-autocomplete__result.components-button:focus:not(:disabled){box-shadow:inset 0 0 0 1px #fff,0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:2px solid transparent}.components-badge{box-sizing:border-box}.components-badge *,.components-badge :after,.components-badge :before{box-sizing:inherit}.components-badge{background-color:color-mix(in srgb,#fff 90%,var(--base-color));border-radius:2px;color:color-mix(in srgb,#000 50%,var(--base-color));display:inline-block;line-height:0;max-width:100%;min-height:24px;padding:2px 8px}.components-badge:where(.is-default){background-color:#f0f0f0;color:#2f2f2f}.components-badge.has-icon{padding-inline-start:4px}.components-badge.is-info{--base-color:#3858e9}.components-badge.is-warning{--base-color:#f0b849}.components-badge.is-error{--base-color:#cc1818}.components-badge.is-success{--base-color:#4ab866}.components-badge__flex-wrapper{align-items:center;display:inline-flex;font-size:12px;font-weight:400;gap:2px;line-height:20px;max-width:100%}.components-badge__icon{flex-shrink:0}.components-badge__content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.components-button-group{display:inline-block}.components-button-group .components-button{border-color:#1e1e1e;border-radius:0;color:#1e1e1e;display:inline-flex}.components-button-group .components-button+.components-button{margin-left:-1px}.components-button-group .components-button:first-child{border-radius:2px 0 0 2px}.components-button-group .components-button:last-child{border-radius:0 2px 2px 0}.components-button-group .components-button.is-primary,.components-button-group .components-button:focus{position:relative;z-index:1}.components-button:focus:is(a){box-shadow:none}.components-button:focus{outline:none}.components-button:focus:not(:active){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-button{align-items:center;appearance:none;background:none;border:1px solid transparent;border-radius:2px;box-sizing:border-box;color:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));cursor:var(--wpds-cursor-control,pointer);display:inline-flex;font-family:inherit;font-size:13px;font-weight:var(--wpds-typography-font-weight-emphasis,600);height:36px;margin:0;padding:4px 12px;text-decoration:none}.components-button.is-next-40px-default-size{height:40px}.components-button:hover:not(:disabled,[aria-disabled=true]),.components-button[aria-expanded=true]{color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}.components-button.is-primary{background:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));text-decoration:none;text-shadow:none;white-space:nowrap}.components-button.is-primary,.components-button.is-primary:hover:not(:disabled){color:var(--wp-components-color-accent-inverted,var(--wpds-color-foreground-interactive-brand-strong,#fff))}.components-button.is-primary:hover:not(:disabled){background:var(--wp-components-color-accent-darker-10,var(--wp-admin-theme-color-darker-10,#2145e6))}.components-button.is-primary:active:not(:disabled){background:var(--wp-components-color-accent-darker-20,var(--wp-admin-theme-color-darker-20,#183ad6));color:var(--wp-components-color-accent-inverted,var(--wpds-color-foreground-interactive-brand-strong,#fff))}.components-button.is-primary:disabled,.components-button.is-primary:disabled:active:enabled,.components-button.is-primary[aria-disabled=true],.components-button.is-primary[aria-disabled=true]:active:enabled,.components-button.is-primary[aria-disabled=true]:enabled{background:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));color:hsla(0,0%,100%,.4)}.components-button.is-primary.is-busy,.components-button.is-primary.is-busy:disabled,.components-button.is-primary.is-busy[aria-disabled=true]{background-image:linear-gradient(-45deg,var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9)) 33%,var(--wp-components-color-accent-darker-20,var(--wp-admin-theme-color-darker-20,#183ad6)) 33%,var(--wp-components-color-accent-darker-20,var(--wp-admin-theme-color-darker-20,#183ad6)) 70%,var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9)) 70%);background-size:100px 100%;color:var(--wp-components-color-accent-inverted,var(--wpds-color-foreground-interactive-brand-strong,#fff))}.components-button.is-secondary:disabled,.components-button.is-secondary[aria-disabled=true],.components-button.is-secondary[aria-disabled=true]:hover,.components-button.is-tertiary:disabled,.components-button.is-tertiary[aria-disabled=true],.components-button.is-tertiary[aria-disabled=true]:hover{background:transparent;color:#949494;transform:none}@media not (prefers-reduced-motion){.components-button.is-secondary{transition:border-color .1s linear}}.components-button.is-secondary{background:transparent;border-color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));white-space:nowrap}.components-button.is-secondary:active:not(:disabled){border-color:transparent}.components-button.is-secondary:hover:not(:disabled,[aria-disabled=true],.is-pressed){background:color-mix(in srgb,var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9)) 4%,transparent);border-color:var(--wp-components-color-accent-darker-20,var(--wp-admin-theme-color-darker-20,#183ad6));color:var(--wp-components-color-accent-darker-20,var(--wp-admin-theme-color-darker-20,#183ad6))}.components-button.is-secondary:focus:not(:active){border-color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}.components-button.is-secondary:disabled:not(:focus),.components-button.is-secondary[aria-disabled=true]:hover:not(:focus),.components-button.is-secondary[aria-disabled=true]:not(:focus){border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}.components-button.is-tertiary{background:transparent;color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));white-space:nowrap}.components-button.is-tertiary:hover:not(:disabled,[aria-disabled=true],.is-pressed){background:color-mix(in srgb,var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9)) 4%,transparent);color:var(--wp-components-color-accent-darker-20,var(--wp-admin-theme-color-darker-20,#183ad6))}.components-button.is-tertiary:active:not(:disabled,[aria-disabled=true]){background:color-mix(in srgb,var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9)) 8%,transparent)}p+.components-button.is-tertiary{margin-left:-6px}.components-button.is-destructive{--wp-components-color-accent:#cc1818;--wp-components-color-accent-darker-10:#9e1313;--wp-components-color-accent-darker-20:#710d0d}.components-button.is-destructive:not(.is-primary):not(.is-secondary):not(.is-tertiary):not(.is-link){color:#cc1818}.components-button.is-destructive:not(.is-primary):not(.is-secondary):not(.is-tertiary):not(.is-link):hover:not(:disabled,[aria-disabled=true]){color:#710d0d}.components-button.is-destructive:not(.is-primary):not(.is-secondary):not(.is-tertiary):not(.is-link):active:not(:disabled,[aria-disabled=true]){background:#ccc}.components-button.is-destructive:not(.is-primary):not(.is-secondary):not(.is-tertiary):not(.is-link):disabled,.components-button.is-destructive:not(.is-primary):not(.is-secondary):not(.is-tertiary):not(.is-link)[aria-disabled=true]{color:#949494}.components-button.is-destructive.is-secondary:hover:not(:disabled,[aria-disabled=true]),.components-button.is-destructive.is-tertiary:hover:not(:disabled,[aria-disabled=true]){background:rgba(204,24,24,.04)}.components-button.is-destructive.is-secondary:active:not(:disabled,[aria-disabled=true]),.components-button.is-destructive.is-tertiary:active:not(:disabled,[aria-disabled=true]){background:rgba(204,24,24,.08)}.components-button.is-link{background:none;border:0;border-radius:0;color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));font-weight:var(--wpds-typography-font-weight-default,400);margin:0;outline:none;padding:0;text-align:left;text-decoration:underline;text-decoration-thickness:from-font;text-underline-offset:.2em}@media not (prefers-reduced-motion){.components-button.is-link{transition-duration:.05s;transition-property:border,background,color;transition-timing-function:ease-in-out}}.components-button.is-link{height:auto}.components-button.is-link:focus:not(:active){border-radius:2px;text-decoration:none}.components-button.is-link:disabled,.components-button.is-link[aria-disabled=true]{color:#949494}.components-button:not(:disabled,[aria-disabled=true]):active{color:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e))}.components-button:disabled,.components-button[aria-disabled=true]{color:#949494;cursor:default}@media not (prefers-reduced-motion){.components-button.is-busy,.components-button.is-secondary.is-busy,.components-button.is-secondary.is-busy:disabled,.components-button.is-secondary.is-busy[aria-disabled=true]{animation:components-button__busy-animation 2.5s linear infinite}}.components-button.is-busy,.components-button.is-secondary.is-busy,.components-button.is-secondary.is-busy:disabled,.components-button.is-secondary.is-busy[aria-disabled=true]{background-image:linear-gradient(-45deg,#fafafa 33%,#e0e0e0 0,#e0e0e0 70%,#fafafa 0);background-size:100px 100%}.components-button.is-compact{height:32px}.components-button.is-compact.has-icon:not(.has-text){min-width:32px;padding:0}.components-button.is-small{font-size:11px;height:var(--wpds-dimension-size-sm,24px);line-height:22px;padding:0 8px}.components-button.is-small.has-icon:not(.has-text){min-width:var(--wpds-dimension-size-sm,24px);padding:0}.components-button.has-icon{justify-content:center;min-width:36px;padding:6px}.components-button.has-icon.is-next-40px-default-size{min-width:40px}.components-button.has-icon .dashicon{align-items:center;box-sizing:content-box;display:inline-flex;justify-content:center;padding:2px}.components-button.has-icon.has-text{gap:4px;justify-content:start;padding-left:8px;padding-right:12px}.components-button.has-icon.has-text.has-icon-right{padding-left:12px;padding-right:8px}.components-button.has-icon:not(.has-text) .dashicon,.components-button.has-icon:not(.has-text) svg{margin-inline:-1px}.components-button.is-pressed,.components-button.is-pressed:hover{color:var(--wp-components-color-foreground-inverted,var(--wpds-color-background-surface-neutral,#fcfcfc))}.components-button.is-pressed:hover:not(:disabled,[aria-disabled=true]),.components-button.is-pressed:not(:disabled,[aria-disabled=true]){background:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e))}.components-button.is-pressed:disabled,.components-button.is-pressed[aria-disabled=true]{color:#949494}.components-button.is-pressed:disabled:not(.is-primary):not(.is-secondary):not(.is-tertiary),.components-button.is-pressed[aria-disabled=true]:not(.is-primary):not(.is-secondary):not(.is-tertiary){background:#949494;color:var(--wp-components-color-foreground-inverted,var(--wpds-color-background-surface-neutral,#fcfcfc))}.components-button svg{fill:currentColor;flex-shrink:0;outline:none}@keyframes components-button__busy-animation{0%{background-position:200px 0}}.components-checkbox-control{--checkbox-input-size:24px}@media (min-width:600px){.components-checkbox-control{--checkbox-input-size:16px}}.components-checkbox-control{--checkbox-input-margin:8px}.components-checkbox-control__label{line-height:var(--checkbox-input-size)}.components-checkbox-control:not(:has(:disabled)) .components-checkbox-control__label{cursor:var(--wpds-cursor-control,pointer)}.components-checkbox-control__input[type=checkbox]{border:1px solid #1e1e1e;border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:2px;border-radius:var(--wpds-border-radius-sm,2px);font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;margin-right:12px;padding:6px 8px;transition:none}@media (min-width:600px){.components-checkbox-control__input[type=checkbox]{font-size:13px;line-height:normal}}.components-checkbox-control__input[type=checkbox]:hover:not(:disabled,[aria-disabled=true],[type=checkbox]){border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}.components-checkbox-control__input[type=checkbox]:focus{border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);box-shadow:none;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-checkbox-control__input[type=checkbox]::placeholder{color:rgba(30,30,30,.62)}.components-checkbox-control__input[type=checkbox]:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wp-admin-theme-color)}.components-checkbox-control__input[type=checkbox]:checked{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color)}.components-checkbox-control__input[type=checkbox]:checked:before,.components-checkbox-control__input[type=checkbox][aria-checked=mixed]:before{color:#fff;margin:-3px -5px}@media (min-width:782px){.components-checkbox-control__input[type=checkbox]:checked:before,.components-checkbox-control__input[type=checkbox][aria-checked=mixed]:before{margin:-4px 0 0 -5px}}.components-checkbox-control__input[type=checkbox][aria-checked=mixed]{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color)}.components-checkbox-control__input[type=checkbox][aria-checked=mixed]:before{content:"\f460";display:inline-block;float:left;font:normal 30px/1 dashicons;vertical-align:middle;width:16px;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (min-width:782px){.components-checkbox-control__input[type=checkbox][aria-checked=mixed]:before{float:none;font-size:21px}}.components-checkbox-control__input[type=checkbox]:disabled,.components-checkbox-control__input[type=checkbox][aria-disabled=true]{background:#f0f0f0;border-color:#ddd;cursor:default;opacity:1}.components-checkbox-control__input[type=checkbox]{appearance:none;background:#fff;clear:none;color:#1e1e1e;display:inline-block;height:var(--checkbox-input-size);line-height:0;margin:0 4px 0 0;outline:0;padding:0!important;text-align:center;vertical-align:top;width:var(--checkbox-input-size)}@media not (prefers-reduced-motion){.components-checkbox-control__input[type=checkbox]{transition:border-color .1s ease-in-out}}.components-checkbox-control__input[type=checkbox]:focus{box-shadow:0 0 0 var(--wp-admin-border-width-focus) #fff,0 0 0 calc(var(--wp-admin-border-width-focus)*2) var(--wp-admin-theme-color);outline:2px solid transparent;outline-offset:2px}.components-checkbox-control__input[type=checkbox]:not(:disabled):is(:checked,:indeterminate){background:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));border-color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}.components-checkbox-control__input[type=checkbox]:not(:disabled){cursor:var(--wpds-cursor-control,pointer)}.components-checkbox-control__input[type=checkbox]:checked:before{content:none}.components-checkbox-control__input-container{aspect-ratio:1;display:inline-block;flex-shrink:0;line-height:1;margin-right:var(--checkbox-input-margin);position:relative;vertical-align:middle;width:var(--checkbox-input-size)}svg.components-checkbox-control__checked,svg.components-checkbox-control__indeterminate{--checkmark-size:var(--checkbox-input-size);color:#fff;cursor:var(--wpds-cursor-control,pointer);height:var(--checkmark-size);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);-webkit-user-select:none;user-select:none;width:var(--checkmark-size)}@media (min-width:600px){svg.components-checkbox-control__checked,svg.components-checkbox-control__indeterminate{--checkmark-size:calc(var(--checkbox-input-size) + 4px)}}.components-checkbox-control:has(:disabled) svg.components-checkbox-control__checked,.components-checkbox-control:has(:disabled) svg.components-checkbox-control__indeterminate{color:var(--wp-components-color-gray-400,var(--wpds-color-stroke-interactive-neutral,#8d8d8d))}.components-checkbox-control__help{display:inline-block;margin-inline-start:calc(var(--checkbox-input-size) + var(--checkbox-input-margin))}.components-circular-option-picker{display:inline-block;isolation:isolate;min-width:188px;width:100%}.components-circular-option-picker .components-circular-option-picker__custom-clear-wrapper{display:flex;justify-content:flex-end;margin-top:12px}.components-circular-option-picker .components-circular-option-picker__swatches{display:flex;flex-wrap:wrap;gap:12px;position:relative;z-index:1}.components-circular-option-picker>:not(.components-circular-option-picker__swatches){position:relative;z-index:0}.components-circular-option-picker__option-wrapper{display:inline-block;height:28px;transform:scale(1);vertical-align:top;width:28px}@media not (prefers-reduced-motion){.components-circular-option-picker__option-wrapper{transition:transform .1s ease;will-change:transform}}.components-circular-option-picker__option-wrapper:hover{transform:scale(1.2)}.components-circular-option-picker__option-wrapper>div{height:100%;width:100%}.components-circular-option-picker__option-wrapper:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' fill='none'%3E%3Cpath fill='%23555d65' d='M6 8V6H4v2zm2 0V6h2v2zm2 8H8v-2h2zm2 0v-2h2v2zm0 2v-2h-2v2H8v2h2v-2zm2 0v2h-2v-2zm2 0h-2v-2h2z'/%3E%3Cpath fill='%23555d65' fill-rule='evenodd' d='M18 18h2v-2h-2v-2h2v-2h-2v-2h2V8h-2v2h-2V8h-2v2h2v2h-2v2h2v2h2zm-2-4v-2h2v2z' clip-rule='evenodd'/%3E%3Cpath fill='%23555d65' d='M18 18v2h-2v-2z'/%3E%3Cpath fill='%23555d65' fill-rule='evenodd' d='M8 10V8H6v2H4v2h2v2H4v2h2v2H4v2h2v2H4v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2V8h-2V6h2V4h-2v2h-2V4h-2v2h-2V4h-2v2h-2V4h-2v2h2v2h-2v2zm0 2v-2H6v2zm2 0v-2h2v2zm0 2v-2H8v2H6v2h2v2H6v2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2V8h-2V6h-2v2h-2V6h-2v2h-2v2h2v2h-2v2z' clip-rule='evenodd'/%3E%3Cpath fill='%23555d65' fill-rule='evenodd' d='M4 0H2v2H0v2h2v2H0v2h2v2H0v2h2v2H0v2h2v2H0v2h2v2H0v2h2v2H0v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2V8h-2V6h2V4h-2V2h2V0h-2v2h-2V0h-2v2h-2V0h-2v2h-2V0h-2v2h-2V0h-2v2H8V0H6v2H4zm0 4V2H2v2zm2 0V2h2v2zm0 2V4H4v2H2v2h2v2H2v2h2v2H2v2h2v2H2v2h2v2H2v2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2V8h-2V6h2V4h-2V2h-2v2h-2V2h-2v2h-2V2h-2v2h-2V2h-2v2H8v2z' clip-rule='evenodd'/%3E%3C/svg%3E");border-radius:50%;bottom:1px;content:"";left:1px;position:absolute;right:1px;top:1px;z-index:-1}.components-circular-option-picker__option{aspect-ratio:1;background:transparent;border:none;border-radius:50%;box-shadow:inset 0 0 0 14px;display:inline-block;height:100%!important;vertical-align:top}@media not (prefers-reduced-motion){.components-circular-option-picker__option{transition:box-shadow .1s ease}}.components-circular-option-picker__option{cursor:var(--wpds-cursor-control,pointer)}.components-circular-option-picker__option:hover{box-shadow:inset 0 0 0 14px!important}.components-circular-option-picker__option[aria-pressed=true],.components-circular-option-picker__option[aria-selected=true]{box-shadow:inset 0 0 0 4px;overflow:visible;position:relative;z-index:1}.components-circular-option-picker__option[aria-pressed=true]+svg,.components-circular-option-picker__option[aria-selected=true]+svg{border-radius:50%;left:2px;pointer-events:none;position:absolute;top:2px;z-index:2}.components-circular-option-picker__option:after{border:1px solid transparent;border-radius:50%;bottom:-1px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);box-sizing:inherit;content:"";left:-1px;position:absolute;right:-1px;top:-1px}.components-circular-option-picker__option:focus:after{border:2px solid #757575;border-radius:50%;box-shadow:inset 0 0 0 2px #fff;content:"";height:calc(100% + 4px);left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:calc(100% + 4px)}.components-circular-option-picker__option.components-button:focus{background-color:transparent;box-shadow:inset 0 0 0 14px;outline:none}.components-circular-option-picker__button-action .components-circular-option-picker__option{background:#fff;color:#fff}.components-circular-option-picker__dropdown-link-action{margin-right:16px}.components-circular-option-picker__dropdown-link-action .components-button{line-height:22px}.components-palette-edit__popover-duotone-picker,.components-palette-edit__popover-gradient-picker{padding:8px;width:260px}.components-dropdown-menu__menu .components-palette-edit__menu-button{width:100%}.component-color-indicator{background:#fff linear-gradient(-45deg,transparent 48%,#ddd 0,#ddd 52%,transparent 0);border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);display:inline-block;height:20px;padding:0;width:20px}.components-combobox-control{width:100%}input.components-combobox-control__input[type=text]{background:var(--wp-components-color-background,var(--wpds-color-background-surface-neutral-strong,#fff));border:none;box-shadow:none;color:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-family:inherit;font-size:16px;line-height:inherit;margin:0;min-height:auto;padding:2px;width:100%}@media (min-width:600px){input.components-combobox-control__input[type=text]{font-size:13px}}input.components-combobox-control__input[type=text]:focus{box-shadow:none;outline:none}.components-combobox-control__suggestions-container{border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;padding:6px 8px}@media (min-width:600px){.components-combobox-control__suggestions-container{font-size:13px;line-height:normal}}.components-combobox-control__suggestions-container:hover:not(:disabled,[aria-disabled=true],[type=checkbox]){border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}.components-combobox-control__suggestions-container:focus{border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);box-shadow:none;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-combobox-control__suggestions-container::placeholder{color:rgba(30,30,30,.62)}.components-combobox-control__suggestions-container{align-items:flex-start;display:flex;flex-wrap:wrap;padding:0;width:100%}.components-combobox-control__suggestions-container:focus-within{outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-combobox-control__suggestions-container .components-spinner{margin:0}.components-color-palette__custom-color-wrapper{position:relative;z-index:0}.components-color-palette__custom-color-button{background:none;border:none;border-radius:4px 4px 0 0;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);box-sizing:border-box;cursor:var(--wpds-cursor-control,pointer);height:64px;outline:1px solid transparent;position:relative;width:100%}.components-color-palette__custom-color-button:focus{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));outline-width:2px}.components-color-palette__custom-color-button:after{background-image:repeating-linear-gradient(45deg,#e0e0e0 25%,transparent 0,transparent 75%,#e0e0e0 0,#e0e0e0),repeating-linear-gradient(45deg,#e0e0e0 25%,transparent 0,transparent 75%,#e0e0e0 0,#e0e0e0);background-position:0 0,24px 24px;background-size:48px 48px;border-radius:3px 3px 0 0;content:"";inset:1px;position:absolute;z-index:-1}.components-color-palette__custom-color-text-wrapper{border-radius:0 0 4px 4px;box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.2),inset 1px 0 0 0 rgba(0,0,0,.2),inset -1px 0 0 0 rgba(0,0,0,.2);font-size:13px;padding:12px 16px;position:relative}.components-color-palette__custom-color-name{color:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));margin:0 1px}.components-color-palette__custom-color-value{color:#757575}.components-color-palette__custom-color-value--is-hex{text-transform:uppercase}.components-color-palette__custom-color-value:empty:after{content:"​";visibility:hidden}.components-custom-gradient-picker__gradient-bar{border-radius:2px;height:48px;position:relative;width:100%;z-index:1}.components-custom-gradient-picker__gradient-bar.has-gradient{background-image:repeating-linear-gradient(45deg,#e0e0e0 25%,transparent 0,transparent 75%,#e0e0e0 0,#e0e0e0),repeating-linear-gradient(45deg,#e0e0e0 25%,transparent 0,transparent 75%,#e0e0e0 0,#e0e0e0);background-position:0 0,12px 12px;background-size:24px 24px}.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__gradient-bar-background{inset:0;position:absolute}.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__markers-container{margin-left:auto;margin-right:auto;position:relative;width:calc(100% - 48px)}.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__control-point-dropdown{display:flex;height:16px;position:absolute;top:16px;width:16px}.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__insert-point-dropdown{background:#fff;border-radius:50%;color:#1e1e1e;height:inherit;min-width:16px!important;padding:2px;position:relative;width:inherit}.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__insert-point-dropdown svg{height:100%;width:100%}.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__control-point-button{border-radius:50%;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) #fff,0 0 2px 0 rgba(0,0,0,.25);height:inherit;outline:2px solid transparent;padding:0;width:inherit}.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__control-point-button.is-active,.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__control-point-button:focus{box-shadow:inset 0 0 0 calc(var(--wp-admin-border-width-focus)*2) #fff,0 0 2px 0 rgba(0,0,0,.25);outline:1.5px solid transparent}.components-custom-gradient-picker__remove-control-point-wrapper{padding-bottom:8px}.components-custom-gradient-picker__inserter{direction:ltr}.components-custom-gradient-picker__liner-gradient-indicator{display:inline-block;flex:0 auto;height:20px;width:20px}.components-custom-gradient-picker__ui-line{position:relative;z-index:0}.components-drop-zone{border-radius:2px;bottom:0;left:0;opacity:0;position:absolute;right:0;top:0;visibility:hidden;z-index:40}.components-drop-zone.is-active{opacity:1;visibility:visible}.components-drop-zone .components-drop-zone__content{align-items:center;background-color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));bottom:0;color:#fff;display:flex;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;right:0;text-align:center;top:0;width:100%;z-index:50}.components-drop-zone .components-drop-zone__content-inner{opacity:0;transform:scale(.9)}.components-drop-zone.is-active.is-dragging-over-element .components-drop-zone__content{opacity:1}@media not (prefers-reduced-motion){.components-drop-zone.is-active.is-dragging-over-element .components-drop-zone__content{transition:opacity .2s ease-in-out}}.components-drop-zone.is-active.is-dragging-over-element .components-drop-zone__content-inner{opacity:1;transform:scale(1)}@media not (prefers-reduced-motion){.components-drop-zone.is-active.is-dragging-over-element .components-drop-zone__content-inner{transition:opacity .1s ease-in-out .1s,transform .1s ease-in-out .1s}}.components-drop-zone__content-icon,.components-drop-zone__content-text{display:block}.components-drop-zone__content-icon{fill:currentColor;line-height:0;margin:0 auto 8px;pointer-events:none}.components-drop-zone__content-text{font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.components-dropdown{display:inline-block}.components-dropdown__content .components-popover__content{padding:8px}.components-dropdown__content .components-popover__content:has(.components-menu-group){padding:0}.components-dropdown__content .components-popover__content:has(.components-menu-group) .components-dropdown-menu__menu>.components-menu-item__button,.components-dropdown__content .components-popover__content:has(.components-menu-group)>.components-menu-item__button{margin:8px;width:auto}.components-dropdown__content [role=menuitem]{white-space:nowrap}.components-dropdown__content .components-menu-group{padding:8px}.components-dropdown__content .components-menu-group+.components-menu-group{border-top:1px solid #ccc;padding:8px}.components-dropdown__content.is-alternate .components-menu-group+.components-menu-group{border-color:#1e1e1e}.components-dropdown-menu__toggle{vertical-align:top}.components-dropdown-menu__menu{font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;line-height:1.4;width:100%}.components-dropdown-menu__menu .components-dropdown-menu__menu-item,.components-dropdown-menu__menu .components-menu-item{cursor:var(--wpds-cursor-control,pointer);font-weight:var(--wpds-typography-font-weight-default,400);outline:none;padding:6px;white-space:nowrap;width:100%}.components-dropdown-menu__menu .components-dropdown-menu__menu-item.has-separator,.components-dropdown-menu__menu .components-menu-item.has-separator{margin-top:6px;overflow:visible;position:relative}.components-dropdown-menu__menu .components-dropdown-menu__menu-item.has-separator:before,.components-dropdown-menu__menu .components-menu-item.has-separator:before{background-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);box-sizing:content-box;content:"";display:block;height:1px;left:0;position:absolute;right:0;top:-3px}.components-dropdown-menu__menu .components-dropdown-menu__menu-item.is-active .dashicon,.components-dropdown-menu__menu .components-dropdown-menu__menu-item.is-active svg,.components-dropdown-menu__menu .components-menu-item.is-active .dashicon,.components-dropdown-menu__menu .components-menu-item.is-active svg{background:#1e1e1e;border-radius:1px;box-shadow:0 0 0 1px #1e1e1e;color:#fff}.components-dropdown-menu__menu .components-dropdown-menu__menu-item.is-icon-only,.components-dropdown-menu__menu .components-menu-item.is-icon-only{width:auto}.components-dropdown-menu__menu .components-menu-item__button,.components-dropdown-menu__menu .components-menu-item__button.components-button{height:auto;min-height:32px;padding-left:8px;padding-right:8px;text-align:left}.components-duotone-picker__color-indicator:before{background:transparent}.components-duotone-picker__color-indicator>.components-button,.components-duotone-picker__color-indicator>.components-button.is-pressed:hover:not(:disabled){background:linear-gradient(-45deg,transparent 48%,#ddd 0,#ddd 52%,transparent 0);color:transparent}.components-duotone-picker__color-indicator>.components-button:hover:not(:disabled):not([aria-disabled=true]),.components-duotone-picker__color-indicator>.components-button:not([aria-disabled=true]):active{color:transparent}.components-color-list-picker,.components-color-list-picker__swatch-button{width:100%}.components-color-list-picker__color-picker{margin:8px 0}.components-color-list-picker__swatch-color{margin:2px}.components-external-link{text-decoration:none}.components-external-link,.components-external-link:visited{color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.components-external-link:active,.components-external-link:hover{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.components-external-link:focus{border-radius:0;box-shadow:none}.components-external-link:focus:not(:active){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-external-link__contents{text-decoration:underline;text-decoration-thickness:from-font;text-underline-offset:.2em}.components-external-link__icon{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-padding-xs,4px)}.components-form-toggle{display:inline-block;height:16px;isolation:isolate;position:relative}.components-form-toggle .components-form-toggle__track{background-color:#fff;border:1px solid #949494;border-radius:8px;box-sizing:border-box;content:"";display:inline-block;height:16px;position:relative;vertical-align:top;width:32px}@media not (prefers-reduced-motion){.components-form-toggle .components-form-toggle__track{transition:background-color .2s ease,border-color .2s ease}}.components-form-toggle .components-form-toggle__track{overflow:hidden}.components-form-toggle .components-form-toggle__track:after{border-top:16px solid transparent;box-sizing:border-box;content:"";inset:0;position:absolute}@media not (prefers-reduced-motion){.components-form-toggle .components-form-toggle__track:after{transition:opacity .2s ease}}.components-form-toggle .components-form-toggle__track:after{opacity:0}.components-form-toggle .components-form-toggle__thumb{border-radius:50%;box-sizing:border-box;display:block;height:12px;left:2px;position:absolute;top:2px;width:12px}@media not (prefers-reduced-motion){.components-form-toggle .components-form-toggle__thumb{transition:transform .2s ease,background-color .2s ease-out}}.components-form-toggle .components-form-toggle__thumb{background-color:#1e1e1e;border:6px solid transparent;box-shadow:0 1px 1px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.02),0 3px 3px rgba(0,0,0,.02),0 4px 4px rgba(0,0,0,.01)}.components-form-toggle.is-checked .components-form-toggle__track{background-color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));border-color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}.components-form-toggle.is-checked .components-form-toggle__track:after{opacity:1}.components-form-toggle .components-form-toggle__input:focus+.components-form-toggle__track{box-shadow:0 0 0 var(--wp-admin-border-width-focus) #fff,0 0 0 calc(var(--wp-admin-border-width-focus)*2) var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));outline:2px solid transparent;outline-offset:2px}.components-form-toggle.is-checked .components-form-toggle__thumb{background-color:#fff;border-width:0;transform:translateX(16px)}.components-form-toggle.is-disabled .components-form-toggle__track,[inert] .components-form-toggle .components-form-toggle__track{background-color:var(--wp-components-color-gray-100,var(--wpds-color-background-surface-neutral,#fcfcfc));border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}@media (forced-colors:active){.components-form-toggle.is-disabled .components-form-toggle__track,[inert] .components-form-toggle .components-form-toggle__track{border-color:GrayText}}.components-form-toggle.is-disabled .components-form-toggle__thumb,[inert] .components-form-toggle .components-form-toggle__thumb{background-color:var(--wp-components-color-gray-400,var(--wpds-color-stroke-interactive-neutral,#8d8d8d));box-shadow:none}@media (forced-colors:active){.components-form-toggle.is-disabled .components-form-toggle__thumb,[inert] .components-form-toggle .components-form-toggle__thumb{border-color:GrayText}}.components-form-toggle.is-disabled.is-checked .components-form-toggle__track,[inert] .components-form-toggle.is-checked .components-form-toggle__track{background-color:var(--wp-components-color-gray-400,var(--wpds-color-stroke-interactive-neutral,#8d8d8d));border-color:var(--wp-components-color-gray-400,var(--wpds-color-stroke-interactive-neutral,#8d8d8d))}@media (forced-colors:active){.components-form-toggle.is-disabled.is-checked .components-form-toggle__track,[inert] .components-form-toggle.is-checked .components-form-toggle__track{border-color:GrayText}.components-form-toggle.is-disabled.is-checked .components-form-toggle__track:after,[inert] .components-form-toggle.is-checked .components-form-toggle__track:after{border-top-color:GrayText}}.components-form-toggle.is-disabled.is-checked .components-form-toggle__thumb,[inert] .components-form-toggle.is-checked .components-form-toggle__thumb{background-color:#fff}.components-form-toggle input.components-form-toggle__input[type=checkbox]{border:none;height:100%;left:0;margin:0;opacity:0;padding:0;position:absolute;top:0;width:100%;z-index:1}.components-form-toggle input.components-form-toggle__input[type=checkbox]:checked{background:none}.components-form-toggle input.components-form-toggle__input[type=checkbox]:before{content:""}.components-form-toggle input.components-form-toggle__input[type=checkbox]:not(:disabled,[aria-disabled=true]){cursor:var(--wpds-cursor-control,pointer)}.components-form-token-field__input-container{border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;padding:6px 8px}@media (min-width:600px){.components-form-token-field__input-container{font-size:13px;line-height:normal}}.components-form-token-field__input-container:hover:not(:disabled,[aria-disabled=true],[type=checkbox]){border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}.components-form-token-field__input-container:focus{border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);box-shadow:none;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-form-token-field__input-container::placeholder{color:rgba(30,30,30,.62)}.components-form-token-field__input-container{cursor:text;padding:0;width:100%}.components-form-token-field__input-container.is-disabled{background:var(--wp-components-color-gray-100,var(--wpds-color-background-surface-neutral,#fcfcfc));cursor:default}.components-form-token-field__input-container.is-disabled,.components-form-token-field__input-container.is-disabled:hover{border-color:var(--wp-components-color-gray-400,var(--wpds-color-stroke-interactive-neutral,#8d8d8d))}.components-form-token-field__input-container.is-active{outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-form-token-field__input-container input[type=text].components-form-token-field__input{background:inherit;border:0;box-shadow:none;color:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));display:inline-block;flex:1;font-family:inherit;font-size:16px;line-height:1;margin-left:4px;max-width:100%;min-height:24px;min-width:50px;padding:0;width:100%}@media (min-width:600px){.components-form-token-field__input-container input[type=text].components-form-token-field__input{font-size:13px}}.components-form-token-field.is-active .components-form-token-field__input-container input[type=text].components-form-token-field__input,.components-form-token-field__input-container input[type=text].components-form-token-field__input:focus{box-shadow:none;outline:none}.components-form-token-field__input-container .components-form-token-field__token+input[type=text].components-form-token-field__input{width:auto}.components-form-token-field__token{color:#1e1e1e;display:flex;font-size:13px;max-width:100%}.components-form-token-field__token.is-success .components-form-token-field__remove-token,.components-form-token-field__token.is-success .components-form-token-field__token-text{background:#4ab866}.components-form-token-field__token.is-error .components-form-token-field__remove-token,.components-form-token-field__token.is-error .components-form-token-field__token-text{background:#cc1818}.components-form-token-field__token.is-validating .components-form-token-field__remove-token,.components-form-token-field__token.is-validating .components-form-token-field__token-text{color:#757575}.components-form-token-field__token.is-disabled .components-form-token-field__remove-token.components-button,.components-form-token-field__token.is-disabled .components-form-token-field__token-text{background:var(--wp-components-color-gray-100,var(--wpds-color-background-surface-neutral,#fcfcfc));color:var(--wp-components-color-gray-600,var(--wpds-color-stroke-interactive-neutral,#8d8d8d))}.components-form-token-field__token.is-borderless{padding:0 24px 0 0;position:relative}.components-form-token-field__token.is-borderless .components-form-token-field__token-text{background:transparent}.components-form-token-field__token.is-borderless:not(.is-disabled) .components-form-token-field__token-text{color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}.components-form-token-field__token.is-borderless .components-form-token-field__remove-token{background:transparent;color:#757575;position:absolute;right:0;top:1px}.components-form-token-field__token.is-borderless.is-success .components-form-token-field__token-text{color:#4ab866}.components-form-token-field__token.is-borderless.is-error .components-form-token-field__token-text{color:#cc1818;padding:0 4px 0 6px}.components-form-token-field__token.is-borderless.is-validating .components-form-token-field__token-text{color:#1e1e1e}.components-form-token-field__remove-token.components-button,.components-form-token-field__token-text{background:#ddd;display:inline-block;height:auto;min-width:unset}@media not (prefers-reduced-motion){.components-form-token-field__remove-token.components-button,.components-form-token-field__token-text{transition:all .2s cubic-bezier(.4,1,.4,1)}}.components-form-token-field__token-text{border-radius:1px 0 0 1px;line-height:24px;overflow:hidden;padding:0 0 0 8px;text-overflow:ellipsis;white-space:nowrap}.components-form-token-field__remove-token.components-button{border-radius:0 1px 1px 0;color:#1e1e1e;line-height:10px;overflow:initial}.components-form-token-field__remove-token.components-button:hover:not(:disabled){color:#1e1e1e}.components-form-token-field__suggestions-list{flex:1 0 100%;max-height:128px;min-width:100%;overflow-y:auto}@media not (prefers-reduced-motion){.components-form-token-field__suggestions-list{transition:all .15s ease-in-out}}.components-form-token-field__suggestions-list{box-shadow:inset 0 1px 0 0 #949494;list-style:none;margin:0;padding:0}.components-form-token-field__suggestion{box-sizing:border-box;color:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));display:block;font-size:13px;margin:0;min-height:32px;padding:8px 12px}.components-form-token-field__suggestion.is-selected{background:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));color:var(--wp-components-color-foreground-inverted,var(--wpds-color-background-surface-neutral,#fcfcfc))}.components-form-token-field__suggestion[aria-disabled=true]{color:#949494;pointer-events:none}.components-form-token-field__suggestion[aria-disabled=true].is-selected{background:color-mix(in srgb,var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9)) 4%,transparent)}.components-form-token-field__suggestion:not(.is-empty){cursor:var(--wpds-cursor-control,pointer)}@media (min-width:600px){.components-guide{width:600px}}.components-guide .components-modal__content{margin-top:0;padding:0}.components-guide .components-modal__content:before{content:none}.components-guide .components-modal__header{border-bottom:none;height:64px;padding:0;position:sticky}.components-guide .components-modal__header .components-button{align-self:flex-start;margin:8px 8px 0 0;position:static}.components-guide .components-guide__container{display:flex;flex-direction:column;justify-content:space-between;margin-top:-64px;min-height:100%}.components-guide .components-guide__page{display:flex;flex-direction:column;justify-content:center;position:relative}@media (min-width:600px){.components-guide .components-guide__page{min-height:300px}}.components-guide .components-guide__footer{align-content:center;display:flex;height:36px;justify-content:center;margin:0 0 24px;padding:0 24px;position:relative;width:100%}.components-guide .components-guide__page-control{margin:0;text-align:center}.components-guide .components-guide__page-control li{display:inline-block;margin:0}.components-guide .components-guide__page-control .components-button{color:#e0e0e0;margin:-6px 0}.components-guide .components-guide__page-control li[aria-current=step] .components-button{color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}.components-modal__frame.components-guide{border:none;max-height:575px;min-width:312px}@media (max-width:600px){.components-modal__frame.components-guide{margin:auto;max-width:calc(100vw - 32px)}}.components-button.components-guide__back-button,.components-button.components-guide__finish-button,.components-button.components-guide__forward-button{position:absolute}.components-button.components-guide__back-button{left:24px}.components-button.components-guide__finish-button,.components-button.components-guide__forward-button{right:24px}[role=region]{position:relative}[role=region].interface-interface-skeleton__content:focus-visible:after{bottom:0;box-shadow:inset 0 0 0 calc(var(--wp-admin-border-width-focus)*2/var(--wp-block-editor-iframe-zoom-out-scale, 1) + .5px) hsla(0,0%,100%,.7);content:"";left:0;outline-color:var(--wp-admin-theme-color);outline-offset:calc(var(--wp-admin-border-width-focus)*-2/var(--wp-block-editor-iframe-zoom-out-scale, 1));outline-style:solid;outline-width:calc(var(--wp-admin-border-width-focus)*2/var(--wp-block-editor-iframe-zoom-out-scale, 1));pointer-events:none;position:absolute;right:0;top:0;z-index:1000000}.is-focusing-regions [role=region]:focus:after{bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:1000000}.is-focusing-regions .editor-post-publish-panel,.is-focusing-regions .interface-interface-skeleton__actions .editor-layout__toggle-entities-saved-states-panel,.is-focusing-regions .interface-interface-skeleton__actions .editor-layout__toggle-publish-panel,.is-focusing-regions .interface-interface-skeleton__sidebar .editor-layout__toggle-sidebar-panel,.is-focusing-regions [role=region]:focus:after,.is-focusing-regions.is-distraction-free .interface-interface-skeleton__header .edit-post-header{box-shadow:inset 0 0 0 calc(var(--wp-admin-border-width-focus)*2/var(--wp-block-editor-iframe-zoom-out-scale, 1) + .5px) hsla(0,0%,100%,.7);outline-color:var(--wp-admin-theme-color);outline-offset:calc(var(--wp-admin-border-width-focus)*-2/var(--wp-block-editor-iframe-zoom-out-scale, 1));outline-style:solid;outline-width:calc(var(--wp-admin-border-width-focus)*2/var(--wp-block-editor-iframe-zoom-out-scale, 1))}.components-input-control__container:focus-within:not(:has(:is(.components-input-control__prefix,.components-input-control__suffix):focus-within)) .components-input-control__backdrop{outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-menu-group+.components-menu-group{border-top:1px solid #1e1e1e;padding-top:8px}.components-menu-group+.components-menu-group.has-hidden-separator{border-top:none;margin-top:0;padding-top:0}.components-menu-group:has(>div:empty){display:none}.components-menu-group__label{color:#757575;font-size:11px;font-weight:var(--wpds-typography-font-weight-emphasis,600);margin-bottom:12px;margin-top:4px;padding:0 8px;text-transform:uppercase;white-space:nowrap}.components-menu-item__button,.components-menu-item__button.components-button{font-weight:var(--wpds-typography-font-weight-default,400);width:100%}.components-menu-item__button.components-button[role=menuitemcheckbox] .components-menu-item__item:only-child,.components-menu-item__button.components-button[role=menuitemradio] .components-menu-item__item:only-child,.components-menu-item__button[role=menuitemcheckbox] .components-menu-item__item:only-child,.components-menu-item__button[role=menuitemradio] .components-menu-item__item:only-child{box-sizing:initial;padding-right:48px}.components-menu-item__button .components-menu-items__item-icon,.components-menu-item__button.components-button .components-menu-items__item-icon{display:inline-block;flex:0 0 auto}.components-menu-item__button .components-menu-items__item-icon.has-icon-right,.components-menu-item__button.components-button .components-menu-items__item-icon.has-icon-right{margin-left:24px;margin-right:-2px}.components-menu-item__button .components-menu-item__shortcut+.components-menu-items__item-icon.has-icon-right,.components-menu-item__button.components-button .components-menu-item__shortcut+.components-menu-items__item-icon.has-icon-right{margin-left:8px}.components-menu-item__button .block-editor-block-icon,.components-menu-item__button.components-button .block-editor-block-icon{margin-left:-2px;margin-right:8px}.components-menu-item__button.components-button.is-primary,.components-menu-item__button.is-primary{justify-content:center}.components-menu-item__button.components-button.is-primary .components-menu-item__item,.components-menu-item__button.is-primary .components-menu-item__item{margin-right:0}.components-menu-item__button.components-button:disabled.is-tertiary,.components-menu-item__button.components-button[aria-disabled=true].is-tertiary,.components-menu-item__button:disabled.is-tertiary,.components-menu-item__button[aria-disabled=true].is-tertiary{background:none;color:var(--wp-components-color-accent-darker-10,var(--wp-admin-theme-color-darker-10,#2145e6));opacity:.3}.components-menu-item__info-wrapper{display:flex;flex-direction:column;margin-right:auto}.components-menu-item__info{color:#757575;font-size:12px;margin-top:4px;white-space:normal}.components-menu-item__item{align-items:center;display:inline-flex;margin-right:auto;min-width:160px;white-space:nowrap}.components-menu-item__shortcut{align-self:center;color:currentColor;display:none;margin-left:auto;margin-right:0;padding-left:24px}@media (min-width:480px){.components-menu-item__shortcut{display:inline}}.components-menu-items-choice,.components-menu-items-choice.components-button{height:auto;min-height:40px}.components-menu-items-choice svg,.components-menu-items-choice.components-button svg{margin-right:12px}.components-menu-items-choice.components-button.has-icon,.components-menu-items-choice.has-icon{padding-left:12px}body.modal-open{overflow:hidden}.components-modal__screen-overlay{background-color:rgba(0,0,0,.35);bottom:0;display:flex;left:0;position:fixed;right:0;top:0;z-index:100000}@keyframes __wp-base-styles-fade-in{0%{opacity:0}to{opacity:1}}@media not (prefers-reduced-motion){.components-modal__screen-overlay{animation:__wp-base-styles-fade-in var(--wpds-motion-duration-sm,.1s) var(--wpds-motion-easing-subtle,cubic-bezier(.15,0,.15,1)) 0s;animation-fill-mode:forwards}}@keyframes __wp-base-styles-fade-out{0%{opacity:1}to{opacity:0}}@media not (prefers-reduced-motion){.components-modal__screen-overlay.is-animating-out{animation:__wp-base-styles-fade-out var(--wpds-motion-duration-sm,.1s) var(--wpds-motion-easing-subtle,cubic-bezier(.15,0,.15,1)) var(--wpds-motion-duration-xs,50ms);animation-fill-mode:forwards}}.components-modal__frame{box-sizing:border-box}.components-modal__frame *,.components-modal__frame :after,.components-modal__frame :before{box-sizing:inherit}.components-modal__frame{align-self:flex-end;animation-fill-mode:forwards;animation-name:components-modal__appear-animation;animation-timing-function:var(--wpds-motion-easing-expressive,cubic-bezier(.25,0,0,1));background:#fff;border-radius:8px 8px 0 0;box-shadow:0 5px 15px rgba(0,0,0,.08),0 15px 27px rgba(0,0,0,.07),0 30px 36px rgba(0,0,0,.04),0 50px 43px rgba(0,0,0,.02);color:#1e1e1e;display:flex;margin:0;max-height:calc(100% - 40px);overflow:hidden;width:100%}.components-modal__frame h1,.components-modal__frame h2,.components-modal__frame h3{color:#1e1e1e}@media not (prefers-reduced-motion){.components-modal__frame{animation-duration:var(--wpds-motion-duration-md,.2s)}}.components-modal__screen-overlay.is-animating-out .components-modal__frame{animation-name:components-modal__disappear-animation;animation-timing-function:var(--wpds-motion-easing-expressive,cubic-bezier(.25,0,0,1))}@media (min-width:600px){.components-modal__frame{align-self:auto;border-radius:8px;margin:auto;max-height:calc(100% - 128px);max-width:calc(100% - 32px);min-width:var(--wpds-dimension-surface-width-sm,320px);width:auto}.components-modal__frame.has-size-large,.components-modal__frame.has-size-medium,.components-modal__frame.has-size-small{width:100%}.components-modal__frame.has-size-small{max-width:var(--wpds-dimension-surface-width-md,400px)}.components-modal__frame.has-size-medium{max-width:var(--wpds-dimension-surface-width-lg,560px)}.components-modal__frame.has-size-large{max-width:var(--wpds-dimension-surface-width-2xl,960px)}}@media (min-width:960px){.components-modal__frame{max-height:70%}}.components-modal__frame.is-full-screen{border-radius:0;height:100%;margin:0;max-height:none;width:100%}.components-modal__frame.is-full-screen :where(.components-modal__content){display:flex;margin-bottom:24px;padding-bottom:0}.components-modal__frame.is-full-screen :where(.components-modal__content)>:last-child{flex:1}@media (min-width:600px){.components-modal__frame.is-full-screen{border-radius:8px;height:calc(100% - 32px);margin:auto;width:calc(100% - 32px)}}@media (min-width:782px){.components-modal__frame.is-full-screen{height:calc(100% - 80px);max-width:none;width:calc(100% - 80px)}}@keyframes components-modal__appear-animation{0%{opacity:0;transform:translateY(100%)}to{opacity:1;transform:translateY(0)}}@keyframes components-modal__disappear-animation{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(100%)}}@media (min-width:600px){@keyframes components-modal__appear-animation{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}@keyframes components-modal__disappear-animation{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}}.components-modal__header{align-items:center;border-bottom:1px solid transparent;box-sizing:border-box;display:flex;flex-direction:row;height:72px;justify-content:space-between;left:0;padding:24px;position:absolute;top:0;width:100%;z-index:10}.components-modal__header .components-modal__header-heading{font-size:20px;font-weight:var(--wpds-typography-font-weight-emphasis,600)}.components-modal__header h1{line-height:1;margin:0}.components-modal__content.has-scrolled-content:not(.hide-header) .components-modal__header{border-bottom-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb)}.components-modal__header+p{margin-top:0}.components-modal__header-heading-container{align-items:center;display:flex;flex-direction:row;flex-grow:1;justify-content:flex-start}.components-modal__header-icon-container{display:inline-block}.components-modal__header-icon-container svg{max-height:36px;max-width:36px;padding:8px}.components-modal__content{flex:1;margin-top:72px;overflow:auto;padding:4px 24px 24px}.components-modal__content.hide-header{margin-top:0;padding-top:24px}.components-modal__content.is-scrollable:focus-visible{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));outline:2px solid transparent;outline-offset:-2px}.components-notice{--wp-components-notice-background-color:var(--wpds-color-background-surface-info-weak,#f3f9ff);--wp-components-notice-border-color:var(--wpds-color-stroke-surface-info,#adc6e2);--wp-components-notice-text-color:var(--wpds-color-foreground-content-info,#001b4f);align-items:start;background-color:var(--wp-components-notice-background-color);border:var(--wpds-border-width-xs,1px) solid var(--wp-components-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);box-sizing:border-box;color:var(--wp-components-notice-text-color);display:grid;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);grid-template-columns:1fr auto;line-height:var(--wpds-typography-line-height-sm,20px);padding:var(--wpds-dimension-padding-md,12px)}.components-notice.is-success{--wp-components-notice-background-color:var(--wpds-color-background-surface-success-weak,#ebffed);--wp-components-notice-border-color:var(--wpds-color-stroke-surface-success,#92d39d);--wp-components-notice-text-color:var(--wpds-color-foreground-content-success,#002900)}.components-notice.is-warning{--wp-components-notice-background-color:var(--wpds-color-background-surface-warning-weak,#fff7e1);--wp-components-notice-border-color:var(--wpds-color-stroke-surface-warning,#e1bd7c);--wp-components-notice-text-color:var(--wpds-color-foreground-content-warning,#2e1900)}.components-notice.is-error{--wp-components-notice-background-color:var(--wpds-color-background-surface-error-weak,#fff6f5);--wp-components-notice-border-color:var(--wpds-color-stroke-surface-error,#e0afa7);--wp-components-notice-text-color:var(--wpds-color-foreground-content-error,#470000)}.components-notice__content{grid-column:1;grid-row:1;padding-block:calc((var(--wpds-dimension-size-sm, 24px) - 1lh)/2)}.components-notice__actions{align-items:center;display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:1;grid-row:2;margin-top:var(--wpds-dimension-gap-sm,8px)}.components-notice__dismiss{color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);grid-column:2;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}.components-notice__dismiss:not(:disabled):not([aria-disabled=true]):focus,.components-notice__dismiss:not(:disabled):not([aria-disabled=true]):not(.is-secondary):active,.components-notice__dismiss:not(:disabled):not([aria-disabled=true]):not(.is-secondary):hover{background-color:transparent;color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}.components-notice__dismiss:not(:disabled):not([aria-disabled=true]):not(.is-secondary):hover{box-shadow:none}.components-notice-list{box-sizing:border-box;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-md,12px);max-width:100vw}.components-panel{background:#fff;border:1px solid #e0e0e0}.components-panel>.components-panel__body:first-child,.components-panel>.components-panel__header:first-child{margin-top:-1px}.components-panel>.components-panel__body:last-child,.components-panel>.components-panel__header:last-child{border-bottom-width:0}.components-panel+.components-panel{margin-top:-1px}.components-panel__body{border-bottom:1px solid #e0e0e0;border-top:1px solid #e0e0e0}.components-panel__body h3{margin:0 0 .5em}.components-panel__body.is-opened{padding:16px}.components-panel__header{align-items:center;border-bottom:1px solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);box-sizing:content-box;display:flex;flex-shrink:0;height:47px;justify-content:space-between;padding:0 16px}.components-panel__header h2{color:inherit;font-size:inherit;margin:0}.components-panel__body+.components-panel__body,.components-panel__body+.components-panel__header,.components-panel__header+.components-panel__body,.components-panel__header+.components-panel__header{margin-top:-1px}.components-panel__body>.components-panel__body-title{display:block;font-size:inherit;margin-bottom:0;margin-top:0;padding:0}@media not (prefers-reduced-motion){.components-panel__body>.components-panel__body-title{transition:background .1s ease-in-out}}.components-panel__body.is-opened>.components-panel__body-title{margin:-16px -16px 5px}.components-panel__body>.components-panel__body-title:hover{background:#f0f0f0;border:none}.components-panel__body-toggle.components-button{color:#1e1e1e;font-weight:var(--wpds-typography-font-weight-emphasis,600);padding:16px 48px 16px 16px;position:relative;text-align:left;width:100%}@media not (prefers-reduced-motion){.components-panel__body-toggle.components-button{transition:background .1s ease-in-out}}.components-panel__body-toggle.components-button{height:auto}.components-panel__body-toggle.components-button:focus{border-radius:0;outline-offset:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*-1)}.components-panel__body-toggle.components-button .components-panel__arrow{color:#1e1e1e;fill:currentColor;position:absolute;right:16px;top:50%;transform:translateY(-50%)}@media not (prefers-reduced-motion){.components-panel__body-toggle.components-button .components-panel__arrow{transition:color .1s ease-in-out}}body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right{margin-top:-10px;transform:scaleX(-1)}.components-panel__icon{color:#757575;margin:-2px 0 -2px 6px}.components-panel__body-toggle-icon{margin-right:-5px}.components-panel__color-title{float:left;height:19px}.components-panel__row{align-items:center;display:flex;justify-content:space-between;margin-top:8px;min-height:36px}.components-panel__row select{min-width:0}.components-panel__row label{flex-shrink:0;margin-right:12px;max-width:75%}.components-panel__row:empty,.components-panel__row:first-of-type{margin-top:0}.components-panel .circle-picker{padding-bottom:20px}.components-placeholder.components-placeholder{align-items:flex-start;box-sizing:border-box;color:#1e1e1e;display:flex;flex-direction:column;font-size:13px;gap:16px;margin:0;padding:24px;position:relative;text-align:left;width:100%;-webkit-font-smoothing:subpixel-antialiased;background-color:#fff;border-radius:2px;box-shadow:inset 0 0 0 1px #1e1e1e;outline:1px solid transparent}.components-placeholder__error,.components-placeholder__fieldset,.components-placeholder__instructions,.components-placeholder__label{font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:400;letter-spacing:normal;line-height:normal;text-transform:none}.components-placeholder__label{align-items:center;display:flex;font-weight:var(--wpds-typography-font-weight-emphasis,600)}.components-placeholder__label .block-editor-block-icon,.components-placeholder__label .dashicon,.components-placeholder__label>svg{fill:currentColor;margin-right:4px}.components-placeholder__label:empty{display:none}.components-placeholder__fieldset,.components-placeholder__fieldset form{display:flex;flex-direction:row;flex-wrap:wrap;gap:16px;justify-content:flex-start;width:100%}.components-placeholder__fieldset form p,.components-placeholder__fieldset p{font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.components-placeholder__fieldset.is-column-layout,.components-placeholder__fieldset.is-column-layout form{flex-direction:column}.components-placeholder__input[type=url]{border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;padding:6px 8px}@media (min-width:600px){.components-placeholder__input[type=url]{font-size:13px;line-height:normal}}.components-placeholder__input[type=url]:hover:not(:disabled,[aria-disabled=true],[type=checkbox]){border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}.components-placeholder__input[type=url]:focus{border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);box-shadow:none;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-placeholder__input[type=url]::placeholder{color:rgba(30,30,30,.62)}.components-placeholder__input[type=url]{flex:1 1 auto}.components-placeholder__error{gap:8px;width:100%}.components-placeholder__fieldset .components-button:not(.is-link)~.components-button.is-link{margin-left:10px;margin-right:10px}.components-placeholder__fieldset .components-button:not(.is-link)~.components-button.is-link:last-child{margin-right:0}.components-placeholder.is-medium .components-placeholder__instructions,.components-placeholder.is-small .components-placeholder__instructions{display:none}.components-placeholder.is-medium .components-placeholder__fieldset,.components-placeholder.is-medium .components-placeholder__fieldset form,.components-placeholder.is-small .components-placeholder__fieldset,.components-placeholder.is-small .components-placeholder__fieldset form{flex-direction:column}.components-placeholder.is-medium .components-button,.components-placeholder.is-medium .components-placeholder__fieldset>*,.components-placeholder.is-small .components-button,.components-placeholder.is-small .components-placeholder__fieldset>*{justify-content:center;width:100%}.components-placeholder.is-small{padding:16px}.components-placeholder.has-illustration{backdrop-filter:blur(100px);backface-visibility:hidden;background-color:transparent;border-radius:0;box-shadow:none;color:inherit;display:flex}.is-dark-theme .components-placeholder.has-illustration{background-color:rgba(0,0,0,.1)}.components-placeholder.has-illustration .components-placeholder__fieldset{margin-left:0;margin-right:0}.components-placeholder.has-illustration .components-button,.components-placeholder.has-illustration .components-placeholder__instructions,.components-placeholder.has-illustration .components-placeholder__label{opacity:0;pointer-events:none}@media not (prefers-reduced-motion){.components-placeholder.has-illustration .components-button,.components-placeholder.has-illustration .components-placeholder__instructions,.components-placeholder.has-illustration .components-placeholder__label{transition:opacity .1s linear}}.is-selected>.components-placeholder.has-illustration .components-button,.is-selected>.components-placeholder.has-illustration .components-placeholder__instructions,.is-selected>.components-placeholder.has-illustration .components-placeholder__label{opacity:1;pointer-events:auto}.components-placeholder.has-illustration:before{background:currentColor;bottom:0;content:"";left:0;opacity:.1;pointer-events:none;position:absolute;right:0;top:0}.components-placeholder.has-illustration{overflow:hidden}.is-selected .components-placeholder.has-illustration{overflow:auto}.components-placeholder__preview{display:flex;justify-content:center}.components-placeholder__illustration{box-sizing:content-box;height:100%;left:50%;opacity:.25;position:absolute;stroke:currentColor;top:50%;transform:translate(-50%,-50%);width:100%}.components-popover{box-sizing:border-box}.components-popover *,.components-popover :after,.components-popover :before{box-sizing:inherit}.components-popover{will-change:transform;z-index:1000000}.components-popover.is-expanded{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1000000!important}.components-popover__content{background:#fff;border-radius:4px;box-shadow:0 0 0 1px #ccc,0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02);box-sizing:border-box;width:min-content}.is-alternate .components-popover__content{border-radius:2px;box-shadow:0 0 0 1px #1e1e1e}.is-unstyled .components-popover__content{background:none;border-radius:0;box-shadow:none}.components-popover.is-expanded .components-popover__content{box-shadow:0 -1px 0 0 #ccc;height:calc(100% - 48px);overflow-y:visible;position:static;width:auto}.components-popover.is-expanded.is-alternate .components-popover__content{box-shadow:0 -1px 0 #1e1e1e}.components-popover__header{align-items:center;background:#fff;display:flex;height:48px;justify-content:space-between;padding:0 8px 0 16px}.components-popover__header-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.components-popover__arrow{display:flex;height:14px;pointer-events:none;position:absolute;width:14px}.components-popover__arrow:before{background-color:#fff;content:"";height:2px;left:1px;position:absolute;right:1px;top:-1px}.components-popover__arrow.is-top{bottom:-14px!important;transform:rotate(0)}.components-popover__arrow.is-right{left:-14px!important;transform:rotate(90deg)}.components-popover__arrow.is-bottom{top:-14px!important;transform:rotate(180deg)}.components-popover__arrow.is-left{right:-14px!important;transform:rotate(-90deg)}.components-popover__triangle{display:block;flex:1}.components-popover__triangle-bg{fill:#fff}.components-popover__triangle-border{fill:transparent;stroke:#ccc;stroke-width:1px}.is-alternate .components-popover__triangle-border{stroke:#1e1e1e}.components-radio-control{border:0;font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;margin:0;padding:0}.components-radio-control__group-wrapper.has-help{margin-block-end:12px}.components-radio-control__option{align-items:center;column-gap:8px;display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto minmax(0,max-content)}.components-radio-control__input[type=radio]{border:1px solid #1e1e1e;border-radius:50%;grid-column:1;grid-row:1;height:24px;margin-right:12px;max-width:24px;min-width:24px;position:relative;transition:none;width:24px}@media not (prefers-reduced-motion){.components-radio-control__input[type=radio]{transition:box-shadow .1s linear}}@media (min-width:600px){.components-radio-control__input[type=radio]{height:16px;max-width:16px;min-width:16px;width:16px}}.components-radio-control__input[type=radio]:checked:before{background-color:#fff;border:4px solid #fff;box-sizing:inherit;height:12px;left:50%;margin:0;position:absolute;top:50%;transform:translate(-50%,-50%);width:12px}@media (min-width:600px){.components-radio-control__input[type=radio]:checked:before{height:8px;width:8px}}.components-radio-control__input[type=radio]:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wp-admin-theme-color)}.components-radio-control__input[type=radio]:checked{background:var(--wp-admin-theme-color);border:none}.components-radio-control__input[type=radio]{appearance:none;display:inline-flex;margin:0;padding:0}.components-radio-control__input[type=radio]:not(:disabled){cursor:var(--wpds-cursor-control,pointer)}.components-radio-control__input[type=radio]:focus{box-shadow:0 0 0 var(--wp-admin-border-width-focus) #fff,0 0 0 calc(var(--wp-admin-border-width-focus)*2) var(--wp-admin-theme-color);outline:2px solid transparent;outline-offset:2px}.components-radio-control__input[type=radio]:checked{background:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));border-color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}.components-radio-control__input[type=radio]:checked:before{border-radius:50%;content:""}.components-radio-control__input[type=radio]:disabled{background:var(--wp-components-color-gray-100,var(--wpds-color-background-surface-neutral,#fcfcfc));border:1px solid var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);opacity:1}.components-radio-control__input[type=radio]:disabled:checked:before{border-color:var(--wp-components-color-gray-400,var(--wpds-color-stroke-interactive-neutral,#8d8d8d));opacity:1}.components-radio-control__label{grid-column:2;grid-row:1}.components-radio-control__input:not(:disabled)+.components-radio-control__label{cursor:var(--wpds-cursor-control,pointer)}.components-radio-control__label{line-height:24px}@media (min-width:600px){.components-radio-control__label{line-height:16px}}.components-radio-control__option-description{grid-column:2;grid-row:2;padding-block-start:4px}.components-radio-control__option-description.components-radio-control__option-description{margin-top:0}.components-resizable-box__handle{display:none;height:23px;width:23px;z-index:2}.components-resizable-box__container.has-show-handle .components-resizable-box__handle{display:block}.components-resizable-box__handle>div{height:100%;outline:none;position:relative;width:100%;z-index:2}.components-resizable-box__container>img{width:inherit}.components-resizable-box__handle:after{background:#fff;border-radius:50%;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9)),0 1px 1px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.02),0 3px 3px rgba(0,0,0,.02),0 4px 4px rgba(0,0,0,.01);content:"";cursor:inherit;display:block;height:15px;outline:2px solid transparent;position:absolute;right:calc(50% - 8px);top:calc(50% - 8px);width:15px}.components-resizable-box__side-handle:before{background:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));border-radius:9999px;content:"";cursor:inherit;display:block;height:3px;position:absolute;right:calc(50% - 1px);top:calc(50% - 1px);width:3px}@media not (prefers-reduced-motion){.components-resizable-box__side-handle:before{transition:transform .1s ease-in;will-change:transform}}.components-resizable-box__side-handle:before{opacity:0}.components-resizable-box__corner-handle,.components-resizable-box__side-handle{z-index:2}.components-resizable-box__side-handle.components-resizable-box__handle-bottom,.components-resizable-box__side-handle.components-resizable-box__handle-bottom:before,.components-resizable-box__side-handle.components-resizable-box__handle-top,.components-resizable-box__side-handle.components-resizable-box__handle-top:before{border-left:0;border-right:0;left:0;width:100%}.components-resizable-box__side-handle.components-resizable-box__handle-left,.components-resizable-box__side-handle.components-resizable-box__handle-left:before,.components-resizable-box__side-handle.components-resizable-box__handle-right,.components-resizable-box__side-handle.components-resizable-box__handle-right:before{border-bottom:0;border-top:0;height:100%;top:0}@media not (prefers-reduced-motion){.components-resizable-box__side-handle.components-resizable-box__handle-bottom:active:before,.components-resizable-box__side-handle.components-resizable-box__handle-bottom:hover:before,.components-resizable-box__side-handle.components-resizable-box__handle-top:active:before,.components-resizable-box__side-handle.components-resizable-box__handle-top:hover:before{animation:components-resizable-box__top-bottom-animation .1s ease-out 0s;animation-fill-mode:forwards}.components-resizable-box__side-handle.components-resizable-box__handle-left:active:before,.components-resizable-box__side-handle.components-resizable-box__handle-left:hover:before,.components-resizable-box__side-handle.components-resizable-box__handle-right:active:before,.components-resizable-box__side-handle.components-resizable-box__handle-right:hover:before{animation:components-resizable-box__left-right-animation .1s ease-out 0s;animation-fill-mode:forwards}}@media not all and (min-resolution:0.001dpcm){@supports (-webkit-appearance:none){.components-resizable-box__side-handle.components-resizable-box__handle-bottom:active:before,.components-resizable-box__side-handle.components-resizable-box__handle-bottom:hover:before,.components-resizable-box__side-handle.components-resizable-box__handle-left:active:before,.components-resizable-box__side-handle.components-resizable-box__handle-left:hover:before,.components-resizable-box__side-handle.components-resizable-box__handle-right:active:before,.components-resizable-box__side-handle.components-resizable-box__handle-right:hover:before,.components-resizable-box__side-handle.components-resizable-box__handle-top:active:before,.components-resizable-box__side-handle.components-resizable-box__handle-top:hover:before{animation:none}}}@keyframes components-resizable-box__top-bottom-animation{0%{opacity:0;transform:scaleX(0)}to{opacity:1;transform:scaleX(1)}}@keyframes components-resizable-box__left-right-animation{0%{opacity:0;transform:scaleY(0)}to{opacity:1;transform:scaleY(1)}} +@charset "UTF-8";@media not (prefers-reduced-motion){.components-animate__appear{animation:components-animate__appear-animation .1s cubic-bezier(0,0,.2,1) 0s;animation-fill-mode:forwards}}.components-animate__appear.is-from-top,.components-animate__appear.is-from-top.is-from-left{transform-origin:top left}.components-animate__appear.is-from-top.is-from-right{transform-origin:top right}.components-animate__appear.is-from-bottom,.components-animate__appear.is-from-bottom.is-from-left{transform-origin:bottom left}.components-animate__appear.is-from-bottom.is-from-right{transform-origin:bottom right}@keyframes components-animate__appear-animation{0%{transform:translateY(-2em) scaleY(0) scaleX(0)}to{transform:translateY(0) scaleY(1) scaleX(1)}}@media not (prefers-reduced-motion){.components-animate__slide-in{animation:components-animate__slide-in-animation .1s cubic-bezier(0,0,.2,1);animation-fill-mode:forwards}.components-animate__slide-in.is-from-left{transform:translateX(100%)}.components-animate__slide-in.is-from-right{transform:translateX(-100%)}}@keyframes components-animate__slide-in-animation{to{transform:translateX(0)}}@media not (prefers-reduced-motion){.components-animate__loading{animation:components-animate__loading 1.6s ease-in-out infinite}}@keyframes components-animate__loading{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}.components-autocomplete__popover .components-popover__content{min-width:200px;padding:8px}.components-autocomplete__result.components-button{display:flex;font-weight:var(--wpds-typography-font-weight-default,400);height:auto;min-height:36px;position:relative;text-align:left;width:100%}.components-autocomplete__result.components-button:focus:not(:disabled):not(:active){box-shadow:0 0 0 calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*2 + 2px) var(--wpds-color-background-surface-neutral-strong,#fff);z-index:1}.components-badge{box-sizing:border-box}.components-badge *,.components-badge :after,.components-badge :before{box-sizing:inherit}.components-badge{background-color:color-mix(in srgb,#fff 90%,var(--base-color));border-radius:2px;color:color-mix(in srgb,#000 50%,var(--base-color));display:inline-block;line-height:0;max-width:100%;min-height:24px;padding:2px 8px}.components-badge:where(.is-default){background-color:#f0f0f0;color:#2f2f2f}.components-badge.has-icon{padding-inline-start:4px}.components-badge.is-info{--base-color:#3858e9}.components-badge.is-warning{--base-color:#f0b849}.components-badge.is-error{--base-color:#cc1818}.components-badge.is-success{--base-color:#4ab866}.components-badge__flex-wrapper{align-items:center;display:inline-flex;font-size:12px;font-weight:400;gap:2px;line-height:20px;max-width:100%}.components-badge__icon{flex-shrink:0}.components-badge__content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.components-button-group{display:inline-block}.components-button-group .components-button{border-color:#1e1e1e;border-radius:0;color:#1e1e1e;display:inline-flex}.components-button-group .components-button+.components-button{margin-left:-1px}.components-button-group .components-button:first-child{border-radius:2px 0 0 2px}.components-button-group .components-button:last-child{border-radius:0 2px 2px 0}.components-button-group .components-button.is-primary,.components-button-group .components-button:focus{position:relative;z-index:1}.components-button:focus:is(a){box-shadow:none}.components-button:focus{outline:none}.components-button:focus:not(:active){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-button{align-items:center;appearance:none;background:none;border:1px solid transparent;border-radius:2px;box-sizing:border-box;color:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));cursor:var(--wpds-cursor-control,pointer);display:inline-flex;font-family:inherit;font-size:13px;font-weight:var(--wpds-typography-font-weight-emphasis,600);height:36px;margin:0;padding:4px 12px;text-decoration:none}.components-button.is-next-40px-default-size{height:40px}.components-button:hover:not(:disabled,[aria-disabled=true]),.components-button[aria-expanded=true]{color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}.components-button.is-primary{background:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));text-decoration:none;text-shadow:none;white-space:nowrap}.components-button.is-primary,.components-button.is-primary:hover:not(:disabled){color:var(--wp-components-color-accent-inverted,var(--wpds-color-foreground-interactive-brand-strong,#fff))}.components-button.is-primary:hover:not(:disabled){background:var(--wp-components-color-accent-darker-10,var(--wp-admin-theme-color-darker-10,#2145e6))}.components-button.is-primary:active:not(:disabled){background:var(--wp-components-color-accent-darker-20,var(--wp-admin-theme-color-darker-20,#183ad6));color:var(--wp-components-color-accent-inverted,var(--wpds-color-foreground-interactive-brand-strong,#fff))}.components-button.is-primary:disabled,.components-button.is-primary:disabled:active:enabled,.components-button.is-primary[aria-disabled=true],.components-button.is-primary[aria-disabled=true]:active:enabled,.components-button.is-primary[aria-disabled=true]:enabled{background:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));color:hsla(0,0%,100%,.4)}.components-button.is-primary.is-busy,.components-button.is-primary.is-busy:disabled,.components-button.is-primary.is-busy[aria-disabled=true]{background-image:linear-gradient(-45deg,var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9)) 33%,var(--wp-components-color-accent-darker-20,var(--wp-admin-theme-color-darker-20,#183ad6)) 33%,var(--wp-components-color-accent-darker-20,var(--wp-admin-theme-color-darker-20,#183ad6)) 70%,var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9)) 70%);background-size:100px 100%;color:var(--wp-components-color-accent-inverted,var(--wpds-color-foreground-interactive-brand-strong,#fff))}.components-button.is-secondary:disabled,.components-button.is-secondary[aria-disabled=true],.components-button.is-secondary[aria-disabled=true]:hover,.components-button.is-tertiary:disabled,.components-button.is-tertiary[aria-disabled=true],.components-button.is-tertiary[aria-disabled=true]:hover{background:transparent;color:#949494;transform:none}@media not (prefers-reduced-motion){.components-button.is-secondary{transition:border-color .1s linear}}.components-button.is-secondary{background:transparent;border-color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));white-space:nowrap}.components-button.is-secondary:active:not(:disabled){border-color:transparent}.components-button.is-secondary:hover:not(:disabled,[aria-disabled=true],.is-pressed){background:color-mix(in srgb,var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9)) 4%,transparent);border-color:var(--wp-components-color-accent-darker-20,var(--wp-admin-theme-color-darker-20,#183ad6));color:var(--wp-components-color-accent-darker-20,var(--wp-admin-theme-color-darker-20,#183ad6))}.components-button.is-secondary:focus:not(:active){border-color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}.components-button.is-secondary:disabled:not(:focus),.components-button.is-secondary[aria-disabled=true]:hover:not(:focus),.components-button.is-secondary[aria-disabled=true]:not(:focus){border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}.components-button.is-tertiary{background:transparent;color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));white-space:nowrap}.components-button.is-tertiary:hover:not(:disabled,[aria-disabled=true],.is-pressed){background:color-mix(in srgb,var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9)) 4%,transparent);color:var(--wp-components-color-accent-darker-20,var(--wp-admin-theme-color-darker-20,#183ad6))}.components-button.is-tertiary:active:not(:disabled,[aria-disabled=true]){background:color-mix(in srgb,var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9)) 8%,transparent)}p+.components-button.is-tertiary{margin-left:-6px}.components-button.is-destructive{--wp-components-color-accent:#cc1818;--wp-components-color-accent-darker-10:#9e1313;--wp-components-color-accent-darker-20:#710d0d}.components-button.is-destructive:not(.is-primary):not(.is-secondary):not(.is-tertiary):not(.is-link){color:#cc1818}.components-button.is-destructive:not(.is-primary):not(.is-secondary):not(.is-tertiary):not(.is-link):hover:not(:disabled,[aria-disabled=true]){color:#710d0d}.components-button.is-destructive:not(.is-primary):not(.is-secondary):not(.is-tertiary):not(.is-link):active:not(:disabled,[aria-disabled=true]){background:#ccc}.components-button.is-destructive:not(.is-primary):not(.is-secondary):not(.is-tertiary):not(.is-link):disabled,.components-button.is-destructive:not(.is-primary):not(.is-secondary):not(.is-tertiary):not(.is-link)[aria-disabled=true]{color:#949494}.components-button.is-destructive.is-secondary:hover:not(:disabled,[aria-disabled=true]),.components-button.is-destructive.is-tertiary:hover:not(:disabled,[aria-disabled=true]){background:rgba(204,24,24,.04)}.components-button.is-destructive.is-secondary:active:not(:disabled,[aria-disabled=true]),.components-button.is-destructive.is-tertiary:active:not(:disabled,[aria-disabled=true]){background:rgba(204,24,24,.08)}.components-button.is-link{background:none;border:0;border-radius:0;color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));font-weight:var(--wpds-typography-font-weight-default,400);margin:0;outline:none;padding:0;text-align:left;text-decoration:underline;text-decoration-thickness:from-font;text-underline-offset:.2em}@media not (prefers-reduced-motion){.components-button.is-link{transition-duration:.05s;transition-property:border,background,color;transition-timing-function:ease-in-out}}.components-button.is-link{height:auto}.components-button.is-link:focus:not(:active){border-radius:2px;text-decoration:none}.components-button.is-link:disabled,.components-button.is-link[aria-disabled=true]{color:#949494}.components-button:not(:disabled,[aria-disabled=true]):active{color:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e))}.components-button:disabled,.components-button[aria-disabled=true]{color:#949494;cursor:default}@media not (prefers-reduced-motion){.components-button.is-busy,.components-button.is-secondary.is-busy,.components-button.is-secondary.is-busy:disabled,.components-button.is-secondary.is-busy[aria-disabled=true]{animation:components-button__busy-animation 2.5s linear infinite}}.components-button.is-busy,.components-button.is-secondary.is-busy,.components-button.is-secondary.is-busy:disabled,.components-button.is-secondary.is-busy[aria-disabled=true]{background-image:linear-gradient(-45deg,#fafafa 33%,#e0e0e0 0,#e0e0e0 70%,#fafafa 0);background-size:100px 100%}.components-button.is-compact{height:32px}.components-button.is-compact.has-icon:not(.has-text){min-width:32px;padding:0}.components-button.is-small{font-size:11px;height:var(--wpds-dimension-size-sm,24px);line-height:22px;padding:0 8px}.components-button.is-small.has-icon:not(.has-text){min-width:var(--wpds-dimension-size-sm,24px);padding:0}.components-button.has-icon{justify-content:center;min-width:36px;padding:6px}.components-button.has-icon.is-next-40px-default-size{min-width:40px}.components-button.has-icon .dashicon{align-items:center;box-sizing:content-box;display:inline-flex;justify-content:center;padding:2px}.components-button.has-icon.has-text{gap:4px;justify-content:start;padding-left:8px;padding-right:12px}.components-button.has-icon.has-text.has-icon-right{padding-left:12px;padding-right:8px}.components-button.has-icon:not(.has-text) .dashicon,.components-button.has-icon:not(.has-text) svg{margin-inline:-1px}.components-button.is-pressed,.components-button.is-pressed:hover{color:var(--wp-components-color-foreground-inverted,var(--wpds-color-background-surface-neutral,#fcfcfc))}.components-button.is-pressed:hover:not(:disabled,[aria-disabled=true]),.components-button.is-pressed:not(:disabled,[aria-disabled=true]){background:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e))}.components-button.is-pressed:disabled,.components-button.is-pressed[aria-disabled=true]{color:#949494}.components-button.is-pressed:disabled:not(.is-primary):not(.is-secondary):not(.is-tertiary),.components-button.is-pressed[aria-disabled=true]:not(.is-primary):not(.is-secondary):not(.is-tertiary){background:#949494;color:var(--wp-components-color-foreground-inverted,var(--wpds-color-background-surface-neutral,#fcfcfc))}.components-button svg{fill:currentColor;flex-shrink:0;outline:none}@keyframes components-button__busy-animation{0%{background-position:200px 0}}.components-checkbox-control{--checkbox-input-size:16px;--checkbox-input-margin:8px}.components-checkbox-control__label{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);line-height:var(--checkbox-input-size)}.components-checkbox-control:not(:has(:disabled)) .components-checkbox-control__label{cursor:var(--wpds-cursor-control,pointer)}.components-checkbox-control__input[type=checkbox]{border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:2px;border-radius:var(--wpds-border-radius-sm,2px);font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;margin-right:12px;padding:6px 8px;transition:none}@media (min-width:600px){.components-checkbox-control__input[type=checkbox]{font-size:13px;line-height:normal}}.components-checkbox-control__input[type=checkbox]:hover:not(:disabled,[aria-disabled=true]){border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}.components-checkbox-control__input[type=checkbox]:focus{border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);box-shadow:none;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-checkbox-control__input[type=checkbox]::placeholder{color:rgba(30,30,30,.62)}.components-checkbox-control__input[type=checkbox]:hover:not(:disabled,[aria-disabled=true]){background:var(--wpds-color-background-interactive-neutral-active,#fff)}.components-checkbox-control__input[type=checkbox]:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wp-admin-theme-color)}.components-checkbox-control__input[type=checkbox]:checked{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color)}.components-checkbox-control__input[type=checkbox]:checked:before,.components-checkbox-control__input[type=checkbox][aria-checked=mixed]:before{color:#fff;margin:-3px -5px}@media (min-width:782px){.components-checkbox-control__input[type=checkbox]:checked:before,.components-checkbox-control__input[type=checkbox][aria-checked=mixed]:before{margin:-4px 0 0 -5px}}.components-checkbox-control__input[type=checkbox][aria-checked=mixed]{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color)}.components-checkbox-control__input[type=checkbox][aria-checked=mixed]:before{content:"\f460";display:inline-block;float:left;font:400 30px/1 dashicons;vertical-align:middle;width:16px;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (min-width:782px){.components-checkbox-control__input[type=checkbox][aria-checked=mixed]:before{float:none;font-size:21px}}.components-checkbox-control__input[type=checkbox]:disabled,.components-checkbox-control__input[type=checkbox][aria-disabled=true]{background:var(--wpds-color-background-interactive-neutral-disabled,#fff);border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);cursor:default;opacity:1}.components-checkbox-control__input[type=checkbox]:disabled:checked:before,.components-checkbox-control__input[type=checkbox]:disabled[aria-checked=mixed]:before,.components-checkbox-control__input[type=checkbox][aria-disabled=true]:checked:before,.components-checkbox-control__input[type=checkbox][aria-disabled=true][aria-checked=mixed]:before{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}.components-checkbox-control__input[type=checkbox]{appearance:none;background:#fff;clear:none;color:#1e1e1e;display:inline-block;height:var(--checkbox-input-size);line-height:0;margin:0 4px 0 0;outline:0;padding:0!important;position:relative;text-align:center;vertical-align:top;width:var(--checkbox-input-size)}@media not (prefers-reduced-motion){.components-checkbox-control__input[type=checkbox]{transition:border-color .1s ease-in-out}}.components-checkbox-control__input[type=checkbox]:focus{box-shadow:0 0 0 var(--wp-admin-border-width-focus) #fff,0 0 0 calc(var(--wp-admin-border-width-focus)*2) var(--wp-admin-theme-color);outline:2px solid transparent;outline-offset:2px}.components-checkbox-control__input[type=checkbox]:not(:disabled):is(:checked,:indeterminate){background:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));border-color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}.components-checkbox-control__input[type=checkbox]:not(:disabled){cursor:var(--wpds-cursor-control,pointer)}.components-checkbox-control__input[type=checkbox]:checked:before{content:none}.components-checkbox-control__input[type=checkbox]:after{aspect-ratio:1;content:"";left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:max(var(--checkbox-input-size),24px)}.components-checkbox-control__input-container{aspect-ratio:1;display:inline-block;flex-shrink:0;line-height:1;margin-right:var(--checkbox-input-margin);position:relative;vertical-align:middle;width:var(--checkbox-input-size)}svg.components-checkbox-control__checked,svg.components-checkbox-control__indeterminate{color:#fff;cursor:var(--wpds-cursor-control,pointer);height:var(--checkbox-input-size);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);-webkit-user-select:none;user-select:none;width:var(--checkbox-input-size)}.components-checkbox-control:has(:disabled) svg.components-checkbox-control__checked,.components-checkbox-control:has(:disabled) svg.components-checkbox-control__indeterminate{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}.components-checkbox-control__help{display:inline-block;margin-inline-start:calc(var(--checkbox-input-size) + var(--checkbox-input-margin))}.components-circular-option-picker{display:inline-block;isolation:isolate;min-width:188px;width:100%}.components-circular-option-picker .components-circular-option-picker__custom-clear-wrapper{display:flex;justify-content:flex-end;margin-top:12px}.components-circular-option-picker .components-circular-option-picker__swatches{display:flex;flex-wrap:wrap;gap:12px;position:relative;z-index:1}.components-circular-option-picker>:not(.components-circular-option-picker__swatches){position:relative;z-index:0}.components-circular-option-picker__option-wrapper{display:inline-block;height:28px;transform:scale(1);vertical-align:top;width:28px}@media not (prefers-reduced-motion){.components-circular-option-picker__option-wrapper{transition:transform .1s ease-out;will-change:transform}}.components-circular-option-picker__option-wrapper:hover{transform:scale(1.1)}.components-circular-option-picker__option-wrapper>div{height:100%;width:100%}.components-circular-option-picker__option-wrapper:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' fill='none'%3E%3Cpath fill='%23555d65' d='M6 8V6H4v2zm2 0V6h2v2zm2 8H8v-2h2zm2 0v-2h2v2zm0 2v-2h-2v2H8v2h2v-2zm2 0v2h-2v-2zm2 0h-2v-2h2z'/%3E%3Cpath fill='%23555d65' fill-rule='evenodd' d='M18 18h2v-2h-2v-2h2v-2h-2v-2h2V8h-2v2h-2V8h-2v2h2v2h-2v2h2v2h2zm-2-4v-2h2v2z' clip-rule='evenodd'/%3E%3Cpath fill='%23555d65' d='M18 18v2h-2v-2z'/%3E%3Cpath fill='%23555d65' fill-rule='evenodd' d='M8 10V8H6v2H4v2h2v2H4v2h2v2H4v2h2v2H4v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2V8h-2V6h2V4h-2v2h-2V4h-2v2h-2V4h-2v2h-2V4h-2v2h2v2h-2v2zm0 2v-2H6v2zm2 0v-2h2v2zm0 2v-2H8v2H6v2h2v2H6v2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2V8h-2V6h-2v2h-2V6h-2v2h-2v2h2v2h-2v2z' clip-rule='evenodd'/%3E%3Cpath fill='%23555d65' fill-rule='evenodd' d='M4 0H2v2H0v2h2v2H0v2h2v2H0v2h2v2H0v2h2v2H0v2h2v2H0v2h2v2H0v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2V8h-2V6h2V4h-2V2h2V0h-2v2h-2V0h-2v2h-2V0h-2v2h-2V0h-2v2h-2V0h-2v2H8V0H6v2H4zm0 4V2H2v2zm2 0V2h2v2zm0 2V4H4v2H2v2h2v2H2v2h2v2H2v2h2v2H2v2h2v2H2v2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2V8h-2V6h2V4h-2V2h-2v2h-2V2h-2v2h-2V2h-2v2h-2V2h-2v2H8v2z' clip-rule='evenodd'/%3E%3C/svg%3E");border-radius:50%;content:"";inset:1px;position:absolute;z-index:-1}.components-circular-option-picker__option{aspect-ratio:1;background:transparent;border:none;border-radius:50%;box-shadow:inset 0 0 0 14px;display:inline-block;height:100%!important;vertical-align:top}@media not (prefers-reduced-motion){.components-circular-option-picker__option{transition:box-shadow .1s ease}}.components-circular-option-picker__option{cursor:var(--wpds-cursor-control,pointer)}.components-circular-option-picker__option[aria-pressed=true],.components-circular-option-picker__option[aria-selected=true]{overflow:visible;position:relative;z-index:1}.components-circular-option-picker__option[aria-pressed=true]+svg,.components-circular-option-picker__option[aria-selected=true]+svg{border-radius:50%;left:2px;pointer-events:none;position:absolute;top:2px;z-index:2}.components-circular-option-picker__option:after{border:1px solid transparent;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);content:"";inset:-1px;position:absolute}.components-circular-option-picker__button-action .components-circular-option-picker__option{background:#fff;color:#fff}.components-circular-option-picker__dropdown-link-action{margin-right:16px}.components-circular-option-picker__dropdown-link-action .components-button{line-height:22px}.components-palette-edit__popover-duotone-picker,.components-palette-edit__popover-gradient-picker{padding:8px;width:260px}.component-color-indicator{background:#fff linear-gradient(-45deg,transparent 48%,#ddd 0,#ddd 52%,transparent 0);border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);display:inline-block;height:20px;padding:0;width:20px}.components-combobox-control{width:100%}input.components-combobox-control__input[type=text]{background:var(--wp-components-color-background,var(--wpds-color-background-surface-neutral-strong,#fff));border:none;box-shadow:none;color:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-family:inherit;font-size:16px;line-height:inherit;margin:0;min-height:auto;padding:2px;width:100%}@media (min-width:600px){input.components-combobox-control__input[type=text]{font-size:13px}}input.components-combobox-control__input[type=text]:focus{box-shadow:none;outline:none}.components-combobox-control__suggestions-container{border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;padding:6px 8px}@media (min-width:600px){.components-combobox-control__suggestions-container{font-size:13px;line-height:normal}}.components-combobox-control__suggestions-container:hover:not(:disabled,[aria-disabled=true]){border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}.components-combobox-control__suggestions-container:focus{border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);box-shadow:none;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-combobox-control__suggestions-container::placeholder{color:rgba(30,30,30,.62)}.components-combobox-control__suggestions-container{align-items:flex-start;display:flex;flex-wrap:wrap;padding:0;width:100%}.components-combobox-control__suggestions-container:focus-within{outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-combobox-control__suggestions-container .components-spinner{margin:0}.components-color-palette__custom-color-wrapper{position:relative;z-index:0}.components-color-palette__custom-color-button{background:none;border:none;border-radius:4px 4px 0 0;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);box-sizing:border-box;cursor:var(--wpds-cursor-control,pointer);height:64px;outline:1px solid transparent;position:relative;width:100%}.components-color-palette__custom-color-button:focus:not(:active){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-color-palette__custom-color-button:after{background-image:repeating-linear-gradient(45deg,#e0e0e0 25%,transparent 0,transparent 75%,#e0e0e0 0,#e0e0e0),repeating-linear-gradient(45deg,#e0e0e0 25%,transparent 0,transparent 75%,#e0e0e0 0,#e0e0e0);background-position:0 0,24px 24px;background-size:48px 48px;border-radius:3px 3px 0 0;content:"";inset:1px;position:absolute;z-index:-1}.components-color-palette__custom-color-text-wrapper{border-radius:0 0 4px 4px;box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.2),inset 1px 0 0 0 rgba(0,0,0,.2),inset -1px 0 0 0 rgba(0,0,0,.2);font-size:13px;padding:12px 16px;position:relative}.components-color-palette__custom-color-name{color:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));margin:0 1px}.components-color-palette__custom-color-value{color:#757575}.components-color-palette__custom-color-value--is-hex{text-transform:uppercase}.components-color-palette__custom-color-value:empty:after{content:"​";visibility:hidden}.components-custom-gradient-picker__gradient-bar{border-radius:2px;height:48px;position:relative;width:100%;z-index:1}.components-custom-gradient-picker__gradient-bar.has-gradient{background-image:repeating-linear-gradient(45deg,#e0e0e0 25%,transparent 0,transparent 75%,#e0e0e0 0,#e0e0e0),repeating-linear-gradient(45deg,#e0e0e0 25%,transparent 0,transparent 75%,#e0e0e0 0,#e0e0e0);background-position:0 0,12px 12px;background-size:24px 24px}.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__gradient-bar-background{inset:0;position:absolute}.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__markers-container{margin-left:auto;margin-right:auto;position:relative;width:calc(100% - 48px)}.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__control-point-dropdown{display:flex;height:16px;position:absolute;top:16px;width:16px}.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__control-point-button:before,.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__insert-point-dropdown:before{content:"";inset:-16px 0;position:absolute}.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__insert-point-dropdown{background:#fff;border-radius:50%;color:#1e1e1e;height:inherit;min-width:16px!important;padding:2px;width:inherit}.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__insert-point-dropdown svg{height:100%;width:100%}.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__control-point-button{border-radius:50%;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) #fff,0 0 2px 0 rgba(0,0,0,.25);height:inherit;padding:0;width:inherit}.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__control-point-button.is-active{box-shadow:inset 0 0 0 calc(var(--wp-admin-border-width-focus)*2) #fff,0 0 2px 0 rgba(0,0,0,.25)}.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__control-point-button:focus:not(:active){box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) #fff,0 0 2px 0 rgba(0,0,0,.25),0 0 0 calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px)) + 2px) var(--wpds-color-background-surface-neutral-strong,#fff);outline-offset:1px}.components-custom-gradient-picker__gradient-bar .components-custom-gradient-picker__control-point-button:focus:not(:active).is-active{box-shadow:inset 0 0 0 calc(var(--wp-admin-border-width-focus)*2) #fff,0 0 2px 0 rgba(0,0,0,.25),0 0 0 calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px)) + 2px) var(--wpds-color-background-surface-neutral-strong,#fff)}.components-custom-gradient-picker__remove-control-point-wrapper{padding-bottom:8px}.components-custom-gradient-picker__inserter{direction:ltr}.components-custom-gradient-picker__liner-gradient-indicator{display:inline-block;flex:0 auto;height:20px;width:20px}.components-custom-gradient-picker__ui-line{position:relative;z-index:0}.components-drop-zone{border-radius:2px;bottom:0;left:0;opacity:0;position:absolute;right:0;top:0;visibility:hidden;z-index:40}.components-drop-zone.is-active{opacity:1;visibility:visible}.components-drop-zone .components-drop-zone__content{align-items:center;background-color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));bottom:0;color:#fff;display:flex;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;right:0;text-align:center;top:0;width:100%;z-index:50}.components-drop-zone .components-drop-zone__content-inner{opacity:0;transform:scale(.9)}.components-drop-zone.is-active.is-dragging-over-element .components-drop-zone__content{opacity:1}@media not (prefers-reduced-motion){.components-drop-zone.is-active.is-dragging-over-element .components-drop-zone__content{transition:opacity .2s ease-in-out}}.components-drop-zone.is-active.is-dragging-over-element .components-drop-zone__content-inner{opacity:1;transform:scale(1)}@media not (prefers-reduced-motion){.components-drop-zone.is-active.is-dragging-over-element .components-drop-zone__content-inner{transition:opacity .1s ease-in-out .1s,transform .1s ease-in-out .1s}}.components-drop-zone__content-icon,.components-drop-zone__content-text{display:block}.components-drop-zone__content-icon{fill:currentColor;line-height:0;margin:0 auto 8px;pointer-events:none}.components-drop-zone__content-text{font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.components-dropdown{display:inline-block}.components-dropdown__content .components-popover__content{padding:8px}.components-dropdown__content .components-popover__content:has(.components-menu-group){padding:0}.components-dropdown__content .components-popover__content:has(.components-menu-group) .components-dropdown-menu__menu>.components-menu-item__button,.components-dropdown__content .components-popover__content:has(.components-menu-group)>.components-menu-item__button{margin:8px;width:auto}.components-dropdown__content [role=menuitem]{white-space:nowrap}.components-dropdown__content .components-menu-group{padding:8px}.components-dropdown__content .components-menu-group+.components-menu-group{border-top:1px solid #ccc;padding:8px}.components-dropdown__content.is-alternate .components-menu-group+.components-menu-group{border-color:#1e1e1e}.components-dropdown-menu__toggle{vertical-align:top}.components-dropdown-menu__menu{font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;line-height:1.4;width:100%}.components-dropdown-menu__menu .components-dropdown-menu__menu-item,.components-dropdown-menu__menu .components-menu-item{cursor:var(--wpds-cursor-control,pointer);font-weight:var(--wpds-typography-font-weight-default,400);outline:none;padding:6px;white-space:nowrap;width:100%}.components-dropdown-menu__menu .components-dropdown-menu__menu-item.has-separator,.components-dropdown-menu__menu .components-menu-item.has-separator{margin-top:6px;overflow:visible;position:relative}.components-dropdown-menu__menu .components-dropdown-menu__menu-item.has-separator:before,.components-dropdown-menu__menu .components-menu-item.has-separator:before{background-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);box-sizing:content-box;content:"";display:block;height:1px;left:0;position:absolute;right:0;top:-3px}.components-dropdown-menu__menu .components-dropdown-menu__menu-item.is-active .dashicon,.components-dropdown-menu__menu .components-dropdown-menu__menu-item.is-active svg,.components-dropdown-menu__menu .components-menu-item.is-active .dashicon,.components-dropdown-menu__menu .components-menu-item.is-active svg{background:#1e1e1e;border-radius:1px;box-shadow:0 0 0 1px #1e1e1e;color:#fff}.components-dropdown-menu__menu .components-dropdown-menu__menu-item.is-icon-only,.components-dropdown-menu__menu .components-menu-item.is-icon-only{width:auto}.components-dropdown-menu__menu .components-menu-item__button,.components-dropdown-menu__menu .components-menu-item__button.components-button{height:auto;min-height:32px;padding-left:8px;padding-right:8px;text-align:left}.components-duotone-picker__color-indicator:before{background:transparent}.components-duotone-picker__color-indicator>.components-button,.components-duotone-picker__color-indicator>.components-button.is-pressed:hover:not(:disabled){background:linear-gradient(-45deg,transparent 48%,#ddd 0,#ddd 52%,transparent 0);color:transparent}.components-duotone-picker__color-indicator>.components-button:hover:not(:disabled):not([aria-disabled=true]),.components-duotone-picker__color-indicator>.components-button:not([aria-disabled=true]):active{color:transparent}.components-color-list-picker,.components-color-list-picker__swatch-button{width:100%}.components-color-list-picker__color-picker{margin:8px 0}.components-color-list-picker__swatch-color{margin:2px}.components-external-link{border-radius:var(--wpds-border-radius-sm,2px);text-decoration:none}.components-external-link,.components-external-link:visited{color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.components-external-link:active,.components-external-link:hover{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.components-external-link:focus{border-radius:var(--wpds-border-radius-sm,2px);box-shadow:none}.components-external-link:focus:not(:active){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-external-link__contents{text-decoration:underline;text-decoration-thickness:from-font;text-underline-offset:.2em}.components-external-link__icon{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-padding-xs,4px)}.components-form-toggle{display:inline-block;height:16px;isolation:isolate;position:relative}.components-form-toggle .components-form-toggle__track{background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);border:1px solid var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:8px;box-sizing:border-box;content:"";display:inline-block;height:16px;vertical-align:top;width:32px}@media not (prefers-reduced-motion){.components-form-toggle .components-form-toggle__track{transition:background-color .2s ease,border-color .2s ease}}.components-form-toggle .components-form-toggle__thumb{border-radius:50%;box-sizing:border-box;display:block;height:12px;left:2px;position:absolute;top:2px;width:12px}@media not (prefers-reduced-motion){.components-form-toggle .components-form-toggle__thumb{transition:transform .2s ease,background-color .2s ease-out}}.components-form-toggle .components-form-toggle__thumb{background-color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);border:6px solid transparent;box-shadow:0 1px 1px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.02),0 3px 3px rgba(0,0,0,.02),0 4px 4px rgba(0,0,0,.01)}@media (forced-colors:active){.components-form-toggle .components-form-toggle__thumb{background-color:ButtonText}}.components-form-toggle:not(.is-checked,.is-disabled):hover .components-form-toggle__track{border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}.components-form-toggle.is-checked .components-form-toggle__track{background-color:var(--wpds-color-background-interactive-brand-strong,var(--wp-admin-theme-color,#3858e9));border-color:transparent}@media (forced-colors:active){.components-form-toggle.is-checked .components-form-toggle__track{background-color:Highlight}}.components-form-toggle .components-form-toggle__input:focus+.components-form-toggle__track{box-shadow:0 0 0 var(--wp-admin-border-width-focus) #fff,0 0 0 calc(var(--wp-admin-border-width-focus)*2) var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline:2px solid transparent;outline-offset:2px}.components-form-toggle.is-checked .components-form-toggle__thumb{background-color:var(--wpds-color-foreground-interactive-brand-strong,#fff);border-width:0;transform:translateX(16px)}@media (forced-colors:active){.components-form-toggle.is-checked .components-form-toggle__thumb{background-color:HighlightText}}.components-form-toggle.is-disabled .components-form-toggle__track,[inert] .components-form-toggle .components-form-toggle__track{background-color:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}@media (forced-colors:active){.components-form-toggle.is-disabled .components-form-toggle__track,[inert] .components-form-toggle .components-form-toggle__track{border-color:GrayText}}.components-form-toggle.is-disabled .components-form-toggle__thumb,[inert] .components-form-toggle .components-form-toggle__thumb{background-color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);box-shadow:none}@media (forced-colors:active){.components-form-toggle.is-disabled .components-form-toggle__thumb,[inert] .components-form-toggle .components-form-toggle__thumb{background-color:GrayText;border-color:GrayText}}.components-form-toggle.is-disabled.is-checked .components-form-toggle__track,[inert] .components-form-toggle.is-checked .components-form-toggle__track{background-color:var(--wpds-color-background-interactive-brand-strong-disabled,#e6e6e6);border-color:transparent}@media (forced-colors:active){.components-form-toggle.is-disabled.is-checked .components-form-toggle__track,[inert] .components-form-toggle.is-checked .components-form-toggle__track{background-color:GrayText}}.components-form-toggle.is-disabled.is-checked .components-form-toggle__thumb,[inert] .components-form-toggle.is-checked .components-form-toggle__thumb{background-color:var(--wpds-color-foreground-interactive-brand-strong-disabled,#8d8d8d)}@media (forced-colors:active){.components-form-toggle.is-disabled.is-checked .components-form-toggle__thumb,[inert] .components-form-toggle.is-checked .components-form-toggle__thumb{background-color:Canvas}}.components-form-toggle input.components-form-toggle__input[type=checkbox]{border:none;height:100%;left:0;margin:0;opacity:0;padding:0;position:absolute;top:0;width:100%;z-index:1}.components-form-toggle input.components-form-toggle__input[type=checkbox]:checked{background:none}.components-form-toggle input.components-form-toggle__input[type=checkbox]:before{content:""}.components-form-toggle input.components-form-toggle__input[type=checkbox]:not(:disabled,[aria-disabled=true]){cursor:var(--wpds-cursor-control,pointer)}.components-form-token-field__input-container{border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;padding:6px 8px}@media (min-width:600px){.components-form-token-field__input-container{font-size:13px;line-height:normal}}.components-form-token-field__input-container:hover:not(:disabled,[aria-disabled=true]){border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}.components-form-token-field__input-container:focus{border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);box-shadow:none;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-form-token-field__input-container::placeholder{color:rgba(30,30,30,.62)}.components-form-token-field__input-container{cursor:text;padding:0;width:100%}.components-form-token-field__input-container.is-disabled{background:var(--wp-components-color-gray-100,var(--wpds-color-background-surface-neutral,#fcfcfc));cursor:default}.components-form-token-field__input-container.is-disabled,.components-form-token-field__input-container.is-disabled:hover{border-color:var(--wp-components-color-gray-400,var(--wpds-color-stroke-interactive-neutral,#8d8d8d))}.components-form-token-field__input-container.is-active{outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-form-token-field__input-container input[type=text].components-form-token-field__input{background:inherit;border:0;box-shadow:none;color:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));display:inline-block;flex:1;font-family:inherit;font-size:16px;line-height:1;margin-left:4px;max-width:100%;min-height:24px;min-width:50px;padding:0;width:100%}@media (min-width:600px){.components-form-token-field__input-container input[type=text].components-form-token-field__input{font-size:13px}}.components-form-token-field.is-active .components-form-token-field__input-container input[type=text].components-form-token-field__input,.components-form-token-field__input-container input[type=text].components-form-token-field__input:focus{box-shadow:none;outline:none}.components-form-token-field__input-container .components-form-token-field__token+input[type=text].components-form-token-field__input{width:auto}.components-form-token-field__token{color:#1e1e1e;display:flex;font-size:13px;max-width:100%}.components-form-token-field__token.is-success .components-form-token-field__remove-token,.components-form-token-field__token.is-success .components-form-token-field__token-text{background:#4ab866}.components-form-token-field__token.is-error .components-form-token-field__remove-token,.components-form-token-field__token.is-error .components-form-token-field__token-text{background:#cc1818}.components-form-token-field__token.is-validating .components-form-token-field__remove-token,.components-form-token-field__token.is-validating .components-form-token-field__token-text{color:#757575}.components-form-token-field__token.is-disabled .components-form-token-field__remove-token.components-button,.components-form-token-field__token.is-disabled .components-form-token-field__token-text{background:var(--wp-components-color-gray-100,var(--wpds-color-background-surface-neutral,#fcfcfc));color:var(--wp-components-color-gray-600,var(--wpds-color-stroke-interactive-neutral,#8d8d8d))}.components-form-token-field__token.is-borderless{padding:0 24px 0 0;position:relative}.components-form-token-field__token.is-borderless .components-form-token-field__token-text{background:transparent}.components-form-token-field__token.is-borderless:not(.is-disabled) .components-form-token-field__token-text{color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}.components-form-token-field__token.is-borderless .components-form-token-field__remove-token{background:transparent;color:#757575;position:absolute;right:0;top:1px}.components-form-token-field__token.is-borderless.is-success .components-form-token-field__token-text{color:#4ab866}.components-form-token-field__token.is-borderless.is-error .components-form-token-field__token-text{color:#cc1818;padding:0 4px 0 6px}.components-form-token-field__token.is-borderless.is-validating .components-form-token-field__token-text{color:#1e1e1e}.components-form-token-field__remove-token.components-button,.components-form-token-field__token-text{background:#ddd;display:inline-block;height:auto;min-width:unset}@media not (prefers-reduced-motion){.components-form-token-field__remove-token.components-button,.components-form-token-field__token-text{transition:all .2s cubic-bezier(.4,1,.4,1)}}.components-form-token-field__token-text{border-radius:1px 0 0 1px;line-height:24px;overflow:hidden;padding:0 0 0 8px;text-overflow:ellipsis;white-space:nowrap}.components-form-token-field__remove-token.components-button{border-radius:0 1px 1px 0;color:#1e1e1e;line-height:10px;overflow:initial}.components-form-token-field__remove-token.components-button:hover:not(:disabled){color:#1e1e1e}.components-form-token-field__suggestions-list{flex:1 0 100%;max-height:128px;min-width:100%;overflow-y:auto}@media not (prefers-reduced-motion){.components-form-token-field__suggestions-list{transition:all .15s ease-in-out}}.components-form-token-field__suggestions-list{box-shadow:inset 0 1px 0 0 #949494;list-style:none;margin:0;padding:0}.components-form-token-field__suggestion{box-sizing:border-box;color:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));display:block;font-size:13px;margin:0;min-height:32px;padding:8px 12px}.components-form-token-field__suggestion.is-selected{background:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));color:var(--wp-components-color-foreground-inverted,var(--wpds-color-background-surface-neutral,#fcfcfc))}.components-form-token-field__suggestion[aria-disabled=true]{color:#949494;pointer-events:none}.components-form-token-field__suggestion[aria-disabled=true].is-selected{background:color-mix(in srgb,var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9)) 4%,transparent)}.components-form-token-field__suggestion:not(.is-empty){cursor:var(--wpds-cursor-control,pointer)}@media (min-width:600px){.components-guide{width:600px}}.components-guide .components-modal__content{margin-top:0;padding:0}.components-guide .components-modal__content:before{content:none}.components-guide .components-modal__header{border-bottom:none;height:64px;padding:0;position:sticky}.components-guide .components-modal__header .components-button{align-self:flex-start;margin:8px 8px 0 0;position:static}.components-guide .components-guide__container{display:flex;flex-direction:column;justify-content:space-between;margin-top:-64px;min-height:100%}.components-guide .components-guide__page{display:flex;flex-direction:column;justify-content:center;position:relative}@media (min-width:600px){.components-guide .components-guide__page{min-height:300px}}.components-guide .components-guide__footer{align-content:center;display:flex;height:36px;justify-content:center;margin:0 0 24px;padding:0 24px;position:relative;width:100%}.components-guide .components-guide__page-control{margin:0;text-align:center}.components-guide .components-guide__page-control li{display:inline-block;margin:0}.components-guide .components-guide__page-control .components-button{color:#e0e0e0;margin:-6px 0}.components-guide .components-guide__page-control li[aria-current=step] .components-button{color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}.components-modal__frame.components-guide{border:none;max-height:575px;min-width:312px}@media (max-width:600px){.components-modal__frame.components-guide{margin:auto;max-width:calc(100vw - 32px)}}.components-button.components-guide__back-button,.components-button.components-guide__finish-button,.components-button.components-guide__forward-button{position:absolute}.components-button.components-guide__back-button{left:24px}.components-button.components-guide__finish-button,.components-button.components-guide__forward-button{right:24px}[role=region]{position:relative}[role=region].interface-interface-skeleton__content:focus-visible:after{bottom:0;box-shadow:inset 0 0 0 calc(var(--wp-admin-border-width-focus)*2/var(--wp-block-editor-iframe-zoom-out-scale, 1) + .5px) hsla(0,0%,100%,.7);content:"";left:0;outline-color:var(--wp-admin-theme-color);outline-offset:calc(var(--wp-admin-border-width-focus)*-2/var(--wp-block-editor-iframe-zoom-out-scale, 1));outline-style:solid;outline-width:calc(var(--wp-admin-border-width-focus)*2/var(--wp-block-editor-iframe-zoom-out-scale, 1));pointer-events:none;position:absolute;right:0;top:0;z-index:1000000}.is-focusing-regions [role=region]:focus:after{bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:1000000}.is-focusing-regions .interface-interface-skeleton__actions:focus .editor-layout__toggle-entities-saved-states-panel,.is-focusing-regions .interface-interface-skeleton__actions:focus .editor-layout__toggle-publish-panel,.is-focusing-regions .interface-interface-skeleton__actions:focus .editor-post-publish-panel,.is-focusing-regions .interface-interface-skeleton__sidebar .editor-layout__toggle-sidebar-panel,.is-focusing-regions [role=region]:focus:after,.is-focusing-regions.is-distraction-free .interface-interface-skeleton__header .edit-post-header{box-shadow:inset 0 0 0 calc(var(--wp-admin-border-width-focus)*2/var(--wp-block-editor-iframe-zoom-out-scale, 1) + .5px) hsla(0,0%,100%,.7);outline-color:var(--wp-admin-theme-color);outline-offset:calc(var(--wp-admin-border-width-focus)*-2/var(--wp-block-editor-iframe-zoom-out-scale, 1));outline-style:solid;outline-width:calc(var(--wp-admin-border-width-focus)*2/var(--wp-block-editor-iframe-zoom-out-scale, 1))}.components-input-control__container:focus-within:not(:has(:is(.components-input-control__prefix,.components-input-control__suffix):focus-within)) .components-input-control__backdrop{outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-menu-group+.components-menu-group{border-top:1px solid #1e1e1e;padding-top:8px}.components-menu-group+.components-menu-group.has-hidden-separator{border-top:none;margin-top:0;padding-top:0}.components-menu-group:has(>div:empty){display:none}.components-menu-group__label{color:#757575;font-size:11px;font-weight:var(--wpds-typography-font-weight-emphasis,600);margin-bottom:12px;margin-top:4px;padding:0 8px;text-transform:uppercase;white-space:nowrap}.components-menu-item__button,.components-menu-item__button.components-button{font-weight:var(--wpds-typography-font-weight-default,400);width:100%}.components-menu-item__button.components-button[role=menuitemcheckbox] .components-menu-item__item:only-child,.components-menu-item__button.components-button[role=menuitemradio] .components-menu-item__item:only-child,.components-menu-item__button[role=menuitemcheckbox] .components-menu-item__item:only-child,.components-menu-item__button[role=menuitemradio] .components-menu-item__item:only-child{box-sizing:initial;padding-right:48px}.components-menu-item__button .components-menu-items__item-icon,.components-menu-item__button.components-button .components-menu-items__item-icon{display:inline-block;flex:0 0 auto}.components-menu-item__button .components-menu-items__item-icon.has-icon-right,.components-menu-item__button.components-button .components-menu-items__item-icon.has-icon-right{margin-left:24px;margin-right:-2px}.components-menu-item__button .components-menu-item__shortcut+.components-menu-items__item-icon.has-icon-right,.components-menu-item__button.components-button .components-menu-item__shortcut+.components-menu-items__item-icon.has-icon-right{margin-left:8px}.components-menu-item__button .block-editor-block-icon,.components-menu-item__button.components-button .block-editor-block-icon{margin-left:-2px;margin-right:8px}.components-menu-item__button.components-button.is-primary,.components-menu-item__button.is-primary{justify-content:center}.components-menu-item__button.components-button.is-primary .components-menu-item__item,.components-menu-item__button.is-primary .components-menu-item__item{margin-right:0}.components-menu-item__button.components-button:disabled.is-tertiary,.components-menu-item__button.components-button[aria-disabled=true].is-tertiary,.components-menu-item__button:disabled.is-tertiary,.components-menu-item__button[aria-disabled=true].is-tertiary{background:none;color:var(--wp-components-color-accent-darker-10,var(--wp-admin-theme-color-darker-10,#2145e6));opacity:.3}.components-menu-item__info-wrapper{display:flex;flex-direction:column;margin-right:auto}.components-menu-item__info{color:#757575;font-size:12px;margin-top:4px;white-space:normal}.components-menu-item__item{align-items:center;display:inline-flex;margin-right:auto;min-width:160px;white-space:nowrap}.components-menu-item__shortcut{align-self:center;color:currentColor;display:none;margin-left:auto;margin-right:0;padding-left:24px}@media (min-width:480px){.components-menu-item__shortcut{display:inline}}.components-menu-items-choice,.components-menu-items-choice.components-button{height:auto;min-height:40px}.components-menu-items-choice svg,.components-menu-items-choice.components-button svg{margin-right:12px}.components-menu-items-choice.components-button.has-icon,.components-menu-items-choice.has-icon{padding-left:12px}body.modal-open{overflow:hidden}.components-modal__screen-overlay{background-color:rgba(0,0,0,.35);bottom:0;display:flex;left:0;position:fixed;right:0;top:0;z-index:100000}@keyframes __wp-base-styles-fade-in{0%{opacity:0}to{opacity:1}}@media not (prefers-reduced-motion){.components-modal__screen-overlay{animation:__wp-base-styles-fade-in var(--wpds-motion-duration-sm,.1s) var(--wpds-motion-easing-subtle,cubic-bezier(.15,0,.15,1)) 0s;animation-fill-mode:forwards}}@keyframes __wp-base-styles-fade-out{0%{opacity:1}to{opacity:0}}@media not (prefers-reduced-motion){.components-modal__screen-overlay.is-animating-out{animation:__wp-base-styles-fade-out var(--wpds-motion-duration-sm,.1s) var(--wpds-motion-easing-subtle,cubic-bezier(.15,0,.15,1)) var(--wpds-motion-duration-xs,50ms);animation-fill-mode:forwards}}.components-modal__frame{box-sizing:border-box}.components-modal__frame *,.components-modal__frame :after,.components-modal__frame :before{box-sizing:inherit}.components-modal__frame{align-self:flex-end;animation-fill-mode:forwards;animation-name:components-modal__appear-animation;animation-timing-function:var(--wpds-motion-easing-expressive,cubic-bezier(.25,0,0,1));background:#fff;border-radius:8px 8px 0 0;box-shadow:0 5px 15px rgba(0,0,0,.08),0 15px 27px rgba(0,0,0,.07),0 30px 36px rgba(0,0,0,.04),0 50px 43px rgba(0,0,0,.02);color:#1e1e1e;display:flex;margin:0;max-height:calc(100% - 40px);overflow:hidden;width:100%}.components-modal__frame h1,.components-modal__frame h2,.components-modal__frame h3{color:#1e1e1e}@media not (prefers-reduced-motion){.components-modal__frame{animation-duration:var(--wpds-motion-duration-md,.2s)}}.components-modal__screen-overlay.is-animating-out .components-modal__frame{animation-name:components-modal__disappear-animation;animation-timing-function:var(--wpds-motion-easing-expressive,cubic-bezier(.25,0,0,1))}@media (min-width:600px){.components-modal__frame{align-self:auto;border-radius:8px;margin:auto;max-height:calc(100% - 128px);max-width:calc(100% - 32px);min-width:var(--wpds-dimension-surface-width-sm,320px);width:auto}.components-modal__frame.has-size-large,.components-modal__frame.has-size-medium,.components-modal__frame.has-size-small{width:100%}.components-modal__frame.has-size-small{max-width:var(--wpds-dimension-surface-width-md,400px)}.components-modal__frame.has-size-medium{max-width:var(--wpds-dimension-surface-width-lg,560px)}.components-modal__frame.has-size-large{max-width:var(--wpds-dimension-surface-width-2xl,960px)}}@media (min-width:960px){.components-modal__frame{max-height:70%}}.components-modal__frame.is-full-screen{border-radius:0;height:100%;margin:0;max-height:none;width:100%}.components-modal__frame.is-full-screen :where(.components-modal__content){display:flex;margin-bottom:24px;padding-bottom:0}.components-modal__frame.is-full-screen :where(.components-modal__content)>:last-child{flex:1}@media (min-width:600px){.components-modal__frame.is-full-screen{border-radius:8px;height:calc(100% - 32px);margin:auto;width:calc(100% - 32px)}}@media (min-width:782px){.components-modal__frame.is-full-screen{height:calc(100% - 80px);max-width:none;width:calc(100% - 80px)}}@keyframes components-modal__appear-animation{0%{opacity:0;transform:translateY(100%)}to{opacity:1;transform:translateY(0)}}@keyframes components-modal__disappear-animation{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(100%)}}@media (min-width:600px){@keyframes components-modal__appear-animation{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}@keyframes components-modal__disappear-animation{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}}.components-modal__header{align-items:center;border-bottom:1px solid transparent;box-sizing:border-box;display:flex;flex-direction:row;height:72px;justify-content:space-between;left:0;padding:24px;position:absolute;top:0;width:100%;z-index:10}.components-modal__header .components-modal__header-heading{font-size:20px;font-weight:var(--wpds-typography-font-weight-emphasis,600)}.components-modal__header h1{line-height:1;margin:0}.components-modal__content.has-scrolled-content:not(.hide-header) .components-modal__header{border-bottom-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb)}.components-modal__header+p{margin-top:0}.components-modal__header-heading-container{align-items:center;display:flex;flex-direction:row;flex-grow:1;justify-content:flex-start}.components-modal__header-icon-container{display:inline-block}.components-modal__header-icon-container svg{max-height:36px;max-width:36px;padding:8px}.components-modal__content{flex:1;margin-top:72px;overflow:auto;padding:4px 24px 24px}.components-modal__content.hide-header{margin-top:0;padding-top:24px}.components-modal__content.is-scrollable:focus-visible{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));outline:2px solid transparent;outline-offset:-2px}.components-notice{--wp-components-notice-background-color:var(--wpds-color-background-surface-info-weak,#f3f9ff);--wp-components-notice-border-color:var(--wpds-color-stroke-surface-info,#adc6e2);--wp-components-notice-text-color:var(--wpds-color-foreground-content-info,#001b4f);align-items:start;background-color:var(--wp-components-notice-background-color);border:var(--wpds-border-width-xs,1px) solid var(--wp-components-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);box-sizing:border-box;color:var(--wp-components-notice-text-color);display:grid;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);grid-template-columns:1fr auto;isolation:isolate;line-height:var(--wpds-typography-line-height-sm,20px);padding:var(--wpds-dimension-padding-md,12px)}.components-notice.is-success{--wp-components-notice-background-color:var(--wpds-color-background-surface-success-weak,#ebffed);--wp-components-notice-border-color:var(--wpds-color-stroke-surface-success,#92d39d);--wp-components-notice-text-color:var(--wpds-color-foreground-content-success,#002900)}.components-notice.is-warning{--wp-components-notice-background-color:var(--wpds-color-background-surface-warning-weak,#fff7e1);--wp-components-notice-border-color:var(--wpds-color-stroke-surface-warning,#e1bd7c);--wp-components-notice-text-color:var(--wpds-color-foreground-content-warning,#2e1900)}.components-notice.is-error{--wp-components-notice-background-color:var(--wpds-color-background-surface-error-weak,#fff6f5);--wp-components-notice-border-color:var(--wpds-color-stroke-surface-error,#e0afa7);--wp-components-notice-text-color:var(--wpds-color-foreground-content-error,#470000)}.components-notice__content{grid-column:1;grid-row:1;padding-block:calc((var(--wpds-dimension-size-sm, 24px) - 1lh)/2)}.components-notice__actions{align-items:center;display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:1;grid-row:2;margin-top:var(--wpds-dimension-gap-sm,8px)}.components-notice__dismiss{color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);grid-column:2;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px);mix-blend-mode:luminosity}.components-notice__dismiss:not(:disabled):not([aria-disabled=true]):focus,.components-notice__dismiss:not(:disabled):not([aria-disabled=true]):not(.is-secondary):active,.components-notice__dismiss:not(:disabled):not([aria-disabled=true]):not(.is-secondary):hover{color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}@media (forced-colors:active){.components-notice__dismiss{mix-blend-mode:normal}}.components-notice-list{box-sizing:border-box;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-md,12px);max-width:100vw}.components-panel{background:#fff;border:1px solid #e0e0e0}.components-panel>.components-panel__body:first-child,.components-panel>.components-panel__header:first-child{margin-top:-1px}.components-panel>.components-panel__body:last-child,.components-panel>.components-panel__header:last-child{border-bottom-width:0}.components-panel+.components-panel{margin-top:-1px}.components-panel__body{border-bottom:1px solid #e0e0e0;border-top:1px solid #e0e0e0}.components-panel__body h3{margin:0 0 .5em}.components-panel__body.is-opened{padding:16px}.components-panel__header{align-items:center;border-bottom:1px solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);box-sizing:content-box;display:flex;flex-shrink:0;height:47px;justify-content:space-between;padding:0 16px}.components-panel__header h2{color:inherit;font-size:inherit;margin:0}.components-panel__body+.components-panel__body,.components-panel__body+.components-panel__header,.components-panel__header+.components-panel__body,.components-panel__header+.components-panel__header{margin-top:-1px}.components-panel__body>.components-panel__body-title{display:block;font-size:inherit;margin-bottom:0;margin-top:0;padding:0}@media not (prefers-reduced-motion){.components-panel__body>.components-panel__body-title{transition:background .1s ease-in-out}}.components-panel__body.is-opened>.components-panel__body-title{margin:-16px -16px 5px}.components-panel__body>.components-panel__body-title:hover{background:#f0f0f0;border:none}.components-panel__body-toggle.components-button{color:#1e1e1e;font-weight:var(--wpds-typography-font-weight-emphasis,600);padding:16px 48px 16px 16px;position:relative;text-align:left;width:100%}@media not (prefers-reduced-motion){.components-panel__body-toggle.components-button{transition:background .1s ease-in-out}}.components-panel__body-toggle.components-button{height:auto}.components-panel__body-toggle.components-button:focus{border-radius:0;outline-offset:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*-1)}.components-panel__body-toggle.components-button .components-panel__arrow{color:#1e1e1e;fill:currentColor;position:absolute;right:16px;top:50%;transform:translateY(-50%)}@media not (prefers-reduced-motion){.components-panel__body-toggle.components-button .components-panel__arrow{transition:color .1s ease-in-out}}body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right{margin-top:-10px;transform:scaleX(-1)}.components-panel__icon{color:#757575;margin:-2px 0 -2px 6px}.components-panel__body-toggle-icon{margin-right:-5px}.components-panel__color-title{float:left;height:19px}.components-panel__row{align-items:center;display:flex;justify-content:space-between;margin-top:8px;min-height:36px}.components-panel__row select{min-width:0}.components-panel__row label{flex-shrink:0;margin-right:12px;max-width:75%}.components-panel__row:empty,.components-panel__row:first-of-type{margin-top:0}.components-panel .circle-picker{padding-bottom:20px}.components-placeholder.components-placeholder{align-items:flex-start;box-sizing:border-box;color:#1e1e1e;display:flex;flex-direction:column;font-size:13px;gap:16px;margin:0;padding:24px;position:relative;text-align:left;width:100%;-webkit-font-smoothing:subpixel-antialiased;background-color:#fff;border-radius:2px;box-shadow:inset 0 0 0 1px #1e1e1e;outline:1px solid transparent}.components-placeholder__error,.components-placeholder__fieldset,.components-placeholder__instructions,.components-placeholder__label{font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:400;letter-spacing:normal;line-height:normal;text-transform:none}.components-placeholder__label{align-items:center;display:flex;font-weight:var(--wpds-typography-font-weight-emphasis,600)}.components-placeholder__label .block-editor-block-icon,.components-placeholder__label .dashicon,.components-placeholder__label>svg{fill:currentColor;margin-right:4px}.components-placeholder__label:empty{display:none}.components-placeholder__fieldset,.components-placeholder__fieldset form{display:flex;flex-direction:row;flex-wrap:wrap;gap:16px;justify-content:flex-start;width:100%}.components-placeholder__fieldset form p,.components-placeholder__fieldset p{font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.components-placeholder__fieldset.is-column-layout,.components-placeholder__fieldset.is-column-layout form{flex-direction:column}.components-placeholder__input[type=url]{border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;padding:6px 8px}@media (min-width:600px){.components-placeholder__input[type=url]{font-size:13px;line-height:normal}}.components-placeholder__input[type=url]:hover:not(:disabled,[aria-disabled=true]){border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}.components-placeholder__input[type=url]:focus{border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);box-shadow:none;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-placeholder__input[type=url]::placeholder{color:rgba(30,30,30,.62)}.components-placeholder__input[type=url]{flex:1 1 auto}.components-placeholder__error{gap:8px;width:100%}.components-placeholder__fieldset .components-button:not(.is-link)~.components-button.is-link{margin-left:10px;margin-right:10px}.components-placeholder__fieldset .components-button:not(.is-link)~.components-button.is-link:last-child{margin-right:0}.components-placeholder.is-medium .components-placeholder__instructions,.components-placeholder.is-small .components-placeholder__instructions{display:none}.components-placeholder.is-medium .components-placeholder__fieldset,.components-placeholder.is-medium .components-placeholder__fieldset form,.components-placeholder.is-small .components-placeholder__fieldset,.components-placeholder.is-small .components-placeholder__fieldset form{flex-direction:column}.components-placeholder.is-medium .components-button,.components-placeholder.is-medium .components-placeholder__fieldset>*,.components-placeholder.is-small .components-button,.components-placeholder.is-small .components-placeholder__fieldset>*{justify-content:center;width:100%}.components-placeholder.is-small{padding:16px}.components-placeholder.has-illustration{backdrop-filter:blur(100px);backface-visibility:hidden;background-color:transparent;border-radius:0;box-shadow:none;color:inherit;display:flex}.is-dark-theme .components-placeholder.has-illustration{background-color:rgba(0,0,0,.1)}.components-placeholder.has-illustration .components-placeholder__fieldset{margin-left:0;margin-right:0}.components-placeholder.has-illustration .components-button,.components-placeholder.has-illustration .components-placeholder__instructions,.components-placeholder.has-illustration .components-placeholder__label{opacity:0;pointer-events:none}@media not (prefers-reduced-motion){.components-placeholder.has-illustration .components-button,.components-placeholder.has-illustration .components-placeholder__instructions,.components-placeholder.has-illustration .components-placeholder__label{transition:opacity .1s linear}}.is-selected>.components-placeholder.has-illustration .components-button,.is-selected>.components-placeholder.has-illustration .components-placeholder__instructions,.is-selected>.components-placeholder.has-illustration .components-placeholder__label{opacity:1;pointer-events:auto}.components-placeholder.has-illustration:before{background:currentColor;bottom:0;content:"";left:0;opacity:.1;pointer-events:none;position:absolute;right:0;top:0}.components-placeholder.has-illustration{overflow:hidden}.is-selected .components-placeholder.has-illustration{overflow:auto}.components-placeholder__preview{display:flex;justify-content:center}.components-placeholder__illustration{box-sizing:content-box;height:100%;left:50%;opacity:.25;position:absolute;stroke:currentColor;top:50%;transform:translate(-50%,-50%);width:100%}.components-popover{box-sizing:border-box}.components-popover *,.components-popover :after,.components-popover :before{box-sizing:inherit}.components-popover{z-index:1000000}.components-popover.is-expanded{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1000000!important}.components-popover__content{background:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:0 0 0 var(--wpds-border-width-xs,1px) var(--wpds-color-stroke-surface-neutral,#dbdbdb),0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02);box-sizing:border-box;width:min-content}.is-alternate .components-popover__content{border-radius:2px;box-shadow:0 0 0 1px #1e1e1e}.is-unstyled .components-popover__content{background:none;border-radius:0;box-shadow:none}.components-popover.is-expanded .components-popover__content{box-shadow:0 calc(var(--wpds-border-width-xs, 1px)*-1) 0 0 var(--wpds-color-stroke-surface-neutral,#dbdbdb);height:calc(100% - 48px);overflow-y:visible;position:static;width:auto}.components-popover.is-expanded.is-alternate .components-popover__content{box-shadow:0 -1px 0 #1e1e1e}@media (forced-colors:active){.components-popover:where(:not(.is-unstyled):not(.is-expanded)) .components-popover__content{outline:var(--wpds-border-width-xs,1px) solid transparent}}.components-popover__header{align-items:center;background:var(--wpds-color-background-surface-neutral-strong,#fff);display:flex;height:48px;justify-content:space-between;padding:0 8px 0 16px}.components-popover__header-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.components-popover__arrow{display:flex;height:14px;pointer-events:none;position:absolute;width:14px}.components-popover__arrow:before{background-color:var(--wpds-color-background-surface-neutral-strong,#fff);content:"";height:calc(var(--wpds-border-width-xs, 1px)*2);left:1px;position:absolute;right:1px;top:calc(var(--wpds-border-width-xs, 1px)*-1)}@media (forced-colors:active){.components-popover__arrow:before{background-color:Canvas}}.components-popover__arrow.is-top{bottom:-14px!important;transform:rotate(0)}.components-popover__arrow.is-right{left:-14px!important;transform:rotate(90deg)}.components-popover__arrow.is-bottom{top:-14px!important;transform:rotate(180deg)}.components-popover__arrow.is-left{right:-14px!important;transform:rotate(-90deg)}.components-popover__triangle{display:block;flex:1}.components-popover__triangle-bg{fill:var(--wpds-color-background-surface-neutral-strong,#fff)}@media (forced-colors:active){.components-popover__triangle-bg{fill:Canvas}}.components-popover__triangle-border{fill:transparent;stroke:var(--wpds-color-stroke-surface-neutral,#dbdbdb);stroke-width:var(--wpds-border-width-xs,1px)}.is-alternate .components-popover__triangle-border{stroke:#1e1e1e}@media (forced-colors:active){.components-popover:not(.is-unstyled) .components-popover__triangle-border{stroke:CanvasText}}.components-radio-control{border:0;font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;margin:0;padding:0}.components-radio-control__group-wrapper.has-help{margin-block-end:12px}.components-radio-control__option{align-items:center;column-gap:8px;display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto minmax(0,max-content)}.components-radio-control__input[type=radio]{background:var(--wpds-color-background-interactive-neutral-weak,#0000);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:50%;grid-column:1;grid-row:1;height:16px;margin-right:12px;max-width:16px;min-width:16px;position:relative;transition:none;width:16px}@media not (prefers-reduced-motion){.components-radio-control__input[type=radio]{transition:box-shadow .1s linear}}.components-radio-control__input[type=radio]:after{aspect-ratio:1;content:"";left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:24px}.components-radio-control__input[type=radio]:hover{border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}.components-radio-control__input[type=radio]:checked:before{background-color:currentColor;border:4px solid;box-sizing:inherit;height:8px;left:50%;margin:0;position:absolute;top:50%;transform:translate(-50%,-50%);width:8px}.components-radio-control__input[type=radio]:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9))}.components-radio-control__input[type=radio]:checked{background:var(--wpds-color-background-interactive-brand-strong,var(--wp-admin-theme-color,#3858e9));border-color:transparent;color:var(--wpds-color-foreground-interactive-brand-strong,#fff)}.components-radio-control__input[type=radio]:disabled,.components-radio-control__input[type=radio][aria-disabled=true]{background:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);cursor:default;opacity:1}@media (forced-colors:active){.components-radio-control__input[type=radio]:disabled,.components-radio-control__input[type=radio][aria-disabled=true]{border-color:GrayText;color:GrayText}}.components-radio-control__input[type=radio]{appearance:none;display:inline-flex;margin:0;padding:0}.components-radio-control__input[type=radio]:not(:disabled){cursor:var(--wpds-cursor-control,pointer)}.components-radio-control__input[type=radio]:focus{box-shadow:0 0 0 var(--wp-admin-border-width-focus) #fff,0 0 0 calc(var(--wp-admin-border-width-focus)*2) var(--wp-admin-theme-color);outline:2px solid transparent;outline-offset:2px}.components-radio-control__input[type=radio]:checked:before{border-radius:50%;content:""}.components-radio-control__input[type=radio]:disabled,.components-radio-control__input[type=radio]:disabled:checked:before{opacity:1}.components-radio-control__label{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);grid-column:2;grid-row:1}.components-radio-control__input:not(:disabled)+.components-radio-control__label{cursor:var(--wpds-cursor-control,pointer)}.components-radio-control__label{line-height:16px}.components-radio-control__option-description{grid-column:2;grid-row:2;padding-block-start:4px}.components-radio-control__option-description.components-radio-control__option-description{margin-top:0}.components-resizable-box__handle{display:none;height:23px;width:23px;z-index:2}.components-resizable-box__container.has-show-handle .components-resizable-box__handle{display:block}.components-resizable-box__handle>div{height:100%;outline:none;position:relative;width:100%;z-index:2}.components-resizable-box__container>img{width:inherit}.components-resizable-box__handle:after{background:#fff;border-radius:50%;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9)),0 1px 1px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.02),0 3px 3px rgba(0,0,0,.02),0 4px 4px rgba(0,0,0,.01);content:"";cursor:inherit;display:block;height:15px;outline:2px solid transparent;position:absolute;right:calc(50% - 8px);top:calc(50% - 8px);width:15px}.components-resizable-box__side-handle:before{background:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));border-radius:9999px;content:"";cursor:inherit;display:block;height:3px;position:absolute;right:calc(50% - 1px);top:calc(50% - 1px);width:3px}@media not (prefers-reduced-motion){.components-resizable-box__side-handle:before{transition:transform .1s ease-in;will-change:transform}}.components-resizable-box__side-handle:before{opacity:0}.components-resizable-box__corner-handle,.components-resizable-box__side-handle{z-index:2}.components-resizable-box__side-handle.components-resizable-box__handle-bottom,.components-resizable-box__side-handle.components-resizable-box__handle-bottom:before,.components-resizable-box__side-handle.components-resizable-box__handle-top,.components-resizable-box__side-handle.components-resizable-box__handle-top:before{border-left:0;border-right:0;left:0;width:100%}.components-resizable-box__side-handle.components-resizable-box__handle-left,.components-resizable-box__side-handle.components-resizable-box__handle-left:before,.components-resizable-box__side-handle.components-resizable-box__handle-right,.components-resizable-box__side-handle.components-resizable-box__handle-right:before{border-bottom:0;border-top:0;height:100%;top:0}@media not (prefers-reduced-motion){.components-resizable-box__side-handle.components-resizable-box__handle-bottom:active:before,.components-resizable-box__side-handle.components-resizable-box__handle-bottom:hover:before,.components-resizable-box__side-handle.components-resizable-box__handle-top:active:before,.components-resizable-box__side-handle.components-resizable-box__handle-top:hover:before{animation:components-resizable-box__top-bottom-animation .1s ease-out 0s;animation-fill-mode:forwards}.components-resizable-box__side-handle.components-resizable-box__handle-left:active:before,.components-resizable-box__side-handle.components-resizable-box__handle-left:hover:before,.components-resizable-box__side-handle.components-resizable-box__handle-right:active:before,.components-resizable-box__side-handle.components-resizable-box__handle-right:hover:before{animation:components-resizable-box__left-right-animation .1s ease-out 0s;animation-fill-mode:forwards}}@media not all and (min-resolution:0.001dpcm){@supports (-webkit-appearance:none){.components-resizable-box__side-handle.components-resizable-box__handle-bottom:active:before,.components-resizable-box__side-handle.components-resizable-box__handle-bottom:hover:before,.components-resizable-box__side-handle.components-resizable-box__handle-left:active:before,.components-resizable-box__side-handle.components-resizable-box__handle-left:hover:before,.components-resizable-box__side-handle.components-resizable-box__handle-right:active:before,.components-resizable-box__side-handle.components-resizable-box__handle-right:hover:before,.components-resizable-box__side-handle.components-resizable-box__handle-top:active:before,.components-resizable-box__side-handle.components-resizable-box__handle-top:hover:before{animation:none}}}@keyframes components-resizable-box__top-bottom-animation{0%{opacity:0;transform:scaleX(0)}to{opacity:1;transform:scaleX(1)}}@keyframes components-resizable-box__left-right-animation{0%{opacity:0;transform:scaleY(0)}to{opacity:1;transform:scaleY(1)}} /*!rtl:begin:ignore*/.components-resizable-box__handle-right{right:-11.5px}.components-resizable-box__handle-left{left:-11.5px}.components-resizable-box__handle-top{top:-11.5px}.components-resizable-box__handle-bottom{bottom:-11.5px} -/*!rtl:end:ignore*/.components-responsive-wrapper{align-items:center;display:flex;justify-content:center;max-width:100%;position:relative}.components-responsive-wrapper__content{display:block;max-width:100%;width:100%}.components-sandbox{overflow:hidden}iframe.components-sandbox{width:100%}body.lockscroll,html.lockscroll{overflow:hidden}.components-select-control__input{outline:0;-webkit-tap-highlight-color:rgba(0,0,0,0)!important}.components-snackbar{backdrop-filter:blur(16px) saturate(180%);background:rgba(0,0,0,.85);border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);box-sizing:border-box;color:#fff;cursor:var(--wpds-cursor-control,pointer);font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;max-width:var(--wpds-dimension-surface-width-lg,560px);padding:12px 20px;pointer-events:auto;width:100%}@media (min-width:600px){.components-snackbar{width:fit-content}}.components-snackbar:focus{box-shadow:inset 0 0 0 1px #fff,0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}.components-snackbar.components-snackbar-explicit-dismiss{cursor:default}.components-snackbar .components-snackbar__content-with-icon{padding-left:24px;position:relative}.components-snackbar .components-snackbar__icon{left:-8px;position:absolute;top:-2.9px}.components-snackbar .components-snackbar__dismiss-button{cursor:var(--wpds-cursor-control,pointer);margin-left:24px}.components-snackbar__action.components-button,.components-snackbar__action.components-external-link{color:#fff;flex-shrink:0;margin-left:32px}.components-snackbar__action.components-button:focus,.components-snackbar__action.components-external-link:focus{box-shadow:none;outline:1px dotted #fff}.components-snackbar__action.components-button:hover,.components-snackbar__action.components-external-link:hover{color:currentColor;text-decoration:none}.components-snackbar__content{align-items:baseline;display:flex;justify-content:space-between;line-height:1.4}.components-snackbar-list{box-sizing:border-box;pointer-events:none;position:absolute;width:100%;z-index:100000}.components-snackbar-list__notice-container{padding-top:8px;position:relative}.components-tab-panel__tabs{align-items:stretch;display:flex;flex-direction:row}.components-tab-panel__tabs[aria-orientation=vertical]{flex-direction:column}.components-tab-panel__tabs-item{background:transparent;border:none;border-radius:0;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);font-weight:var(--wpds-typography-font-weight-default,400);height:48px!important;margin-left:0;padding:3px var(--wpds-dimension-padding-lg,16px);position:relative}.components-tab-panel__tabs-item:disabled,.components-tab-panel__tabs-item[aria-disabled=true]{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}.components-tab-panel__tabs-item:not(:disabled,[aria-disabled=true]):is(:hover,:focus-visible){color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}.components-tab-panel__tabs-item:focus:not(:disabled){outline:none;position:relative}.components-tab-panel__tabs-item:after{background:var(--wpds-color-stroke-interactive-neutral-strong,#6e6e6e);border-radius:0;bottom:0;content:"";height:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*0);left:0;pointer-events:none;position:absolute;right:0}@media not (prefers-reduced-motion){.components-tab-panel__tabs-item:after{transition:height .1s linear}}.components-tab-panel__tabs-item.is-active:after{height:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*1);outline:2px solid transparent;outline-offset:-1px}.components-tab-panel__tabs-item:before{border-radius:var(--wpds-border-radius-sm,2px);content:"";inset:var(--wpds-dimension-padding-md,12px);pointer-events:none;position:absolute}.components-tab-panel__tabs-item:focus-visible:before{outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));outline-offset:0}.components-tab-panel__tabs[aria-orientation=vertical] .components-tab-panel__tabs-item{border-radius:var(--wpds-border-radius-sm,2px)}.components-tab-panel__tabs[aria-orientation=vertical] .components-tab-panel__tabs-item:after{display:none}.components-tab-panel__tabs[aria-orientation=vertical] .components-tab-panel__tabs-item.is-active{background:var(--wpds-color-background-interactive-neutral-weak-active,#ededed)}.components-tab-panel__tab-content:focus{outline:none}.components-tab-panel__tab-content:focus-visible{outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));outline-offset:0}.components-text-control__input,.components-text-control__input[type=color],.components-text-control__input[type=date],.components-text-control__input[type=datetime-local],.components-text-control__input[type=datetime],.components-text-control__input[type=email],.components-text-control__input[type=month],.components-text-control__input[type=number],.components-text-control__input[type=password],.components-text-control__input[type=tel],.components-text-control__input[type=text],.components-text-control__input[type=time],.components-text-control__input[type=url],.components-text-control__input[type=week]{background:var(--wp-components-color-background,var(--wpds-color-background-surface-neutral-strong,#fff));border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);color:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;height:40px;line-height:normal;margin:0;padding:6px 8px;width:100%}@media (min-width:600px){.components-text-control__input,.components-text-control__input[type=color],.components-text-control__input[type=date],.components-text-control__input[type=datetime-local],.components-text-control__input[type=datetime],.components-text-control__input[type=email],.components-text-control__input[type=month],.components-text-control__input[type=number],.components-text-control__input[type=password],.components-text-control__input[type=tel],.components-text-control__input[type=text],.components-text-control__input[type=time],.components-text-control__input[type=url],.components-text-control__input[type=week]{font-size:13px;line-height:normal}}.components-text-control__input:hover:not(:disabled,[aria-disabled=true],[type=checkbox]),.components-text-control__input[type=color]:hover:not(:disabled,[aria-disabled=true],[type=checkbox]),.components-text-control__input[type=date]:hover:not(:disabled,[aria-disabled=true],[type=checkbox]),.components-text-control__input[type=datetime-local]:hover:not(:disabled,[aria-disabled=true],[type=checkbox]),.components-text-control__input[type=datetime]:hover:not(:disabled,[aria-disabled=true],[type=checkbox]),.components-text-control__input[type=email]:hover:not(:disabled,[aria-disabled=true],[type=checkbox]),.components-text-control__input[type=month]:hover:not(:disabled,[aria-disabled=true],[type=checkbox]),.components-text-control__input[type=number]:hover:not(:disabled,[aria-disabled=true],[type=checkbox]),.components-text-control__input[type=password]:hover:not(:disabled,[aria-disabled=true],[type=checkbox]),.components-text-control__input[type=tel]:hover:not(:disabled,[aria-disabled=true],[type=checkbox]),.components-text-control__input[type=text]:hover:not(:disabled,[aria-disabled=true],[type=checkbox]),.components-text-control__input[type=time]:hover:not(:disabled,[aria-disabled=true],[type=checkbox]),.components-text-control__input[type=url]:hover:not(:disabled,[aria-disabled=true],[type=checkbox]),.components-text-control__input[type=week]:hover:not(:disabled,[aria-disabled=true],[type=checkbox]){border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}.components-text-control__input:focus,.components-text-control__input[type=color]:focus,.components-text-control__input[type=date]:focus,.components-text-control__input[type=datetime-local]:focus,.components-text-control__input[type=datetime]:focus,.components-text-control__input[type=email]:focus,.components-text-control__input[type=month]:focus,.components-text-control__input[type=number]:focus,.components-text-control__input[type=password]:focus,.components-text-control__input[type=tel]:focus,.components-text-control__input[type=text]:focus,.components-text-control__input[type=time]:focus,.components-text-control__input[type=url]:focus,.components-text-control__input[type=week]:focus{border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);box-shadow:none;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-text-control__input::placeholder,.components-text-control__input[type=color]::placeholder,.components-text-control__input[type=date]::placeholder,.components-text-control__input[type=datetime-local]::placeholder,.components-text-control__input[type=datetime]::placeholder,.components-text-control__input[type=email]::placeholder,.components-text-control__input[type=month]::placeholder,.components-text-control__input[type=number]::placeholder,.components-text-control__input[type=password]::placeholder,.components-text-control__input[type=tel]::placeholder,.components-text-control__input[type=text]::placeholder,.components-text-control__input[type=time]::placeholder,.components-text-control__input[type=url]::placeholder,.components-text-control__input[type=week]::placeholder{color:rgba(30,30,30,.62)}.components-text-control__input,.components-text-control__input[type=color],.components-text-control__input[type=date],.components-text-control__input[type=datetime-local],.components-text-control__input[type=datetime],.components-text-control__input[type=email],.components-text-control__input[type=month],.components-text-control__input[type=number],.components-text-control__input[type=password],.components-text-control__input[type=tel],.components-text-control__input[type=text],.components-text-control__input[type=time],.components-text-control__input[type=url],.components-text-control__input[type=week]{padding-left:12px;padding-right:12px}.components-text-control__input::placeholder,.components-text-control__input[type=color]::placeholder,.components-text-control__input[type=date]::placeholder,.components-text-control__input[type=datetime-local]::placeholder,.components-text-control__input[type=datetime]::placeholder,.components-text-control__input[type=email]::placeholder,.components-text-control__input[type=month]::placeholder,.components-text-control__input[type=number]::placeholder,.components-text-control__input[type=password]::placeholder,.components-text-control__input[type=tel]::placeholder,.components-text-control__input[type=text]::placeholder,.components-text-control__input[type=time]::placeholder,.components-text-control__input[type=url]::placeholder,.components-text-control__input[type=week]::placeholder{color:color-mix(in srgb,var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e)),transparent 38%)}.components-text-control__input[type=email],.components-text-control__input[type=url]{direction:ltr}.components-tip{color:#757575;display:flex}.components-tip svg{align-self:center;color:#f0b849;flex-shrink:0;margin-right:16px}.components-tip p{margin:0}.components-toggle-control__label{line-height:16px}.components-toggle-control__label:not(.is-disabled){cursor:var(--wpds-cursor-control,pointer)}.components-toggle-control__help{display:inline-block;margin-inline-start:40px}.components-accessible-toolbar{border:1px solid var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));border-radius:2px;display:inline-flex;flex-shrink:0}.components-accessible-toolbar>.components-toolbar-group:last-child{border-right:none}.components-accessible-toolbar.is-unstyled{border:none}.components-accessible-toolbar.is-unstyled>.components-toolbar-group{border-right:none}.components-accessible-toolbar[aria-orientation=vertical],.components-toolbar[aria-orientation=vertical]{align-items:center;display:flex;flex-direction:column}.components-accessible-toolbar .components-button,.components-toolbar .components-button{height:48px;padding-left:16px;padding-right:16px;position:relative;z-index:1}.components-accessible-toolbar .components-button:focus:not(:disabled),.components-toolbar .components-button:focus:not(:disabled){box-shadow:none;outline:none}.components-accessible-toolbar .components-button:before,.components-toolbar .components-button:before{border-radius:2px;content:"";display:block;height:32px;left:8px;position:absolute;right:8px;z-index:-1}@media not (prefers-reduced-motion){.components-accessible-toolbar .components-button:before,.components-toolbar .components-button:before{animation:components-button__appear-animation .1s ease;animation-fill-mode:forwards}}.components-accessible-toolbar .components-button svg,.components-toolbar .components-button svg{margin-left:auto;margin-right:auto;position:relative}.components-accessible-toolbar .components-button.is-pressed,.components-accessible-toolbar .components-button.is-pressed:hover,.components-toolbar .components-button.is-pressed,.components-toolbar .components-button.is-pressed:hover{background:transparent}.components-accessible-toolbar .components-button.is-pressed:before,.components-toolbar .components-button.is-pressed:before{background:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e))}.components-accessible-toolbar .components-button:focus:before,.components-toolbar .components-button:focus:before{box-shadow:inset 0 0 0 1px #fff,0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:2px solid transparent}.components-accessible-toolbar .components-button.has-icon.has-icon,.components-toolbar .components-button.has-icon.has-icon{min-width:48px;padding-left:8px;padding-right:8px}@keyframes components-button__appear-animation{0%{transform:scaleY(0)}to{transform:scaleY(1)}}.components-toolbar__control.components-button{position:relative}.components-toolbar__control.components-button[data-subscript] svg{padding:5px 10px 5px 0}.components-toolbar__control.components-button[data-subscript]:after{bottom:10px;content:attr(data-subscript);font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:12px;position:absolute;right:8px}.components-toolbar__control.components-button:not(:disabled).is-pressed[data-subscript]:after{color:#fff}.components-toolbar-group{background-color:var(--wp-components-color-background,var(--wpds-color-background-surface-neutral-strong,#fff));border-right:1px solid var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));display:inline-flex;flex-shrink:0;flex-wrap:wrap;min-height:48px;padding-left:6px;padding-right:6px}.components-toolbar-group .components-toolbar-group.components-toolbar-group{border-width:0;margin:0}.components-toolbar-group{line-height:0}.components-toolbar-group .components-button.components-button,.components-toolbar-group .components-button.has-icon.has-icon{justify-content:center;min-width:36px;padding-left:6px;padding-right:6px}.components-toolbar-group .components-button.components-button svg,.components-toolbar-group .components-button.has-icon.has-icon svg{min-width:var(--wpds-dimension-size-sm,24px)}.components-toolbar-group .components-button.components-button:before,.components-toolbar-group .components-button.has-icon.has-icon:before{left:2px;right:2px}.components-toolbar{background-color:var(--wp-components-color-background,var(--wpds-color-background-surface-neutral-strong,#fff));border:1px solid var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));display:inline-flex;flex-shrink:0;flex-wrap:wrap;margin:0;min-height:48px}.components-toolbar .components-toolbar.components-toolbar{border-width:0;margin:0}div.components-toolbar>div{display:flex;margin:0}div.components-toolbar>div+div.has-left-divider{margin-left:6px;overflow:visible;position:relative}div.components-toolbar>div+div.has-left-divider:before{background-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);box-sizing:content-box;content:"";display:inline-block;height:20px;left:-3px;position:absolute;top:8px;width:1px}.components-tooltip{background:#000;border-radius:var(--wpds-border-radius-md,4px);box-shadow:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);color:#f0f0f0;font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:12px;line-height:1.4;padding:4px 8px;text-align:center;z-index:1000002}.components-tooltip__shortcut{margin-left:8px}.components-validated-control textarea:invalid[data-validity-visible],.components-validated-control:has(:is(input,select):invalid[data-validity-visible]) .components-input-control__backdrop,.components-validated-control__wrapper-with-error-delegate:has(input:invalid[data-validity-visible]) .components-validated-control__content-editable [role=textbox],.components-validated-control__wrapper-with-error-delegate:has(select:invalid[data-validity-visible]) .components-input-control__backdrop{--focus-color:var(--wpds-color-stroke-interactive-error,#cc1818)}.components-validated-control textarea:invalid[data-validity-visible],.components-validated-control:has(:is(input,select):invalid[data-validity-visible]) .components-input-control__backdrop,.components-validated-control__wrapper-with-error-delegate:has(input:invalid[data-validity-visible]) .components-validated-control__content-editable [role=textbox],.components-validated-control__wrapper-with-error-delegate:has(select:invalid[data-validity-visible]) .components-input-control__backdrop{border-color:var(--wpds-color-stroke-interactive-error,#cc1818)}.components-validated-control__wrapper-with-error-delegate{position:relative}.components-validated-control__error-delegate{height:100%;opacity:0;pointer-events:none;position:absolute;top:0;width:100%}:root{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color--rgb:56,88,233;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-10--rgb:33.0384615385,68.7307692308,230.4615384615;--wp-admin-theme-color-darker-20:#183ad6;--wp-admin-theme-color-darker-20--rgb:23.6923076923,58.1538461538,214.3076923077;--wp-admin-border-width-focus:2px}@media (min-resolution:192dpi){:root{--wp-admin-border-width-focus:1.5px}} +/*!rtl:end:ignore*/.components-responsive-wrapper{align-items:center;display:flex;justify-content:center;max-width:100%;position:relative}.components-responsive-wrapper__content{display:block;max-width:100%;width:100%}.components-sandbox{overflow:hidden}iframe.components-sandbox{width:100%}body.lockscroll,html.lockscroll{overflow:hidden}.components-select-control__input{outline:0;-webkit-tap-highlight-color:rgba(0,0,0,0)!important}.components-snackbar{backdrop-filter:blur(16px) saturate(180%);background:rgba(0,0,0,.85);border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);box-sizing:border-box;color:#fff;cursor:var(--wpds-cursor-control,pointer);font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;max-width:var(--wpds-dimension-surface-width-lg,560px);padding:12px 20px;pointer-events:auto;width:100%}@media (min-width:600px){.components-snackbar{width:fit-content}}.components-snackbar:focus{box-shadow:inset 0 0 0 1px #fff,0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}.components-snackbar.components-snackbar-explicit-dismiss{cursor:default}.components-snackbar .components-snackbar__content-with-icon{padding-left:24px;position:relative}.components-snackbar .components-snackbar__icon{left:-8px;position:absolute;top:-2.9px}.components-snackbar .components-snackbar__dismiss-button{cursor:var(--wpds-cursor-control,pointer);margin-left:24px}.components-snackbar__action.components-button,.components-snackbar__action.components-external-link{color:#fff;flex-shrink:0;margin-left:32px;--focus-color:#fff}.components-snackbar__action.components-button:hover,.components-snackbar__action.components-external-link:hover{color:currentColor;text-decoration:none}.components-snackbar__content{align-items:baseline;display:flex;justify-content:space-between;line-height:1.4}.components-snackbar-list{box-sizing:border-box;pointer-events:none;position:absolute;width:100%;z-index:100000}.components-snackbar-list__notice-container{padding-top:8px;position:relative}.components-tab-panel__tabs{align-items:stretch;display:flex;flex-direction:row}.components-tab-panel__tabs[aria-orientation=vertical]{flex-direction:column}.components-tab-panel__tabs-item{background:transparent;border:none;border-radius:0;cursor:var(--wpds-cursor-control,pointer);font-weight:var(--wpds-typography-font-weight-default,400);height:48px!important;isolation:isolate;margin-left:0;padding:3px var(--wpds-dimension-padding-lg,16px);position:relative}.components-tab-panel__tabs-item[aria-selected=true]{cursor:default}.components-tab-panel__tabs-item:disabled,.components-tab-panel__tabs-item[aria-disabled=true]{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}.components-tab-panel__tabs .components-tab-panel__tabs-item:not(:disabled,[aria-disabled=true]){color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e)}.components-tab-panel__tabs .components-tab-panel__tabs-item:not(:disabled,[aria-disabled=true]):focus-visible,.components-tab-panel__tabs .components-tab-panel__tabs-item:not(:disabled,[aria-disabled=true]):is(:hover,:active):not([aria-selected=true]){color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}.components-tab-panel__tabs .components-tab-panel__tabs-item:not(:disabled,[aria-disabled=true]):focus-visible:before,.components-tab-panel__tabs .components-tab-panel__tabs-item:not(:disabled,[aria-disabled=true]):is(:hover,:active):not([aria-selected=true]):before{background-color:var(--wpds-color-background-interactive-neutral-weak-active,#ededed)}.components-tab-panel__tabs-item:focus:not(:disabled){outline:none;position:relative}.components-tab-panel__tabs-item:after{background:currentColor;border-radius:0;bottom:0;content:"";height:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*0);left:0;pointer-events:none;position:absolute;right:0}@media not (prefers-reduced-motion){.components-tab-panel__tabs-item:after{transition:height .1s linear}}.components-tab-panel__tabs-item.is-active:after{height:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*1);outline:2px solid transparent;outline-offset:-1px}.components-tab-panel__tabs-item:before{border-radius:var(--wpds-border-radius-sm,2px);content:"";inset:var(--wpds-dimension-padding-md,12px);pointer-events:none;position:absolute;z-index:-1}.components-tab-panel__tabs-item:focus-visible:before{outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));outline-offset:0}.components-tab-panel__tabs[aria-orientation=vertical] .components-tab-panel__tabs-item:before{inset:0;outline-offset:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*-1)}.components-tab-panel__tabs[aria-orientation=vertical] .components-tab-panel__tabs-item .components-tab-panel__tabs-item-label{display:inline-flex;position:relative}.components-tab-panel__tabs[aria-orientation=vertical] .components-tab-panel__tabs-item:after{height:var(--wpds-dimension-size-sm,24px);inset-block-end:auto;inset-block-start:50%;inset-inline:0 auto;transform:translateY(-50%);width:0}@media not (prefers-reduced-motion){.components-tab-panel__tabs[aria-orientation=vertical] .components-tab-panel__tabs-item:after{transition-property:width}}.components-tab-panel__tabs[aria-orientation=vertical] .components-tab-panel__tabs-item:not(.has-icon):after{content:none}.components-tab-panel__tabs[aria-orientation=vertical] .components-tab-panel__tabs-item .components-tab-panel__tabs-item-label:after{background:currentColor;content:"";inset-block:0;inset-inline-start:calc(var(--wpds-dimension-padding-lg, 16px)*-1);pointer-events:none;position:absolute;width:0}@media not (prefers-reduced-motion){.components-tab-panel__tabs[aria-orientation=vertical] .components-tab-panel__tabs-item .components-tab-panel__tabs-item-label:after{transition:width .1s linear}}.components-tab-panel__tabs[aria-orientation=vertical] .components-tab-panel__tabs-item.is-active .components-tab-panel__tabs-item-label:after,.components-tab-panel__tabs[aria-orientation=vertical] .components-tab-panel__tabs-item.is-active:after{outline:2px solid transparent;outline-offset:-1px;width:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-tab-panel__tab-content:focus{outline:none}.components-tab-panel__tab-content:focus-visible{outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));outline-offset:0}.components-text-control__input,.components-text-control__input[type=color],.components-text-control__input[type=date],.components-text-control__input[type=datetime-local],.components-text-control__input[type=datetime],.components-text-control__input[type=email],.components-text-control__input[type=month],.components-text-control__input[type=number],.components-text-control__input[type=password],.components-text-control__input[type=tel],.components-text-control__input[type=text],.components-text-control__input[type=time],.components-text-control__input[type=url],.components-text-control__input[type=week]{background:var(--wp-components-color-background,var(--wpds-color-background-surface-neutral-strong,#fff));border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);color:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;height:40px;line-height:normal;margin:0;padding:6px 8px;width:100%}@media (min-width:600px){.components-text-control__input,.components-text-control__input[type=color],.components-text-control__input[type=date],.components-text-control__input[type=datetime-local],.components-text-control__input[type=datetime],.components-text-control__input[type=email],.components-text-control__input[type=month],.components-text-control__input[type=number],.components-text-control__input[type=password],.components-text-control__input[type=tel],.components-text-control__input[type=text],.components-text-control__input[type=time],.components-text-control__input[type=url],.components-text-control__input[type=week]{font-size:13px;line-height:normal}}.components-text-control__input:hover:not(:disabled,[aria-disabled=true]),.components-text-control__input[type=color]:hover:not(:disabled,[aria-disabled=true]),.components-text-control__input[type=date]:hover:not(:disabled,[aria-disabled=true]),.components-text-control__input[type=datetime-local]:hover:not(:disabled,[aria-disabled=true]),.components-text-control__input[type=datetime]:hover:not(:disabled,[aria-disabled=true]),.components-text-control__input[type=email]:hover:not(:disabled,[aria-disabled=true]),.components-text-control__input[type=month]:hover:not(:disabled,[aria-disabled=true]),.components-text-control__input[type=number]:hover:not(:disabled,[aria-disabled=true]),.components-text-control__input[type=password]:hover:not(:disabled,[aria-disabled=true]),.components-text-control__input[type=tel]:hover:not(:disabled,[aria-disabled=true]),.components-text-control__input[type=text]:hover:not(:disabled,[aria-disabled=true]),.components-text-control__input[type=time]:hover:not(:disabled,[aria-disabled=true]),.components-text-control__input[type=url]:hover:not(:disabled,[aria-disabled=true]),.components-text-control__input[type=week]:hover:not(:disabled,[aria-disabled=true]){border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}.components-text-control__input:focus,.components-text-control__input[type=color]:focus,.components-text-control__input[type=date]:focus,.components-text-control__input[type=datetime-local]:focus,.components-text-control__input[type=datetime]:focus,.components-text-control__input[type=email]:focus,.components-text-control__input[type=month]:focus,.components-text-control__input[type=number]:focus,.components-text-control__input[type=password]:focus,.components-text-control__input[type=tel]:focus,.components-text-control__input[type=text]:focus,.components-text-control__input[type=time]:focus,.components-text-control__input[type=url]:focus,.components-text-control__input[type=week]:focus{border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);box-shadow:none;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}.components-text-control__input::placeholder,.components-text-control__input[type=color]::placeholder,.components-text-control__input[type=date]::placeholder,.components-text-control__input[type=datetime-local]::placeholder,.components-text-control__input[type=datetime]::placeholder,.components-text-control__input[type=email]::placeholder,.components-text-control__input[type=month]::placeholder,.components-text-control__input[type=number]::placeholder,.components-text-control__input[type=password]::placeholder,.components-text-control__input[type=tel]::placeholder,.components-text-control__input[type=text]::placeholder,.components-text-control__input[type=time]::placeholder,.components-text-control__input[type=url]::placeholder,.components-text-control__input[type=week]::placeholder{color:rgba(30,30,30,.62)}.components-text-control__input,.components-text-control__input[type=color],.components-text-control__input[type=date],.components-text-control__input[type=datetime-local],.components-text-control__input[type=datetime],.components-text-control__input[type=email],.components-text-control__input[type=month],.components-text-control__input[type=number],.components-text-control__input[type=password],.components-text-control__input[type=tel],.components-text-control__input[type=text],.components-text-control__input[type=time],.components-text-control__input[type=url],.components-text-control__input[type=week]{padding-left:12px;padding-right:12px}.components-text-control__input::placeholder,.components-text-control__input[type=color]::placeholder,.components-text-control__input[type=date]::placeholder,.components-text-control__input[type=datetime-local]::placeholder,.components-text-control__input[type=datetime]::placeholder,.components-text-control__input[type=email]::placeholder,.components-text-control__input[type=month]::placeholder,.components-text-control__input[type=number]::placeholder,.components-text-control__input[type=password]::placeholder,.components-text-control__input[type=tel]::placeholder,.components-text-control__input[type=text]::placeholder,.components-text-control__input[type=time]::placeholder,.components-text-control__input[type=url]::placeholder,.components-text-control__input[type=week]::placeholder{color:color-mix(in srgb,var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e)),transparent 38%)}.components-text-control__input:disabled,.components-text-control__input[aria-disabled=true],.components-text-control__input[type=color]:disabled,.components-text-control__input[type=color][aria-disabled=true],.components-text-control__input[type=date]:disabled,.components-text-control__input[type=date][aria-disabled=true],.components-text-control__input[type=datetime-local]:disabled,.components-text-control__input[type=datetime-local][aria-disabled=true],.components-text-control__input[type=datetime]:disabled,.components-text-control__input[type=datetime][aria-disabled=true],.components-text-control__input[type=email]:disabled,.components-text-control__input[type=email][aria-disabled=true],.components-text-control__input[type=month]:disabled,.components-text-control__input[type=month][aria-disabled=true],.components-text-control__input[type=number]:disabled,.components-text-control__input[type=number][aria-disabled=true],.components-text-control__input[type=password]:disabled,.components-text-control__input[type=password][aria-disabled=true],.components-text-control__input[type=tel]:disabled,.components-text-control__input[type=tel][aria-disabled=true],.components-text-control__input[type=text]:disabled,.components-text-control__input[type=text][aria-disabled=true],.components-text-control__input[type=time]:disabled,.components-text-control__input[type=time][aria-disabled=true],.components-text-control__input[type=url]:disabled,.components-text-control__input[type=url][aria-disabled=true],.components-text-control__input[type=week]:disabled,.components-text-control__input[type=week][aria-disabled=true]{background:var(--wpds-color-background-interactive-neutral-disabled,#fff);border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}@media (forced-colors:active){.components-text-control__input:disabled,.components-text-control__input[aria-disabled=true],.components-text-control__input[type=color]:disabled,.components-text-control__input[type=color][aria-disabled=true],.components-text-control__input[type=date]:disabled,.components-text-control__input[type=date][aria-disabled=true],.components-text-control__input[type=datetime-local]:disabled,.components-text-control__input[type=datetime-local][aria-disabled=true],.components-text-control__input[type=datetime]:disabled,.components-text-control__input[type=datetime][aria-disabled=true],.components-text-control__input[type=email]:disabled,.components-text-control__input[type=email][aria-disabled=true],.components-text-control__input[type=month]:disabled,.components-text-control__input[type=month][aria-disabled=true],.components-text-control__input[type=number]:disabled,.components-text-control__input[type=number][aria-disabled=true],.components-text-control__input[type=password]:disabled,.components-text-control__input[type=password][aria-disabled=true],.components-text-control__input[type=tel]:disabled,.components-text-control__input[type=tel][aria-disabled=true],.components-text-control__input[type=text]:disabled,.components-text-control__input[type=text][aria-disabled=true],.components-text-control__input[type=time]:disabled,.components-text-control__input[type=time][aria-disabled=true],.components-text-control__input[type=url]:disabled,.components-text-control__input[type=url][aria-disabled=true],.components-text-control__input[type=week]:disabled,.components-text-control__input[type=week][aria-disabled=true]{border-color:GrayText;color:GrayText}}.components-text-control__input:disabled::placeholder,.components-text-control__input[aria-disabled=true]::placeholder,.components-text-control__input[type=color]:disabled::placeholder,.components-text-control__input[type=color][aria-disabled=true]::placeholder,.components-text-control__input[type=date]:disabled::placeholder,.components-text-control__input[type=date][aria-disabled=true]::placeholder,.components-text-control__input[type=datetime-local]:disabled::placeholder,.components-text-control__input[type=datetime-local][aria-disabled=true]::placeholder,.components-text-control__input[type=datetime]:disabled::placeholder,.components-text-control__input[type=datetime][aria-disabled=true]::placeholder,.components-text-control__input[type=email]:disabled::placeholder,.components-text-control__input[type=email][aria-disabled=true]::placeholder,.components-text-control__input[type=month]:disabled::placeholder,.components-text-control__input[type=month][aria-disabled=true]::placeholder,.components-text-control__input[type=number]:disabled::placeholder,.components-text-control__input[type=number][aria-disabled=true]::placeholder,.components-text-control__input[type=password]:disabled::placeholder,.components-text-control__input[type=password][aria-disabled=true]::placeholder,.components-text-control__input[type=tel]:disabled::placeholder,.components-text-control__input[type=tel][aria-disabled=true]::placeholder,.components-text-control__input[type=text]:disabled::placeholder,.components-text-control__input[type=text][aria-disabled=true]::placeholder,.components-text-control__input[type=time]:disabled::placeholder,.components-text-control__input[type=time][aria-disabled=true]::placeholder,.components-text-control__input[type=url]:disabled::placeholder,.components-text-control__input[type=url][aria-disabled=true]::placeholder,.components-text-control__input[type=week]:disabled::placeholder,.components-text-control__input[type=week][aria-disabled=true]::placeholder{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}.components-text-control__input[type=email],.components-text-control__input[type=url]{direction:ltr}.components-tip{color:#757575;display:flex}.components-tip svg{align-self:center;color:#f0b849;flex-shrink:0;margin-right:16px}.components-tip p{margin:0}.components-toggle-control__label{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);line-height:16px}.components-toggle-control__label:not(.is-disabled){cursor:var(--wpds-cursor-control,pointer)}.components-toggle-control__help{display:inline-block;margin-inline-start:40px}.components-accessible-toolbar{border:1px solid var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));border-radius:2px;display:inline-flex;flex-shrink:0}.components-accessible-toolbar>.components-toolbar-group:last-child{border-right:none}.components-accessible-toolbar.is-unstyled{border:none}.components-accessible-toolbar.is-unstyled>.components-toolbar-group{border-right:none}.components-accessible-toolbar[aria-orientation=vertical],.components-toolbar[aria-orientation=vertical]{align-items:center;display:flex;flex-direction:column}.components-accessible-toolbar .components-button,.components-toolbar .components-button{height:48px;padding-left:16px;padding-right:16px;position:relative;z-index:1}.components-accessible-toolbar .components-button:focus:not(:disabled),.components-toolbar .components-button:focus:not(:disabled){box-shadow:none;outline:none}.components-accessible-toolbar .components-button:before,.components-toolbar .components-button:before{border-radius:2px;content:"";display:block;height:32px;left:8px;position:absolute;right:8px;z-index:-1}@media not (prefers-reduced-motion){.components-accessible-toolbar .components-button:before,.components-toolbar .components-button:before{animation:components-button__appear-animation .1s ease;animation-fill-mode:forwards}}.components-accessible-toolbar .components-button svg,.components-toolbar .components-button svg{margin-left:auto;margin-right:auto;position:relative}.components-accessible-toolbar .components-button.is-pressed,.components-accessible-toolbar .components-button.is-pressed:hover,.components-toolbar .components-button.is-pressed,.components-toolbar .components-button.is-pressed:hover{background:transparent}.components-accessible-toolbar .components-button.is-pressed:before,.components-toolbar .components-button.is-pressed:before{background:var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e))}.components-accessible-toolbar .components-button:focus:before,.components-toolbar .components-button:focus:before{box-shadow:inset 0 0 0 1px #fff,0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:2px solid transparent}.components-accessible-toolbar .components-button.has-icon.has-icon,.components-toolbar .components-button.has-icon.has-icon{min-width:48px;padding-left:8px;padding-right:8px}@keyframes components-button__appear-animation{0%{transform:scaleY(0)}to{transform:scaleY(1)}}.components-toolbar__control.components-button{position:relative}.components-toolbar__control.components-button[data-subscript] svg{padding:5px 10px 5px 0}.components-toolbar__control.components-button[data-subscript]:after{bottom:10px;content:attr(data-subscript);font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:12px;position:absolute;right:8px}.components-toolbar__control.components-button:not(:disabled).is-pressed[data-subscript]:after{color:#fff}.components-toolbar-group{background-color:var(--wp-components-color-background,var(--wpds-color-background-surface-neutral-strong,#fff));border-right:1px solid var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));display:inline-flex;flex-shrink:0;flex-wrap:wrap;min-height:48px;padding-left:6px;padding-right:6px}.components-toolbar-group .components-toolbar-group.components-toolbar-group{border-width:0;margin:0}.components-toolbar-group{line-height:0}.components-toolbar-group .components-button.components-button,.components-toolbar-group .components-button.has-icon.has-icon{justify-content:center;min-width:36px;padding-left:6px;padding-right:6px}.components-toolbar-group .components-button.components-button svg,.components-toolbar-group .components-button.has-icon.has-icon svg{min-width:var(--wpds-dimension-size-sm,24px)}.components-toolbar-group .components-button.components-button:before,.components-toolbar-group .components-button.has-icon.has-icon:before{left:2px;right:2px}.components-toolbar{background-color:var(--wp-components-color-background,var(--wpds-color-background-surface-neutral-strong,#fff));border:1px solid var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e));display:inline-flex;flex-shrink:0;flex-wrap:wrap;margin:0;min-height:48px}.components-toolbar .components-toolbar.components-toolbar{border-width:0;margin:0}div.components-toolbar>div{display:flex;margin:0}div.components-toolbar>div+div.has-left-divider{margin-left:6px;overflow:visible;position:relative}div.components-toolbar>div+div.has-left-divider:before{background-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);box-sizing:content-box;content:"";display:inline-block;height:20px;left:-3px;position:absolute;top:8px;width:1px}.components-tooltip{background:#000;border-radius:var(--wpds-border-radius-md,4px);box-shadow:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);color:#f0f0f0;font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:12px;line-height:1.4;padding:4px 8px;text-align:center;z-index:1000002}.components-tooltip__shortcut{margin-left:8px}.components-validated-control textarea:invalid[data-validity-visible],.components-validated-control:has(:is(input,select):invalid[data-validity-visible]) .components-input-control__backdrop,.components-validated-control__wrapper-with-error-delegate:has(input:invalid[data-validity-visible]) .components-validated-control__content-editable [role=textbox],.components-validated-control__wrapper-with-error-delegate:has(select:invalid[data-validity-visible]) .components-input-control__backdrop{--focus-color:var(--wpds-color-stroke-interactive-error,#cc1818)}.components-validated-control textarea:invalid[data-validity-visible],.components-validated-control:has(:is(input,select):invalid[data-validity-visible]) .components-input-control__backdrop,.components-validated-control__wrapper-with-error-delegate:has(input:invalid[data-validity-visible]) .components-validated-control__content-editable [role=textbox],.components-validated-control__wrapper-with-error-delegate:has(select:invalid[data-validity-visible]) .components-input-control__backdrop{border-color:var(--wpds-color-stroke-interactive-error,#cc1818)}.components-validated-control__wrapper-with-error-delegate{position:relative}.components-validated-control__error-delegate{height:100%;opacity:0;pointer-events:none;position:absolute;top:0;width:100%}:root{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color--rgb:56,88,233;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-10--rgb:33.0384615385,68.7307692308,230.4615384615;--wp-admin-theme-color-darker-20:#183ad6;--wp-admin-theme-color-darker-20--rgb:23.6923076923,58.1538461538,214.3076923077;--wp-admin-border-width-focus:2px}@media (min-resolution:192dpi){:root{--wp-admin-border-width-focus:1.5px}} /*# sourceMappingURL=gallery-ui.css.map*/ \ No newline at end of file diff --git a/js/asset-edit.js b/js/asset-edit.js index 3d9113a10..b73c0c09e 100644 --- a/js/asset-edit.js +++ b/js/asset-edit.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e,t,i,r;e={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},t=["(","?"],i={")":["("],":":["?","?:"]},r=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var s={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,i){if(e)throw t;return i}};function n(n){var a=function(s){for(var n,a,o,l,d=[],c=[];n=s.match(r);){for(a=n[0],(o=s.substr(0,n.index).trim())&&d.push(o);l=c.pop();){if(i[a]){if(i[a][0]===l){a=i[a][1]||a;break}}else if(t.indexOf(l)>=0||e[l]1===e?0:1},d=/^i18n\.(n?gettext|has_translation)(_|$)/;var c=function(e){return"string"!=typeof e||""===e?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var u=function(e){return"string"!=typeof e||""===e?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var p=function(e,t){return function(i,r,s,n=10){const a=e[t];if(!u(i))return;if(!c(r))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof n)return void console.error("If specified, the hook priority must be a number.");const o={callback:s,priority:n,namespace:r};if(a[i]){const e=a[i].handlers;let t;for(t=e.length;t>0&&!(n>=e[t-1].priority);t--);t===e.length?e[t]=o:e.splice(t,0,o),a.__current.forEach(e=>{e.name===i&&e.currentIndex>=t&&e.currentIndex++})}else a[i]={handlers:[o],runs:0};"hookAdded"!==i&&e.doAction("hookAdded",i,r,s,n)}};var h=function(e,t,i=!1){return function(r,s){const n=e[t];if(!u(r))return;if(!i&&!c(s))return;if(!n[r])return 0;let a=0;if(i)a=n[r].handlers.length,n[r]={runs:n[r].runs,handlers:[]};else{const e=n[r].handlers;for(let t=e.length-1;t>=0;t--)e[t].namespace===s&&(e.splice(t,1),a++,n.__current.forEach(e=>{e.name===r&&e.currentIndex>=t&&e.currentIndex--}))}return"hookRemoved"!==r&&e.doAction("hookRemoved",r,s),a}};var v=function(e,t){return function(i,r){const s=e[t];return void 0!==r?i in s&&s[i].handlers.some(e=>e.namespace===r):i in s}};var y=function(e,t,i,r){return function(s,...n){const a=e[t];a[s]||(a[s]={handlers:[],runs:0}),a[s].runs++;const o=a[s].handlers;if(!o||!o.length)return i?n[0]:void 0;const l={name:s,currentIndex:0};return(r?async function(){try{a.__current.add(l);let e=i?n[0]:void 0;for(;l.currentIndex0:Array.from(r.__current).some(e=>e.name===i)}};var g=function(e,t){return function(i){const r=e[t];if(u(i))return r[i]&&r[i].runs?r[i].runs:0}},w=class{actions;filters;addAction;addFilter;removeAction;removeFilter;hasAction;hasFilter;removeAllActions;removeAllFilters;doAction;doActionAsync;applyFilters;applyFiltersAsync;currentAction;currentFilter;doingAction;doingFilter;didAction;didFilter;constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=p(this,"actions"),this.addFilter=p(this,"filters"),this.removeAction=h(this,"actions"),this.removeFilter=h(this,"filters"),this.hasAction=v(this,"actions"),this.hasFilter=v(this,"filters"),this.removeAllActions=h(this,"actions",!0),this.removeAllFilters=h(this,"filters",!0),this.doAction=y(this,"actions",!1,!1),this.doActionAsync=y(this,"actions",!1,!0),this.applyFilters=y(this,"filters",!0,!1),this.applyFiltersAsync=y(this,"filters",!0,!0),this.currentAction=f(this,"actions"),this.currentFilter=f(this,"filters"),this.doingAction=m(this,"actions"),this.doingFilter=m(this,"filters"),this.didAction=g(this,"actions"),this.didFilter=g(this,"filters")}};var I=function(){return new w}(),{addAction:_,addFilter:b,removeAction:O,removeFilter:x,hasAction:S,hasFilter:P,removeAllActions:E,removeAllFilters:k,doAction:A,doActionAsync:T,applyFilters:F,applyFiltersAsync:L,currentAction:C,currentFilter:B,doingAction:j,doingFilter:$,didAction:M,didFilter:W,actions:z,filters:D}=I,R=((e,t,i)=>{const r=new o({}),s=new Set,n=()=>{s.forEach(e=>e())},a=(e,t="default")=>{r.data[t]={...r.data[t],...e},r.data[t][""]={...l,...r.data[t]?.[""]},delete r.pluralForms[t]},c=(e,t)=>{a(e,t),n()},u=(e="default",t,i,s,n)=>(r.data[e]||a(void 0,e),r.dcnpgettext(e,t,i,s,n)),p=e=>e||"default",h=(e,t,r)=>{let s=u(r,t,e);return i?(s=i.applyFilters("i18n.gettext_with_context",s,e,t,r),i.applyFilters("i18n.gettext_with_context_"+p(r),s,e,t,r)):s};if(e&&c(e,t),i){const e=e=>{d.test(e)&&n()};i.addAction("hookAdded","core/i18n",e),i.addAction("hookRemoved","core/i18n",e)}return{getLocaleData:(e="default")=>r.data[e],setLocaleData:c,addLocaleData:(e,t="default")=>{r.data[t]={...r.data[t],...e,"":{...l,...r.data[t]?.[""],...e?.[""]}},delete r.pluralForms[t],n()},resetLocaleData:(e,t)=>{r.data={},r.pluralForms={},c(e,t)},subscribe:e=>(s.add(e),()=>s.delete(e)),__:(e,t)=>{let r=u(t,void 0,e);return i?(r=i.applyFilters("i18n.gettext",r,e,t),i.applyFilters("i18n.gettext_"+p(t),r,e,t)):r},_x:h,_n:(e,t,r,s)=>{let n=u(s,void 0,e,t,r);return i?(n=i.applyFilters("i18n.ngettext",n,e,t,r,s),i.applyFilters("i18n.ngettext_"+p(s),n,e,t,r,s)):n},_nx:(e,t,r,s,n)=>{let a=u(n,s,e,t,r);return i?(a=i.applyFilters("i18n.ngettext_with_context",a,e,t,r,s,n),i.applyFilters("i18n.ngettext_with_context_"+p(n),a,e,t,r,s,n)):a},isRTL:()=>"rtl"===h("ltr","text direction"),hasTranslation:(e,t,s)=>{const n=t?t+""+e:e;let a=!!r.data?.[s??"default"]?.[n];return i&&(a=i.applyFilters("i18n.has_translation",a,e,t,s),a=i.applyFilters("i18n.has_translation_"+p(s),a,e,t,s)),a}}})(void 0,void 0,I),V=(R.getLocaleData.bind(R),R.setLocaleData.bind(R),R.resetLocaleData.bind(R),R.subscribe.bind(R),R.__.bind(R));R._x.bind(R),R._n.bind(R),R._nx.bind(R),R.isRTL.bind(R),R.hasTranslation.bind(R);const N={preview:null,wrap:null,apply:null,url:null,defaultWidth:null,defaultHeight:null,maxSize:null,init(){return this},createPreview(e=400,t=300){return this.maxSize=e>t?e:t,this.defaultWidth=e,this.defaultHeight=t,this.wrap=document.createElement("div"),this.apply=document.createElement("button"),this.preview=document.createElement("img"),this.apply.type="button",this.apply.classList.add("button-primary"),this.apply.innerText=V("Preview","cloudinary"),this.preview.style.transition="opacity 1s",this.preview.style.opacity=1,this.preview.style.maxWidth="100%",this.preview.style.maxHeight="100%",this.reset(),this.wrap.style.minHeight="200px",this.wrap.style.width=this.maxSize+"px",this.wrap.style.position="relative",this.wrap.style.display="flex",this.wrap.style.alignItems="center",this.wrap.style.justifyContent="center",this.apply.style.position="absolute",this.apply.style.display="none",this.wrap.appendChild(this.preview),this.wrap.appendChild(this.apply),this.preview.addEventListener("load",e=>{this.preview.style.opacity=1,this.wrap.style.width="",this.wrap.style.height="",this.defaultHeight=this.preview.height,this.defaultWidth=this.preview.width,this.defaultHeight>this.defaultWidth?this.wrap.style.height=this.maxSize+"px":this.wrap.style.width=this.maxSize+"px"}),this.preview.addEventListener("error",e=>{this.preview.src=this.getNoURL("⚠")}),this.apply.addEventListener("click",()=>{this.apply.style.display="none",this.reset(),this.preview.style.opacity=.6,this.preview.src=this.url}),this.wrap},reset(){this.preview.src=this.getNoURL()},setSrc(e,t=!1){this.preview.style.opacity=.6,t?(this.apply.style.display="none",this.preview.src=e):(this.apply.style.display="block",this.url=e)},getNoURL(e="︎"){const t=this.defaultWidth/2-23,i=this.defaultHeight/2+25;return`data:image/svg+xml;utf8,${e}`}},U={preview:null,wrap:null,apply:null,url:null,publicId:null,player:null,defaultWidth:null,defaultHeight:null,maxSize:null,init(){return this},createPreview(e=427,t=240){return this.maxSize=e>t?e:t,this.defaultWidth=e,this.defaultHeight=t,this.wrap=document.createElement("div"),this.apply=document.createElement("button"),this.preview=document.createElement("video"),this.apply.type="button",this.apply.classList.add("button-primary"),this.apply.innerText=V("Preview","cloudinary"),this.preview.id="cld-asset-video-preview",this.preview.style.transition="opacity 1s",this.preview.style.opacity=1,this.preview.style.maxWidth="100%",this.preview.style.maxHeight="100%",this.preview.controls=!0,this.preview.setAttribute("width",e),this.preview.setAttribute("height",t),this.wrap.style.minHeight="200px",this.wrap.style.width=this.maxSize+"px",this.wrap.style.position="relative",this.wrap.style.display="flex",this.wrap.style.alignItems="center",this.wrap.style.justifyContent="center",this.apply.style.position="absolute",this.apply.style.display="none",this.wrap.appendChild(this.preview),this.wrap.appendChild(this.apply),this.apply.addEventListener("click",()=>{this.apply.style.display="none",this.preview.style.opacity=.6,this.updatePlayer(this.url)}),this.wrap},setPublicId(e){this.publicId=e,this.initPlayer()},initPlayer(){void 0!==window.cloudinary&&void 0!==window.cld?this.player||(this.player=window.cld.videoPlayer(this.preview.id,{fluid:!0,controls:!0})):console.error("Cloudinary video player not loaded")},setSrc(e,t=!1){this.preview.style.opacity=.6,t?(this.apply.style.display="none",this.player||this.initPlayer(),this.updatePlayer(e)):(this.apply.style.display="block",this.url=e)},updatePlayer(e){if(!this.player)return;const t={publicId:this.publicId};e&&""!==e.trim()&&(t.transformation={raw_transformation:e}),this.player.source(t),this.preview.style.opacity=1},reset(e){this.setSrc(e,!1)}};var H=["@wordpress/admin-ui","@wordpress/api-fetch","@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/boot","@wordpress/commands","@wordpress/compose","@wordpress/connectors","@wordpress/workflows","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/font-list-route","@wordpress/format-library","@wordpress/patterns","@wordpress/preferences","@wordpress/rich-text","@wordpress/route","@wordpress/router","@wordpress/routes","@wordpress/storybook","@wordpress/sync","@wordpress/theme","@wordpress/dataviews","@wordpress/fields","@wordpress/lazy-editor","@wordpress/media-editor","@wordpress/media-utils","@wordpress/upload-media","@wordpress/global-styles-engine","@wordpress/global-styles-ui","@wordpress/ui","@wordpress/views","@wordpress/widget-dashboard"];function G(e,t){if(!e)throw new Error("Cannot lock an undefined object.");const i=e;Y in i||(i[Y]={}),X.set(i[Y],t)}function J(e){if(!e)throw new Error("Cannot unlock an undefined object.");const t=e;if(!(Y in t))throw new Error("Cannot unlock an object that was not locked before. ");return X.get(t[Y])}var X=new WeakMap,Y=Symbol("Private API ID");var{lock:q,unlock:K}=((e,t)=>{if(!H.includes(t))throw new Error(`You tried to opt-in to unstable APIs as module "${t}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress."!==e)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return{lock:G,unlock:J}})("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/api-fetch");var Q=function(e){const t=(e,i)=>{const{headers:r={}}=e;for(const s in r)if("x-wp-nonce"===s.toLowerCase()&&r[s]===t.nonce)return i(e);return i({...e,headers:{...r,"X-WP-Nonce":t.nonce}})};return t.nonce=e,t},Z=(e,t)=>{let i,r,s=e.path;return"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(i=e.namespace.replace(/^\/|\/$/g,""),r=e.endpoint.replace(/^\//,""),s=r?i+"/"+r:i),delete e.namespace,delete e.endpoint,t({...e,path:s})},ee=e=>(t,i)=>Z(t,t=>{let r,s=t.url,n=t.path;return"string"==typeof n&&(r=e,-1!==e.indexOf("?")&&(n=n.replace("?","&")),n=n.replace(/^\//,""),"string"==typeof r&&-1!==r.indexOf("?")&&(n=n.replace("?","&")),s=r+n),i({...t,url:s})});function te(e){try{return decodeURIComponent(e)}catch{return e}}function ie(e){const t=e.indexOf("?");if(-1===t)return e;const i=e.slice(0,t),r=e.slice(t+1);return r?i+"?"+r.split("&").map(e=>e.split("=")).map(e=>e.map(te)).sort((e,t)=>e[0].localeCompare(t[0])).map(e=>e.map(encodeURIComponent)).map(e=>e.join("=")).join("&"):i}function re(e){return(function(e){let t;try{t=new URL(e,"http://example.com").search.substring(1)}catch{}if(t)return t}(e)||"").replace(/\+/g,"%20").split("&").reduce((e,t)=>{const i=t.indexOf("="),r=-1!==i,s=te(r?t.slice(0,i):t);if(s){const n=r?te(t.slice(i+1)):"";!function(e,t,i){const r=t.length,s=r-1;for(let n=0;n{"link"===t.toLowerCase()&&(e.headers[t]=i.replace(/<([^>]+)>/,(e,t)=>`<${encodeURI(t)}>`))}),Promise.resolve(t?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}}var de=function(e){const{OPTIONS:t={},...i}=Object.fromEntries(Object.entries(e).map(([e,t])=>[ie(e),t])),r=new Set(Object.keys(i)),s=new Set(Object.keys(t));let n=!1;const a=(e,a)=>{const{parse:o=!0}=e;let l=e.path;if(!l&&e.url){const{rest_route:t,...i}=re(e.url);"string"==typeof t&&(l=ne(t,i))}if("string"!=typeof l)return a(e);const d=e.method||"GET",c=ie(l);if("GET"===d&&i[c]){const e=i[c];return n||delete i[c],r.delete(c),le(e,!!o)}if("OPTIONS"===d&&t[c]){const e=t[c];return n||delete t[c],s.delete(c),le(e,!!o)}return a(e)};return a[ae]=()=>{n=!0},a[oe]=()=>{const e=[...Array.from(r,e=>`GET ${e}`),...Array.from(s,e=>`OPTIONS ${e}`)];e.length?console.warn("[api-fetch][preload] Some preloads were never consumed:",e):console.log("[api-fetch][preload] All preloads consumed."),r.clear(),s.clear();for(const e of Object.keys(i))delete i[e];for(const e of Object.keys(t))delete t[e]},a},ce=({path:e,url:t,...i},r)=>({...i,url:t&&ne(t,r),path:e&&ne(e,r)}),ue=e=>e.json?e.json():Promise.reject(e),pe=e=>{const{next:t}=(e=>{if(!e)return{};const t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}})(e.headers.get("link"));return t},he=async(e,t)=>{if(!1===e.parse)return t(e);if(!(e=>{const t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),i=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||i})(e))return t(e);const i=await Fe({...ce(e,{per_page:100}),parse:!1}),r=await ue(i);if(!Array.isArray(r))return r;let s=pe(i);if(!s)return r;let n=[].concat(r);for(;s;){const t=await Fe({...e,path:void 0,url:s,parse:!1}),i=await ue(t);n=n.concat(i),s=pe(t)}return n},ve=new Set(["PATCH","PUT","DELETE"]),ye="GET",fe=(e,t)=>{const{method:i=ye}=e;return ve.has(i.toUpperCase())&&(e={...e,headers:{"Content-Type":"application/json",...e.headers,"X-HTTP-Method-Override":i},method:"POST"}),t(e)};function me(e,t){return re(e)[t]}function ge(e,t){return void 0!==me(e,t)}async function we(e,t=!1){try{if("function"!=typeof e.text)return await e.json();const i=await e.text();return t&&""===i?null:JSON.parse(i)}catch{throw{code:"invalid_json",message:V("The response is not a valid JSON response.")}}}async function Ie(e,t=!0){return t?204===e.status?null:await we(e,!0):e}async function _e(e,t=!0){if(!t)throw e;throw await we(e)}var be=(e,t)=>{if(!function(e){const t=!!e.method&&"POST"===e.method;return(!!e.path&&-1!==e.path.indexOf("/wp/v2/media")||!!e.url&&-1!==e.url.indexOf("/wp/v2/media"))&&t}(e))return t(e);let i=0;const r=e=>(i++,t({path:`/wp/v2/media/${e}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>i<5?r(e):(t({path:`/wp/v2/media/${e}?force=true`,method:"DELETE"}),Promise.reject())));return t({...e,parse:!1}).catch(t=>{if(!(t instanceof globalThis.Response))return Promise.reject(t);const i=t.headers.get("x-wp-upload-attachment-id");return t.status>=500&&t.status<600&&i?r(i).catch(()=>!1!==e.parse?Promise.reject({code:"post_process",message:V("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(t)):_e(t,e.parse)}).then(t=>Ie(t,e.parse))};function Oe(e,...t){const i=e.replace(/^[^#]*/,""),r=(e=e.replace(/#.*/,"")).indexOf("?");if(-1===r)return e+i;const s=re(e),n=e.substr(0,r);t.forEach(e=>delete s[e]);const a=se(s);return(a?n+"?"+a:n)+i}var xe=e=>(t,i)=>{if("string"==typeof t.url){const i=me(t.url,"wp_theme_preview");void 0===i?t.url=ne(t.url,{wp_theme_preview:e}):""===i&&(t.url=Oe(t.url,"wp_theme_preview"))}if("string"==typeof t.path){const i=me(t.path,"wp_theme_preview");void 0===i?t.path=ne(t.path,{wp_theme_preview:e}):""===i&&(t.path=Oe(t.path,"wp_theme_preview"))}return i(t)},Se={Accept:"application/json, */*;q=0.1"},Pe={credentials:"include"},Ee=[(e,t)=>("string"!=typeof e.url||ge(e.url,"_locale")||(e.url=ne(e.url,{_locale:"user"})),"string"!=typeof e.path||ge(e.path,"_locale")||(e.path=ne(e.path,{_locale:"user"})),t(e)),Z,fe,he];var ke=e=>{const{url:t,path:i,data:r,parse:s=!0,...n}=e;let{body:a,headers:o}=e;o={...Se,...o},r&&(a=JSON.stringify(r),o["Content-Type"]="application/json");return globalThis.fetch(t||i||window.location.href,{...Pe,...n,body:a,headers:o}).then(e=>e.ok?Ie(e,s):_e(e,s),e=>{if(e&&"AbortError"===e.name)throw e;if(!globalThis.navigator.onLine)throw{code:"offline_error",message:V("Unable to connect. Please check your Internet connection.")};throw{code:"fetch_error",message:V("Could not get a valid response from the server.")}})},Ae=ke;var Te=e=>Ee.reduceRight((e,t)=>i=>t(i,e),Ae)(e).catch(t=>"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):globalThis.fetch(Te.nonceEndpoint).then(e=>e.ok?e.text():Promise.reject(t)).then(t=>(Te.nonceMiddleware.nonce=t,Te(e))));Te.use=function(e){Ee.unshift(e)},Te.unregister=function(e){const t=Ee.indexOf(e);return-1!==t&&(Ee.splice(t,1),!0)},Te.setFetchHandler=function(e){Ae=e},Te.defaultFetchHandler=ke,Te.privateApis={},q(Te.privateApis,{enablePreloadMultiUse:function(){for(const e of Ee)e[ae]?.()},clearPreloadedData:function(){for(const e of Ee)e[oe]?.()}}),Te.createNonceMiddleware=Q,Te.createPreloadingMiddleware=de,Te.createRootURLMiddleware=ee,Te.fetchAllMiddleware=he,Te.httpV1Middleware=fe,Te.mediaUploadMiddleware=be,Te.createThemePreviewMiddleware=xe;var Fe=Te;const Le={id:null,post_id:null,transformations:null,beforeCallbacks:[],completeCallbacks:[],init(e){if(void 0!==cldData.editor)return Fe.use(Fe.createNonceMiddleware(cldData.editor.nonce)),this.callback=e,this},save(e){this.doBefore(e),Fe({path:cldData.editor.save_url,data:e,method:"POST"}).then(e=>{this.doComplete(e,this)})},doBefore(e){this.beforeCallbacks.forEach(t=>t(e,this))},doComplete(e){this.completeCallbacks.forEach(t=>t(e,this))},onBefore(e){this.beforeCallbacks.push(e)},onComplete(e){this.completeCallbacks.push(e)}},Ce=V("Select Image","cloudinary"),Be=V("Replace Image","cloudinary"),je={wrap:document.getElementById("cld-asset-edit"),isVideo:!1,preview:null,id:null,editor:null,base:null,publicId:null,size:null,currentURL:null,transformationsInput:document.getElementById("edit_asset.edit_affects.transformations"),textOverlayColorInput:document.getElementById("edit_asset.edit_affects.text_overlay_color"),textOverlayFontFaceInput:document.getElementById("edit_asset.edit_affects.text_overlay_font_face"),textOverlayFontSizeInput:document.getElementById("edit_asset.edit_affects.text_overlay_font_size"),textOverlayTextInput:document.getElementById("edit_asset.edit_affects.text_overlay_text"),textOverlayPositionInput:document.getElementById("edit_asset.edit_affects.text_overlay_position"),textOverlayXOffsetInput:document.getElementById("edit_asset.edit_affects.text_overlay_x_offset"),textOverlayYOffsetInput:document.getElementById("edit_asset.edit_affects.text_overlay_y_offset"),imageOverlayImageIdInput:document.getElementById("edit_asset.edit_affects.image_overlay_image_id"),imageOverlayPublicIdInput:document.getElementById("edit_asset.edit_affects.image_overlay_public_id"),imageOverlaySizeInput:document.getElementById("edit_asset.edit_affects.image_overlay_size"),imageOverlayOpacityInput:document.getElementById("edit_asset.edit_affects.image_overlay_opacity"),imageOverlayPositionInput:document.getElementById("edit_asset.edit_affects.image_overlay_position"),imageOverlayXOffsetInput:document.getElementById("edit_asset.edit_affects.image_overlay_x_offset"),imageOverlayYOffsetInput:document.getElementById("edit_asset.edit_affects.image_overlay_y_offset"),saveButton:document.getElementById("cld-asset-edit-save"),saveTextOverlayButton:document.getElementById("cld-asset-save-text-overlay"),saveImageOverlayButton:document.getElementById("cld-asset-save-image-overlay"),removeTextOverlayButton:document.getElementById("cld-asset-remove-text-overlay"),removeImageOverlayButton:document.getElementById("cld-asset-remove-image-overlay"),textGrid:document.getElementById("edit-overlay-grid-text"),imageGrid:document.getElementById("edit-overlay-grid-image"),imagePreviewWrapper:document.getElementById("edit-overlay-select-image-preview"),assetPreviewTransformationString:document.getElementById("asset-preview-transformation-string"),assetPreviewSuccessMessage:document.getElementById("asset-preview-success-message"),imageSelect:document.getElementById("edit-overlay-select-image"),textOverlayMap:null,imageOverlayMap:null,init(){const e=JSON.parse(this.wrap.dataset.item);if(this.id=e.ID,this.base=e.base+e.size+"/",this.transformationsInput.value=e.transformations?e.transformations:"",!e?.file)return;this.isVideo="video"===e?.type,this.publicId=e.file,this.textOverlayMap=[{key:"text",input:this.textOverlayTextInput,defaultValue:"",event:"input"},{key:"color",input:this.textOverlayColorInput,defaultValue:"",event:"input"},{key:"fontFace",input:this.textOverlayFontFaceInput,defaultValue:"Arial",event:"input"},{key:"fontSize",input:this.textOverlayFontSizeInput,defaultValue:20,event:"input"},{key:"position",input:this.textOverlayPositionInput,defaultValue:"",event:"change"},{key:"xOffset",input:this.textOverlayXOffsetInput,defaultValue:0,event:"input"},{key:"yOffset",input:this.textOverlayYOffsetInput,defaultValue:0,event:"input"}],this.imageOverlayMap=[{key:"imageId",input:this.imageOverlayImageIdInput,defaultValue:"",event:"input"},{key:"publicId",input:this.imageOverlayPublicIdInput,defaultValue:"",event:"input"},{key:"size",input:this.imageOverlaySizeInput,defaultValue:100,event:"input"},{key:"opacity",input:this.imageOverlayOpacityInput,defaultValue:20,event:"input"},{key:"position",input:this.imageOverlayPositionInput,defaultValue:"",event:"change"},{key:"xOffset",input:this.imageOverlayXOffsetInput,defaultValue:0,event:"input"},{key:"yOffset",input:this.imageOverlayYOffsetInput,defaultValue:0,event:"input"}];const t=this.parseJsonOverlay(e.text_overlay),i=this.parseJsonOverlay(e.image_overlay);this.setOverlayInputs(this.textOverlayMap,t),this.setOverlayInputs(this.imageOverlayMap,i),this.initPreview(e),this.initEditor(),this.initGravityGrid("edit-overlay-grid-text",t),this.initGravityGrid("edit-overlay-grid-image",i),this.initImageSelect(),this.initRemoveOverlayButtons()},initPreview(e){this.isVideo?(this.preview=U.init(),this.wrap.appendChild(this.preview.createPreview(480,360)),this.preview.setPublicId(e?.data?.public_id),this.preview.setSrc(this.buildSrc(),!0)):(this.preview=N.init(),this.wrap.appendChild(this.preview.createPreview("100%","auto")),this.preview.setSrc(this.buildSrc(),!0)),this.transformationsInput.addEventListener("input",e=>{this.preview.setSrc(this.buildSrc())}),this.addOverlayEventListeners()},addOverlayEventListeners(){const e=()=>{const e=this.textOverlayTextInput?.value?.trim();e&&this.preview.setSrc(this.buildSrc())},t=()=>{const e=this.imageOverlayPublicIdInput?.value?.trim();e&&this.preview.setSrc(this.buildSrc())};this.textOverlayTextInput&&this.textOverlayTextInput.addEventListener("input",()=>{this.preview.setSrc(this.buildSrc())}),this.imageOverlayPublicIdInput&&this.imageOverlayPublicIdInput.addEventListener("input",()=>{this.preview.setSrc(this.buildSrc())});const i=this.textOverlayMap.filter(({key:e})=>"text"!==e),r=this.imageOverlayMap.filter(({key:e})=>"imageId"!==e);i.forEach(({input:t,event:i})=>{t&&(t===this.textOverlayColorInput?t.addEventListener(i,()=>{setTimeout(e,0)}):t.addEventListener(i,e))}),r.forEach(({input:e,event:i})=>{e&&e.addEventListener(i,t)})},initEditor(){this.editor=Le.init(),this.editor.onBefore(()=>this.preview.reset()),this.editor.onComplete(e=>{this.preview.setSrc(this.buildSrc(),!0),e.note?alert(e.note):(this.assetPreviewSuccessMessage.style.display="block",setTimeout(()=>{this.assetPreviewSuccessMessage.style.display="none"},2e3))}),this.saveButton.addEventListener("click",e=>{e.preventDefault(),this.editor.save({ID:this.id,transformations:this.transformationsInput.value})}),this.saveTextOverlayButton.addEventListener("click",e=>{e.preventDefault();const t=this.getOverlayData(this.textOverlayMap);t.transformation=this.buildTextOverlay(),this.editor.save({ID:this.id,textOverlay:t})}),this.saveImageOverlayButton.addEventListener("click",e=>{e.preventDefault();const t=this.getOverlayData(this.imageOverlayMap);t.transformation=this.buildImageOverlay(),this.editor.save({ID:this.id,imageOverlay:t})})},initGravityGrid(e,t){const i=document.getElementById(e);let r=[];if(!i||!i.dataset?.gridOptions)return;try{if(r=JSON.parse(i.dataset.gridOptions),r.length<1)return}catch(e){return}const s={"edit-overlay-grid-text":{positionInput:this.textOverlayPositionInput,contentInput:this.textOverlayTextInput},"edit-overlay-grid-image":{positionInput:this.imageOverlayPositionInput,contentInput:this.imageOverlayPublicIdInput}}[e];r.forEach(e=>{const r=document.createElement("div");r.className="edit-overlay-grid__cell",r.dataset.gravity=e,t&&t.position&&t.position===e&&r.classList.add("edit-overlay-grid__cell--selected"),r.addEventListener("click",()=>{if(i.querySelectorAll(".edit-overlay-grid__cell--selected").forEach(e=>e.classList.remove("edit-overlay-grid__cell--selected")),r.classList.add("edit-overlay-grid__cell--selected"),s){s.positionInput.value=e;const t=s.contentInput?.value?.trim();t&&this.preview.setSrc(this.buildSrc())}}),i.appendChild(r)})},updateImageSelectLabel(e){this.imageSelect&&(this.imageSelect.textContent=e)},initImageSelect(){this.imageSelect&&(this.imageSelect.addEventListener("click",e=>{e.preventDefault();const t=wp.media({title:Ce,button:{text:Ce},library:{type:"image"},multiple:!1});t.on("select",()=>{const e=t.state().get("selection").first().toJSON();e?.public_id?(this.imageOverlayImageIdInput.value=e.id,this.imageOverlayPublicIdInput.value=e.public_id,this.updateImageSelectLabel(Be),this.renderImageOverlay(e)):(this.imageOverlayImageIdInput.value="",this.imageOverlayPublicIdInput.value="",this.updateImageSelectLabel(Ce),this.renderImageOverlay({}),alert(V("Please select an image that is synced to Cloudinary.","cloudinary"))),this.preview.setSrc(this.buildSrc())}),t.open()}),this.imageOverlayPublicIdInput?.value?this.updateImageSelectLabel(Be):this.updateImageSelectLabel(Ce))},renderImageOverlay(e){if(this.imagePreviewWrapper&&this.imagePreviewWrapper.firstChild&&this.imagePreviewWrapper.removeChild(this.imagePreviewWrapper.firstChild),this.imagePreviewWrapper&&(e?.url||e?.source_url)){const t=document.createElement("img");t.src=e.url||e.source_url,t.alt=e.alt||"",this.imagePreviewWrapper.appendChild(t)}},initRemoveOverlayButtons(){this.removeTextOverlayButton&&this.removeTextOverlayButton.addEventListener("click",e=>{e.preventDefault(),this.clearTextOverlay()}),this.removeImageOverlayButton&&this.removeImageOverlayButton.addEventListener("click",e=>{e.preventDefault(),this.clearImageOverlay()})},clearTextOverlay(){this.textOverlayMap.forEach(({input:e,defaultValue:t})=>{e&&(e.value=t,e.dispatchEvent(new Event("change")))}),this.textGrid&&this.textGrid.querySelectorAll(".edit-overlay-grid__cell--selected").forEach(e=>e.classList.remove("edit-overlay-grid__cell--selected")),this.preview.setSrc(this.buildSrc())},clearImageOverlay(){this.imageOverlayMap.forEach(({input:e,defaultValue:t})=>{e&&(e.value=t,e.dispatchEvent(new Event("change")))}),this.imagePreviewWrapper&&this.imagePreviewWrapper.firstChild&&(this.imagePreviewWrapper.removeChild(this.imagePreviewWrapper.firstChild),this.updateImageSelectLabel(Ce)),this.imageGrid&&this.imageGrid.querySelectorAll(".edit-overlay-grid__cell--selected").forEach(e=>e.classList.remove("edit-overlay-grid__cell--selected")),this.preview.setSrc(this.buildSrc())},getFormattedPercentageValue(e){const t=e/100;return t%1==0?t.toFixed(1):t},buildPlacementQualifiers(e,t,i){const r=[];return e?.value&&r.push(`g_${e.value}`),t?.value&&r.push(`x_${t.value}`),i?.value&&r.push(`y_${i.value}`),r.length>0?","+r.join(","):""},buildImageOverlay(){const e=this.imageOverlayPublicIdInput.value.trim().replace(/\//g,":");if(!e)return"";let t=`l_${e}`;const i=[];this.imageOverlaySizeInput?.value&&i.push(`c_scale,w_${this.imageOverlaySizeInput.value}`),this.imageOverlayOpacityInput?.value&&i.push(`o_${this.imageOverlayOpacityInput.value}`),i.length>0&&(t+="/"+i.join("/"));return`${t}/c_limit,w_1.0,fl_relative/fl_layer_apply${this.buildPlacementQualifiers(this.imageOverlayPositionInput,this.imageOverlayXOffsetInput,this.imageOverlayYOffsetInput)}`},buildTextOverlay(){if(!this.textOverlayTextInput||!this.textOverlayTextInput.value.trim())return"";const e=this.textOverlayTextInput.value.trim();let t=`l_text:${this.textOverlayFontFaceInput?.value||"Arial"}_${this.textOverlayFontSizeInput?.value||"20"}:${encodeURIComponent(e)}`;if(this.textOverlayColorInput?.value){let e=this.textOverlayColorInput.value;if(e.startsWith("rgb")){const t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9]*\.?[0-9]+))?\)/);if(t){const i=parseInt(t[1]).toString(16).padStart(2,"0"),r=parseInt(t[2]).toString(16).padStart(2,"0"),s=parseInt(t[3]).toString(16).padStart(2,"0");if(void 0!==t[4]){const n=parseFloat(t[4]);e=i+r+s+Math.round(255*n).toString(16).padStart(2,"0")}else e=i+r+s}}else e=e.replace("#","");t=`co_rgb:${e},${t}`}return`${t}/c_limit,w_0.9,fl_relative/fl_layer_apply${this.buildPlacementQualifiers(this.textOverlayPositionInput,this.textOverlayXOffsetInput,this.textOverlayYOffsetInput)}`},buildSrc(){const e=this.transformationsInput.value,t=this.buildTextOverlay(),i=this.buildImageOverlay(),r=[this.base],s=[],n=(e,t,i=e,n=!0)=>{if(e){const a=e.replace(/\/$/,"");r.push(a);const o=n?"/":"";s.push(`${o}${i}`)}};e?n(e,"string-preview-transformations",`.../${e}`,!1):s.push('...'),n(t,"string-preview-text-overlay"),n(i,"string-preview-image-overlay"),n(this.publicId,"string-preview-public-id",this.publicId,!1);const a=r.join("/").replace(/([^:]\/)\/+/g,"$1");return this.assetPreviewTransformationString.innerHTML=s.join(""),this.assetPreviewTransformationString.href=a,this.isVideo?this.videoTransformations(e,i,t):a},videoTransformations(e,t,i){const r=[];return e&&r.push(e),i&&r.push(i),t&&r.push(t),r.join("/")},getOverlayData(e){const t={};return e.forEach(({key:e,input:i})=>{t[e]=i?.value||""}),t},parseJsonOverlay(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}return e},setOverlayInputs(e,t){e.forEach(({key:e,input:i,defaultValue:r})=>{i&&(i.value=t&&void 0!==t[e]?t[e]:r,i.dispatchEvent(new Event("change")),"color"===e&&i.value&&jQuery(this.textOverlayColorInput).iris({color:i.value}),"imageId"===e&&i.value&&this.fetchImageById(i.value).then(e=>{je.renderImageOverlay(e)}))})},fetchImageById:e=>fetch(`/wp-json/wp/v2/media/${e}`).then(e=>{if(!e.ok)throw new Error(V("Image not found","cloudinary"));return e.json()})};window.addEventListener("load",()=>je.init())})(); +(()=>{"use strict";var e,t,i,r;e={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},t=["(","?"],i={")":["("],":":["?","?:"]},r=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var s={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,i){if(e)throw t;return i}};function n(n){var a=function(s){for(var n,a,o,l,d=[],c=[];n=s.match(r);){for(a=n[0],(o=s.substr(0,n.index).trim())&&d.push(o);l=c.pop();){if(i[a]){if(i[a][0]===l){a=i[a][1]||a;break}}else if(t.indexOf(l)>=0||e[l]1===e?0:1},d=/^i18n\.(n?gettext|has_translation)(_|$)/;var c=function(e){return"string"!=typeof e||""===e?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var u=function(e){return"string"!=typeof e||""===e?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var p=function(e,t){return function(i,r,s,n=10){const a=e[t];if(!u(i))return;if(!c(r))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof n)return void console.error("If specified, the hook priority must be a number.");const o={callback:s,priority:n,namespace:r};if(a[i]){const e=a[i].handlers;let t;for(t=e.length;t>0&&!(n>=e[t-1].priority);t--);t===e.length?e[t]=o:e.splice(t,0,o),a.__current.forEach(e=>{e.name===i&&e.currentIndex>=t&&e.currentIndex++})}else a[i]={handlers:[o],runs:0};"hookAdded"!==i&&e.doAction("hookAdded",i,r,s,n)}};var h=function(e,t,i=!1){return function(r,s){const n=e[t];if(!u(r))return;if(!i&&!c(s))return;if(!n[r])return 0;let a=0;if(i)a=n[r].handlers.length,n[r]={runs:n[r].runs,handlers:[]};else{const e=n[r].handlers;for(let t=e.length-1;t>=0;t--)e[t].namespace===s&&(e.splice(t,1),a++,n.__current.forEach(e=>{e.name===r&&e.currentIndex>=t&&e.currentIndex--}))}return"hookRemoved"!==r&&e.doAction("hookRemoved",r,s),a}};var v=function(e,t){return function(i,r){const s=e[t];return void 0!==r?i in s&&s[i].handlers.some(e=>e.namespace===r):i in s}};var y=function(e,t,i,r){return function(s,...n){const a=e[t];a[s]||(a[s]={handlers:[],runs:0}),a[s].runs++;const o=a[s].handlers;if(!o||!o.length)return i?n[0]:void 0;const l={name:s,currentIndex:0};return(r?async function(){try{a.__current.add(l);let e=i?n[0]:void 0;for(;l.currentIndex0:Array.from(r.__current).some(e=>e.name===i)}};var g=function(e,t){return function(i){const r=e[t];if(u(i))return r[i]&&r[i].runs?r[i].runs:0}},w=class{actions;filters;addAction;addFilter;removeAction;removeFilter;hasAction;hasFilter;removeAllActions;removeAllFilters;doAction;doActionAsync;applyFilters;applyFiltersAsync;currentAction;currentFilter;doingAction;doingFilter;didAction;didFilter;constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=p(this,"actions"),this.addFilter=p(this,"filters"),this.removeAction=h(this,"actions"),this.removeFilter=h(this,"filters"),this.hasAction=v(this,"actions"),this.hasFilter=v(this,"filters"),this.removeAllActions=h(this,"actions",!0),this.removeAllFilters=h(this,"filters",!0),this.doAction=y(this,"actions",!1,!1),this.doActionAsync=y(this,"actions",!1,!0),this.applyFilters=y(this,"filters",!0,!1),this.applyFiltersAsync=y(this,"filters",!0,!0),this.currentAction=f(this,"actions"),this.currentFilter=f(this,"filters"),this.doingAction=m(this,"actions"),this.doingFilter=m(this,"filters"),this.didAction=g(this,"actions"),this.didFilter=g(this,"filters")}};var I=function(){return new w}(),{addAction:_,addFilter:b,removeAction:O,removeFilter:x,hasAction:S,hasFilter:P,removeAllActions:E,removeAllFilters:k,doAction:A,doActionAsync:T,applyFilters:F,applyFiltersAsync:L,currentAction:C,currentFilter:B,doingAction:j,doingFilter:$,didAction:M,didFilter:W,actions:z,filters:D}=I,R=((e,t,i)=>{const r=new o({}),s=new Set,n=()=>{s.forEach(e=>e())},a=(e,t="default")=>{r.data[t]={...r.data[t],...e},r.data[t][""]={...l,...r.data[t]?.[""]},delete r.pluralForms[t]},c=(e,t)=>{a(e,t),n()},u=(e="default",t,i,s,n)=>(r.data[e]||a(void 0,e),r.dcnpgettext(e,t,i,s,n)),p=e=>e||"default",h=(e,t,r)=>{let s=u(r,t,e);return i?(s=i.applyFilters("i18n.gettext_with_context",s,e,t,r),i.applyFilters("i18n.gettext_with_context_"+p(r),s,e,t,r)):s};if(e&&c(e,t),i){const e=e=>{d.test(e)&&n()};i.addAction("hookAdded","core/i18n",e),i.addAction("hookRemoved","core/i18n",e)}return{getLocaleData:(e="default")=>r.data[e],setLocaleData:c,addLocaleData:(e,t="default")=>{r.data[t]={...r.data[t],...e,"":{...l,...r.data[t]?.[""],...e?.[""]}},delete r.pluralForms[t],n()},resetLocaleData:(e,t)=>{r.data={},r.pluralForms={},c(e,t)},subscribe:e=>(s.add(e),()=>s.delete(e)),__:(e,t)=>{let r=u(t,void 0,e);return i?(r=i.applyFilters("i18n.gettext",r,e,t),i.applyFilters("i18n.gettext_"+p(t),r,e,t)):r},_x:h,_n:(e,t,r,s)=>{let n=u(s,void 0,e,t,r);return i?(n=i.applyFilters("i18n.ngettext",n,e,t,r,s),i.applyFilters("i18n.ngettext_"+p(s),n,e,t,r,s)):n},_nx:(e,t,r,s,n)=>{let a=u(n,s,e,t,r);return i?(a=i.applyFilters("i18n.ngettext_with_context",a,e,t,r,s,n),i.applyFilters("i18n.ngettext_with_context_"+p(n),a,e,t,r,s,n)):a},isRTL:()=>"rtl"===h("ltr","text direction"),hasTranslation:(e,t,s)=>{const n=t?t+""+e:e;let a=!!r.data?.[s??"default"]?.[n];return i&&(a=i.applyFilters("i18n.has_translation",a,e,t,s),a=i.applyFilters("i18n.has_translation_"+p(s),a,e,t,s)),a}}})(void 0,void 0,I),V=(R.getLocaleData.bind(R),R.setLocaleData.bind(R),R.resetLocaleData.bind(R),R.subscribe.bind(R),R.__.bind(R));R._x.bind(R),R._n.bind(R),R._nx.bind(R),R.isRTL.bind(R),R.hasTranslation.bind(R);const N={preview:null,wrap:null,apply:null,url:null,defaultWidth:null,defaultHeight:null,maxSize:null,init(){return this},createPreview(e=400,t=300){return this.maxSize=e>t?e:t,this.defaultWidth=e,this.defaultHeight=t,this.wrap=document.createElement("div"),this.apply=document.createElement("button"),this.preview=document.createElement("img"),this.apply.type="button",this.apply.classList.add("button-primary"),this.apply.innerText=V("Preview","cloudinary"),this.preview.style.transition="opacity 1s",this.preview.style.opacity=1,this.preview.style.maxWidth="100%",this.preview.style.maxHeight="100%",this.reset(),this.wrap.style.minHeight="200px",this.wrap.style.width=this.maxSize+"px",this.wrap.style.position="relative",this.wrap.style.display="flex",this.wrap.style.alignItems="center",this.wrap.style.justifyContent="center",this.apply.style.position="absolute",this.apply.style.display="none",this.wrap.appendChild(this.preview),this.wrap.appendChild(this.apply),this.preview.addEventListener("load",e=>{this.preview.style.opacity=1,this.wrap.style.width="",this.wrap.style.height="",this.defaultHeight=this.preview.height,this.defaultWidth=this.preview.width,this.defaultHeight>this.defaultWidth?this.wrap.style.height=this.maxSize+"px":this.wrap.style.width=this.maxSize+"px"}),this.preview.addEventListener("error",e=>{this.preview.src=this.getNoURL("⚠")}),this.apply.addEventListener("click",()=>{this.apply.style.display="none",this.reset(),this.preview.style.opacity=.6,this.preview.src=this.url}),this.wrap},reset(){this.preview.src=this.getNoURL()},setSrc(e,t=!1){this.preview.style.opacity=.6,t?(this.apply.style.display="none",this.preview.src=e):(this.apply.style.display="block",this.url=e)},getNoURL(e="︎"){const t=this.defaultWidth/2-23,i=this.defaultHeight/2+25;return`data:image/svg+xml;utf8,${e}`}},U={preview:null,wrap:null,apply:null,url:null,publicId:null,player:null,defaultWidth:null,defaultHeight:null,maxSize:null,init(){return this},createPreview(e=427,t=240){return this.maxSize=e>t?e:t,this.defaultWidth=e,this.defaultHeight=t,this.wrap=document.createElement("div"),this.apply=document.createElement("button"),this.preview=document.createElement("video"),this.apply.type="button",this.apply.classList.add("button-primary"),this.apply.innerText=V("Preview","cloudinary"),this.preview.id="cld-asset-video-preview",this.preview.style.transition="opacity 1s",this.preview.style.opacity=1,this.preview.style.maxWidth="100%",this.preview.style.maxHeight="100%",this.preview.controls=!0,this.preview.setAttribute("width",e),this.preview.setAttribute("height",t),this.wrap.style.minHeight="200px",this.wrap.style.width=this.maxSize+"px",this.wrap.style.position="relative",this.wrap.style.display="flex",this.wrap.style.alignItems="center",this.wrap.style.justifyContent="center",this.apply.style.position="absolute",this.apply.style.display="none",this.wrap.appendChild(this.preview),this.wrap.appendChild(this.apply),this.apply.addEventListener("click",()=>{this.apply.style.display="none",this.preview.style.opacity=.6,this.updatePlayer(this.url)}),this.wrap},setPublicId(e){this.publicId=e,this.initPlayer()},initPlayer(){void 0!==window.cloudinary&&void 0!==window.cld?this.player||(this.player=window.cld.videoPlayer(this.preview.id,{fluid:!0,controls:!0})):console.error("Cloudinary video player not loaded")},setSrc(e,t=!1){this.preview.style.opacity=.6,t?(this.apply.style.display="none",this.player||this.initPlayer(),this.updatePlayer(e)):(this.apply.style.display="block",this.url=e)},updatePlayer(e){if(!this.player)return;const t={publicId:this.publicId};e&&""!==e.trim()&&(t.transformation={raw_transformation:e}),this.player.source(t),this.preview.style.opacity=1},reset(e){this.setSrc(e,!1)}};var H=["@wordpress/admin-ui","@wordpress/api-fetch","@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/boot","@wordpress/commands","@wordpress/compose","@wordpress/connectors","@wordpress/workflows","@wordpress/components","@wordpress/core-actions","@wordpress/core-commands","@wordpress/core-data","@wordpress/core-fields","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/font-list-route","@wordpress/format-library","@wordpress/notices","@wordpress/patterns","@wordpress/preferences","@wordpress/rich-text","@wordpress/route","@wordpress/router","@wordpress/routes","@wordpress/storybook","@wordpress/theme","@wordpress/dataviews","@wordpress/sync","@wordpress/fields","@wordpress/lazy-editor","@wordpress/media-editor","@wordpress/media-utils","@wordpress/upload-media","@wordpress/global-styles-engine","@wordpress/global-styles-ui","@wordpress/ui","@wordpress/views","@wordpress/widget-dashboard"];function G(e,t){if(!e)throw new Error("Cannot lock an undefined object.");const i=e;Y in i||(i[Y]={}),X.set(i[Y],t)}function J(e){if(!e)throw new Error("Cannot unlock an undefined object.");const t=e;if(!(Y in t))throw new Error("Cannot unlock an object that was not locked before. ");return X.get(t[Y])}var X=new WeakMap,Y=Symbol("Private API ID");var{lock:q,unlock:K}=((e,t)=>{if(!H.includes(t))throw new Error(`You tried to opt-in to unstable APIs as module "${t}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress."!==e)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return{lock:G,unlock:J}})("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/api-fetch");var Q=function(e){const t=(e,i)=>{const{headers:r={}}=e;for(const s in r)if("x-wp-nonce"===s.toLowerCase()&&r[s]===t.nonce)return i(e);return i({...e,headers:{...r,"X-WP-Nonce":t.nonce}})};return t.nonce=e,t},Z=(e,t)=>{let i,r,s=e.path;return"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(i=e.namespace.replace(/^\/|\/$/g,""),r=e.endpoint.replace(/^\//,""),s=r?i+"/"+r:i),delete e.namespace,delete e.endpoint,t({...e,path:s})},ee=e=>(t,i)=>Z(t,t=>{let r,s=t.url,n=t.path;return"string"==typeof n&&(r=e,-1!==e.indexOf("?")&&(n=n.replace("?","&")),n=n.replace(/^\//,""),"string"==typeof r&&-1!==r.indexOf("?")&&(n=n.replace("?","&")),s=r+n),i({...t,url:s})});function te(e){try{return decodeURIComponent(e)}catch{return e}}function ie(e){const t=e.indexOf("?");if(-1===t)return e;const i=e.slice(0,t),r=e.slice(t+1);return r?i+"?"+r.split("&").map(e=>e.split("=")).map(e=>e.map(te)).sort((e,t)=>e[0].localeCompare(t[0])).map(e=>e.map(encodeURIComponent)).map(e=>e.join("=")).join("&"):i}function re(e){return(function(e){let t;try{t=new URL(e,"http://example.com").search.substring(1)}catch{}if(t)return t}(e)||"").replace(/\+/g,"%20").split("&").reduce((e,t)=>{const i=t.indexOf("="),r=-1!==i,s=te(r?t.slice(0,i):t);if(s){const n=r?te(t.slice(i+1)):"";!function(e,t,i){const r=t.length,s=r-1;for(let n=0;n{"link"===t.toLowerCase()&&(e.headers[t]=i.replace(/<([^>]+)>/,(e,t)=>`<${encodeURI(t)}>`))}),Promise.resolve(t?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}}var de=function(e){const{OPTIONS:t={},...i}=Object.fromEntries(Object.entries(e).map(([e,t])=>[ie(e),t])),r=new Set(Object.keys(i)),s=new Set(Object.keys(t));let n=!1;const a=(e,a)=>{const{parse:o=!0}=e;let l=e.path;if(!l&&e.url){const{rest_route:t,...i}=re(e.url);"string"==typeof t&&(l=ne(t,i))}if("string"!=typeof l)return a(e);const d=e.method||"GET",c=ie(l);if("GET"===d&&i[c]){const e=i[c];return n||delete i[c],r.delete(c),le(e,!!o)}if("OPTIONS"===d&&t[c]){const e=t[c];return n||delete t[c],s.delete(c),le(e,!!o)}return a(e)};return a[ae]=()=>{n=!0},a[oe]=()=>{const e=[...Array.from(r,e=>`GET ${e}`),...Array.from(s,e=>`OPTIONS ${e}`)];e.length?console.warn("[api-fetch][preload] Some preloads were never consumed:",e):console.log("[api-fetch][preload] All preloads consumed."),r.clear(),s.clear();for(const e of Object.keys(i))delete i[e];for(const e of Object.keys(t))delete t[e]},a},ce=({path:e,url:t,...i},r)=>({...i,url:t&&ne(t,r),path:e&&ne(e,r)}),ue=e=>e.json?e.json():Promise.reject(e),pe=e=>{const{next:t}=(e=>{if(!e)return{};const t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}})(e.headers.get("link"));return t},he=async(e,t)=>{if(!1===e.parse)return t(e);if(!(e=>{const t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),i=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||i})(e))return t(e);const i=await Fe({...ce(e,{per_page:100}),parse:!1}),r=await ue(i);if(!Array.isArray(r))return r;let s=pe(i);if(!s)return r;let n=[].concat(r);for(;s;){const t=await Fe({...e,path:void 0,url:s,parse:!1}),i=await ue(t);n=n.concat(i),s=pe(t)}return n},ve=new Set(["PATCH","PUT","DELETE"]),ye="GET",fe=(e,t)=>{const{method:i=ye}=e;return ve.has(i.toUpperCase())&&(e={...e,headers:{"Content-Type":"application/json",...e.headers,"X-HTTP-Method-Override":i},method:"POST"}),t(e)};function me(e,t){return re(e)[t]}function ge(e,t){return void 0!==me(e,t)}async function we(e,t=!1){try{if("function"!=typeof e.text)return await e.json();const i=await e.text();return t&&""===i?null:JSON.parse(i)}catch{throw{code:"invalid_json",message:V("The response is not a valid JSON response."),data:{status:e.status}}}}async function Ie(e,t=!0){return t?204===e.status?null:await we(e,!0):e}async function _e(e,t=!0){if(!t)throw e;const i=await we(e);if(i&&"object"==typeof i&&!Array.isArray(i)&&void 0===i.data)throw{...i,data:{status:e.status}};throw i}var be=(e,t)=>{if(!function(e){const t=!!e.method&&"POST"===e.method;return(!!e.path&&-1!==e.path.indexOf("/wp/v2/media")||!!e.url&&-1!==e.url.indexOf("/wp/v2/media"))&&t}(e))return t(e);let i=0;const r=e=>(i++,t({path:`/wp/v2/media/${e}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>i<5?r(e):(t({path:`/wp/v2/media/${e}?force=true`,method:"DELETE"}),Promise.reject())));return t({...e,parse:!1}).catch(t=>{if(!(t instanceof globalThis.Response))return Promise.reject(t);const i=t.headers.get("x-wp-upload-attachment-id");return t.status>=500&&t.status<600&&i?r(i).catch(()=>!1!==e.parse?Promise.reject({code:"post_process",message:V("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(t)):_e(t,e.parse)}).then(t=>Ie(t,e.parse))};function Oe(e,...t){const i=e.replace(/^[^#]*/,""),r=(e=e.replace(/#.*/,"")).indexOf("?");if(-1===r)return e+i;const s=re(e),n=e.substr(0,r);t.forEach(e=>delete s[e]);const a=se(s);return(a?n+"?"+a:n)+i}var xe=e=>(t,i)=>{if("string"==typeof t.url){const i=me(t.url,"wp_theme_preview");void 0===i?t.url=ne(t.url,{wp_theme_preview:e}):""===i&&(t.url=Oe(t.url,"wp_theme_preview"))}if("string"==typeof t.path){const i=me(t.path,"wp_theme_preview");void 0===i?t.path=ne(t.path,{wp_theme_preview:e}):""===i&&(t.path=Oe(t.path,"wp_theme_preview"))}return i(t)},Se={Accept:"application/json, */*;q=0.1"},Pe={credentials:"include"},Ee=[(e,t)=>("string"!=typeof e.url||ge(e.url,"_locale")||(e.url=ne(e.url,{_locale:"user"})),"string"!=typeof e.path||ge(e.path,"_locale")||(e.path=ne(e.path,{_locale:"user"})),t(e)),Z,fe,he];var ke=e=>{const{url:t,path:i,data:r,parse:s=!0,...n}=e;let{body:a,headers:o}=e;o={...Se,...o},r&&(a=JSON.stringify(r),o["Content-Type"]="application/json");return globalThis.fetch(t||i||window.location.href,{...Pe,...n,body:a,headers:o}).then(e=>e.ok?Ie(e,s):_e(e,s),e=>{if(e&&"AbortError"===e.name)throw e;if(!globalThis.navigator.onLine)throw{code:"offline_error",message:V("Unable to connect. Please check your Internet connection.")};throw{code:"fetch_error",message:V("Could not get a valid response from the server.")}})},Ae=ke;var Te=e=>Ee.reduceRight((e,t)=>i=>t(i,e),Ae)(e).catch(t=>"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):globalThis.fetch(Te.nonceEndpoint).then(e=>e.ok?e.text():Promise.reject(t)).then(t=>(Te.nonceMiddleware.nonce=t,Te(e))));Te.use=function(e){Ee.unshift(e)},Te.unregister=function(e){const t=Ee.indexOf(e);return-1!==t&&(Ee.splice(t,1),!0)},Te.setFetchHandler=function(e){Ae=e},Te.defaultFetchHandler=ke,Te.privateApis={},q(Te.privateApis,{enablePreloadMultiUse:function(){for(const e of Ee)e[ae]?.()},clearPreloadedData:function(){for(const e of Ee)e[oe]?.()}}),Te.createNonceMiddleware=Q,Te.createPreloadingMiddleware=de,Te.createRootURLMiddleware=ee,Te.fetchAllMiddleware=he,Te.httpV1Middleware=fe,Te.mediaUploadMiddleware=be,Te.createThemePreviewMiddleware=xe;var Fe=Te;const Le={id:null,post_id:null,transformations:null,beforeCallbacks:[],completeCallbacks:[],init(e){if(void 0!==cldData.editor)return Fe.use(Fe.createNonceMiddleware(cldData.editor.nonce)),this.callback=e,this},save(e){this.doBefore(e),Fe({path:cldData.editor.save_url,data:e,method:"POST"}).then(e=>{this.doComplete(e,this)})},doBefore(e){this.beforeCallbacks.forEach(t=>t(e,this))},doComplete(e){this.completeCallbacks.forEach(t=>t(e,this))},onBefore(e){this.beforeCallbacks.push(e)},onComplete(e){this.completeCallbacks.push(e)}},Ce=V("Select Image","cloudinary"),Be=V("Replace Image","cloudinary"),je={wrap:document.getElementById("cld-asset-edit"),isVideo:!1,preview:null,id:null,editor:null,base:null,publicId:null,size:null,currentURL:null,transformationsInput:document.getElementById("edit_asset.edit_affects.transformations"),textOverlayColorInput:document.getElementById("edit_asset.edit_affects.text_overlay_color"),textOverlayFontFaceInput:document.getElementById("edit_asset.edit_affects.text_overlay_font_face"),textOverlayFontSizeInput:document.getElementById("edit_asset.edit_affects.text_overlay_font_size"),textOverlayTextInput:document.getElementById("edit_asset.edit_affects.text_overlay_text"),textOverlayPositionInput:document.getElementById("edit_asset.edit_affects.text_overlay_position"),textOverlayXOffsetInput:document.getElementById("edit_asset.edit_affects.text_overlay_x_offset"),textOverlayYOffsetInput:document.getElementById("edit_asset.edit_affects.text_overlay_y_offset"),imageOverlayImageIdInput:document.getElementById("edit_asset.edit_affects.image_overlay_image_id"),imageOverlayPublicIdInput:document.getElementById("edit_asset.edit_affects.image_overlay_public_id"),imageOverlaySizeInput:document.getElementById("edit_asset.edit_affects.image_overlay_size"),imageOverlayOpacityInput:document.getElementById("edit_asset.edit_affects.image_overlay_opacity"),imageOverlayPositionInput:document.getElementById("edit_asset.edit_affects.image_overlay_position"),imageOverlayXOffsetInput:document.getElementById("edit_asset.edit_affects.image_overlay_x_offset"),imageOverlayYOffsetInput:document.getElementById("edit_asset.edit_affects.image_overlay_y_offset"),saveButton:document.getElementById("cld-asset-edit-save"),saveTextOverlayButton:document.getElementById("cld-asset-save-text-overlay"),saveImageOverlayButton:document.getElementById("cld-asset-save-image-overlay"),removeTextOverlayButton:document.getElementById("cld-asset-remove-text-overlay"),removeImageOverlayButton:document.getElementById("cld-asset-remove-image-overlay"),textGrid:document.getElementById("edit-overlay-grid-text"),imageGrid:document.getElementById("edit-overlay-grid-image"),imagePreviewWrapper:document.getElementById("edit-overlay-select-image-preview"),assetPreviewTransformationString:document.getElementById("asset-preview-transformation-string"),assetPreviewSuccessMessage:document.getElementById("asset-preview-success-message"),imageSelect:document.getElementById("edit-overlay-select-image"),textOverlayMap:null,imageOverlayMap:null,init(){const e=JSON.parse(this.wrap.dataset.item);if(this.id=e.ID,this.base=e.base+e.size+"/",this.transformationsInput.value=e.transformations?e.transformations:"",!e?.file)return;this.isVideo="video"===e?.type,this.publicId=e.file,this.textOverlayMap=[{key:"text",input:this.textOverlayTextInput,defaultValue:"",event:"input"},{key:"color",input:this.textOverlayColorInput,defaultValue:"",event:"input"},{key:"fontFace",input:this.textOverlayFontFaceInput,defaultValue:"Arial",event:"input"},{key:"fontSize",input:this.textOverlayFontSizeInput,defaultValue:20,event:"input"},{key:"position",input:this.textOverlayPositionInput,defaultValue:"",event:"change"},{key:"xOffset",input:this.textOverlayXOffsetInput,defaultValue:0,event:"input"},{key:"yOffset",input:this.textOverlayYOffsetInput,defaultValue:0,event:"input"}],this.imageOverlayMap=[{key:"imageId",input:this.imageOverlayImageIdInput,defaultValue:"",event:"input"},{key:"publicId",input:this.imageOverlayPublicIdInput,defaultValue:"",event:"input"},{key:"size",input:this.imageOverlaySizeInput,defaultValue:100,event:"input"},{key:"opacity",input:this.imageOverlayOpacityInput,defaultValue:20,event:"input"},{key:"position",input:this.imageOverlayPositionInput,defaultValue:"",event:"change"},{key:"xOffset",input:this.imageOverlayXOffsetInput,defaultValue:0,event:"input"},{key:"yOffset",input:this.imageOverlayYOffsetInput,defaultValue:0,event:"input"}];const t=this.parseJsonOverlay(e.text_overlay),i=this.parseJsonOverlay(e.image_overlay);this.setOverlayInputs(this.textOverlayMap,t),this.setOverlayInputs(this.imageOverlayMap,i),this.initPreview(e),this.initEditor(),this.initGravityGrid("edit-overlay-grid-text",t),this.initGravityGrid("edit-overlay-grid-image",i),this.initImageSelect(),this.initRemoveOverlayButtons()},initPreview(e){this.isVideo?(this.preview=U.init(),this.wrap.appendChild(this.preview.createPreview(480,360)),this.preview.setPublicId(e?.data?.public_id),this.preview.setSrc(this.buildSrc(),!0)):(this.preview=N.init(),this.wrap.appendChild(this.preview.createPreview("100%","auto")),this.preview.setSrc(this.buildSrc(),!0)),this.transformationsInput.addEventListener("input",e=>{this.preview.setSrc(this.buildSrc())}),this.addOverlayEventListeners()},addOverlayEventListeners(){const e=()=>{const e=this.textOverlayTextInput?.value?.trim();e&&this.preview.setSrc(this.buildSrc())},t=()=>{const e=this.imageOverlayPublicIdInput?.value?.trim();e&&this.preview.setSrc(this.buildSrc())};this.textOverlayTextInput&&this.textOverlayTextInput.addEventListener("input",()=>{this.preview.setSrc(this.buildSrc())}),this.imageOverlayPublicIdInput&&this.imageOverlayPublicIdInput.addEventListener("input",()=>{this.preview.setSrc(this.buildSrc())});const i=this.textOverlayMap.filter(({key:e})=>"text"!==e),r=this.imageOverlayMap.filter(({key:e})=>"imageId"!==e);i.forEach(({input:t,event:i})=>{t&&(t===this.textOverlayColorInput?t.addEventListener(i,()=>{setTimeout(e,0)}):t.addEventListener(i,e))}),r.forEach(({input:e,event:i})=>{e&&e.addEventListener(i,t)})},initEditor(){this.editor=Le.init(),this.editor.onBefore(()=>this.preview.reset()),this.editor.onComplete(e=>{this.preview.setSrc(this.buildSrc(),!0),e.note?alert(e.note):(this.assetPreviewSuccessMessage.style.display="block",setTimeout(()=>{this.assetPreviewSuccessMessage.style.display="none"},2e3))}),this.saveButton.addEventListener("click",e=>{e.preventDefault(),this.editor.save({ID:this.id,transformations:this.transformationsInput.value})}),this.saveTextOverlayButton.addEventListener("click",e=>{e.preventDefault();const t=this.getOverlayData(this.textOverlayMap);t.transformation=this.buildTextOverlay(),this.editor.save({ID:this.id,textOverlay:t})}),this.saveImageOverlayButton.addEventListener("click",e=>{e.preventDefault();const t=this.getOverlayData(this.imageOverlayMap);t.transformation=this.buildImageOverlay(),this.editor.save({ID:this.id,imageOverlay:t})})},initGravityGrid(e,t){const i=document.getElementById(e);let r=[];if(!i||!i.dataset?.gridOptions)return;try{if(r=JSON.parse(i.dataset.gridOptions),r.length<1)return}catch(e){return}const s={"edit-overlay-grid-text":{positionInput:this.textOverlayPositionInput,contentInput:this.textOverlayTextInput},"edit-overlay-grid-image":{positionInput:this.imageOverlayPositionInput,contentInput:this.imageOverlayPublicIdInput}}[e];r.forEach(e=>{const r=document.createElement("div");r.className="edit-overlay-grid__cell",r.dataset.gravity=e,t&&t.position&&t.position===e&&r.classList.add("edit-overlay-grid__cell--selected"),r.addEventListener("click",()=>{if(i.querySelectorAll(".edit-overlay-grid__cell--selected").forEach(e=>e.classList.remove("edit-overlay-grid__cell--selected")),r.classList.add("edit-overlay-grid__cell--selected"),s){s.positionInput.value=e;const t=s.contentInput?.value?.trim();t&&this.preview.setSrc(this.buildSrc())}}),i.appendChild(r)})},updateImageSelectLabel(e){this.imageSelect&&(this.imageSelect.textContent=e)},initImageSelect(){this.imageSelect&&(this.imageSelect.addEventListener("click",e=>{e.preventDefault();const t=wp.media({title:Ce,button:{text:Ce},library:{type:"image"},multiple:!1});t.on("select",()=>{const e=t.state().get("selection").first().toJSON();e?.public_id?(this.imageOverlayImageIdInput.value=e.id,this.imageOverlayPublicIdInput.value=e.public_id,this.updateImageSelectLabel(Be),this.renderImageOverlay(e)):(this.imageOverlayImageIdInput.value="",this.imageOverlayPublicIdInput.value="",this.updateImageSelectLabel(Ce),this.renderImageOverlay({}),alert(V("Please select an image that is synced to Cloudinary.","cloudinary"))),this.preview.setSrc(this.buildSrc())}),t.open()}),this.imageOverlayPublicIdInput?.value?this.updateImageSelectLabel(Be):this.updateImageSelectLabel(Ce))},renderImageOverlay(e){if(this.imagePreviewWrapper&&this.imagePreviewWrapper.firstChild&&this.imagePreviewWrapper.removeChild(this.imagePreviewWrapper.firstChild),this.imagePreviewWrapper&&(e?.url||e?.source_url)){const t=document.createElement("img");t.src=e.url||e.source_url,t.alt=e.alt||"",this.imagePreviewWrapper.appendChild(t)}},initRemoveOverlayButtons(){this.removeTextOverlayButton&&this.removeTextOverlayButton.addEventListener("click",e=>{e.preventDefault(),this.clearTextOverlay()}),this.removeImageOverlayButton&&this.removeImageOverlayButton.addEventListener("click",e=>{e.preventDefault(),this.clearImageOverlay()})},clearTextOverlay(){this.textOverlayMap.forEach(({input:e,defaultValue:t})=>{e&&(e.value=t,e.dispatchEvent(new Event("change")))}),this.textGrid&&this.textGrid.querySelectorAll(".edit-overlay-grid__cell--selected").forEach(e=>e.classList.remove("edit-overlay-grid__cell--selected")),this.preview.setSrc(this.buildSrc())},clearImageOverlay(){this.imageOverlayMap.forEach(({input:e,defaultValue:t})=>{e&&(e.value=t,e.dispatchEvent(new Event("change")))}),this.imagePreviewWrapper&&this.imagePreviewWrapper.firstChild&&(this.imagePreviewWrapper.removeChild(this.imagePreviewWrapper.firstChild),this.updateImageSelectLabel(Ce)),this.imageGrid&&this.imageGrid.querySelectorAll(".edit-overlay-grid__cell--selected").forEach(e=>e.classList.remove("edit-overlay-grid__cell--selected")),this.preview.setSrc(this.buildSrc())},getFormattedPercentageValue(e){const t=e/100;return t%1==0?t.toFixed(1):t},buildPlacementQualifiers(e,t,i){const r=[];return e?.value&&r.push(`g_${e.value}`),t?.value&&r.push(`x_${t.value}`),i?.value&&r.push(`y_${i.value}`),r.length>0?","+r.join(","):""},buildImageOverlay(){const e=this.imageOverlayPublicIdInput.value.trim().replace(/\//g,":");if(!e)return"";let t=`l_${e}`;const i=[];this.imageOverlaySizeInput?.value&&i.push(`c_scale,w_${this.imageOverlaySizeInput.value}`),this.imageOverlayOpacityInput?.value&&i.push(`o_${this.imageOverlayOpacityInput.value}`),i.length>0&&(t+="/"+i.join("/"));return`${t}/c_limit,w_1.0,fl_relative/fl_layer_apply${this.buildPlacementQualifiers(this.imageOverlayPositionInput,this.imageOverlayXOffsetInput,this.imageOverlayYOffsetInput)}`},buildTextOverlay(){if(!this.textOverlayTextInput||!this.textOverlayTextInput.value.trim())return"";const e=this.textOverlayTextInput.value.trim();let t=`l_text:${this.textOverlayFontFaceInput?.value||"Arial"}_${this.textOverlayFontSizeInput?.value||"20"}:${encodeURIComponent(e)}`;if(this.textOverlayColorInput?.value){let e=this.textOverlayColorInput.value;if(e.startsWith("rgb")){const t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9]*\.?[0-9]+))?\)/);if(t){const i=parseInt(t[1]).toString(16).padStart(2,"0"),r=parseInt(t[2]).toString(16).padStart(2,"0"),s=parseInt(t[3]).toString(16).padStart(2,"0");if(void 0!==t[4]){const n=parseFloat(t[4]);e=i+r+s+Math.round(255*n).toString(16).padStart(2,"0")}else e=i+r+s}}else e=e.replace("#","");t=`co_rgb:${e},${t}`}return`${t}/c_limit,w_0.9,fl_relative/fl_layer_apply${this.buildPlacementQualifiers(this.textOverlayPositionInput,this.textOverlayXOffsetInput,this.textOverlayYOffsetInput)}`},buildSrc(){const e=this.transformationsInput.value,t=this.buildTextOverlay(),i=this.buildImageOverlay(),r=[this.base],s=[],n=(e,t,i=e,n=!0)=>{if(e){const a=e.replace(/\/$/,"");r.push(a);const o=n?"/":"";s.push(`${o}${i}`)}};e?n(e,"string-preview-transformations",`.../${e}`,!1):s.push('...'),n(t,"string-preview-text-overlay"),n(i,"string-preview-image-overlay"),n(this.publicId,"string-preview-public-id",this.publicId,!1);const a=r.join("/").replace(/([^:]\/)\/+/g,"$1");return this.assetPreviewTransformationString.innerHTML=s.join(""),this.assetPreviewTransformationString.href=a,this.isVideo?this.videoTransformations(e,i,t):a},videoTransformations(e,t,i){const r=[];return e&&r.push(e),i&&r.push(i),t&&r.push(t),r.join("/")},getOverlayData(e){const t={};return e.forEach(({key:e,input:i})=>{t[e]=i?.value||""}),t},parseJsonOverlay(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}return e},setOverlayInputs(e,t){e.forEach(({key:e,input:i,defaultValue:r})=>{i&&(i.value=t&&void 0!==t[e]?t[e]:r,i.dispatchEvent(new Event("change")),"color"===e&&i.value&&jQuery(this.textOverlayColorInput).iris({color:i.value}),"imageId"===e&&i.value&&this.fetchImageById(i.value).then(e=>{je.renderImageOverlay(e)}))})},fetchImageById:e=>fetch(`/wp-json/wp/v2/media/${e}`).then(e=>{if(!e.ok)throw new Error(V("Image not found","cloudinary"));return e.json()})};window.addEventListener("load",()=>je.init())})(); //# sourceMappingURL=asset-edit.js.map \ No newline at end of file diff --git a/js/asset-manager.js b/js/asset-manager.js index 6b1c1dd12..87b84808a 100644 --- a/js/asset-manager.js +++ b/js/asset-manager.js @@ -1,2 +1,2 @@ -(()=>{var e={951(e,t){var n,r,s,i;i=function(){var e="BKMGTPEZY".split("");function t(e,t){return e&&e.toLowerCase()===t.toLowerCase()}return function(n,r){return n="number"==typeof n?n:0,(r=r||{}).fixed="number"==typeof r.fixed?r.fixed:2,r.spacer="string"==typeof r.spacer?r.spacer:" ",r.calculate=function(e){var s=t(e,"si")?["k","B"]:["K","iB"],i=t(e,"si")?1e3:1024,a=Math.log(n)/Math.log(i)|0,o=n/Math.pow(i,a),c=o.toFixed(r.fixed);return a-1<3&&!t(e,"si")&&t(e,"jedec")&&(s[1]="B"),{suffix:a?(s[0]+"MGTPEZY")[a-1]+s[1]:1==(0|c)?"Byte":"Bytes",magnitude:a,result:o,fixed:c,bits:{result:o/8,fixed:(o/8).toFixed(r.fixed)}}},r.to=function(r,s){var i=t(s,"si")?1e3:1024,a=e.indexOf("string"==typeof r?r[0].toUpperCase():"B"),o=n;if(-1===a||0===a)return o.toFixed(2);for(;a>0;a--)o/=i;return o.toFixed(2)},r.human=function(e){var t=r.calculate(e);return t.fixed+r.spacer+t.suffix},r}},e.exports?e.exports=i():(r=[],void 0===(s="function"==typeof(n=i)?n.apply(t,r):n)||(e.exports=s))}};const t={};function n(r){const s=t[r];if(void 0!==s)return s.exports;const i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.hasOwn(e,t),(()=>{"use strict";var e,t,r,s;e={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},t=["(","?"],r={")":["("],":":["?","?:"]},s=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var i={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,n){if(e)throw t;return n}};function a(n){var a=function(n){for(var i,a,o,c,l=[],d=[];i=n.match(s);){for(a=i[0],(o=n.substr(0,i.index).trim())&&l.push(o);c=d.pop();){if(r[a]){if(r[a][0]===c){a=r[a][1]||a;break}}else if(t.indexOf(c)>=0||e[c]1===e?0:1},d=/^i18n\.(n?gettext|has_translation)(_|$)/;var u=function(e){return"string"!=typeof e||""===e?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var h=function(e){return"string"!=typeof e||""===e?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var p=function(e,t){return function(n,r,s,i=10){const a=e[t];if(!h(n))return;if(!u(r))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof i)return void console.error("If specified, the hook priority must be a number.");const o={callback:s,priority:i,namespace:r};if(a[n]){const e=a[n].handlers;let t;for(t=e.length;t>0&&!(i>=e[t-1].priority);t--);t===e.length?e[t]=o:e.splice(t,0,o),a.__current.forEach(e=>{e.name===n&&e.currentIndex>=t&&e.currentIndex++})}else a[n]={handlers:[o],runs:0};"hookAdded"!==n&&e.doAction("hookAdded",n,r,s,i)}};var f=function(e,t,n=!1){return function(r,s){const i=e[t];if(!h(r))return;if(!n&&!u(s))return;if(!i[r])return 0;let a=0;if(n)a=i[r].handlers.length,i[r]={runs:i[r].runs,handlers:[]};else{const e=i[r].handlers;for(let t=e.length-1;t>=0;t--)e[t].namespace===s&&(e.splice(t,1),a++,i.__current.forEach(e=>{e.name===r&&e.currentIndex>=t&&e.currentIndex--}))}return"hookRemoved"!==r&&e.doAction("hookRemoved",r,s),a}};var m=function(e,t){return function(n,r){const s=e[t];return void 0!==r?n in s&&s[n].handlers.some(e=>e.namespace===r):n in s}};var g=function(e,t,n,r){return function(s,...i){const a=e[t];a[s]||(a[s]={handlers:[],runs:0}),a[s].runs++;const o=a[s].handlers;if(!o||!o.length)return n?i[0]:void 0;const c={name:s,currentIndex:0};return(r?async function(){try{a.__current.add(c);let e=n?i[0]:void 0;for(;c.currentIndex0:Array.from(r.__current).some(e=>e.name===n)}};var w=function(e,t){return function(n){const r=e[t];if(h(n))return r[n]&&r[n].runs?r[n].runs:0}},v=class{actions;filters;addAction;addFilter;removeAction;removeFilter;hasAction;hasFilter;removeAllActions;removeAllFilters;doAction;doActionAsync;applyFilters;applyFiltersAsync;currentAction;currentFilter;doingAction;doingFilter;didAction;didFilter;constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=p(this,"actions"),this.addFilter=p(this,"filters"),this.removeAction=f(this,"actions"),this.removeFilter=f(this,"filters"),this.hasAction=m(this,"actions"),this.hasFilter=m(this,"filters"),this.removeAllActions=f(this,"actions",!0),this.removeAllFilters=f(this,"filters",!0),this.doAction=g(this,"actions",!1,!1),this.doActionAsync=g(this,"actions",!1,!0),this.applyFilters=g(this,"filters",!0,!1),this.applyFiltersAsync=g(this,"filters",!0,!0),this.currentAction=_(this,"actions"),this.currentFilter=_(this,"filters"),this.doingAction=y(this,"actions"),this.doingFilter=y(this,"filters"),this.didAction=w(this,"actions"),this.didFilter=w(this,"filters")}};var b=function(){return new v}(),{addAction:x,addFilter:k,removeAction:E,removeFilter:A,hasAction:P,hasFilter:C,removeAllActions:S,removeAllFilters:T,doAction:O,doActionAsync:L,applyFilters:I,applyFiltersAsync:F,currentAction:D,currentFilter:N,doingAction:j,doingFilter:M,didAction:z,didFilter:R,actions:U,filters:B}=b,J=((e,t,n)=>{const r=new c({}),s=new Set,i=()=>{s.forEach(e=>e())},a=(e,t="default")=>{r.data[t]={...r.data[t],...e},r.data[t][""]={...l,...r.data[t]?.[""]},delete r.pluralForms[t]},o=(e,t)=>{a(e,t),i()},u=(e="default",t,n,s,i)=>(r.data[e]||a(void 0,e),r.dcnpgettext(e,t,n,s,i)),h=e=>e||"default",p=(e,t,r)=>{let s=u(r,t,e);return n?(s=n.applyFilters("i18n.gettext_with_context",s,e,t,r),n.applyFilters("i18n.gettext_with_context_"+h(r),s,e,t,r)):s};if(e&&o(e,t),n){const e=e=>{d.test(e)&&i()};n.addAction("hookAdded","core/i18n",e),n.addAction("hookRemoved","core/i18n",e)}return{getLocaleData:(e="default")=>r.data[e],setLocaleData:o,addLocaleData:(e,t="default")=>{r.data[t]={...r.data[t],...e,"":{...l,...r.data[t]?.[""],...e?.[""]}},delete r.pluralForms[t],i()},resetLocaleData:(e,t)=>{r.data={},r.pluralForms={},o(e,t)},subscribe:e=>(s.add(e),()=>s.delete(e)),__:(e,t)=>{let r=u(t,void 0,e);return n?(r=n.applyFilters("i18n.gettext",r,e,t),n.applyFilters("i18n.gettext_"+h(t),r,e,t)):r},_x:p,_n:(e,t,r,s)=>{let i=u(s,void 0,e,t,r);return n?(i=n.applyFilters("i18n.ngettext",i,e,t,r,s),n.applyFilters("i18n.ngettext_"+h(s),i,e,t,r,s)):i},_nx:(e,t,r,s,i)=>{let a=u(i,s,e,t,r);return n?(a=n.applyFilters("i18n.ngettext_with_context",a,e,t,r,s,i),n.applyFilters("i18n.ngettext_with_context_"+h(i),a,e,t,r,s,i)):a},isRTL:()=>"rtl"===p("ltr","text direction"),hasTranslation:(e,t,s)=>{const i=t?t+""+e:e;let a=!!r.data?.[s??"default"]?.[i];return n&&(a=n.applyFilters("i18n.has_translation",a,e,t,s),a=n.applyFilters("i18n.has_translation_"+h(s),a,e,t,s)),a}}})(void 0,void 0,b),$=(J.getLocaleData.bind(J),J.setLocaleData.bind(J),J.resetLocaleData.bind(J),J.subscribe.bind(J),J.__.bind(J)),H=(J._x.bind(J),J._n.bind(J),J._nx.bind(J),J.isRTL.bind(J),J.hasTranslation.bind(J),["@wordpress/admin-ui","@wordpress/api-fetch","@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/boot","@wordpress/commands","@wordpress/compose","@wordpress/connectors","@wordpress/workflows","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/font-list-route","@wordpress/format-library","@wordpress/patterns","@wordpress/preferences","@wordpress/rich-text","@wordpress/route","@wordpress/router","@wordpress/routes","@wordpress/storybook","@wordpress/sync","@wordpress/theme","@wordpress/dataviews","@wordpress/fields","@wordpress/lazy-editor","@wordpress/media-editor","@wordpress/media-utils","@wordpress/upload-media","@wordpress/global-styles-engine","@wordpress/global-styles-ui","@wordpress/ui","@wordpress/views","@wordpress/widget-dashboard"]);function W(e,t){if(!e)throw new Error("Cannot lock an undefined object.");const n=e;G in n||(n[G]={}),q.set(n[G],t)}function K(e){if(!e)throw new Error("Cannot unlock an undefined object.");const t=e;if(!(G in t))throw new Error("Cannot unlock an object that was not locked before. ");return q.get(t[G])}var q=new WeakMap,G=Symbol("Private API ID");var{lock:Z,unlock:Y}=((e,t)=>{if(!H.includes(t))throw new Error(`You tried to opt-in to unstable APIs as module "${t}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress."!==e)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return{lock:W,unlock:K}})("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/api-fetch");var X=function(e){const t=(e,n)=>{const{headers:r={}}=e;for(const s in r)if("x-wp-nonce"===s.toLowerCase()&&r[s]===t.nonce)return n(e);return n({...e,headers:{...r,"X-WP-Nonce":t.nonce}})};return t.nonce=e,t},V=(e,t)=>{let n,r,s=e.path;return"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(n=e.namespace.replace(/^\/|\/$/g,""),r=e.endpoint.replace(/^\//,""),s=r?n+"/"+r:n),delete e.namespace,delete e.endpoint,t({...e,path:s})},Q=e=>(t,n)=>V(t,t=>{let r,s=t.url,i=t.path;return"string"==typeof i&&(r=e,-1!==e.indexOf("?")&&(i=i.replace("?","&")),i=i.replace(/^\//,""),"string"==typeof r&&-1!==r.indexOf("?")&&(i=i.replace("?","&")),s=r+i),n({...t,url:s})});function ee(e){try{return decodeURIComponent(e)}catch{return e}}function te(e){const t=e.indexOf("?");if(-1===t)return e;const n=e.slice(0,t),r=e.slice(t+1);return r?n+"?"+r.split("&").map(e=>e.split("=")).map(e=>e.map(ee)).sort((e,t)=>e[0].localeCompare(t[0])).map(e=>e.map(encodeURIComponent)).map(e=>e.join("=")).join("&"):n}function ne(e){return(function(e){let t;try{t=new URL(e,"http://example.com").search.substring(1)}catch{}if(t)return t}(e)||"").replace(/\+/g,"%20").split("&").reduce((e,t)=>{const n=t.indexOf("="),r=-1!==n,s=ee(r?t.slice(0,n):t);if(s){const i=r?ee(t.slice(n+1)):"";!function(e,t,n){const r=t.length,s=r-1;for(let i=0;i{"link"===t.toLowerCase()&&(e.headers[t]=n.replace(/<([^>]+)>/,(e,t)=>`<${encodeURI(t)}>`))}),Promise.resolve(t?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}}var ce=function(e){const{OPTIONS:t={},...n}=Object.fromEntries(Object.entries(e).map(([e,t])=>[te(e),t])),r=new Set(Object.keys(n)),s=new Set(Object.keys(t));let i=!1;const a=(e,a)=>{const{parse:o=!0}=e;let c=e.path;if(!c&&e.url){const{rest_route:t,...n}=ne(e.url);"string"==typeof t&&(c=se(t,n))}if("string"!=typeof c)return a(e);const l=e.method||"GET",d=te(c);if("GET"===l&&n[d]){const e=n[d];return i||delete n[d],r.delete(d),oe(e,!!o)}if("OPTIONS"===l&&t[d]){const e=t[d];return i||delete t[d],s.delete(d),oe(e,!!o)}return a(e)};return a[ie]=()=>{i=!0},a[ae]=()=>{const e=[...Array.from(r,e=>`GET ${e}`),...Array.from(s,e=>`OPTIONS ${e}`)];e.length?console.warn("[api-fetch][preload] Some preloads were never consumed:",e):console.log("[api-fetch][preload] All preloads consumed."),r.clear(),s.clear();for(const e of Object.keys(n))delete n[e];for(const e of Object.keys(t))delete t[e]},a},le=({path:e,url:t,...n},r)=>({...n,url:t&&se(t,r),path:e&&se(e,r)}),de=e=>e.json?e.json():Promise.reject(e),ue=e=>{const{next:t}=(e=>{if(!e)return{};const t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}})(e.headers.get("link"));return t},he=async(e,t)=>{if(!1===e.parse)return t(e);if(!(e=>{const t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),n=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||n})(e))return t(e);const n=await Oe({...le(e,{per_page:100}),parse:!1}),r=await de(n);if(!Array.isArray(r))return r;let s=ue(n);if(!s)return r;let i=[].concat(r);for(;s;){const t=await Oe({...e,path:void 0,url:s,parse:!1}),n=await de(t);i=i.concat(n),s=ue(t)}return i},pe=new Set(["PATCH","PUT","DELETE"]),fe="GET",me=(e,t)=>{const{method:n=fe}=e;return pe.has(n.toUpperCase())&&(e={...e,headers:{"Content-Type":"application/json",...e.headers,"X-HTTP-Method-Override":n},method:"POST"}),t(e)};function ge(e,t){return ne(e)[t]}function _e(e,t){return void 0!==ge(e,t)}async function ye(e,t=!1){try{if("function"!=typeof e.text)return await e.json();const n=await e.text();return t&&""===n?null:JSON.parse(n)}catch{throw{code:"invalid_json",message:$("The response is not a valid JSON response.")}}}async function we(e,t=!0){return t?204===e.status?null:await ye(e,!0):e}async function ve(e,t=!0){if(!t)throw e;throw await ye(e)}var be=(e,t)=>{if(!function(e){const t=!!e.method&&"POST"===e.method;return(!!e.path&&-1!==e.path.indexOf("/wp/v2/media")||!!e.url&&-1!==e.url.indexOf("/wp/v2/media"))&&t}(e))return t(e);let n=0;const r=e=>(n++,t({path:`/wp/v2/media/${e}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>n<5?r(e):(t({path:`/wp/v2/media/${e}?force=true`,method:"DELETE"}),Promise.reject())));return t({...e,parse:!1}).catch(t=>{if(!(t instanceof globalThis.Response))return Promise.reject(t);const n=t.headers.get("x-wp-upload-attachment-id");return t.status>=500&&t.status<600&&n?r(n).catch(()=>!1!==e.parse?Promise.reject({code:"post_process",message:$("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(t)):ve(t,e.parse)}).then(t=>we(t,e.parse))};function xe(e,...t){const n=e.replace(/^[^#]*/,""),r=(e=e.replace(/#.*/,"")).indexOf("?");if(-1===r)return e+n;const s=ne(e),i=e.substr(0,r);t.forEach(e=>delete s[e]);const a=re(s);return(a?i+"?"+a:i)+n}var ke=e=>(t,n)=>{if("string"==typeof t.url){const n=ge(t.url,"wp_theme_preview");void 0===n?t.url=se(t.url,{wp_theme_preview:e}):""===n&&(t.url=xe(t.url,"wp_theme_preview"))}if("string"==typeof t.path){const n=ge(t.path,"wp_theme_preview");void 0===n?t.path=se(t.path,{wp_theme_preview:e}):""===n&&(t.path=xe(t.path,"wp_theme_preview"))}return n(t)},Ee={Accept:"application/json, */*;q=0.1"},Ae={credentials:"include"},Pe=[(e,t)=>("string"!=typeof e.url||_e(e.url,"_locale")||(e.url=se(e.url,{_locale:"user"})),"string"!=typeof e.path||_e(e.path,"_locale")||(e.path=se(e.path,{_locale:"user"})),t(e)),V,me,he];var Ce=e=>{const{url:t,path:n,data:r,parse:s=!0,...i}=e;let{body:a,headers:o}=e;o={...Ee,...o},r&&(a=JSON.stringify(r),o["Content-Type"]="application/json");return globalThis.fetch(t||n||window.location.href,{...Ae,...i,body:a,headers:o}).then(e=>e.ok?we(e,s):ve(e,s),e=>{if(e&&"AbortError"===e.name)throw e;if(!globalThis.navigator.onLine)throw{code:"offline_error",message:$("Unable to connect. Please check your Internet connection.")};throw{code:"fetch_error",message:$("Could not get a valid response from the server.")}})},Se=Ce;var Te=e=>Pe.reduceRight((e,t)=>n=>t(n,e),Se)(e).catch(t=>"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):globalThis.fetch(Te.nonceEndpoint).then(e=>e.ok?e.text():Promise.reject(t)).then(t=>(Te.nonceMiddleware.nonce=t,Te(e))));Te.use=function(e){Pe.unshift(e)},Te.unregister=function(e){const t=Pe.indexOf(e);return-1!==t&&(Pe.splice(t,1),!0)},Te.setFetchHandler=function(e){Se=e},Te.defaultFetchHandler=Ce,Te.privateApis={},Z(Te.privateApis,{enablePreloadMultiUse:function(){for(const e of Pe)e[ie]?.()},clearPreloadedData:function(){for(const e of Pe)e[ae]?.()}}),Te.createNonceMiddleware=X,Te.createPreloadingMiddleware=ce,Te.createRootURLMiddleware=Q,Te.fetchAllMiddleware=he,Te.httpV1Middleware=me,Te.mediaUploadMiddleware=be,Te.createThemePreviewMiddleware=ke;var Oe=Te,Le=n(951),Ie=n.n(Le);const Fe={controlled:null,bind(e){this.controlled=e,this.controlled.forEach(e=>{this._main(e)}),this._init()},_init(){this.controlled.forEach(e=>{this._checkUp(e)})},_main(e){const t=JSON.parse(e.dataset.main);e.dataset.size&&(e.filesize=parseInt(e.dataset.size,10)),e.mains=t.map(t=>{const n=document.getElementById(t),r=document.getElementById(t+"_size_wrapper");return r&&(n.filesize=0,n.sizespan=r),this._addChild(n,e),n}),this._bindEvents(e),e.mains.forEach(e=>{this._bindEvents(e)})},_bindEvents(e){e.eventBound||(e.addEventListener("click",t=>{const n=t.target;n.elements&&(this._checkDown(n),this._evaluateSize(n)),n.mains&&this._checkUp(e)}),e.eventBound=!0)},_addChild(e,t){const n=e.elements?e.elements:[];-1===n.indexOf(t)&&(n.push(t),e.elements=n)},_removeChild(e,t){const n=e.elements.indexOf(t);-1{t.checked!==e.checked&&(t.checked=e.checked,t.disabled&&(t.checked=!1),t.dispatchEvent(new Event("change")))}),e.elements.forEach(t=>{this._checkDown(t),t.elements||this._checkUp(t,e)}))},_checkUp(e,t){e.mains&&[...e.mains].forEach(e=>{e!==t&&this._evaluateCheckStatus(e),this._checkUp(e),this._evaluateSize(e)})},_evaluateCheckStatus(e){let t=0,n=e.classList.contains("partial");n&&(e.classList.remove("partial"),n=!1),e.elements.forEach(r=>{null!==r.parentNode?(t+=r.checked,r.classList.contains("partial")&&(n=!0)):this._removeChild(e,r)});let r="some";t===e.elements.length?r="on":0===t?r="off":n=!0,n&&e.classList.add("partial");const s="off"!==r;e.checked===s&&e.value===r||(e.value=r,e.checked=s,e.dispatchEvent(new Event("change")))},_evaluateSize(e){if(e.sizespan&&e.elements){e.filesize=0,e.elements.forEach(t=>{t.checked&&(e.filesize+=t.filesize)});let t=null;0this.sendStates(),2e3),localStorage.setItem(this.key,JSON.stringify(this.data)))},set(e,t){this.data[e]&&this.data[e]===t||(this.data[e]=t,this._update())},get(e){let t=null;return this.data[e]&&(t=this.data[e]),t},sendStates(){fetch(cldData.stateURL,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":cldData.stateNonce},body:JSON.stringify(this.data)}).then(e=>e.json()).then(e=>{e.success&&(this.previous=JSON.stringify(e.state),localStorage.removeItem(this.key))})}},Ne={cachePoints:{},spinners:{},states:null,init(e,t){if(this.states=t,"undefined"!=typeof CLDASSETS){Oe.use(Oe.createNonceMiddleware(CLDASSETS.nonce));e.querySelectorAll("[data-cache-point]").forEach(e=>this._bind(e));const t=document.getElementById("connect.cache.cld_purge_all");t&&(t.disabled="disabled",t.style.width="100px",t.style.transition="width 0.5s",t.addEventListener("click",()=>{t.dataset.purging||confirm(wp.i18n.__("Purge entire cache?","cloudinary"))&&this._purgeAll(t,!1)}),this._watchPurge(t),setInterval(()=>{this._watchPurge(t)},5e3))}},getCachePoint(e){return this.cachePoints["_"+e]?this.cachePoints["_"+e]:null},setCachePoint(e,t){const n=document.getElementById(t.dataset.slug),r=document.createElement("div"),s=this._getRow(),i=document.createElement("td");i.colSpan=2,i.className="cld-loading",s.appendChild(i);const a=document.getElementById(t.dataset.slug+"_search"),o=document.getElementById(t.dataset.slug+"_reload"),c=document.getElementById(t.dataset.browser),l=document.getElementById(t.dataset.apply);l.style.float="right",l.style.marginLeft="6px",c.addEventListener("change",t=>{this._handleManager(e)}),n.addEventListener("change",t=>{this._handleManager(e)}),window.addEventListener("CacheToggle",e=>{e.detail.cachePoint===t&&this._cacheChange(t,e.detail)}),l.addEventListener("click",e=>{this._applyChanges(t)}),o.addEventListener("click",t=>{this._load(e)}),a.addEventListener("keydown",t=>{13===t.which&&(t.preventDefault(),t.stopPropagation(),this._load(e))}),r.className="cld-pagenav",l.cacheChanges={disable:[],enable:[],delete:[]},t.main=n,t.search=a,t.controller=c,t.viewer=t.parentNode.parentNode,t.loader=s,t.table=t.parentNode,t.apply=l,t.paginate=r,t.currentPage=1,t.viewer.appendChild(r),this.cachePoints["_"+e]=t},close(e){e.classList.add("closed")},open(e){e.classList.remove("closed")},isOpen(e){const t=this.getCachePoint(e);let n=!1;return t&&(n=t.controller.checked&&t.main.checked),n},_bind(e){const t=e.dataset.cachePoint;this.setCachePoint(t,e),this._handleManager(t)},_handleManager(e){const t=this.getCachePoint(e);t&&(this.isOpen(e)?(this.open(t.viewer),this.states.set(t.viewer.id,"open"),t.loaded||this._load(e)):(this.close(t.viewer),t.controller.checked=!1,this.states.set(t.viewer.id,"close")))},_load(e){const t=this.getCachePoint(e);let n="100px";t.clientHeight&&(n=t.clientHeight-16+"px"),this._clearChildren(t),t.appendChild(t.loader),this.open(t.loader),t.loader.firstChild.style.height=n,Oe({path:CLDASSETS.fetch_url,data:{ID:e,page:t.currentPage,search:t.search.value},method:"POST"}).then(e=>{t.removeChild(t.loader),this._buildList(t,e.items),this._buildNav(t,e);const n=t.querySelectorAll("[data-main]");Fe.bind(n),t.loaded=!0})},_cacheChange(e,t){const n=t.checked?t.states.on:t.states.off,r=t.checked?t.states.off:t.states.on;this._removeFromList(e,t.item.ID,r)||this._addToList(e,t.item.ID,n),this._evaluateApply(e)},_evaluateApply(e){e.apply.disabled="disabled";const t=e.apply.cacheChanges;let n=!1;for(const e in t)t[e].length&&(n=!0);n&&(e.apply.disabled="")},_applyChanges(e){const t=e.apply.cacheChanges;e.apply.disabled="disabled";for(const n in t)t[n].length&&this._set_state(e,n,t[n])},_watchPurge(e){e.dataset.purging||e.dataset.updating||(e.dataset.updating=!0,Oe({path:CLDASSETS.purge_all,data:{count:!0},method:"POST"}).then(t=>{e.dataset.updating="",0t.percent?(e.disabled="",this._purgeAll(e,!0)):0{e.innerText=$("Purging cache","cloudinary")+" "+Math.round(t.percent,2)+"%",e.style.backgroundImage="linear-gradient(90deg, #2a0 "+t.percent+"%, #787878 "+t.percent+"%)",100>t.percent?this._purgeAction(e,!0,n):n?n():(e.innerText=wp.i18n.__("Purge complete.","cloudinary"),setTimeout(()=>{e.dataset.purging="",e.style.backgroundImage="",e.style.minHeight="",e.style.border="",e.style.width="100px",e.disabled="disabled",e.innerText=e.dataset.title},2e3))})},_set_state(e,t,n){this._showSpinners(n),Oe({path:CLDASSETS.update_url,data:{state:t,ids:n},method:"POST"}).then(n=>{this._hideSpinners(n),n.forEach(n=>{this._removeFromList(e,n,t),this._evaluateApply(e),e.apply.disabled="disabled"}),"delete"===t&&this._load(e.dataset.cachePoint)})},_showSpinners(e){e.forEach(e=>{this.spinners["spinner_"+e].style.visibility="visible"})},_hideSpinners(e){e.forEach(e=>{this.spinners["spinner_"+e].style.visibility="hidden"})},_removeFromList(e,t,n){const r=this._getListIndex(e,t,n);let s=!1;return-1e.apply.cacheChanges[n].indexOf(t),_noCache(e){const t=this._getNote(wp.i18n.__("No files cached.","cloudinary"));e.viewer.appendChild(t),this.close(e.table)},_clearChildren(e){for(;e.children.length;){const t=e.lastChild;t.children.length&&this._clearChildren(t),e.removeChild(t)}},_buildList(e,t){t.forEach(t=>{if(t.note)return void e.appendChild(this._getNote(t.note));const n=this._getRow(t.ID),r=this._getStateSwitch(e,t,{on:"enable",off:"disable"}),s=this._getFile(e,t,n),i=this._getEdit(t,e);n.appendChild(s),n.appendChild(i),n.appendChild(r),e.appendChild(n)})},_buildNav(e,t){e.paginate.innerHTML="";const n=document.createElement("button"),r=document.createElement("button");n.type="button",n.innerHTML="‹",n.className="button cld-pagenav-prev",1===t.current_page?n.disabled=!0:n.addEventListener("click",n=>{e.currentPage=t.current_page-1,this._load(e.dataset.cachePoint)}),r.type="button",r.innerHTML="›",r.className="button cld-pagenav-next",t.current_page===t.total_pages||0===t.total_pages?r.disabled=!0:r.addEventListener("click",n=>{e.currentPage=t.current_page+1,this._load(e.dataset.cachePoint)});const s=document.createElement("span");if(s.innerText=t.nav_text,s.className="cld-pagenav-text",e.paginate.appendChild(n),e.paginate.appendChild(s),e.paginate.appendChild(r),e.paginate.appendChild(e.apply),e.apply.classList.remove("closed"),e.apply.disabled="disabled",t.items.length){const t=document.createElement("button");t.type="button",t.className="button",t.innerText=wp.i18n.__("Purge cache point","cloudinary"),t.style.float="right",e.paginate.appendChild(t),t.addEventListener("click",n=>{if(confirm(wp.i18n.__("Purge entire cache point?","cloudinary"))){t.dataset.parent=e.dataset.cachePoint;const n=this;t.classList.add("button-primary"),this._purgeAll(t,!1,function(){n._load(e.dataset.cachePoint)})}})}},_getNote(e){const t=this._getRow(),n=document.createElement("td");return n.colSpan=2,n.innerText=e,t.appendChild(n),t},_getRow(e){const t=document.createElement("tr");return e&&(t.id="row_"+e),t},_getEdit(e){const t=document.createElement("td"),n=document.createElement("a");return n.href=e.edit_url,e.data.transformations?n.innerText=e.data.transformations:n.innerText=$("Add transformations","cloudinary"),t.appendChild(n),t},_getFile(e,t){const n=document.createElement("td"),r=document.createElement("label"),s=this._getDeleter(e,n,t);r.innerText=t.short_url,r.htmlFor=t.key,n.appendChild(s),n.appendChild(r);const i=document.createElement("span"),a="spinner_"+t.ID;return i.className="spinner",i.id=a,n.appendChild(i),this.spinners[a]=i,n},_getDeleter(e,t,n){const r=document.createElement("input"),s=[e.dataset.slug+"_deleter"],i=this._getListIndex(e,n.ID,"delete");return r.type="checkbox",r.value=n.ID,r.id=n.key,r.dataset.main=JSON.stringify(s),-1{t.style.opacity=1,t.style.textDecoration="",r.checked&&(t.style.opacity=.8,t.style.textDecoration="line-through");const i=new CustomEvent("CacheToggle",{detail:{checked:r.checked,states:{on:"delete",off:n.active?"enable":"disable"},item:n,cachePoint:e}});window.dispatchEvent(i)}),r},_getStateSwitch(e,t,n){const r=document.createElement("td"),s=document.createElement("label"),i=document.createElement("input"),a=document.createElement("span"),o=(e.dataset.slug,this._getListIndex(e,t.ID,"disable"));return r.style.textAlign="right",s.className="cld-input-on-off-control mini",i.type="checkbox",i.value=t.ID,i.checked=!(-1{const s=new CustomEvent("CacheToggle",{detail:{checked:i.checked,states:n,item:t,cachePoint:e}});window.dispatchEvent(s)}),r.appendChild(s),r}},je=document.getElementById("cloudinary-settings-page");je&&(De.init(),window.addEventListener("load",()=>Ne.init(je,De)))})()})(); +(()=>{var e={951(e,t){var n,r,s,i;i=function(){var e="BKMGTPEZY".split("");function t(e,t){return e&&e.toLowerCase()===t.toLowerCase()}return function(n,r){return n="number"==typeof n?n:0,(r=r||{}).fixed="number"==typeof r.fixed?r.fixed:2,r.spacer="string"==typeof r.spacer?r.spacer:" ",r.calculate=function(e){var s=t(e,"si")?["k","B"]:["K","iB"],i=t(e,"si")?1e3:1024,a=Math.log(n)/Math.log(i)|0,o=n/Math.pow(i,a),c=o.toFixed(r.fixed);return a-1<3&&!t(e,"si")&&t(e,"jedec")&&(s[1]="B"),{suffix:a?(s[0]+"MGTPEZY")[a-1]+s[1]:1==(0|c)?"Byte":"Bytes",magnitude:a,result:o,fixed:c,bits:{result:o/8,fixed:(o/8).toFixed(r.fixed)}}},r.to=function(r,s){var i=t(s,"si")?1e3:1024,a=e.indexOf("string"==typeof r?r[0].toUpperCase():"B"),o=n;if(-1===a||0===a)return o.toFixed(2);for(;a>0;a--)o/=i;return o.toFixed(2)},r.human=function(e){var t=r.calculate(e);return t.fixed+r.spacer+t.suffix},r}},e.exports?e.exports=i():(r=[],void 0===(s="function"==typeof(n=i)?n.apply(t,r):n)||(e.exports=s))}};const t={};function n(r){const s=t[r];if(void 0!==s)return s.exports;const i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.hasOwn(e,t),(()=>{"use strict";var e,t,r,s;e={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},t=["(","?"],r={")":["("],":":["?","?:"]},s=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var i={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,n){if(e)throw t;return n}};function a(n){var a=function(n){for(var i,a,o,c,l=[],d=[];i=n.match(s);){for(a=i[0],(o=n.substr(0,i.index).trim())&&l.push(o);c=d.pop();){if(r[a]){if(r[a][0]===c){a=r[a][1]||a;break}}else if(t.indexOf(c)>=0||e[c]1===e?0:1},d=/^i18n\.(n?gettext|has_translation)(_|$)/;var u=function(e){return"string"!=typeof e||""===e?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var h=function(e){return"string"!=typeof e||""===e?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var p=function(e,t){return function(n,r,s,i=10){const a=e[t];if(!h(n))return;if(!u(r))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof i)return void console.error("If specified, the hook priority must be a number.");const o={callback:s,priority:i,namespace:r};if(a[n]){const e=a[n].handlers;let t;for(t=e.length;t>0&&!(i>=e[t-1].priority);t--);t===e.length?e[t]=o:e.splice(t,0,o),a.__current.forEach(e=>{e.name===n&&e.currentIndex>=t&&e.currentIndex++})}else a[n]={handlers:[o],runs:0};"hookAdded"!==n&&e.doAction("hookAdded",n,r,s,i)}};var f=function(e,t,n=!1){return function(r,s){const i=e[t];if(!h(r))return;if(!n&&!u(s))return;if(!i[r])return 0;let a=0;if(n)a=i[r].handlers.length,i[r]={runs:i[r].runs,handlers:[]};else{const e=i[r].handlers;for(let t=e.length-1;t>=0;t--)e[t].namespace===s&&(e.splice(t,1),a++,i.__current.forEach(e=>{e.name===r&&e.currentIndex>=t&&e.currentIndex--}))}return"hookRemoved"!==r&&e.doAction("hookRemoved",r,s),a}};var m=function(e,t){return function(n,r){const s=e[t];return void 0!==r?n in s&&s[n].handlers.some(e=>e.namespace===r):n in s}};var g=function(e,t,n,r){return function(s,...i){const a=e[t];a[s]||(a[s]={handlers:[],runs:0}),a[s].runs++;const o=a[s].handlers;if(!o||!o.length)return n?i[0]:void 0;const c={name:s,currentIndex:0};return(r?async function(){try{a.__current.add(c);let e=n?i[0]:void 0;for(;c.currentIndex0:Array.from(r.__current).some(e=>e.name===n)}};var w=function(e,t){return function(n){const r=e[t];if(h(n))return r[n]&&r[n].runs?r[n].runs:0}},v=class{actions;filters;addAction;addFilter;removeAction;removeFilter;hasAction;hasFilter;removeAllActions;removeAllFilters;doAction;doActionAsync;applyFilters;applyFiltersAsync;currentAction;currentFilter;doingAction;doingFilter;didAction;didFilter;constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=p(this,"actions"),this.addFilter=p(this,"filters"),this.removeAction=f(this,"actions"),this.removeFilter=f(this,"filters"),this.hasAction=m(this,"actions"),this.hasFilter=m(this,"filters"),this.removeAllActions=f(this,"actions",!0),this.removeAllFilters=f(this,"filters",!0),this.doAction=g(this,"actions",!1,!1),this.doActionAsync=g(this,"actions",!1,!0),this.applyFilters=g(this,"filters",!0,!1),this.applyFiltersAsync=g(this,"filters",!0,!0),this.currentAction=_(this,"actions"),this.currentFilter=_(this,"filters"),this.doingAction=y(this,"actions"),this.doingFilter=y(this,"filters"),this.didAction=w(this,"actions"),this.didFilter=w(this,"filters")}};var b=function(){return new v}(),{addAction:x,addFilter:k,removeAction:E,removeFilter:A,hasAction:P,hasFilter:C,removeAllActions:S,removeAllFilters:T,doAction:O,doActionAsync:L,applyFilters:I,applyFiltersAsync:F,currentAction:D,currentFilter:N,doingAction:j,doingFilter:M,didAction:z,didFilter:R,actions:U,filters:B}=b,J=((e,t,n)=>{const r=new c({}),s=new Set,i=()=>{s.forEach(e=>e())},a=(e,t="default")=>{r.data[t]={...r.data[t],...e},r.data[t][""]={...l,...r.data[t]?.[""]},delete r.pluralForms[t]},o=(e,t)=>{a(e,t),i()},u=(e="default",t,n,s,i)=>(r.data[e]||a(void 0,e),r.dcnpgettext(e,t,n,s,i)),h=e=>e||"default",p=(e,t,r)=>{let s=u(r,t,e);return n?(s=n.applyFilters("i18n.gettext_with_context",s,e,t,r),n.applyFilters("i18n.gettext_with_context_"+h(r),s,e,t,r)):s};if(e&&o(e,t),n){const e=e=>{d.test(e)&&i()};n.addAction("hookAdded","core/i18n",e),n.addAction("hookRemoved","core/i18n",e)}return{getLocaleData:(e="default")=>r.data[e],setLocaleData:o,addLocaleData:(e,t="default")=>{r.data[t]={...r.data[t],...e,"":{...l,...r.data[t]?.[""],...e?.[""]}},delete r.pluralForms[t],i()},resetLocaleData:(e,t)=>{r.data={},r.pluralForms={},o(e,t)},subscribe:e=>(s.add(e),()=>s.delete(e)),__:(e,t)=>{let r=u(t,void 0,e);return n?(r=n.applyFilters("i18n.gettext",r,e,t),n.applyFilters("i18n.gettext_"+h(t),r,e,t)):r},_x:p,_n:(e,t,r,s)=>{let i=u(s,void 0,e,t,r);return n?(i=n.applyFilters("i18n.ngettext",i,e,t,r,s),n.applyFilters("i18n.ngettext_"+h(s),i,e,t,r,s)):i},_nx:(e,t,r,s,i)=>{let a=u(i,s,e,t,r);return n?(a=n.applyFilters("i18n.ngettext_with_context",a,e,t,r,s,i),n.applyFilters("i18n.ngettext_with_context_"+h(i),a,e,t,r,s,i)):a},isRTL:()=>"rtl"===p("ltr","text direction"),hasTranslation:(e,t,s)=>{const i=t?t+""+e:e;let a=!!r.data?.[s??"default"]?.[i];return n&&(a=n.applyFilters("i18n.has_translation",a,e,t,s),a=n.applyFilters("i18n.has_translation_"+h(s),a,e,t,s)),a}}})(void 0,void 0,b),$=(J.getLocaleData.bind(J),J.setLocaleData.bind(J),J.resetLocaleData.bind(J),J.subscribe.bind(J),J.__.bind(J)),H=(J._x.bind(J),J._n.bind(J),J._nx.bind(J),J.isRTL.bind(J),J.hasTranslation.bind(J),["@wordpress/admin-ui","@wordpress/api-fetch","@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/boot","@wordpress/commands","@wordpress/compose","@wordpress/connectors","@wordpress/workflows","@wordpress/components","@wordpress/core-actions","@wordpress/core-commands","@wordpress/core-data","@wordpress/core-fields","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/font-list-route","@wordpress/format-library","@wordpress/notices","@wordpress/patterns","@wordpress/preferences","@wordpress/rich-text","@wordpress/route","@wordpress/router","@wordpress/routes","@wordpress/storybook","@wordpress/theme","@wordpress/dataviews","@wordpress/sync","@wordpress/fields","@wordpress/lazy-editor","@wordpress/media-editor","@wordpress/media-utils","@wordpress/upload-media","@wordpress/global-styles-engine","@wordpress/global-styles-ui","@wordpress/ui","@wordpress/views","@wordpress/widget-dashboard"]);function W(e,t){if(!e)throw new Error("Cannot lock an undefined object.");const n=e;G in n||(n[G]={}),q.set(n[G],t)}function K(e){if(!e)throw new Error("Cannot unlock an undefined object.");const t=e;if(!(G in t))throw new Error("Cannot unlock an object that was not locked before. ");return q.get(t[G])}var q=new WeakMap,G=Symbol("Private API ID");var{lock:Z,unlock:Y}=((e,t)=>{if(!H.includes(t))throw new Error(`You tried to opt-in to unstable APIs as module "${t}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress."!==e)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return{lock:W,unlock:K}})("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/api-fetch");var X=function(e){const t=(e,n)=>{const{headers:r={}}=e;for(const s in r)if("x-wp-nonce"===s.toLowerCase()&&r[s]===t.nonce)return n(e);return n({...e,headers:{...r,"X-WP-Nonce":t.nonce}})};return t.nonce=e,t},V=(e,t)=>{let n,r,s=e.path;return"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(n=e.namespace.replace(/^\/|\/$/g,""),r=e.endpoint.replace(/^\//,""),s=r?n+"/"+r:n),delete e.namespace,delete e.endpoint,t({...e,path:s})},Q=e=>(t,n)=>V(t,t=>{let r,s=t.url,i=t.path;return"string"==typeof i&&(r=e,-1!==e.indexOf("?")&&(i=i.replace("?","&")),i=i.replace(/^\//,""),"string"==typeof r&&-1!==r.indexOf("?")&&(i=i.replace("?","&")),s=r+i),n({...t,url:s})});function ee(e){try{return decodeURIComponent(e)}catch{return e}}function te(e){const t=e.indexOf("?");if(-1===t)return e;const n=e.slice(0,t),r=e.slice(t+1);return r?n+"?"+r.split("&").map(e=>e.split("=")).map(e=>e.map(ee)).sort((e,t)=>e[0].localeCompare(t[0])).map(e=>e.map(encodeURIComponent)).map(e=>e.join("=")).join("&"):n}function ne(e){return(function(e){let t;try{t=new URL(e,"http://example.com").search.substring(1)}catch{}if(t)return t}(e)||"").replace(/\+/g,"%20").split("&").reduce((e,t)=>{const n=t.indexOf("="),r=-1!==n,s=ee(r?t.slice(0,n):t);if(s){const i=r?ee(t.slice(n+1)):"";!function(e,t,n){const r=t.length,s=r-1;for(let i=0;i{"link"===t.toLowerCase()&&(e.headers[t]=n.replace(/<([^>]+)>/,(e,t)=>`<${encodeURI(t)}>`))}),Promise.resolve(t?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}}var ce=function(e){const{OPTIONS:t={},...n}=Object.fromEntries(Object.entries(e).map(([e,t])=>[te(e),t])),r=new Set(Object.keys(n)),s=new Set(Object.keys(t));let i=!1;const a=(e,a)=>{const{parse:o=!0}=e;let c=e.path;if(!c&&e.url){const{rest_route:t,...n}=ne(e.url);"string"==typeof t&&(c=se(t,n))}if("string"!=typeof c)return a(e);const l=e.method||"GET",d=te(c);if("GET"===l&&n[d]){const e=n[d];return i||delete n[d],r.delete(d),oe(e,!!o)}if("OPTIONS"===l&&t[d]){const e=t[d];return i||delete t[d],s.delete(d),oe(e,!!o)}return a(e)};return a[ie]=()=>{i=!0},a[ae]=()=>{const e=[...Array.from(r,e=>`GET ${e}`),...Array.from(s,e=>`OPTIONS ${e}`)];e.length?console.warn("[api-fetch][preload] Some preloads were never consumed:",e):console.log("[api-fetch][preload] All preloads consumed."),r.clear(),s.clear();for(const e of Object.keys(n))delete n[e];for(const e of Object.keys(t))delete t[e]},a},le=({path:e,url:t,...n},r)=>({...n,url:t&&se(t,r),path:e&&se(e,r)}),de=e=>e.json?e.json():Promise.reject(e),ue=e=>{const{next:t}=(e=>{if(!e)return{};const t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}})(e.headers.get("link"));return t},he=async(e,t)=>{if(!1===e.parse)return t(e);if(!(e=>{const t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),n=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||n})(e))return t(e);const n=await Oe({...le(e,{per_page:100}),parse:!1}),r=await de(n);if(!Array.isArray(r))return r;let s=ue(n);if(!s)return r;let i=[].concat(r);for(;s;){const t=await Oe({...e,path:void 0,url:s,parse:!1}),n=await de(t);i=i.concat(n),s=ue(t)}return i},pe=new Set(["PATCH","PUT","DELETE"]),fe="GET",me=(e,t)=>{const{method:n=fe}=e;return pe.has(n.toUpperCase())&&(e={...e,headers:{"Content-Type":"application/json",...e.headers,"X-HTTP-Method-Override":n},method:"POST"}),t(e)};function ge(e,t){return ne(e)[t]}function _e(e,t){return void 0!==ge(e,t)}async function ye(e,t=!1){try{if("function"!=typeof e.text)return await e.json();const n=await e.text();return t&&""===n?null:JSON.parse(n)}catch{throw{code:"invalid_json",message:$("The response is not a valid JSON response."),data:{status:e.status}}}}async function we(e,t=!0){return t?204===e.status?null:await ye(e,!0):e}async function ve(e,t=!0){if(!t)throw e;const n=await ye(e);if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.data)throw{...n,data:{status:e.status}};throw n}var be=(e,t)=>{if(!function(e){const t=!!e.method&&"POST"===e.method;return(!!e.path&&-1!==e.path.indexOf("/wp/v2/media")||!!e.url&&-1!==e.url.indexOf("/wp/v2/media"))&&t}(e))return t(e);let n=0;const r=e=>(n++,t({path:`/wp/v2/media/${e}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>n<5?r(e):(t({path:`/wp/v2/media/${e}?force=true`,method:"DELETE"}),Promise.reject())));return t({...e,parse:!1}).catch(t=>{if(!(t instanceof globalThis.Response))return Promise.reject(t);const n=t.headers.get("x-wp-upload-attachment-id");return t.status>=500&&t.status<600&&n?r(n).catch(()=>!1!==e.parse?Promise.reject({code:"post_process",message:$("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(t)):ve(t,e.parse)}).then(t=>we(t,e.parse))};function xe(e,...t){const n=e.replace(/^[^#]*/,""),r=(e=e.replace(/#.*/,"")).indexOf("?");if(-1===r)return e+n;const s=ne(e),i=e.substr(0,r);t.forEach(e=>delete s[e]);const a=re(s);return(a?i+"?"+a:i)+n}var ke=e=>(t,n)=>{if("string"==typeof t.url){const n=ge(t.url,"wp_theme_preview");void 0===n?t.url=se(t.url,{wp_theme_preview:e}):""===n&&(t.url=xe(t.url,"wp_theme_preview"))}if("string"==typeof t.path){const n=ge(t.path,"wp_theme_preview");void 0===n?t.path=se(t.path,{wp_theme_preview:e}):""===n&&(t.path=xe(t.path,"wp_theme_preview"))}return n(t)},Ee={Accept:"application/json, */*;q=0.1"},Ae={credentials:"include"},Pe=[(e,t)=>("string"!=typeof e.url||_e(e.url,"_locale")||(e.url=se(e.url,{_locale:"user"})),"string"!=typeof e.path||_e(e.path,"_locale")||(e.path=se(e.path,{_locale:"user"})),t(e)),V,me,he];var Ce=e=>{const{url:t,path:n,data:r,parse:s=!0,...i}=e;let{body:a,headers:o}=e;o={...Ee,...o},r&&(a=JSON.stringify(r),o["Content-Type"]="application/json");return globalThis.fetch(t||n||window.location.href,{...Ae,...i,body:a,headers:o}).then(e=>e.ok?we(e,s):ve(e,s),e=>{if(e&&"AbortError"===e.name)throw e;if(!globalThis.navigator.onLine)throw{code:"offline_error",message:$("Unable to connect. Please check your Internet connection.")};throw{code:"fetch_error",message:$("Could not get a valid response from the server.")}})},Se=Ce;var Te=e=>Pe.reduceRight((e,t)=>n=>t(n,e),Se)(e).catch(t=>"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):globalThis.fetch(Te.nonceEndpoint).then(e=>e.ok?e.text():Promise.reject(t)).then(t=>(Te.nonceMiddleware.nonce=t,Te(e))));Te.use=function(e){Pe.unshift(e)},Te.unregister=function(e){const t=Pe.indexOf(e);return-1!==t&&(Pe.splice(t,1),!0)},Te.setFetchHandler=function(e){Se=e},Te.defaultFetchHandler=Ce,Te.privateApis={},Z(Te.privateApis,{enablePreloadMultiUse:function(){for(const e of Pe)e[ie]?.()},clearPreloadedData:function(){for(const e of Pe)e[ae]?.()}}),Te.createNonceMiddleware=X,Te.createPreloadingMiddleware=ce,Te.createRootURLMiddleware=Q,Te.fetchAllMiddleware=he,Te.httpV1Middleware=me,Te.mediaUploadMiddleware=be,Te.createThemePreviewMiddleware=ke;var Oe=Te,Le=n(951),Ie=n.n(Le);const Fe={controlled:null,bind(e){this.controlled=e,this.controlled.forEach(e=>{this._main(e)}),this._init()},_init(){this.controlled.forEach(e=>{this._checkUp(e)})},_main(e){const t=JSON.parse(e.dataset.main);e.dataset.size&&(e.filesize=parseInt(e.dataset.size,10)),e.mains=t.map(t=>{const n=document.getElementById(t),r=document.getElementById(t+"_size_wrapper");return r&&(n.filesize=0,n.sizespan=r),this._addChild(n,e),n}),this._bindEvents(e),e.mains.forEach(e=>{this._bindEvents(e)})},_bindEvents(e){e.eventBound||(e.addEventListener("click",t=>{const n=t.target;n.elements&&(this._checkDown(n),this._evaluateSize(n)),n.mains&&this._checkUp(e)}),e.eventBound=!0)},_addChild(e,t){const n=e.elements?e.elements:[];-1===n.indexOf(t)&&(n.push(t),e.elements=n)},_removeChild(e,t){const n=e.elements.indexOf(t);-1{t.checked!==e.checked&&(t.checked=e.checked,t.disabled&&(t.checked=!1),t.dispatchEvent(new Event("change")))}),e.elements.forEach(t=>{this._checkDown(t),t.elements||this._checkUp(t,e)}))},_checkUp(e,t){e.mains&&[...e.mains].forEach(e=>{e!==t&&this._evaluateCheckStatus(e),this._checkUp(e),this._evaluateSize(e)})},_evaluateCheckStatus(e){let t=0,n=e.classList.contains("partial");n&&(e.classList.remove("partial"),n=!1),e.elements.forEach(r=>{null!==r.parentNode?(t+=r.checked,r.classList.contains("partial")&&(n=!0)):this._removeChild(e,r)});let r="some";t===e.elements.length?r="on":0===t?r="off":n=!0,n&&e.classList.add("partial");const s="off"!==r;e.checked===s&&e.value===r||(e.value=r,e.checked=s,e.dispatchEvent(new Event("change")))},_evaluateSize(e){if(e.sizespan&&e.elements){e.filesize=0,e.elements.forEach(t=>{t.checked&&(e.filesize+=t.filesize)});let t=null;0this.sendStates(),2e3),localStorage.setItem(this.key,JSON.stringify(this.data)))},set(e,t){this.data[e]&&this.data[e]===t||(this.data[e]=t,this._update())},get(e){let t=null;return this.data[e]&&(t=this.data[e]),t},sendStates(){fetch(cldData.stateURL,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":cldData.stateNonce},body:JSON.stringify(this.data)}).then(e=>e.json()).then(e=>{e.success&&(this.previous=JSON.stringify(e.state),localStorage.removeItem(this.key))})}},Ne={cachePoints:{},spinners:{},states:null,init(e,t){if(this.states=t,"undefined"!=typeof CLDASSETS){Oe.use(Oe.createNonceMiddleware(CLDASSETS.nonce));e.querySelectorAll("[data-cache-point]").forEach(e=>this._bind(e));const t=document.getElementById("connect.cache.cld_purge_all");t&&(t.disabled="disabled",t.style.width="100px",t.style.transition="width 0.5s",t.addEventListener("click",()=>{t.dataset.purging||confirm(wp.i18n.__("Purge entire cache?","cloudinary"))&&this._purgeAll(t,!1)}),this._watchPurge(t),setInterval(()=>{this._watchPurge(t)},5e3))}},getCachePoint(e){return this.cachePoints["_"+e]?this.cachePoints["_"+e]:null},setCachePoint(e,t){const n=document.getElementById(t.dataset.slug),r=document.createElement("div"),s=this._getRow(),i=document.createElement("td");i.colSpan=2,i.className="cld-loading",s.appendChild(i);const a=document.getElementById(t.dataset.slug+"_search"),o=document.getElementById(t.dataset.slug+"_reload"),c=document.getElementById(t.dataset.browser),l=document.getElementById(t.dataset.apply);l.style.float="right",l.style.marginLeft="6px",c.addEventListener("change",t=>{this._handleManager(e)}),n.addEventListener("change",t=>{this._handleManager(e)}),window.addEventListener("CacheToggle",e=>{e.detail.cachePoint===t&&this._cacheChange(t,e.detail)}),l.addEventListener("click",e=>{this._applyChanges(t)}),o.addEventListener("click",t=>{this._load(e)}),a.addEventListener("keydown",t=>{13===t.which&&(t.preventDefault(),t.stopPropagation(),this._load(e))}),r.className="cld-pagenav",l.cacheChanges={disable:[],enable:[],delete:[]},t.main=n,t.search=a,t.controller=c,t.viewer=t.parentNode.parentNode,t.loader=s,t.table=t.parentNode,t.apply=l,t.paginate=r,t.currentPage=1,t.viewer.appendChild(r),this.cachePoints["_"+e]=t},close(e){e.classList.add("closed")},open(e){e.classList.remove("closed")},isOpen(e){const t=this.getCachePoint(e);let n=!1;return t&&(n=t.controller.checked&&t.main.checked),n},_bind(e){const t=e.dataset.cachePoint;this.setCachePoint(t,e),this._handleManager(t)},_handleManager(e){const t=this.getCachePoint(e);t&&(this.isOpen(e)?(this.open(t.viewer),this.states.set(t.viewer.id,"open"),t.loaded||this._load(e)):(this.close(t.viewer),t.controller.checked=!1,this.states.set(t.viewer.id,"close")))},_load(e){const t=this.getCachePoint(e);let n="100px";t.clientHeight&&(n=t.clientHeight-16+"px"),this._clearChildren(t),t.appendChild(t.loader),this.open(t.loader),t.loader.firstChild.style.height=n,Oe({path:CLDASSETS.fetch_url,data:{ID:e,page:t.currentPage,search:t.search.value},method:"POST"}).then(e=>{t.removeChild(t.loader),this._buildList(t,e.items),this._buildNav(t,e);const n=t.querySelectorAll("[data-main]");Fe.bind(n),t.loaded=!0})},_cacheChange(e,t){const n=t.checked?t.states.on:t.states.off,r=t.checked?t.states.off:t.states.on;this._removeFromList(e,t.item.ID,r)||this._addToList(e,t.item.ID,n),this._evaluateApply(e)},_evaluateApply(e){e.apply.disabled="disabled";const t=e.apply.cacheChanges;let n=!1;for(const e in t)t[e].length&&(n=!0);n&&(e.apply.disabled="")},_applyChanges(e){const t=e.apply.cacheChanges;e.apply.disabled="disabled";for(const n in t)t[n].length&&this._set_state(e,n,t[n])},_watchPurge(e){e.dataset.purging||e.dataset.updating||(e.dataset.updating=!0,Oe({path:CLDASSETS.purge_all,data:{count:!0},method:"POST"}).then(t=>{e.dataset.updating="",0t.percent?(e.disabled="",this._purgeAll(e,!0)):0{e.innerText=$("Purging cache","cloudinary")+" "+Math.round(t.percent,2)+"%",e.style.backgroundImage="linear-gradient(90deg, #2a0 "+t.percent+"%, #787878 "+t.percent+"%)",100>t.percent?this._purgeAction(e,!0,n):n?n():(e.innerText=wp.i18n.__("Purge complete.","cloudinary"),setTimeout(()=>{e.dataset.purging="",e.style.backgroundImage="",e.style.minHeight="",e.style.border="",e.style.width="100px",e.disabled="disabled",e.innerText=e.dataset.title},2e3))})},_set_state(e,t,n){this._showSpinners(n),Oe({path:CLDASSETS.update_url,data:{state:t,ids:n},method:"POST"}).then(n=>{this._hideSpinners(n),n.forEach(n=>{this._removeFromList(e,n,t),this._evaluateApply(e),e.apply.disabled="disabled"}),"delete"===t&&this._load(e.dataset.cachePoint)})},_showSpinners(e){e.forEach(e=>{this.spinners["spinner_"+e].style.visibility="visible"})},_hideSpinners(e){e.forEach(e=>{this.spinners["spinner_"+e].style.visibility="hidden"})},_removeFromList(e,t,n){const r=this._getListIndex(e,t,n);let s=!1;return-1e.apply.cacheChanges[n].indexOf(t),_noCache(e){const t=this._getNote(wp.i18n.__("No files cached.","cloudinary"));e.viewer.appendChild(t),this.close(e.table)},_clearChildren(e){for(;e.children.length;){const t=e.lastChild;t.children.length&&this._clearChildren(t),e.removeChild(t)}},_buildList(e,t){t.forEach(t=>{if(t.note)return void e.appendChild(this._getNote(t.note));const n=this._getRow(t.ID),r=this._getStateSwitch(e,t,{on:"enable",off:"disable"}),s=this._getFile(e,t,n),i=this._getEdit(t,e);n.appendChild(s),n.appendChild(i),n.appendChild(r),e.appendChild(n)})},_buildNav(e,t){e.paginate.innerHTML="";const n=document.createElement("button"),r=document.createElement("button");n.type="button",n.innerHTML="‹",n.className="button cld-pagenav-prev",1===t.current_page?n.disabled=!0:n.addEventListener("click",n=>{e.currentPage=t.current_page-1,this._load(e.dataset.cachePoint)}),r.type="button",r.innerHTML="›",r.className="button cld-pagenav-next",t.current_page===t.total_pages||0===t.total_pages?r.disabled=!0:r.addEventListener("click",n=>{e.currentPage=t.current_page+1,this._load(e.dataset.cachePoint)});const s=document.createElement("span");if(s.innerText=t.nav_text,s.className="cld-pagenav-text",e.paginate.appendChild(n),e.paginate.appendChild(s),e.paginate.appendChild(r),e.paginate.appendChild(e.apply),e.apply.classList.remove("closed"),e.apply.disabled="disabled",t.items.length){const t=document.createElement("button");t.type="button",t.className="button",t.innerText=wp.i18n.__("Purge cache point","cloudinary"),t.style.float="right",e.paginate.appendChild(t),t.addEventListener("click",n=>{if(confirm(wp.i18n.__("Purge entire cache point?","cloudinary"))){t.dataset.parent=e.dataset.cachePoint;const n=this;t.classList.add("button-primary"),this._purgeAll(t,!1,function(){n._load(e.dataset.cachePoint)})}})}},_getNote(e){const t=this._getRow(),n=document.createElement("td");return n.colSpan=2,n.innerText=e,t.appendChild(n),t},_getRow(e){const t=document.createElement("tr");return e&&(t.id="row_"+e),t},_getEdit(e){const t=document.createElement("td"),n=document.createElement("a");return n.href=e.edit_url,e.data.transformations?n.innerText=e.data.transformations:n.innerText=$("Add transformations","cloudinary"),t.appendChild(n),t},_getFile(e,t){const n=document.createElement("td"),r=document.createElement("label"),s=this._getDeleter(e,n,t);r.innerText=t.short_url,r.htmlFor=t.key,n.appendChild(s),n.appendChild(r);const i=document.createElement("span"),a="spinner_"+t.ID;return i.className="spinner",i.id=a,n.appendChild(i),this.spinners[a]=i,n},_getDeleter(e,t,n){const r=document.createElement("input"),s=[e.dataset.slug+"_deleter"],i=this._getListIndex(e,n.ID,"delete");return r.type="checkbox",r.value=n.ID,r.id=n.key,r.dataset.main=JSON.stringify(s),-1{t.style.opacity=1,t.style.textDecoration="",r.checked&&(t.style.opacity=.8,t.style.textDecoration="line-through");const i=new CustomEvent("CacheToggle",{detail:{checked:r.checked,states:{on:"delete",off:n.active?"enable":"disable"},item:n,cachePoint:e}});window.dispatchEvent(i)}),r},_getStateSwitch(e,t,n){const r=document.createElement("td"),s=document.createElement("label"),i=document.createElement("input"),a=document.createElement("span"),o=(e.dataset.slug,this._getListIndex(e,t.ID,"disable"));return r.style.textAlign="right",s.className="cld-input-on-off-control mini",i.type="checkbox",i.value=t.ID,i.checked=!(-1{const s=new CustomEvent("CacheToggle",{detail:{checked:i.checked,states:n,item:t,cachePoint:e}});window.dispatchEvent(s)}),r.appendChild(s),r}},je=document.getElementById("cloudinary-settings-page");je&&(De.init(),window.addEventListener("load",()=>Ne.init(je,De)))})()})(); //# sourceMappingURL=asset-manager.js.map \ No newline at end of file diff --git a/js/cloudinary.js b/js/cloudinary.js index 7f89ee4de..18b28d3e6 100644 --- a/js/cloudinary.js +++ b/js/cloudinary.js @@ -1,2 +1,2 @@ -(()=>{var t={951(t,e){var i,n,s,o;o=function(){var t="BKMGTPEZY".split("");function e(t,e){return t&&t.toLowerCase()===e.toLowerCase()}return function(i,n){return i="number"==typeof i?i:0,(n=n||{}).fixed="number"==typeof n.fixed?n.fixed:2,n.spacer="string"==typeof n.spacer?n.spacer:" ",n.calculate=function(t){var s=e(t,"si")?["k","B"]:["K","iB"],o=e(t,"si")?1e3:1024,r=Math.log(i)/Math.log(o)|0,a=i/Math.pow(o,r),l=a.toFixed(n.fixed);return r-1<3&&!e(t,"si")&&e(t,"jedec")&&(s[1]="B"),{suffix:r?(s[0]+"MGTPEZY")[r-1]+s[1]:1==(0|l)?"Byte":"Bytes",magnitude:r,result:a,fixed:l,bits:{result:a/8,fixed:(a/8).toFixed(n.fixed)}}},n.to=function(n,s){var o=e(s,"si")?1e3:1024,r=t.indexOf("string"==typeof n?n[0].toUpperCase():"B"),a=i;if(-1===r||0===r)return a.toFixed(2);for(;r>0;r--)a/=o;return a.toFixed(2)},n.human=function(t){var e=n.calculate(t);return e.fixed+n.spacer+e.suffix},n}},t.exports?t.exports=o():(n=[],void 0===(s="function"==typeof(i=o)?i.apply(e,n):i)||(t.exports=s))},998(t,e){var i,n,s;n=[],i=function(){"use strict";function t(t,e){var i,s,o;for(i=1,s=arguments.length;i>1].factor>t?s=e-1:n=e;return i[n]},r.prototype.parse=function(t,e){var i=t.match(this._regexp);if(null!==i){var s,o=i[3];if(n(this._prefixes,o))s=this._prefixes[o];else{if(e||(o=o.toLowerCase(),!n(this._lcPrefixes,o)))return;o=this._lcPrefixes[o],s=this._prefixes[o]}var r=+i[2];return void 0!==i[1]&&(r=-r),{factor:s,prefix:o,unit:i[4],value:r}}};var a={binary:r.create(",Ki,Mi,Gi,Ti,Pi,Ei,Zi,Yi".split(","),1024),SI:r.create("q,r,y,z,a,f,p,n,µ,m,,k,M,G,T,P,E,Z,Y,R,Q".split(","),1e3,-10)},l=t({},a.binary._prefixes),c=a.SI._prefixes;for(var h in c)c[h]>=1&&(l[h]=c[h]);var d=new r(l),u={maxDecimals:2,separator:" ",unit:""},f={rounding:"round",scale:"SI",strict:!1};function p(t,e){var n=i(e,u,"decimals"),s=E(t,e,void 0!==n?n:i(e,u,"maxDecimals"));t=void 0!==n?s.value.toFixed(n):String(s.value);var o=s.prefix+i(e,u,"unit");return""===o?t:t+i(e,u,"separator")+o}var g={scale:"binary",unit:"B"};function m(e,i){return p(e,void 0===i?g:t({},g,i))}function b(t,e){return x(_(t,e))}var v={scale:d,unit:"B"};function y(e,i){return x(w(e,void 0===i?v:t({},v,i),!0))}function x(t){var e=String(t.value).split(".")[1];if(void 0!==e&&-1===e.indexOf("e")){var i=Math.pow(10,e.length),n=Math.round(t.value*i)*t.factor;if(n%1==0&&Math.abs(n)<=s)return n/i}return t.value*t.factor}function _(t,e){return w(t,e,!1)}function w(t,e,n){if("string"!=typeof t)throw new TypeError("str must be a string");var s=o(a,i(e,f,"scale"));if(void 0===s)throw new Error("missing scale");var r=i(e,f,"strict"),l=i(e,f,"unit");if(void 0!==l){var c=(t=t.trim()).slice(-l.length);""!==l&&(c===l||n&&!r&&c.toLowerCase()===l.toLowerCase())?t=t.slice(0,-l.length):l=""}var h=s.parse(t,r);if(void 0===h||void 0!==l&&""!==h.unit)throw new Error("cannot parse str");return void 0!==l&&(h.unit=l),h}var k={ceil:function(t){return Math.ceil(+t.toPrecision(15))},floor:function(t){return Math.floor(+t.toPrecision(15))},round:Math.round},S={ceil:"floor",floor:"ceil"};function M(t,e){return t<10*e?10:1}function O(t,e){return E(t,e,i(e,f,"maxDecimals"))}function E(t,e,s){if("number"!=typeof t||t!=t)throw new TypeError("value must be a number");if(0===t)return{value:0,prefix:""};if(!isFinite(t))return{value:t,prefix:""};var r=t<0;r&&(t=-t);var l=o(a,i(e,f,"scale"));if(void 0===l)throw new Error("missing scale");var c=i(e,f,"rounding");if(!n(k,c))throw new Error("invalid rounding");r&&n(S,c)&&(c=S[c]);var h,d=k[c],u="auto"===s;void 0===s||u||(h=Math.pow(10,s));var p,g=i(e,f,"prefix");if(void 0!==g){if(!n(l._prefixes,g))throw new Error("invalid prefix");p=l._prefixes[g]}else{var m=l.findPrefix(t);if(void 0!==s)do{p=m.factor,u&&(h=M(t,p));var b=p/h;t=d(t/b)*b}while((m=l.findPrefix(t)).factor!==p);else p=m.factor;g=m.prefix}return u&&(h=M(t,p)),t=void 0===h?t/p:d(t*h/p)/h,{prefix:g,value:r?-t:t}}return p.bytes=m,p.parse=b,b.bytes=y,b.raw=_,p.raw=O,p.Scale=r,p},void 0===(s="function"==typeof i?i.apply(e,n):i)||(t.exports=s)},336(t){var e,i="loading"in HTMLImageElement.prototype,n="loading"in HTMLIFrameElement.prototype,s="onscroll"in window;function o(t){var e,i,n=[];"picture"===t.parentNode.tagName.toLowerCase()&&((i=(e=t.parentNode).querySelector("source[data-lazy-remove]"))&&e.removeChild(i),n=Array.prototype.slice.call(t.parentNode.querySelectorAll("source"))),n.push(t),n.forEach(function(t){t.hasAttribute("data-lazy-srcset")&&(t.setAttribute("srcset",t.getAttribute("data-lazy-srcset")),t.removeAttribute("data-lazy-srcset"))}),t.setAttribute("src",t.getAttribute("data-lazy-src")),t.removeAttribute("data-lazy-src")}function r(t){var o=document.createElement("div");for(o.innerHTML=function(t){var o=t.textContent||t.innerHTML,r="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 "+((o.match(/width=['"](\d+)['"]/)||!1)[1]||1)+" "+((o.match(/height=['"](\d+)['"]/)||!1)[1]||1)+"%27%3E%3C/svg%3E";return(/\n-1}function zt(t,e){var i=this.__data__,n=te(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this}function Bt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e1?i[s-1]:void 0,r=s>2?i[2]:void 0;for(o=t.length>3&&"function"==typeof o?(s--,o):void 0,r&&ke(i[0],i[1],r)&&(o=s<3?void 0:o,s=1),e=Object(e);++n-1&&t%1==0&&t0){if(++e>=o)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function De(t){if(null!=t){try{return ot.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ie(t,e){return t===e||t!=t&&e!=e}var Re=se(function(){return arguments}())?se:function(t){return He(t)&&rt.call(t,"callee")&&!bt.call(t,"callee")},je=Array.isArray;function Fe(t){return null!=t&&We(t.length)&&!Ne(t)}function ze(t){return He(t)&&Fe(t)}var Be=_t||Ke;function Ne(t){if(!Ve(t))return!1;var e=ne(t);return e==p||e==g||e==h||e==x}function We(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Ve(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function He(t){return null!=t&&"object"==typeof t}function $e(t){if(!He(t)||ne(t)!=y)return!1;var e=gt(t);if(null===e)return!0;var i=rt.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&ot.call(i)==ct}var Ue=X?K(X):re;function qe(t){return ge(t,Ye(t))}function Ye(t){return Fe(t)?Kt(t,!0):ae(t)}var Xe=me(function(t,e,i){le(t,e,i)});function Je(t){return function(){return t}}function Ge(t){return t}function Ke(){return!1}e.exports=Xe}).call(this)}).call(this,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,i,n){var s,o;s=self,o=function(){return function(){"use strict";var t={720:function(t,e,i){i.r(e),i.d(e,{Scene:function(){return ae},Tweenable:function(){return Mt},interpolate:function(){return ee},processTweens:function(){return bt},setBezierFunction:function(){return H},shouldScheduleUpdate:function(){return xt},tween:function(){return Ot},unsetBezierFunction:function(){return $}});var n={};i.r(n),i.d(n,{bounce:function(){return R},bouncePast:function(){return j},easeFrom:function(){return z},easeFromTo:function(){return F},easeInBack:function(){return A},easeInCirc:function(){return S},easeInCubic:function(){return c},easeInExpo:function(){return _},easeInOutBack:function(){return C},easeInOutCirc:function(){return O},easeInOutCubic:function(){return d},easeInOutExpo:function(){return k},easeInOutQuad:function(){return l},easeInOutQuart:function(){return p},easeInOutQuint:function(){return b},easeInOutSine:function(){return x},easeInQuad:function(){return r},easeInQuart:function(){return u},easeInQuint:function(){return g},easeInSine:function(){return v},easeOutBack:function(){return T},easeOutBounce:function(){return E},easeOutCirc:function(){return M},easeOutCubic:function(){return h},easeOutExpo:function(){return w},easeOutQuad:function(){return a},easeOutQuart:function(){return f},easeOutQuint:function(){return m},easeOutSine:function(){return y},easeTo:function(){return B},elastic:function(){return P},linear:function(){return o},swingFrom:function(){return D},swingFromTo:function(){return L},swingTo:function(){return I}});var s={};i.r(s),i.d(s,{afterTween:function(){return Jt},beforeTween:function(){return Xt},doesApply:function(){return qt},tweenCreated:function(){return Yt}});var o=function(t){return t},r=function(t){return Math.pow(t,2)},a=function(t){return-(Math.pow(t-1,2)-1)},l=function(t){return(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2)},c=function(t){return Math.pow(t,3)},h=function(t){return Math.pow(t-1,3)+1},d=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)},u=function(t){return Math.pow(t,4)},f=function(t){return-(Math.pow(t-1,4)-1)},p=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},g=function(t){return Math.pow(t,5)},m=function(t){return Math.pow(t-1,5)+1},b=function(t){return(t/=.5)<1?.5*Math.pow(t,5):.5*(Math.pow(t-2,5)+2)},v=function(t){return 1-Math.cos(t*(Math.PI/2))},y=function(t){return Math.sin(t*(Math.PI/2))},x=function(t){return-.5*(Math.cos(Math.PI*t)-1)},_=function(t){return 0===t?0:Math.pow(2,10*(t-1))},w=function(t){return 1===t?1:1-Math.pow(2,-10*t)},k=function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},S=function(t){return-(Math.sqrt(1-t*t)-1)},M=function(t){return Math.sqrt(1-Math.pow(t-1,2))},O=function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},E=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},A=function(t){var e=1.70158;return t*t*((e+1)*t-e)},T=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},C=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},P=function(t){return-1*Math.pow(4,-8*t)*Math.sin((6*t-1)*(2*Math.PI)/2)+1},L=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},D=function(t){var e=1.70158;return t*t*((e+1)*t-e)},I=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},R=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},j=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?2-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?2-(7.5625*(t-=2.25/2.75)*t+.9375):2-(7.5625*(t-=2.625/2.75)*t+.984375)},F=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},z=function(t){return Math.pow(t,4)},B=function(t){return Math.pow(t,.25)};function N(t,e,i,n,s,o){var r,a,l,c,h,d=0,u=0,f=0,p=function(t){return((d*t+u)*t+f)*t},g=function(t){return(3*d*t+2*u)*t+f},m=function(t){return t>=0?t:0-t};return d=1-(f=3*e)-(u=3*(n-e)-f),l=1-(h=3*i)-(c=3*(s-i)-h),r=t,a=function(t){return 1/(200*t)}(o),function(t){return((l*t+c)*t+h)*t}(function(t,e){var i,n,s,o,r,a;for(s=t,a=0;a<8;a++){if(o=p(s)-t,m(o)(n=1))return n;for(;io?i=s:n=s,s=.5*(n-i)+i}return s}(r,a))}var W,V=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.25,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.25,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.75,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.75;return function(s){return N(s,t,e,i,n,1)}},H=function(t,e,i,n,s){var o=V(e,i,n,s);return o.displayName=t,o.x1=e,o.y1=i,o.x2=n,o.y2=s,Mt.formulas[t]=o},$=function(t){return delete Mt.formulas[t]};function U(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function q(t,e){for(var i=0;it.length)&&(e=t.length);for(var i=0,n=new Array(e);ia?a:e;t._hasEnded=l>=a;var c=o-(a-l),h=t._filters.length>0;if(t._hasEnded)return t._render(r,t._data,c),t.stop(!0);h&&t._applyFilter(rt),l1&&void 0!==arguments[1]?arguments[1]:it,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Array.isArray(e))return V.apply(void 0,X(e));var n=Y(e);if(pt[e])return pt[e];if(n===ct||n===lt)for(var s in t)i[s]=e;else for(var o in t)i[o]=e[o]||it;return i},kt=function(t){t===ut?(ut=t._next)?ut._previous=null:ft=null:t===ft?(ft=t._previous)?ft._next=null:ut=null:(tt=t._previous,et=t._next,tt._next=et,et._previous=tt),t._previous=t._next=null},St="function"==typeof Promise?Promise:null;W=Symbol.toStringTag;var Mt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;U(this,t),Q(this,W,"Promise"),this._config={},this._data={},this._delay=0,this._filters=[],this._next=null,this._previous=null,this._timestamp=null,this._hasEnded=!1,this._resolve=null,this._reject=null,this._currentState=e||{},this._originalState={},this._targetState={},this._start=dt,this._render=dt,this._promiseCtor=St,i&&this.setConfig(i)}var e;return e=[{key:"_applyFilter",value:function(t){for(var e=this._filters.length;e>0;e--){var i=this._filters[e-e][t];i&&i(this)}}},{key:"tween",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return this._isPlaying&&this.stop(),!e&&this._config||this.setConfig(e),this._pausedAtTime=null,this._timestamp=t.now(),this._start(this.get(),this._data),this._delay&&this._render(this._currentState,this._data,0),this._resume(this._timestamp)}},{key:"setConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this._config;for(var n in e)i[n]=e[n];var s=i.promise,o=void 0===s?this._promiseCtor:s,r=i.start,a=void 0===r?dt:r,l=i.finish,c=i.render,h=void 0===c?this._config.step||dt:c,d=i.step,u=void 0===d?dt:d;this._data=i.data||i.attachment||this._data,this._isPlaying=!1,this._pausedAtTime=null,this._scheduleId=null,this._delay=e.delay||0,this._start=a,this._render=h||u,this._duration=i.duration||500,this._promiseCtor=o,l&&(this._resolve=l);var f=e.from,p=e.to,g=void 0===p?{}:p,m=this._currentState,b=this._originalState,v=this._targetState;for(var y in f)m[y]=f[y];var x=!1;for(var _ in m){var w=m[_];x||Y(w)!==ct||(x=!0),b[_]=w,v[_]=g.hasOwnProperty(_)?g[_]:w}if(this._easing=wt(this._currentState,i.easing,this._easing),this._filters.length=0,x){for(var k in t.filters)t.filters[k].doesApply(this)&&this._filters.push(t.filters[k]);this._applyFilter(at)}return this}},{key:"then",value:function(t,e){var i=this;return this._promise=new this._promiseCtor(function(t,e){i._resolve=t,i._reject=e}),this._promise.then(t,e)}},{key:"catch",value:function(t){return this.then().catch(t)}},{key:"finally",value:function(t){return this.then().finally(t)}},{key:"get",value:function(){return K({},this._currentState)}},{key:"set",value:function(t){this._currentState=t}},{key:"pause",value:function(){if(this._isPlaying)return this._pausedAtTime=t.now(),this._isPlaying=!1,kt(this),this}},{key:"resume",value:function(){return this._resume()}},{key:"_resume",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.now();return null===this._timestamp?this.tween():this._isPlaying?this._promise:(this._pausedAtTime&&(this._timestamp+=e-this._pausedAtTime,this._pausedAtTime=null),this._isPlaying=!0,null===ut?(ut=this,ft=this):(this._previous=ft,ft._next=this,ft=this),this)}},{key:"seek",value:function(e){e=Math.max(e,0);var i=t.now();return this._timestamp+e===0||(this._timestamp=i-e,mt(this,i)),this}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._isPlaying)return this;this._isPlaying=!1,kt(this);var e=this._filters.length>0;return t&&(e&&this._applyFilter(rt),gt(1,this._currentState,this._originalState,this._targetState,1,0,this._easing),e&&(this._applyFilter(st),this._applyFilter(ot))),this._resolve&&this._resolve({data:this._data,state:this._currentState,tweenable:this}),this._resolve=null,this._reject=null,this}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._currentState,i=this._data;return this._isPlaying?(this._reject&&this._reject({data:i,state:e,tweenable:this}),this._resolve=null,this._reject=null,this.stop(t)):this}},{key:"isPlaying",value:function(){return this._isPlaying}},{key:"hasEnded",value:function(){return this._hasEnded}},{key:"setScheduleFunction",value:function(e){t.setScheduleFunction(e)}},{key:"data",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t&&(this._data=K({},t)),this._data}},{key:"dispose",value:function(){for(var t in this)delete this[t]}}],e&&q(t.prototype,e),t}();function Ot(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new Mt;return e.tween(t),e.tweenable=e,e}Q(Mt,"now",function(){return Z}),Q(Mt,"setScheduleFunction",function(t){return ht=t}),Q(Mt,"filters",{}),Q(Mt,"formulas",pt),xt(!0);var Et,At,Tt=/(\d|-|\.)/,Ct=/([^\-0-9.]+)/g,Pt=/[0-9.-]+/g,Lt=(Et=Pt.source,At=/,\s*/.source,new RegExp("rgba?\\(".concat(Et).concat(At).concat(Et).concat(At).concat(Et,"(").concat(At).concat(Et,")?\\)"),"g")),Dt=/^.*\(/,It=/#([0-9]|[a-f]){3,6}/gi,Rt="VAL",jt=function(t,e){return t.map(function(t,i){return"_".concat(e,"_").concat(i)})};function Ft(t){return parseInt(t,16)}var zt=function(t){return"rgb(".concat((e=t,3===(e=e.replace(/#/,"")).length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[Ft(e.substr(0,2)),Ft(e.substr(2,2)),Ft(e.substr(4,2))]).join(","),")");var e},Bt=function(t,e,i){var n=e.match(t),s=e.replace(t,Rt);return n&&n.forEach(function(t){return s=s.replace(Rt,i(t))}),s},Nt=function(t){for(var e in t){var i=t[e];"string"==typeof i&&i.match(It)&&(t[e]=Bt(It,i,zt))}},Wt=function(t){var e=t.match(Pt),i=e.slice(0,3).map(Math.floor),n=t.match(Dt)[0];if(3===e.length)return"".concat(n).concat(i.join(","),")");if(4===e.length)return"".concat(n).concat(i.join(","),",").concat(e[3],")");throw new Error("Invalid rgbChunk: ".concat(t))},Vt=function(t){return t.match(Pt)},Ht=function(t,e){var i={};return e.forEach(function(e){i[e]=t[e],delete t[e]}),i},$t=function(t,e){return e.map(function(e){return t[e]})},Ut=function(t,e){return e.forEach(function(e){return t=t.replace(Rt,+e.toFixed(4))}),t},qt=function(t){for(var e in t._currentState)if("string"==typeof t._currentState[e])return!0;return!1};function Yt(t){var e=t._currentState;[e,t._originalState,t._targetState].forEach(Nt),t._tokenData=function(t){var e,i,n={};for(var s in t){var o=t[s];"string"==typeof o&&(n[s]={formatString:(e=o,i=void 0,i=e.match(Ct),i?(1===i.length||e.charAt(0).match(Tt))&&i.unshift(""):i=["",""],i.join(Rt)),chunkNames:jt(Vt(o),s)})}return n}(e)}function Xt(t){var e=t._currentState,i=t._originalState,n=t._targetState,s=t._easing,o=t._tokenData;!function(t,e){var i=function(i){var n=e[i].chunkNames,s=t[i];if("string"==typeof s){var o=s.split(" "),r=o[o.length-1];n.forEach(function(e,i){return t[e]=o[i]||r})}else n.forEach(function(e){return t[e]=s});delete t[i]};for(var n in e)i(n)}(s,o),[e,i,n].forEach(function(t){return function(t,e){var i=function(i){Vt(t[i]).forEach(function(n,s){return t[e[i].chunkNames[s]]=+n}),delete t[i]};for(var n in e)i(n)}(t,o)})}function Jt(t){var e=t._currentState,i=t._originalState,n=t._targetState,s=t._easing,o=t._tokenData;[e,i,n].forEach(function(t){return function(t,e){for(var i in e){var n=e[i],s=n.chunkNames,o=n.formatString,r=Ut(o,$t(Ht(t,s),s));t[i]=Bt(Lt,r,Wt)}}(t,o)}),function(t,e){for(var i in e){var n=e[i].chunkNames,s=t[n[0]];t[i]="string"==typeof s?n.map(function(e){var i=t[e];return delete t[e],i}).join(" "):s}}(s,o)}function Gt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function Kt(t){for(var e=1;e4&&void 0!==arguments[4]?arguments[4]:0,o=Kt({},t),r=wt(t,n);for(var a in Zt._filters.length=0,Zt.set({}),Zt._currentState=o,Zt._originalState=t,Zt._targetState=e,Zt._easing=r,te)te[a].doesApply(Zt)&&Zt._filters.push(te[a]);Zt._applyFilter("tweenCreated"),Zt._applyFilter("beforeTween");var l=gt(i,o,t,e,1,s,r);return Zt._applyFilter("afterTween"),l};function ie(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);it.strokeWidth&&(e=t.trailWidth);var i=50-e/2;return s.render(this._pathTemplate,{radius:i,"2radius":2*i})},o.prototype._trailString=function(t){return this._pathString(t)},e.exports=o},{"./shape":8,"./utils":10}],4:[function(t,e,i){var n=t("./shape"),s=t("./utils"),o=function(t,e){this._pathTemplate=e.vertical?"M {center},100 L {center},0":"M 0,{center} L 100,{center}",n.apply(this,arguments)};o.prototype=new n,o.prototype.constructor=o,o.prototype._initializeSvg=function(t,e){var i=e.vertical?"0 0 "+e.strokeWidth+" 100":"0 0 100 "+e.strokeWidth;t.setAttribute("viewBox",i),t.setAttribute("preserveAspectRatio","none")},o.prototype._pathString=function(t){return s.render(this._pathTemplate,{center:t.strokeWidth/2})},o.prototype._trailString=function(t){return this._pathString(t)},e.exports=o},{"./shape":8,"./utils":10}],5:[function(t,e,i){e.exports={Line:t("./line"),Circle:t("./circle"),SemiCircle:t("./semicircle"),Square:t("./square"),Path:t("./path"),Shape:t("./shape"),utils:t("./utils")}},{"./circle":3,"./line":4,"./path":6,"./semicircle":7,"./shape":8,"./square":9,"./utils":10}],6:[function(t,e,i){var n=t("shifty"),s=t("./utils"),o=n.Tweenable,r={easeIn:"easeInCubic",easeOut:"easeOutCubic",easeInOut:"easeInOutCubic"},a=function t(e,i){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");var n;i=s.extend({delay:0,duration:800,easing:"linear",from:{},to:{},step:function(){}},i),n=s.isString(e)?document.querySelector(e):e,this.path=n,this._opts=i,this._tweenable=null;var o=this.path.getTotalLength();this.path.style.strokeDasharray=o+" "+o,this.set(0)};a.prototype.value=function(){var t=this._getComputedDashOffset(),e=this.path.getTotalLength();return parseFloat((1-t/e).toFixed(6),10)},a.prototype.set=function(t){this.stop(),this.path.style.strokeDashoffset=this._progressToOffset(t);var e=this._opts.step;if(s.isFunction(e)){var i=this._easing(this._opts.easing);e(this._calculateTo(t,i),this._opts.shape||this,this._opts.attachment)}},a.prototype.stop=function(){this._stopTween(),this.path.style.strokeDashoffset=this._getComputedDashOffset()},a.prototype.animate=function(t,e,i){e=e||{},s.isFunction(e)&&(i=e,e={});var n=s.extend({},e),r=s.extend({},this._opts);e=s.extend(r,e);var a=this._easing(e.easing),l=this._resolveFromAndTo(t,a,n);this.stop(),this.path.getBoundingClientRect();var c=this._getComputedDashOffset(),h=this._progressToOffset(t),d=this;this._tweenable=new o,this._tweenable.tween({from:s.extend({offset:c},l.from),to:s.extend({offset:h},l.to),duration:e.duration,delay:e.delay,easing:a,step:function(t){d.path.style.strokeDashoffset=t.offset;var i=e.shape||d;e.step(t,i,e.attachment)}}).then(function(t){s.isFunction(i)&&i()}).catch(function(t){throw console.error("Error in tweening:",t),t})},a.prototype._getComputedDashOffset=function(){var t=window.getComputedStyle(this.path,null);return parseFloat(t.getPropertyValue("stroke-dashoffset"),10)},a.prototype._progressToOffset=function(t){var e=this.path.getTotalLength();return e-t*e},a.prototype._resolveFromAndTo=function(t,e,i){return i.from&&i.to?{from:i.from,to:i.to}:{from:this._calculateFrom(e),to:this._calculateTo(t,e)}},a.prototype._calculateFrom=function(t){return n.interpolate(this._opts.from,this._opts.to,this.value(),t)},a.prototype._calculateTo=function(t,e){return n.interpolate(this._opts.from,this._opts.to,t,e)},a.prototype._stopTween=function(){null!==this._tweenable&&(this._tweenable.stop(!0),this._tweenable=null)},a.prototype._easing=function(t){return r.hasOwnProperty(t)?r[t]:t},e.exports=a},{"./utils":10,shifty:2}],7:[function(t,e,i){var n=t("./shape"),s=t("./circle"),o=t("./utils"),r=function(t,e){this._pathTemplate="M 50,50 m -{radius},0 a {radius},{radius} 0 1 1 {2radius},0",this.containerAspectRatio=2,n.apply(this,arguments)};r.prototype=new n,r.prototype.constructor=r,r.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 50")},r.prototype._initializeTextContainer=function(t,e,i){t.text.style&&(i.style.top="auto",i.style.bottom="0",t.text.alignToBottom?o.setStyle(i,"transform","translate(-50%, 0)"):o.setStyle(i,"transform","translate(-50%, 50%)"))},r.prototype._pathString=s.prototype._pathString,r.prototype._trailString=s.prototype._trailString,e.exports=r},{"./circle":3,"./shape":8,"./utils":10}],8:[function(t,e,i){var n=t("./path"),s=t("./utils"),o="Object is destroyed",r=function t(e,i){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");if(0!==arguments.length){this._opts=s.extend({color:"#555",strokeWidth:1,trailColor:null,trailWidth:null,fill:null,text:{style:{color:null,position:"absolute",left:"50%",top:"50%",padding:0,margin:0,transform:{prefix:!0,value:"translate(-50%, -50%)"}},autoStyleContainer:!0,alignToBottom:!0,value:null,className:"progressbar-text"},svgStyle:{display:"block",width:"100%"},warnings:!1},i,!0),s.isObject(i)&&void 0!==i.svgStyle&&(this._opts.svgStyle=i.svgStyle),s.isObject(i)&&s.isObject(i.text)&&void 0!==i.text.style&&(this._opts.text.style=i.text.style);var o,r=this._createSvgView(this._opts);if(!(o=s.isString(e)?document.querySelector(e):e))throw new Error("Container does not exist: "+e);this._container=o,this._container.appendChild(r.svg),this._opts.warnings&&this._warnContainerAspectRatio(this._container),this._opts.svgStyle&&s.setStyles(r.svg,this._opts.svgStyle),this.svg=r.svg,this.path=r.path,this.trail=r.trail,this.text=null;var a=s.extend({attachment:void 0,shape:this},this._opts);this._progressPath=new n(r.path,a),s.isObject(this._opts.text)&&null!==this._opts.text.value&&this.setText(this._opts.text.value)}};r.prototype.animate=function(t,e,i){if(null===this._progressPath)throw new Error(o);this._progressPath.animate(t,e,i)},r.prototype.stop=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath.stop()},r.prototype.pause=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.pause()},r.prototype.resume=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.resume()},r.prototype.destroy=function(){if(null===this._progressPath)throw new Error(o);this.stop(),this.svg.parentNode.removeChild(this.svg),this.svg=null,this.path=null,this.trail=null,this._progressPath=null,null!==this.text&&(this.text.parentNode.removeChild(this.text),this.text=null)},r.prototype.set=function(t){if(null===this._progressPath)throw new Error(o);this._progressPath.set(t)},r.prototype.value=function(){if(null===this._progressPath)throw new Error(o);return void 0===this._progressPath?0:this._progressPath.value()},r.prototype.setText=function(t){if(null===this._progressPath)throw new Error(o);null===this.text&&(this.text=this._createTextContainer(this._opts,this._container),this._container.appendChild(this.text)),s.isObject(t)?(s.removeChildren(this.text),this.text.appendChild(t)):this.text.innerHTML=t},r.prototype._createSvgView=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");this._initializeSvg(e,t);var i=null;(t.trailColor||t.trailWidth)&&(i=this._createTrail(t),e.appendChild(i));var n=this._createPath(t);return e.appendChild(n),{svg:e,path:n,trail:i}},r.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 100")},r.prototype._createPath=function(t){var e=this._pathString(t);return this._createPathElement(e,t)},r.prototype._createTrail=function(t){var e=this._trailString(t),i=s.extend({},t);return i.trailColor||(i.trailColor="#eee"),i.trailWidth||(i.trailWidth=i.strokeWidth),i.color=i.trailColor,i.strokeWidth=i.trailWidth,i.fill=null,this._createPathElement(e,i)},r.prototype._createPathElement=function(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",t),i.setAttribute("stroke",e.color),i.setAttribute("stroke-width",e.strokeWidth),e.fill?i.setAttribute("fill",e.fill):i.setAttribute("fill-opacity","0"),i},r.prototype._createTextContainer=function(t,e){var i=document.createElement("div");i.className=t.text.className;var n=t.text.style;return n&&(t.text.autoStyleContainer&&(e.style.position="relative"),s.setStyles(i,n),n.color||(i.style.color=t.color)),this._initializeTextContainer(t,e,i),i},r.prototype._initializeTextContainer=function(t,e,i){},r.prototype._pathString=function(t){throw new Error("Override this function for each progress bar")},r.prototype._trailString=function(t){throw new Error("Override this function for each progress bar")},r.prototype._warnContainerAspectRatio=function(t){if(this.containerAspectRatio){var e=window.getComputedStyle(t,null),i=parseFloat(e.getPropertyValue("width"),10),n=parseFloat(e.getPropertyValue("height"),10);s.floatEquals(this.containerAspectRatio,i/n)||(console.warn("Incorrect aspect ratio of container","#"+t.id,"detected:",e.getPropertyValue("width")+"(width)","/",e.getPropertyValue("height")+"(height)","=",i/n),console.warn("Aspect ratio of should be",this.containerAspectRatio))}},e.exports=r},{"./path":6,"./utils":10}],9:[function(t,e,i){var n=t("./shape"),s=t("./utils"),o=function(t,e){this._pathTemplate="M 0,{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{strokeWidth}",this._trailTemplate="M {startMargin},{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{halfOfStrokeWidth}",n.apply(this,arguments)};o.prototype=new n,o.prototype.constructor=o,o.prototype._pathString=function(t){var e=100-t.strokeWidth/2;return s.render(this._pathTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2})},o.prototype._trailString=function(t){var e=100-t.strokeWidth/2;return s.render(this._trailTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2,startMargin:t.strokeWidth/2-t.trailWidth/2})},e.exports=o},{"./shape":8,"./utils":10}],10:[function(t,e,i){var n=t("lodash.merge"),s="Webkit Moz O ms".split(" "),o=.001;function r(t,e){var i=t;for(var n in e)if(e.hasOwnProperty(n)){var s=e[n],o=new RegExp("\\{"+n+"\\}","g");i=i.replace(o,s)}return i}function a(t,e,i){for(var n=t.style,o=0;oo[0];break;case"lt":i=this.value{const e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.hasOwn(t,e),(()=>{let t;globalThis.importScripts&&(t=globalThis.location+"");const e=globalThis.document;if(!t&&e&&("SCRIPT"===e.currentScript?.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){const i=e.getElementsByTagName("script");if(i.length){let e=i.length-1;for(;e>-1&&(!t||!/^https?:/.test(t));)t=i[e--].src}}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),i.p=t})(),(()=>{"use strict";i(336),i(712),i(544);const t={sample:{image:document.getElementById("transformation-sample-image"),video:document.getElementById("transformation-sample-video")},preview:{image:document.getElementById("sample-image"),video:document.getElementById("sample-video")},fields:document.getElementsByClassName("cld-ui-input"),button:{image:document.getElementById("refresh-image-preview"),video:document.getElementById("refresh-video-preview")},spinner:{image:document.getElementById("image-loader"),video:document.getElementById("video-loader")},optimization:{image:document.getElementById("image_settings.image_optimization"),video:document.getElementById("video_settings.video_optimization")},error_container:document.getElementById("cld-preview-error"),activeItem:null,elements:{image:[],video:[]},_placeItem(t){null!==t&&(t.style.display="block",t.style.visibility="visible",t.style.position="absolute",t.style.top=t.parentElement.clientHeight/2-t.clientHeight/2+"px",t.style.left=t.parentElement.clientWidth/2-t.clientWidth/2+"px")},_setLoading(t){this.sample[t]&&(this.button[t].style.display="block",this._placeItem(this.button[t]),this.preview[t].style.opacity="0.1")},_build(t){if(!this.sample[t])return;this.sample[t].innerHTML="",this.elements[t]=[];for(const e of this.fields){if(t!==e.dataset.context||e.dataset.disabled&&"true"===e.dataset.disabled)continue;let i=e.value.trim();if(i.length){if("select-one"===e.type){if("none"===i||!1===this.optimization[t].checked)continue;i=e.dataset.meta+"_"+i}else t=e.dataset.context,e.dataset.meta&&(i=e.dataset.meta+"_"+i),e.dataset.suffix&&(i+=e.dataset.suffix),i=this._transformations(i,t,!0);i&&this.elements[t].push(i)}}let e="";this.elements[t].length&&(e="/"+this._getGlobalTransformationElements(t).replace(/ /g,"%20")),this.sample[t].textContent=e,this.sample[t].parentElement.href="https://res.cloudinary.com/demo/"+this.sample[t].parentElement.innerText.trim().replace("../","").replace(/ /g,"%20")},_clearLoading(t){this.spinner[t].style.visibility="hidden",this.activeItem=null,this.preview[t].style.opacity=1},_refresh(t,e){if(t&&t.preventDefault(),!this.sample[e])return;const i=this,n=CLD_GLOBAL_TRANSFORMATIONS[e].preview_url+this._getGlobalTransformationElements(e)+CLD_GLOBAL_TRANSFORMATIONS[e].file;if(this.button[e].style.display="none",this._placeItem(this.spinner[e]),"image"===e){const t=new Image;t.onload=function(){i.preview[e].src=this.src,i._clearLoading(e),i.error_container&&(i.error_container.style.display="none"),t.remove()},t.onerror=function(){const t=i.elements[e].includes("f_mp4");i.error_container&&(i.error_container.style.display="block",t?(i.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[e].warning.replace("%s","f_mp4"),i.error_container.classList.replace("settings-alert-error","settings-alert-warning")):(i.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[e].error,i.error_container.classList.replace("settings-alert-warning","settings-alert-error"))),i._clearLoading(e)},t.src=n}else{const t=i._transformations(i._getGlobalTransformationElements(e),e);samplePlayer.source({publicId:"sailing_boat",transformation:t}),i._clearLoading(e)}},_getGlobalTransformationElements(t){let e=[];return e.push(this.elements[t].slice(0,2).join(",")),e.push(this.elements[t].slice(2).join(",")),e=e.filter(t=>t).join("/"),e},_transformations(t,e,i=!1){const n=CLD_GLOBAL_TRANSFORMATIONS[e].valid_types;let s=null;const o=t.split("/"),r=[];for(let t=0;t":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},n=["(","?"],s={")":["("],":":["?","?:"]},o=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var r={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,i){if(t)throw e;return i}};function a(t){var i=function(t){for(var i,r,a,l,c=[],h=[];i=t.match(o);){for(r=i[0],(a=t.substr(0,i.index).trim())&&c.push(a);l=h.pop();){if(s[r]){if(s[r][0]===l){r=s[r][1]||r;break}}else if(n.indexOf(l)>=0||e[l]1===t?0:1},d=/^i18n\.(n?gettext|has_translation)(_|$)/;var u=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var f=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var p=function(t,e){return function(i,n,s,o=10){const r=t[e];if(!f(i))return;if(!u(n))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof o)return void console.error("If specified, the hook priority must be a number.");const a={callback:s,priority:o,namespace:n};if(r[i]){const t=r[i].handlers;let e;for(e=t.length;e>0&&!(o>=t[e-1].priority);e--);e===t.length?t[e]=a:t.splice(e,0,a),r.__current.forEach(t=>{t.name===i&&t.currentIndex>=e&&t.currentIndex++})}else r[i]={handlers:[a],runs:0};"hookAdded"!==i&&t.doAction("hookAdded",i,n,s,o)}};var g=function(t,e,i=!1){return function(n,s){const o=t[e];if(!f(n))return;if(!i&&!u(s))return;if(!o[n])return 0;let r=0;if(i)r=o[n].handlers.length,o[n]={runs:o[n].runs,handlers:[]};else{const t=o[n].handlers;for(let e=t.length-1;e>=0;e--)t[e].namespace===s&&(t.splice(e,1),r++,o.__current.forEach(t=>{t.name===n&&t.currentIndex>=e&&t.currentIndex--}))}return"hookRemoved"!==n&&t.doAction("hookRemoved",n,s),r}};var m=function(t,e){return function(i,n){const s=t[e];return void 0!==n?i in s&&s[i].handlers.some(t=>t.namespace===n):i in s}};var b=function(t,e,i,n){return function(s,...o){const r=t[e];r[s]||(r[s]={handlers:[],runs:0}),r[s].runs++;const a=r[s].handlers;if(!a||!a.length)return i?o[0]:void 0;const l={name:s,currentIndex:0};return(n?async function(){try{r.__current.add(l);let t=i?o[0]:void 0;for(;l.currentIndex0:Array.from(n.__current).some(t=>t.name===i)}};var x=function(t,e){return function(i){const n=t[e];if(f(i))return n[i]&&n[i].runs?n[i].runs:0}},_=class{actions;filters;addAction;addFilter;removeAction;removeFilter;hasAction;hasFilter;removeAllActions;removeAllFilters;doAction;doActionAsync;applyFilters;applyFiltersAsync;currentAction;currentFilter;doingAction;doingFilter;didAction;didFilter;constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=p(this,"actions"),this.addFilter=p(this,"filters"),this.removeAction=g(this,"actions"),this.removeFilter=g(this,"filters"),this.hasAction=m(this,"actions"),this.hasFilter=m(this,"filters"),this.removeAllActions=g(this,"actions",!0),this.removeAllFilters=g(this,"filters",!0),this.doAction=b(this,"actions",!1,!1),this.doActionAsync=b(this,"actions",!1,!0),this.applyFilters=b(this,"filters",!0,!1),this.applyFiltersAsync=b(this,"filters",!0,!0),this.currentAction=v(this,"actions"),this.currentFilter=v(this,"filters"),this.doingAction=y(this,"actions"),this.doingFilter=y(this,"filters"),this.didAction=x(this,"actions"),this.didFilter=x(this,"filters")}};var w=function(){return new _}(),{addAction:k,addFilter:S,removeAction:M,removeFilter:O,hasAction:E,hasFilter:A,removeAllActions:T,removeAllFilters:C,doAction:P,doActionAsync:L,applyFilters:D,applyFiltersAsync:I,currentAction:R,currentFilter:j,doingAction:F,doingFilter:z,didAction:B,didFilter:N,actions:W,filters:V}=w,H=((t,e,i)=>{const n=new c({}),s=new Set,o=()=>{s.forEach(t=>t())},r=(t,e="default")=>{n.data[e]={...n.data[e],...t},n.data[e][""]={...h,...n.data[e]?.[""]},delete n.pluralForms[e]},a=(t,e)=>{r(t,e),o()},l=(t="default",e,i,s,o)=>(n.data[t]||r(void 0,t),n.dcnpgettext(t,e,i,s,o)),u=t=>t||"default",f=(t,e,n)=>{let s=l(n,e,t);return i?(s=i.applyFilters("i18n.gettext_with_context",s,t,e,n),i.applyFilters("i18n.gettext_with_context_"+u(n),s,t,e,n)):s};if(t&&a(t,e),i){const t=t=>{d.test(t)&&o()};i.addAction("hookAdded","core/i18n",t),i.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:(t="default")=>n.data[t],setLocaleData:a,addLocaleData:(t,e="default")=>{n.data[e]={...n.data[e],...t,"":{...h,...n.data[e]?.[""],...t?.[""]}},delete n.pluralForms[e],o()},resetLocaleData:(t,e)=>{n.data={},n.pluralForms={},a(t,e)},subscribe:t=>(s.add(t),()=>s.delete(t)),__:(t,e)=>{let n=l(e,void 0,t);return i?(n=i.applyFilters("i18n.gettext",n,t,e),i.applyFilters("i18n.gettext_"+u(e),n,t,e)):n},_x:f,_n:(t,e,n,s)=>{let o=l(s,void 0,t,e,n);return i?(o=i.applyFilters("i18n.ngettext",o,t,e,n,s),i.applyFilters("i18n.ngettext_"+u(s),o,t,e,n,s)):o},_nx:(t,e,n,s,o)=>{let r=l(o,s,t,e,n);return i?(r=i.applyFilters("i18n.ngettext_with_context",r,t,e,n,s,o),i.applyFilters("i18n.ngettext_with_context_"+u(o),r,t,e,n,s,o)):r},isRTL:()=>"rtl"===f("ltr","text direction"),hasTranslation:(t,e,s)=>{const o=e?e+""+t:t;let r=!!n.data?.[s??"default"]?.[o];return i&&(r=i.applyFilters("i18n.has_translation",r,t,e,s),r=i.applyFilters("i18n.has_translation_"+u(s),r,t,e,s)),r}}})(void 0,void 0,w),$=(H.getLocaleData.bind(H),H.setLocaleData.bind(H),H.resetLocaleData.bind(H),H.subscribe.bind(H),H.__.bind(H)),U=(H._x.bind(H),H._n.bind(H),H._nx.bind(H),H.isRTL.bind(H),H.hasTranslation.bind(H),["@wordpress/admin-ui","@wordpress/api-fetch","@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/boot","@wordpress/commands","@wordpress/compose","@wordpress/connectors","@wordpress/workflows","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/font-list-route","@wordpress/format-library","@wordpress/patterns","@wordpress/preferences","@wordpress/rich-text","@wordpress/route","@wordpress/router","@wordpress/routes","@wordpress/storybook","@wordpress/sync","@wordpress/theme","@wordpress/dataviews","@wordpress/fields","@wordpress/lazy-editor","@wordpress/media-editor","@wordpress/media-utils","@wordpress/upload-media","@wordpress/global-styles-engine","@wordpress/global-styles-ui","@wordpress/ui","@wordpress/views","@wordpress/widget-dashboard"]);function q(t,e){if(!t)throw new Error("Cannot lock an undefined object.");const i=t;J in i||(i[J]={}),X.set(i[J],e)}function Y(t){if(!t)throw new Error("Cannot unlock an undefined object.");const e=t;if(!(J in e))throw new Error("Cannot unlock an object that was not locked before. ");return X.get(e[J])}var X=new WeakMap,J=Symbol("Private API ID");var{lock:G,unlock:K}=((t,e)=>{if(!U.includes(e))throw new Error(`You tried to opt-in to unstable APIs as module "${e}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress."!==t)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return{lock:q,unlock:Y}})("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/api-fetch");var Q=function(t){const e=(t,i)=>{const{headers:n={}}=t;for(const s in n)if("x-wp-nonce"===s.toLowerCase()&&n[s]===e.nonce)return i(t);return i({...t,headers:{...n,"X-WP-Nonce":e.nonce}})};return e.nonce=t,e},Z=(t,e)=>{let i,n,s=t.path;return"string"==typeof t.namespace&&"string"==typeof t.endpoint&&(i=t.namespace.replace(/^\/|\/$/g,""),n=t.endpoint.replace(/^\//,""),s=n?i+"/"+n:i),delete t.namespace,delete t.endpoint,e({...t,path:s})},tt=t=>(e,i)=>Z(e,e=>{let n,s=e.url,o=e.path;return"string"==typeof o&&(n=t,-1!==t.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(o=o.replace("?","&")),s=n+o),i({...e,url:s})});function et(t){try{return decodeURIComponent(t)}catch{return t}}function it(t){const e=t.indexOf("?");if(-1===e)return t;const i=t.slice(0,e),n=t.slice(e+1);return n?i+"?"+n.split("&").map(t=>t.split("=")).map(t=>t.map(et)).sort((t,e)=>t[0].localeCompare(e[0])).map(t=>t.map(encodeURIComponent)).map(t=>t.join("=")).join("&"):i}function nt(t){return(function(t){let e;try{e=new URL(t,"http://example.com").search.substring(1)}catch{}if(e)return e}(t)||"").replace(/\+/g,"%20").split("&").reduce((t,e)=>{const i=e.indexOf("="),n=-1!==i,s=et(n?e.slice(0,i):e);if(s){const o=n?et(e.slice(i+1)):"";!function(t,e,i){const n=e.length,s=n-1;for(let o=0;o{"link"===e.toLowerCase()&&(t.headers[e]=i.replace(/<([^>]+)>/,(t,e)=>`<${encodeURI(e)}>`))}),Promise.resolve(e?t.body:new window.Response(JSON.stringify(t.body),{status:200,statusText:"OK",headers:t.headers}))}}var ct=function(t){const{OPTIONS:e={},...i}=Object.fromEntries(Object.entries(t).map(([t,e])=>[it(t),e])),n=new Set(Object.keys(i)),s=new Set(Object.keys(e));let o=!1;const r=(t,r)=>{const{parse:a=!0}=t;let l=t.path;if(!l&&t.url){const{rest_route:e,...i}=nt(t.url);"string"==typeof e&&(l=ot(e,i))}if("string"!=typeof l)return r(t);const c=t.method||"GET",h=it(l);if("GET"===c&&i[h]){const t=i[h];return o||delete i[h],n.delete(h),lt(t,!!a)}if("OPTIONS"===c&&e[h]){const t=e[h];return o||delete e[h],s.delete(h),lt(t,!!a)}return r(t)};return r[rt]=()=>{o=!0},r[at]=()=>{const t=[...Array.from(n,t=>`GET ${t}`),...Array.from(s,t=>`OPTIONS ${t}`)];t.length?console.warn("[api-fetch][preload] Some preloads were never consumed:",t):console.log("[api-fetch][preload] All preloads consumed."),n.clear(),s.clear();for(const t of Object.keys(i))delete i[t];for(const t of Object.keys(e))delete e[t]},r},ht=({path:t,url:e,...i},n)=>({...i,url:e&&ot(e,n),path:t&&ot(t,n)}),dt=t=>t.json?t.json():Promise.reject(t),ut=t=>{const{next:e}=(t=>{if(!t)return{};const e=t.match(/<([^>]+)>; rel="next"/);return e?{next:e[1]}:{}})(t.headers.get("link"));return e},ft=async(t,e)=>{if(!1===t.parse)return e(t);if(!(t=>{const e=!!t.path&&-1!==t.path.indexOf("per_page=-1"),i=!!t.url&&-1!==t.url.indexOf("per_page=-1");return e||i})(t))return e(t);const i=await Pt({...ht(t,{per_page:100}),parse:!1}),n=await dt(i);if(!Array.isArray(n))return n;let s=ut(i);if(!s)return n;let o=[].concat(n);for(;s;){const e=await Pt({...t,path:void 0,url:s,parse:!1}),i=await dt(e);o=o.concat(i),s=ut(e)}return o},pt=new Set(["PATCH","PUT","DELETE"]),gt="GET",mt=(t,e)=>{const{method:i=gt}=t;return pt.has(i.toUpperCase())&&(t={...t,headers:{"Content-Type":"application/json",...t.headers,"X-HTTP-Method-Override":i},method:"POST"}),e(t)};function bt(t,e){return nt(t)[e]}function vt(t,e){return void 0!==bt(t,e)}async function yt(t,e=!1){try{if("function"!=typeof t.text)return await t.json();const i=await t.text();return e&&""===i?null:JSON.parse(i)}catch{throw{code:"invalid_json",message:$("The response is not a valid JSON response.")}}}async function xt(t,e=!0){return e?204===t.status?null:await yt(t,!0):t}async function _t(t,e=!0){if(!e)throw t;throw await yt(t)}var wt=(t,e)=>{if(!function(t){const e=!!t.method&&"POST"===t.method;return(!!t.path&&-1!==t.path.indexOf("/wp/v2/media")||!!t.url&&-1!==t.url.indexOf("/wp/v2/media"))&&e}(t))return e(t);let i=0;const n=t=>(i++,e({path:`/wp/v2/media/${t}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>i<5?n(t):(e({path:`/wp/v2/media/${t}?force=true`,method:"DELETE"}),Promise.reject())));return e({...t,parse:!1}).catch(e=>{if(!(e instanceof globalThis.Response))return Promise.reject(e);const i=e.headers.get("x-wp-upload-attachment-id");return e.status>=500&&e.status<600&&i?n(i).catch(()=>!1!==t.parse?Promise.reject({code:"post_process",message:$("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(e)):_t(e,t.parse)}).then(e=>xt(e,t.parse))};function kt(t,...e){const i=t.replace(/^[^#]*/,""),n=(t=t.replace(/#.*/,"")).indexOf("?");if(-1===n)return t+i;const s=nt(t),o=t.substr(0,n);e.forEach(t=>delete s[t]);const r=st(s);return(r?o+"?"+r:o)+i}var St=t=>(e,i)=>{if("string"==typeof e.url){const i=bt(e.url,"wp_theme_preview");void 0===i?e.url=ot(e.url,{wp_theme_preview:t}):""===i&&(e.url=kt(e.url,"wp_theme_preview"))}if("string"==typeof e.path){const i=bt(e.path,"wp_theme_preview");void 0===i?e.path=ot(e.path,{wp_theme_preview:t}):""===i&&(e.path=kt(e.path,"wp_theme_preview"))}return i(e)},Mt={Accept:"application/json, */*;q=0.1"},Ot={credentials:"include"},Et=[(t,e)=>("string"!=typeof t.url||vt(t.url,"_locale")||(t.url=ot(t.url,{_locale:"user"})),"string"!=typeof t.path||vt(t.path,"_locale")||(t.path=ot(t.path,{_locale:"user"})),e(t)),Z,mt,ft];var At=t=>{const{url:e,path:i,data:n,parse:s=!0,...o}=t;let{body:r,headers:a}=t;a={...Mt,...a},n&&(r=JSON.stringify(n),a["Content-Type"]="application/json");return globalThis.fetch(e||i||window.location.href,{...Ot,...o,body:r,headers:a}).then(t=>t.ok?xt(t,s):_t(t,s),t=>{if(t&&"AbortError"===t.name)throw t;if(!globalThis.navigator.onLine)throw{code:"offline_error",message:$("Unable to connect. Please check your Internet connection.")};throw{code:"fetch_error",message:$("Could not get a valid response from the server.")}})},Tt=At;var Ct=t=>Et.reduceRight((t,e)=>i=>e(i,t),Tt)(t).catch(e=>"rest_cookie_invalid_nonce"!==e.code?Promise.reject(e):globalThis.fetch(Ct.nonceEndpoint).then(t=>t.ok?t.text():Promise.reject(e)).then(e=>(Ct.nonceMiddleware.nonce=e,Ct(t))));Ct.use=function(t){Et.unshift(t)},Ct.unregister=function(t){const e=Et.indexOf(t);return-1!==e&&(Et.splice(e,1),!0)},Ct.setFetchHandler=function(t){Tt=t},Ct.defaultFetchHandler=At,Ct.privateApis={},G(Ct.privateApis,{enablePreloadMultiUse:function(){for(const t of Et)t[rt]?.()},clearPreloadedData:function(){for(const t of Et)t[at]?.()}}),Ct.createNonceMiddleware=Q,Ct.createPreloadingMiddleware=ct,Ct.createRootURLMiddleware=tt,Ct.fetchAllMiddleware=ft,Ct.httpV1Middleware=mt,Ct.mediaUploadMiddleware=wt,Ct.createThemePreviewMiddleware=St;var Pt=Ct;const Lt={wpWrap:document.getElementById("wpwrap"),adminbar:document.getElementById("wpadminbar"),wpContent:document.getElementById("wpbody-content"),libraryWrap:document.getElementById("cloudinary-dam"),cloudinaryHeader:document.getElementById("cloudinary-header"),wpFooter:document.getElementById("wpfooter"),importStatus:document.getElementById("import-status"),downloading:{},_init(){const t=this,e=this.libraryWrap,i=this.importStatus;"undefined"!=typeof CLDN&&document.querySelector(CLDN.mloptions.inline_container)&&(Pt.use(Pt.createNonceMiddleware(CLDN.nonce)),cloudinary.openMediaLibrary(CLDN.mloptions,{insertHandler(n){const s=[];for(let o=0;o{o.style.opacity=1},250),void 0!==n.fetch?Pt({path:cldData.dam.fetch_url,data:{src:n.url,filename:n.filename,attachment_id:n.attachment_id,transformations:n.transformations},method:"POST"}).then(e=>{e&&!1===e.success&&t.showError(e.data)}).catch(e=>{t.showError(e&&e.message)}).finally(()=>{t.removeProgress(s,r)}):t.removeProgress(s,r)})}}}),window.addEventListener("resize",function(){t._resize()}),t._resize())},_resize(){this.libraryWrap.style.height=this.wpFooter.offsetTop-this.libraryWrap.offsetTop-this.adminbar.offsetHeight+"px"},removeProgress(t,e){const i=t[e];delete t[e],i.removeChild(i.firstChild),setTimeout(()=>{i.style.opacity=0,setTimeout(()=>{i.parentNode.removeChild(i),Object.keys(t).length||(this.libraryWrap.style.marginRight="0px",this.importStatus.style.display="none")},1e3)},500)},showError(t){window.alert(t||$("Could not import the asset.","cloudinary"))},makeProgress(t){const e=document.createElement("div"),i=document.createElement("span"),n=document.createElement("span");return e.classList.add("cld-import-item"),i.classList.add("spinner"),n.classList.add("cld-import-item-id"),n.innerText=t.public_id,e.appendChild(i),e.appendChild(n),e}};window.addEventListener("load",()=>Lt._init());const Dt={_init(){const t=this;if("undefined"!=typeof CLDIS){[...document.getElementsByClassName("cld-notice-box")].forEach(e=>{const i=e.getElementsByClassName("notice-dismiss");i.length&&i[0].addEventListener("click",i=>{e.style.height=e.offsetHeight+"px",i.preventDefault(),setTimeout(function(){t._dismiss(e)},5)})})}},_dismiss(t){const e=t.dataset.dismiss,i=parseInt(t.dataset.duration);t.classList.add("dismissed"),t.style.height="0px",setTimeout(function(){t.remove()},400),00&&Nt(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Nt(n.height)/t.offsetHeight||1);var r=(Rt(t)?It(t):window).visualViewport,a=!Vt()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/s,c=(n.top+(a&&r?r.offsetTop:0))/o,h=n.width/s,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function $t(t){var e=It(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ut(t){return t?(t.nodeName||"").toLowerCase():null}function qt(t){return((Rt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Yt(t){return Ht(qt(t)).left+$t(t).scrollLeft}function Xt(t){return It(t).getComputedStyle(t)}function Jt(t){var e=Xt(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function Gt(t,e,i){void 0===i&&(i=!1);var n,s,o=jt(e),r=jt(e)&&function(t){var e=t.getBoundingClientRect(),i=Nt(e.width)/t.offsetWidth||1,n=Nt(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=qt(e),l=Ht(t,r,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!i)&&(("body"!==Ut(e)||Jt(a))&&(c=(n=e)!==It(n)&&jt(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:$t(n)),jt(e)?((h=Ht(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=Yt(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function Kt(t){var e=Ht(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Qt(t){return"html"===Ut(t)?t:t.assignedSlot||t.parentNode||(Ft(t)?t.host:null)||qt(t)}function Zt(t){return["html","body","#document"].indexOf(Ut(t))>=0?t.ownerDocument.body:jt(t)&&Jt(t)?t:Zt(Qt(t))}function te(t,e){var i;void 0===e&&(e=[]);var n=Zt(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=It(n),r=s?[o].concat(o.visualViewport||[],Jt(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(te(Qt(r)))}function ee(t){return["table","td","th"].indexOf(Ut(t))>=0}function ie(t){return jt(t)&&"fixed"!==Xt(t).position?t.offsetParent:null}function ne(t){for(var e=It(t),i=ie(t);i&&ee(i)&&"static"===Xt(i).position;)i=ie(i);return i&&("html"===Ut(i)||"body"===Ut(i)&&"static"===Xt(i).position)?e:i||function(t){var e=/firefox/i.test(Wt());if(/Trident/i.test(Wt())&&jt(t)&&"fixed"===Xt(t).position)return null;var i=Qt(t);for(Ft(i)&&(i=i.host);jt(i)&&["html","body"].indexOf(Ut(i))<0;){var n=Xt(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}var se="top",oe="bottom",re="right",ae="left",le="auto",ce=[se,oe,re,ae],he="start",de="end",ue="viewport",fe="popper",pe=ce.reduce(function(t,e){return t.concat([e+"-"+he,e+"-"+de])},[]),ge=[].concat(ce,[le]).reduce(function(t,e){return t.concat([e,e+"-"+he,e+"-"+de])},[]),me=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function be(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}}),n.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){i.has(t.name)||s(t)}),n}var ve={placement:"bottom",modifiers:[],strategy:"absolute"};function ye(){for(var t=arguments.length,e=new Array(t),i=0;i=0?"x":"y"}function Me(t){var e,i=t.reference,n=t.element,s=t.placement,o=s?we(s):null,r=s?ke(s):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case se:e={x:a,y:i.y-n.height};break;case oe:e={x:a,y:i.y+i.height};break;case re:e={x:i.x+i.width,y:l};break;case ae:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?Se(o):null;if(null!=c){var h="y"===c?"height":"width";switch(r){case he:e[c]=e[c]-(i[h]/2-n[h]/2);break;case de:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}var Oe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ee(t){var e,i=t.popper,n=t.popperRect,s=t.placement,o=t.variation,r=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,d=t.isFixed,u=r.x,f=void 0===u?0:u,p=r.y,g=void 0===p?0:p,m="function"==typeof h?h({x:f,y:g}):{x:f,y:g};f=m.x,g=m.y;var b=r.hasOwnProperty("x"),v=r.hasOwnProperty("y"),y=ae,x=se,_=window;if(c){var w=ne(i),k="clientHeight",S="clientWidth";if(w===It(i)&&"static"!==Xt(w=qt(i)).position&&"absolute"===a&&(k="scrollHeight",S="scrollWidth"),s===se||(s===ae||s===re)&&o===de)x=oe,g-=(d&&w===_&&_.visualViewport?_.visualViewport.height:w[k])-n.height,g*=l?1:-1;if(s===ae||(s===se||s===oe)&&o===de)y=re,f-=(d&&w===_&&_.visualViewport?_.visualViewport.width:w[S])-n.width,f*=l?1:-1}var M,O=Object.assign({position:a},c&&Oe),E=!0===h?function(t,e){var i=t.x,n=t.y,s=e.devicePixelRatio||1;return{x:Nt(i*s)/s||0,y:Nt(n*s)/s||0}}({x:f,y:g},It(i)):{x:f,y:g};return f=E.x,g=E.y,l?Object.assign({},O,((M={})[x]=v?"0":"",M[y]=b?"0":"",M.transform=(_.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",M)):Object.assign({},O,((e={})[x]=v?g+"px":"",e[y]=b?f+"px":"",e.transform="",e))}const Ae={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];jt(s)&&Ut(s)&&(Object.assign(s.style,i),Object.keys(n).forEach(function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(t){var n=e.elements[t],s=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce(function(t,e){return t[e]="",t},{});jt(n)&&Ut(n)&&(Object.assign(n.style,o),Object.keys(s).forEach(function(t){n.removeAttribute(t)}))})}},requires:["computeStyles"]};const Te={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.offset,o=void 0===s?[0,0]:s,r=ge.reduce(function(t,i){return t[i]=function(t,e,i){var n=we(t),s=[ae,se].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[ae,re].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}(i,e.rects,o),t},{}),a=r[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}};var Ce={left:"right",right:"left",bottom:"top",top:"bottom"};function Pe(t){return t.replace(/left|right|bottom|top/g,function(t){return Ce[t]})}var Le={start:"end",end:"start"};function De(t){return t.replace(/start|end/g,function(t){return Le[t]})}function Ie(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Ft(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Re(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function je(t,e,i){return e===ue?Re(function(t,e){var i=It(t),n=qt(t),s=i.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=Vt();(c||!c&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+Yt(t),y:l}}(t,i)):Rt(e)?function(t,e){var i=Ht(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):Re(function(t){var e,i=qt(t),n=$t(t),s=null==(e=t.ownerDocument)?void 0:e.body,o=zt(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=zt(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+Yt(t),l=-n.scrollTop;return"rtl"===Xt(s||i).direction&&(a+=zt(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}(qt(t)))}function Fe(t,e,i,n){var s="clippingParents"===e?function(t){var e=te(Qt(t)),i=["absolute","fixed"].indexOf(Xt(t).position)>=0&&jt(t)?ne(t):t;return Rt(i)?e.filter(function(t){return Rt(t)&&Ie(t,i)&&"body"!==Ut(t)}):[]}(t):[].concat(e),o=[].concat(s,[i]),r=o[0],a=o.reduce(function(e,i){var s=je(t,i,n);return e.top=zt(s.top,e.top),e.right=Bt(s.right,e.right),e.bottom=Bt(s.bottom,e.bottom),e.left=zt(s.left,e.left),e},je(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ze(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Be(t,e){return e.reduce(function(e,i){return e[i]=t,e},{})}function Ne(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=void 0===n?t.placement:n,o=i.strategy,r=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?"clippingParents":a,c=i.rootBoundary,h=void 0===c?ue:c,d=i.elementContext,u=void 0===d?fe:d,f=i.altBoundary,p=void 0!==f&&f,g=i.padding,m=void 0===g?0:g,b=ze("number"!=typeof m?m:Be(m,ce)),v=u===fe?"reference":fe,y=t.rects.popper,x=t.elements[p?v:u],_=Fe(Rt(x)?x:x.contextElement||qt(t.elements.popper),l,h,r),w=Ht(t.elements.reference),k=Me({reference:w,element:y,strategy:"absolute",placement:s}),S=Re(Object.assign({},y,k)),M=u===fe?S:w,O={top:_.top-M.top+b.top,bottom:M.bottom-_.bottom+b.bottom,left:_.left-M.left+b.left,right:M.right-_.right+b.right},E=t.modifiersData.offset;if(u===fe&&E){var A=E[s];Object.keys(O).forEach(function(t){var e=[re,oe].indexOf(t)>=0?1:-1,i=[se,oe].indexOf(t)>=0?"y":"x";O[t]+=A[i]*e})}return O}function We(t,e,i){return zt(t,Bt(e,i))}const Ve={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0!==r&&r,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,u=i.tether,f=void 0===u||u,p=i.tetherOffset,g=void 0===p?0:p,m=Ne(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),b=we(e.placement),v=ke(e.placement),y=!v,x=Se(b),_="x"===x?"y":"x",w=e.modifiersData.popperOffsets,k=e.rects.reference,S=e.rects.popper,M="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,O="number"==typeof M?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),E=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,A={x:0,y:0};if(w){if(o){var T,C="y"===x?se:ae,P="y"===x?oe:re,L="y"===x?"height":"width",D=w[x],I=D+m[C],R=D-m[P],j=f?-S[L]/2:0,F=v===he?k[L]:S[L],z=v===he?-S[L]:-k[L],B=e.elements.arrow,N=f&&B?Kt(B):{width:0,height:0},W=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=W[C],H=W[P],$=We(0,k[L],N[L]),U=y?k[L]/2-j-$-V-O.mainAxis:F-$-V-O.mainAxis,q=y?-k[L]/2+j+$+H+O.mainAxis:z+$+H+O.mainAxis,Y=e.elements.arrow&&ne(e.elements.arrow),X=Y?"y"===x?Y.clientTop||0:Y.clientLeft||0:0,J=null!=(T=null==E?void 0:E[x])?T:0,G=D+q-J,K=We(f?Bt(I,D+U-J-X):I,D,f?zt(R,G):R);w[x]=K,A[x]=K-D}if(a){var Q,Z="x"===x?se:ae,tt="x"===x?oe:re,et=w[_],it="y"===_?"height":"width",nt=et+m[Z],st=et-m[tt],ot=-1!==[se,ae].indexOf(b),rt=null!=(Q=null==E?void 0:E[_])?Q:0,at=ot?nt:et-k[it]-S[it]-rt+O.altAxis,lt=ot?et+k[it]+S[it]-rt-O.altAxis:st,ct=f&&ot?function(t,e,i){var n=We(t,e,i);return n>i?i:n}(at,et,lt):We(f?at:nt,et,f?lt:st);w[_]=ct,A[_]=ct-et}e.modifiersData[n]=A}},requiresIfExists:["offset"]};const He={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,s=t.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,a=we(i.placement),l=Se(a),c=[ae,re].indexOf(a)>=0?"height":"width";if(o&&r){var h=function(t,e){return ze("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Be(t,ce))}(s.padding,i),d=Kt(o),u="y"===l?se:ae,f="y"===l?oe:re,p=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],g=r[l]-i.rects.reference[l],m=ne(o),b=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,v=p/2-g/2,y=h[u],x=b-d[c]-h[f],_=b/2-d[c]/2+v,w=We(y,_,x),k=l;i.modifiersData[n]=((e={})[k]=w,e.centerOffset=w-_,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Ie(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function $e(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Ue(t){return[se,re,oe,ae].some(function(e){return t[e]>=0})}var qe=xe({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,l=It(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(t){t.addEventListener("scroll",i.update,_e)}),a&&l.addEventListener("resize",i.update,_e),function(){o&&c.forEach(function(t){t.removeEventListener("scroll",i.update,_e)}),a&&l.removeEventListener("resize",i.update,_e)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=Me({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:we(e.placement),variation:ke(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Ee(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ee(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},Ae,Te,{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0===r||r,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,u=i.altBoundary,f=i.flipVariations,p=void 0===f||f,g=i.allowedAutoPlacements,m=e.options.placement,b=we(m),v=l||(b===m||!p?[Pe(m)]:function(t){if(we(t)===le)return[];var e=Pe(t);return[De(t),e,De(e)]}(m)),y=[m].concat(v).reduce(function(t,i){return t.concat(we(i)===le?function(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,o=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?ge:l,h=ke(n),d=h?a?pe:pe.filter(function(t){return ke(t)===h}):ce,u=d.filter(function(t){return c.indexOf(t)>=0});0===u.length&&(u=d);var f=u.reduce(function(e,i){return e[i]=Ne(t,{placement:i,boundary:s,rootBoundary:o,padding:r})[we(i)],e},{});return Object.keys(f).sort(function(t,e){return f[t]-f[e]})}(e,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:g}):i)},[]),x=e.rects.reference,_=e.rects.popper,w=new Map,k=!0,S=y[0],M=0;M=0,C=T?"width":"height",P=Ne(e,{placement:O,boundary:h,rootBoundary:d,altBoundary:u,padding:c}),L=T?A?re:ae:A?oe:se;x[C]>_[C]&&(L=Pe(L));var D=Pe(L),I=[];if(o&&I.push(P[E]<=0),a&&I.push(P[L]<=0,P[D]<=0),I.every(function(t){return t})){S=O,k=!1;break}w.set(O,I)}if(k)for(var R=function(t){var e=y.find(function(e){var i=w.get(e);if(i)return i.slice(0,t).every(function(t){return t})});if(e)return S=e,"break"},j=p?3:1;j>0;j--){if("break"===R(j))break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Ve,He,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=Ne(e,{elementContext:"reference"}),a=Ne(e,{altBoundary:!0}),l=$e(r,n),c=$e(a,s,o),h=Ue(l),d=Ue(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}}]}),Ye="tippy-content",Xe="tippy-backdrop",Je="tippy-arrow",Ge="tippy-svg-arrow",Ke={passive:!0,capture:!0},Qe=function(){return document.body};function Ze(t,e,i){if(Array.isArray(t)){var n=t[e];return n??(Array.isArray(i)?i[e]:i)}return t}function ti(t,e){var i={}.toString.call(t);return 0===i.indexOf("[object")&&i.indexOf(e+"]")>-1}function ei(t,e){return"function"==typeof t?t.apply(void 0,e):t}function ii(t,e){return 0===e?t:function(n){clearTimeout(i),i=setTimeout(function(){t(n)},e)};var i}function ni(t){return[].concat(t)}function si(t,e){-1===t.indexOf(e)&&t.push(e)}function oi(t){return t.split("-")[0]}function ri(t){return[].slice.call(t)}function ai(t){return Object.keys(t).reduce(function(e,i){return void 0!==t[i]&&(e[i]=t[i]),e},{})}function li(){return document.createElement("div")}function ci(t){return["Element","Fragment"].some(function(e){return ti(t,e)})}function hi(t){return ti(t,"MouseEvent")}function di(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function ui(t){return ci(t)?[t]:function(t){return ti(t,"NodeList")}(t)?ri(t):Array.isArray(t)?t:ri(document.querySelectorAll(t))}function fi(t,e){t.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function pi(t,e){t.forEach(function(t){t&&t.setAttribute("data-state",e)})}function gi(t){var e,i=ni(t)[0];return null!=i&&null!=(e=i.ownerDocument)&&e.body?i.ownerDocument:document}function mi(t,e,i){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(e){t[n](e,i)})}function bi(t,e){for(var i=e;i;){var n;if(t.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var vi={isTouch:!1},yi=0;function xi(){vi.isTouch||(vi.isTouch=!0,window.performance&&document.addEventListener("mousemove",_i))}function _i(){var t=performance.now();t-yi<20&&(vi.isTouch=!1,document.removeEventListener("mousemove",_i)),yi=t}function wi(){var t=document.activeElement;if(di(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}var ki=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Si={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Mi=Object.assign({appendTo:Qe,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Si,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Oi=Object.keys(Mi);function Ei(t){var e=(t.plugins||[]).reduce(function(e,i){var n,s=i.name,o=i.defaultValue;s&&(e[s]=void 0!==t[s]?t[s]:null!=(n=Mi[s])?n:o);return e},{});return Object.assign({},t,e)}function Ai(t,e){var i=Object.assign({},e,{content:ei(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(Ei(Object.assign({},Mi,{plugins:e}))):Oi).reduce(function(e,i){var n=(t.getAttribute("data-tippy-"+i)||"").trim();if(!n)return e;if("content"===i)e[i]=n;else try{e[i]=JSON.parse(n)}catch(t){e[i]=n}return e},{})}(t,e.plugins));return i.aria=Object.assign({},Mi.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?e.interactive:i.aria.expanded,content:"auto"===i.aria.content?e.interactive?null:"describedby":i.aria.content},i}function Ti(t,e){t.innerHTML=e}function Ci(t){var e=li();return!0===t?e.className=Je:(e.className=Ge,ci(t)?e.appendChild(t):Ti(e,t)),e}function Pi(t,e){ci(e.content)?(Ti(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ti(t,e.content):t.textContent=e.content)}function Li(t){var e=t.firstElementChild,i=ri(e.children);return{box:e,content:i.find(function(t){return t.classList.contains(Ye)}),arrow:i.find(function(t){return t.classList.contains(Je)||t.classList.contains(Ge)}),backdrop:i.find(function(t){return t.classList.contains(Xe)})}}function Di(t){var e=li(),i=li();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=li();function s(i,n){var s=Li(e),o=s.box,r=s.content,a=s.arrow;n.theme?o.setAttribute("data-theme",n.theme):o.removeAttribute("data-theme"),"string"==typeof n.animation?o.setAttribute("data-animation",n.animation):o.removeAttribute("data-animation"),n.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?o.setAttribute("role",n.role):o.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||Pi(r,t.props),n.arrow?a?i.arrow!==n.arrow&&(o.removeChild(a),o.appendChild(Ci(n.arrow))):o.appendChild(Ci(n.arrow)):a&&o.removeChild(a)}return n.className=Ye,n.setAttribute("data-state","hidden"),Pi(n,t.props),e.appendChild(i),i.appendChild(n),s(t.props,t.props),{popper:e,onUpdate:s}}Di.$$tippy=!0;var Ii=1,Ri=[],ji=[];function Fi(t,e){var i,n,s,o,r,a,l,c,h=Ai(t,Object.assign({},Mi,Ei(ai(e)))),d=!1,u=!1,f=!1,p=!1,g=[],m=ii(Y,h.interactiveDebounce),b=Ii++,v=(c=h.plugins).filter(function(t,e){return c.indexOf(t)===e}),y={id:b,reference:t,popper:li(),popperInstance:null,props:h,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(s)},setProps:function(e){0;if(y.state.isDestroyed)return;D("onBeforeUpdate",[y,e]),U();var i=y.props,n=Ai(t,Object.assign({},i,ai(e),{ignoreAttributes:!0}));y.props=n,$(),i.interactiveDebounce!==n.interactiveDebounce&&(j(),m=ii(Y,n.interactiveDebounce));i.triggerTarget&&!n.triggerTarget?ni(i.triggerTarget).forEach(function(t){t.removeAttribute("aria-expanded")}):n.triggerTarget&&t.removeAttribute("aria-expanded");R(),L(),w&&w(i,n);y.popperInstance&&(K(),Z().forEach(function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}));D("onAfterUpdate",[y,e])},setContent:function(t){y.setProps({content:t})},show:function(){0;var t=y.state.isVisible,e=y.state.isDestroyed,i=!y.state.isEnabled,n=vi.isTouch&&!y.props.touch,s=Ze(y.props.duration,0,Mi.duration);if(t||e||i||n)return;if(A().hasAttribute("disabled"))return;if(D("onShow",[y],!1),!1===y.props.onShow(y))return;y.state.isVisible=!0,E()&&(_.style.visibility="visible");L(),N(),y.state.isMounted||(_.style.transition="none");if(E()){var o=C();fi([o.box,o.content],0)}a=function(){var t;if(y.state.isVisible&&!p){if(p=!0,_.offsetHeight,_.style.transition=y.props.moveTransition,E()&&y.props.animation){var e=C(),i=e.box,n=e.content;fi([i,n],s),pi([i,n],"visible")}I(),R(),si(ji,y),null==(t=y.popperInstance)||t.forceUpdate(),D("onMount",[y]),y.props.animation&&E()&&function(t,e){V(t,e)}(s,function(){y.state.isShown=!0,D("onShown",[y])})}},function(){var t,e=y.props.appendTo,i=A();t=y.props.interactive&&e===Qe||"parent"===e?i.parentNode:ei(e,[i]);t.contains(_)||t.appendChild(_);y.state.isMounted=!0,K(),!1}()},hide:function(){0;var t=!y.state.isVisible,e=y.state.isDestroyed,i=!y.state.isEnabled,n=Ze(y.props.duration,1,Mi.duration);if(t||e||i)return;if(D("onHide",[y],!1),!1===y.props.onHide(y))return;y.state.isVisible=!1,y.state.isShown=!1,p=!1,d=!1,E()&&(_.style.visibility="hidden");if(j(),W(),L(!0),E()){var s=C(),o=s.box,r=s.content;y.props.animation&&(fi([o,r],n),pi([o,r],"hidden"))}I(),R(),y.props.animation?E()&&function(t,e){V(t,function(){!y.state.isVisible&&_.parentNode&&_.parentNode.contains(_)&&e()})}(n,y.unmount):y.unmount()},hideWithInteractivity:function(t){0;T().addEventListener("mousemove",m),si(Ri,m),m(t)},enable:function(){y.state.isEnabled=!0},disable:function(){y.hide(),y.state.isEnabled=!1},unmount:function(){0;y.state.isVisible&&y.hide();if(!y.state.isMounted)return;Q(),Z().forEach(function(t){t._tippy.unmount()}),_.parentNode&&_.parentNode.removeChild(_);ji=ji.filter(function(t){return t!==y}),y.state.isMounted=!1,D("onHidden",[y])},destroy:function(){0;if(y.state.isDestroyed)return;y.clearDelayTimeouts(),y.unmount(),U(),delete t._tippy,y.state.isDestroyed=!0,D("onDestroy",[y])}};if(!h.render)return y;var x=h.render(y),_=x.popper,w=x.onUpdate;_.setAttribute("data-tippy-root",""),_.id="tippy-"+y.id,y.popper=_,t._tippy=y,_._tippy=y;var k=v.map(function(t){return t.fn(y)}),S=t.hasAttribute("aria-expanded");return $(),R(),L(),D("onCreate",[y]),h.showOnCreate&&tt(),_.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),_.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&T().addEventListener("mousemove",m)}),y;function M(){var t=y.props.touch;return Array.isArray(t)?t:[t,0]}function O(){return"hold"===M()[0]}function E(){var t;return!(null==(t=y.props.render)||!t.$$tippy)}function A(){return l||t}function T(){var t=A().parentNode;return t?gi(t):document}function C(){return Li(_)}function P(t){return y.state.isMounted&&!y.state.isVisible||vi.isTouch||o&&"focus"===o.type?0:Ze(y.props.delay,t?0:1,Mi.delay)}function L(t){void 0===t&&(t=!1),_.style.pointerEvents=y.props.interactive&&!t?"":"none",_.style.zIndex=""+y.props.zIndex}function D(t,e,i){var n;(void 0===i&&(i=!0),k.forEach(function(i){i[t]&&i[t].apply(i,e)}),i)&&(n=y.props)[t].apply(n,e)}function I(){var e=y.props.aria;if(e.content){var i="aria-"+e.content,n=_.id;ni(y.props.triggerTarget||t).forEach(function(t){var e=t.getAttribute(i);if(y.state.isVisible)t.setAttribute(i,e?e+" "+n:n);else{var s=e&&e.replace(n,"").trim();s?t.setAttribute(i,s):t.removeAttribute(i)}})}}function R(){!S&&y.props.aria.expanded&&ni(y.props.triggerTarget||t).forEach(function(t){y.props.interactive?t.setAttribute("aria-expanded",y.state.isVisible&&t===A()?"true":"false"):t.removeAttribute("aria-expanded")})}function j(){T().removeEventListener("mousemove",m),Ri=Ri.filter(function(t){return t!==m})}function F(e){if(!vi.isTouch||!f&&"mousedown"!==e.type){var i=e.composedPath&&e.composedPath()[0]||e.target;if(!y.props.interactive||!bi(_,i)){if(ni(y.props.triggerTarget||t).some(function(t){return bi(t,i)})){if(vi.isTouch)return;if(y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else D("onClickOutside",[y,e]);!0===y.props.hideOnClick&&(y.clearDelayTimeouts(),y.hide(),u=!0,setTimeout(function(){u=!1}),y.state.isMounted||W())}}}function z(){f=!0}function B(){f=!1}function N(){var t=T();t.addEventListener("mousedown",F,!0),t.addEventListener("touchend",F,Ke),t.addEventListener("touchstart",B,Ke),t.addEventListener("touchmove",z,Ke)}function W(){var t=T();t.removeEventListener("mousedown",F,!0),t.removeEventListener("touchend",F,Ke),t.removeEventListener("touchstart",B,Ke),t.removeEventListener("touchmove",z,Ke)}function V(t,e){var i=C().box;function n(t){t.target===i&&(mi(i,"remove",n),e())}if(0===t)return e();mi(i,"remove",r),mi(i,"add",n),r=n}function H(e,i,n){void 0===n&&(n=!1),ni(y.props.triggerTarget||t).forEach(function(t){t.addEventListener(e,i,n),g.push({node:t,eventType:e,handler:i,options:n})})}function $(){var t;O()&&(H("touchstart",q,{passive:!0}),H("touchend",X,{passive:!0})),(t=y.props.trigger,t.split(/\s+/).filter(Boolean)).forEach(function(t){if("manual"!==t)switch(H(t,q),t){case"mouseenter":H("mouseleave",X);break;case"focus":H(ki?"focusout":"blur",J);break;case"focusin":H("focusout",J)}})}function U(){g.forEach(function(t){var e=t.node,i=t.eventType,n=t.handler,s=t.options;e.removeEventListener(i,n,s)}),g=[]}function q(t){var e,i=!1;if(y.state.isEnabled&&!G(t)&&!u){var n="focus"===(null==(e=o)?void 0:e.type);o=t,l=t.currentTarget,R(),!y.state.isVisible&&hi(t)&&Ri.forEach(function(e){return e(t)}),"click"===t.type&&(y.props.trigger.indexOf("mouseenter")<0||d)&&!1!==y.props.hideOnClick&&y.state.isVisible?i=!0:tt(t),"click"===t.type&&(d=!i),i&&!n&&et(t)}}function Y(t){var e=t.target,i=A().contains(e)||_.contains(e);if("mousemove"!==t.type||!i){var n=Z().concat(_).map(function(t){var e,i=null==(e=t._tippy.popperInstance)?void 0:e.state;return i?{popperRect:t.getBoundingClientRect(),popperState:i,props:h}:null}).filter(Boolean);(function(t,e){var i=e.clientX,n=e.clientY;return t.every(function(t){var e=t.popperRect,s=t.popperState,o=t.props.interactiveBorder,r=oi(s.placement),a=s.modifiersData.offset;if(!a)return!0;var l="bottom"===r?a.top.y:0,c="top"===r?a.bottom.y:0,h="right"===r?a.left.x:0,d="left"===r?a.right.x:0,u=e.top-n+l>o,f=n-e.bottom-c>o,p=e.left-i+h>o,g=i-e.right-d>o;return u||f||p||g})})(n,t)&&(j(),et(t))}}function X(t){G(t)||y.props.trigger.indexOf("click")>=0&&d||(y.props.interactive?y.hideWithInteractivity(t):et(t))}function J(t){y.props.trigger.indexOf("focusin")<0&&t.target!==A()||y.props.interactive&&t.relatedTarget&&_.contains(t.relatedTarget)||et(t)}function G(t){return!!vi.isTouch&&O()!==t.type.indexOf("touch")>=0}function K(){Q();var e=y.props,i=e.popperOptions,n=e.placement,s=e.offset,o=e.getReferenceClientRect,r=e.moveTransition,l=E()?Li(_).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||A()}:t,h={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(E()){var i=C().box;["placement","reference-hidden","escaped"].forEach(function(t){"placement"===t?i.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?i.setAttribute("data-"+t,""):i.removeAttribute("data-"+t)}),e.attributes.popper={}}}},d=[{name:"offset",options:{offset:s}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!r}},h];E()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==i?void 0:i.modifiers)||[]),y.popperInstance=qe(c,_,Object.assign({},i,{placement:n,onFirstUpdate:a,modifiers:d}))}function Q(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function Z(){return ri(_.querySelectorAll("[data-tippy-root]"))}function tt(t){y.clearDelayTimeouts(),t&&D("onTrigger",[y,t]),N();var e=P(!0),n=M(),s=n[0],o=n[1];vi.isTouch&&"hold"===s&&o&&(e=o),e?i=setTimeout(function(){y.show()},e):y.show()}function et(t){if(y.clearDelayTimeouts(),D("onUntrigger",[y,t]),y.state.isVisible){if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&d)){var e=P(!1);e?n=setTimeout(function(){y.state.isVisible&&y.hide()},e):s=requestAnimationFrame(function(){y.hide()})}}else W()}}function zi(t,e){void 0===e&&(e={});var i=Mi.plugins.concat(e.plugins||[]);document.addEventListener("touchstart",xi,Ke),window.addEventListener("blur",wi);var n=Object.assign({},e,{plugins:i}),s=ui(t).reduce(function(t,e){var i=e&&Fi(e,n);return i&&t.push(i),t},[]);return ci(t)?s[0]:s}zi.defaultProps=Mi,zi.setDefaultProps=function(t){Object.keys(t).forEach(function(e){Mi[e]=t[e]})},zi.currentInput=vi;Object.assign({},Ae,{effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow)}});zi.setDefaultProps({render:Di});const Bi=zi;var Ni=i(951),Wi=i.n(Ni);const Vi={controlled:null,bind(t){this.controlled=t,this.controlled.forEach(t=>{this._main(t)}),this._init()},_init(){this.controlled.forEach(t=>{this._checkUp(t)})},_main(t){const e=JSON.parse(t.dataset.main);t.dataset.size&&(t.filesize=parseInt(t.dataset.size,10)),t.mains=e.map(e=>{const i=document.getElementById(e),n=document.getElementById(e+"_size_wrapper");return n&&(i.filesize=0,i.sizespan=n),this._addChild(i,t),i}),this._bindEvents(t),t.mains.forEach(t=>{this._bindEvents(t)})},_bindEvents(t){t.eventBound||(t.addEventListener("click",e=>{const i=e.target;i.elements&&(this._checkDown(i),this._evaluateSize(i)),i.mains&&this._checkUp(t)}),t.eventBound=!0)},_addChild(t,e){const i=t.elements?t.elements:[];-1===i.indexOf(e)&&(i.push(e),t.elements=i)},_removeChild(t,e){const i=t.elements.indexOf(e);-1{e.checked!==t.checked&&(e.checked=t.checked,e.disabled&&(e.checked=!1),e.dispatchEvent(new Event("change")))}),t.elements.forEach(e=>{this._checkDown(e),e.elements||this._checkUp(e,t)}))},_checkUp(t,e){t.mains&&[...t.mains].forEach(t=>{t!==e&&this._evaluateCheckStatus(t),this._checkUp(t),this._evaluateSize(t)})},_evaluateCheckStatus(t){let e=0,i=t.classList.contains("partial");i&&(t.classList.remove("partial"),i=!1),t.elements.forEach(n=>{null!==n.parentNode?(e+=n.checked,n.classList.contains("partial")&&(i=!0)):this._removeChild(t,n)});let n="some";e===t.elements.length?n="on":0===e?n="off":i=!0,i&&t.classList.add("partial");const s="off"!==n;t.checked===s&&t.value===n||(t.value=n,t.checked=s,t.dispatchEvent(new Event("change")))},_evaluateSize(t){if(t.sizespan&&t.elements){t.filesize=0,t.elements.forEach(e=>{e.checked&&(t.filesize+=e.filesize)});let e=null;0Math.max(Math.min(t,i),e);function Xi(t){return Yi(qi(2.55*t),0,255)}function Ji(t){return Yi(qi(255*t),0,255)}function Gi(t){return Yi(qi(t/2.55)/100,0,1)}function Ki(t){return Yi(qi(100*t),0,100)}const Qi={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Zi=[..."0123456789ABCDEF"],tn=t=>Zi[15&t],en=t=>Zi[(240&t)>>4]+Zi[15&t],nn=t=>(240&t)>>4==(15&t);function sn(t){var e=(t=>nn(t.r)&&nn(t.g)&&nn(t.b)&&nn(t.a))(t)?tn:en;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const on=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function rn(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function an(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function ln(t,e,i){const n=rn(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function cn(t){const e=t.r/255,i=t.g/255,n=t.b/255,s=Math.max(e,i,n),o=Math.min(e,i,n),r=(s+o)/2;let a,l,c;return s!==o&&(c=s-o,l=r>.5?c/(2-s-o):c/(s+o),a=function(t,e,i,n,s){return t===s?(e-i)/n+(e>16&255,o>>8&255,255&o]}return t}(),mn.transparent=[0,0,0,0]);const e=mn[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const vn=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const yn=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,xn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function _n(t,e,i){if(t){let n=cn(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=dn(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function wn(t,e){return t?Object.assign(e||{},t):t}function kn(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Ji(t[3]))):(e=wn(t,{r:0,g:0,b:0,a:1})).a=Ji(e.a),e}function Sn(t){return"r"===t.charAt(0)?function(t){const e=vn.exec(t);let i,n,s,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?Xi(t):Yi(255*t,0,255)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?Xi(i):Yi(i,0,255)),n=255&(e[4]?Xi(n):Yi(n,0,255)),s=255&(e[6]?Xi(s):Yi(s,0,255)),{r:i,g:n,b:s,a:o}}}(t):fn(t)}class Mn{constructor(t){if(t instanceof Mn)return t;const e=typeof t;let i;var n,s,o;"object"===e?i=kn(t):"string"===e&&(o=(n=t).length,"#"===n[0]&&(4===o||5===o?s={r:255&17*Qi[n[1]],g:255&17*Qi[n[2]],b:255&17*Qi[n[3]],a:5===o?17*Qi[n[4]]:255}:7!==o&&9!==o||(s={r:Qi[n[1]]<<4|Qi[n[2]],g:Qi[n[3]]<<4|Qi[n[4]],b:Qi[n[5]]<<4|Qi[n[6]],a:9===o?Qi[n[7]]<<4|Qi[n[8]]:255})),i=s||bn(t)||Sn(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=wn(this._rgb);return t&&(t.a=Gi(t.a)),t}set rgb(t){this._rgb=kn(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Gi(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?sn(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=cn(t),i=e[0],n=Ki(e[1]),s=Ki(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${Gi(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let s;const o=e===s?.5:e,r=2*o-1,a=i.a-n.a,l=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-l,i.r=255&l*i.r+s*n.r+.5,i.g=255&l*i.g+s*n.g+.5,i.b=255&l*i.b+s*n.b+.5,i.a=o*i.a+(1-o)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const n=xn(Gi(t.r)),s=xn(Gi(t.g)),o=xn(Gi(t.b));return{r:Ji(yn(n+i*(xn(Gi(e.r))-n))),g:Ji(yn(s+i*(xn(Gi(e.g))-s))),b:Ji(yn(o+i*(xn(Gi(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Mn(this.rgb)}alpha(t){return this._rgb.a=Ji(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=qi(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return _n(this._rgb,2,t),this}darken(t){return _n(this._rgb,2,-t),this}saturate(t){return _n(this._rgb,1,t),this}desaturate(t){return _n(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=cn(t);i[0]=un(i[0]+e),i=dn(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function On(){}const En=(()=>{let t=0;return()=>t++})();function An(t){return null==t}function Tn(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function Cn(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function Pn(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function Ln(t,e){return Pn(t)?t:e}function Dn(t,e){return void 0===t?e:t}const In=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Rn(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function jn(t,e,i,n){let s,o,r;if(Tn(t))if(o=t.length,n)for(s=o-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;st,x:t=>t.x,y:t=>t.y};function Un(t,e){const i=$n[e]||($n[e]=function(t){const e=function(t){const e=t.split("."),i=[];let n="";for(const t of e)n+=t,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function qn(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Yn=t=>void 0!==t,Xn=t=>"function"==typeof t,Jn=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};const Gn=Math.PI,Kn=2*Gn,Qn=Kn+Gn,Zn=Number.POSITIVE_INFINITY,ts=Gn/180,es=Gn/2,is=Gn/4,ns=2*Gn/3,ss=Math.log10,os=Math.sign;function rs(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function xs(t,e,i){i=i||(i=>t[i]1;)n=o+s>>1,i(n)?o=n:s=n;return{lo:o,hi:s}}const _s=(t,e,i,n)=>xs(t,i,n?n=>{const s=t[n][e];return st[n][e]xs(t,i,n=>t[n][e]>=i);const ks=["push","pop","shift","splice","unshift"];function Ss(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(ks.forEach(e=>{delete t[e]}),delete t._chartjs)}function Ms(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Os="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Es(t,e){let i=[],n=!1;return function(...s){i=s,n||(n=!0,Os.call(window,()=>{n=!1,t.apply(e,i)}))}}const As=t=>"start"===t?"left":"end"===t?"right":"center",Ts=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function Cs(t,e,i){const n=e.length;let s=0,o=n;if(t._sorted){const{iScale:r,vScale:a,_parsed:l}=t,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,h=r.axis,{min:d,max:u,minDefined:f,maxDefined:p}=r.getUserBounds();if(f){if(s=Math.min(_s(l,h,d).lo,i?n:_s(e,h,r.getPixelForValue(d)).lo),c){const t=l.slice(0,s+1).reverse().findIndex(t=>!An(t[a.axis]));s-=Math.max(0,t)}s=vs(s,0,n-1)}if(p){let t=Math.max(_s(l,r.axis,u,!0).hi+1,i?0:_s(e,h,r.getPixelForValue(u),!0).hi+1);if(c){const e=l.slice(t-1).findIndex(t=>!An(t[a.axis]));t+=Math.max(0,e)}o=vs(t,s,n)-s}else o=n-s}return{start:s,count:o}}function Ps(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const o=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),o}const Ls=t=>0===t||1===t,Ds=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*Kn/i),Is=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*Kn/i)+1,Rs={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*es),easeOutSine:t=>Math.sin(t*es),easeInOutSine:t=>-.5*(Math.cos(Gn*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Ls(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Ls(t)?t:Ds(t,.075,.3),easeOutElastic:t=>Ls(t)?t:Is(t,.075,.3),easeInOutElastic(t){const e=.1125;return Ls(t)?t:t<.5?.5*Ds(2*t,e,.45):.5+.5*Is(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Rs.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*Rs.easeInBounce(2*t):.5*Rs.easeOutBounce(2*t-1)+.5};function js(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Fs(t){return js(t)?t:new Mn(t)}function zs(t){return js(t)?t:new Mn(t).saturate(.5).darken(.1).hexString()}const Bs=["x","y","borderWidth","radius","tension"],Ns=["color","borderColor","backgroundColor"];const Ws=new Map;function Vs(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=Ws.get(i);return n||(n=new Intl.NumberFormat(t,e),Ws.set(i,n)),n}(e,i).format(t)}const Hs={values:t=>Tn(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let s,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(s="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const r=ss(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Vs(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(ss(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?Hs.numeric.call(this,t,e,i):""}};var $s={formatters:Hs};const Us=Object.create(null),qs=Object.create(null);function Ys(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>zs(e.backgroundColor),this.hoverBorderColor=(t,e)=>zs(e.borderColor),this.hoverColor=(t,e)=>zs(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Xs(this,t,e)}get(t){return Ys(this,t)}describe(t,e){return Xs(qs,t,e)}override(t,e){return Xs(Us,t,e)}route(t,e,i,n){const s=Ys(this,t),o=Ys(this,i),r="_"+e;Object.defineProperties(s,{[r]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=o[n];return Cn(t)?Object.assign({},e,t):Dn(t,e)},set(t){this[r]=t}}})}apply(t){t.forEach(t=>t(this))}}var Gs=new Js({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Ns},numbers:{type:"number",properties:Bs}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:$s.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function Ks(t,e,i,n,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,i.push(s)),o>n&&(n=o),n}function Qs(t,e,i,n){let s=(n=n||{}).data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},o=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const a=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function no(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==o.strokeColor;let l,c;for(t.save(),t.font=s.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),An(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l+t||0;function bo(t,e){const i={},n=Cn(e),s=n?Object.keys(e):e,o=Cn(t)?n?i=>Dn(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of s)i[t]=mo(o(t));return i}function vo(t){return bo(t,{top:"y",right:"x",bottom:"y",left:"x"})}function yo(t){return bo(t,["topLeft","topRight","bottomLeft","bottomRight"])}function xo(t){const e=vo(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function _o(t,e){t=t||{},e=e||Gs.font;let i=Dn(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=Dn(t.style,e.style);n&&!(""+n).match(po)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:Dn(t.family,e.family),lineHeight:go(Dn(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:Dn(t.weight,e.weight),string:""};return s.string=function(t){return!t||An(t.size)||An(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(s),s}function wo(t,e,i,n){let s,o,r,a=!0;for(s=0,o=t.length;st[0]){const o=i||t;void 0===n&&(n=Ro("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:n,_getTarget:s,override:i=>So([i,...t],e,o,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>To(i,n,()=>function(t,e,i,n){let s;for(const o of e)if(s=Ro(Eo(o,t),i),void 0!==s)return Ao(t,s)?Do(i,n,t,s):s}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>jo(t).includes(e),ownKeys:t=>jo(t),set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function Mo(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Oo(t,n),setContext:e=>Mo(t,e,i,n),override:s=>Mo(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>To(t,e,()=>function(t,e,i){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=t;let a=n[e];Xn(a)&&r.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(o,r||n);a.delete(t),Ao(t,l)&&(l=Do(s._scopes,s,t,l));return l}(e,a,t,i));Tn(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=i;if(void 0!==o.index&&n(t))return e[o.index%e.length];if(Cn(e[0])){const i=e,n=s._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=Do(n,s,t,l);e.push(Mo(i,o,r&&r[t],a))}}return e}(e,a,t,r.isIndexable));Ao(e,a)&&(a=Mo(a,s,o&&o[e],r));return a}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function Oo(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:Xn(i)?i:()=>i,isIndexable:Xn(n)?n:()=>n}}const Eo=(t,e)=>t?t+qn(e):e,Ao=(t,e)=>Cn(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function To(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const n=i();return t[e]=n,n}function Co(t,e,i){return Xn(t)?t(e,i):t}const Po=(t,e)=>!0===t?e:"string"==typeof t?Un(e,t):void 0;function Lo(t,e,i,n,s){for(const o of e){const e=Po(i,o);if(e){t.add(e);const o=Co(e._fallback,i,s);if(void 0!==o&&o!==i&&o!==n)return o}else if(!1===e&&void 0!==n&&i!==n)return null}return!1}function Do(t,e,i,n){const s=e._rootScopes,o=Co(e._fallback,i,n),r=[...t,...s],a=new Set;a.add(n);let l=Io(a,r,i,o||i,n);return null!==l&&((void 0===o||o===i||(l=Io(a,r,o,l,n),null!==l))&&So(Array.from(a),[""],s,o,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];if(Tn(s)&&Cn(i))return i;return s||{}}(e,i,n)))}function Io(t,e,i,n,s){for(;i;)i=Lo(t,e,i,n,s);return i}function Ro(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function jo(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function Fo(t,e,i,n){const{iScale:s}=t,{key:o="r"}=this._parsing,r=new Array(n);let a,l,c,h;for(a=0,l=n;ae"x"===t?"y":"x";function Wo(t,e,i,n){const s=t.skip?e:t,o=e,r=i.skip?e:i,a=ps(o,s),l=ps(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function Vo(t,e="x"){const i=No(e),n=t.length,s=Array(n).fill(0),o=Array(n);let r,a,l,c=Bo(t,0);for(r=0;r!t.skip)),"monotone"===e.cubicInterpolationMode)Vo(t,s);else{let i=n?t[t.length-1]:t[0];for(o=0,r=t.length;ot.ownerDocument.defaultView.getComputedStyle(t,null);const Jo=["top","right","bottom","left"];function Go(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const o=Jo[s];n[o]=parseFloat(t[e+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function Ko(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,s=Xo(i),o="border-box"===s.boxSizing,r=Go(s,"padding"),a=Go(s,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:s,offsetY:o}=n;let r,a,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,o,t.target))r=s,a=o;else{const t=e.getBoundingClientRect();r=n.clientX-t.left,a=n.clientY-t.top,l=!0}return{x:r,y:a,box:l}}(t,i),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:p}=e;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/p*i.height/n)}}const Qo=t=>Math.round(10*t)/10;function Zo(t,e,i,n){const s=Xo(t),o=Go(s,"margin"),r=Yo(s.maxWidth,t,"clientWidth")||Zn,a=Yo(s.maxHeight,t,"clientHeight")||Zn,l=function(t,e,i){let n,s;if(void 0===e||void 0===i){const o=t&&qo(t);if(o){const t=o.getBoundingClientRect(),r=Xo(o),a=Go(r,"border","width"),l=Go(r,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=Yo(r.maxWidth,o,"clientWidth"),s=Yo(r.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||Zn,maxHeight:s||Zn}}(t,e,i);let{width:c,height:h}=l;if("content-box"===s.boxSizing){const t=Go(s,"border","width"),e=Go(s,"padding");c-=e.width+t.width,h-=e.height+t.height}c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=Qo(Math.min(c,r,l.maxWidth)),h=Qo(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Qo(c/2));return(void 0!==e||void 0!==i)&&n&&l.height&&h>l.height&&(h=l.height,c=Qo(Math.floor(h*n))),{width:c,height:h}}function tr(t,e,i){const n=e||1,s=Qo(t.height*n),o=Qo(t.width*n);t.height=Qo(t.height),t.width=Qo(t.width);const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||r.height!==s||r.width!==o)&&(t.currentDevicePixelRatio=n,r.height=s,r.width=o,t.ctx.setTransform(n,0,0,n,0,0),!0)}const er=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Uo()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function ir(t,e){const i=function(t,e){return Xo(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function nr(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function sr(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function or(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},r=nr(t,s,i),a=nr(s,o,i),l=nr(o,e,i),c=nr(r,a,i),h=nr(a,l,i);return nr(c,h,i)}function rr(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function ar(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function lr(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function cr(t){return"angle"===t?{between:bs,compare:gs,normalize:ms}:{between:ys,compare:(t,e)=>t-e,normalize:t=>t}}function hr({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:s}}function dr(t,e,i){if(!i)return[t];const{property:n,start:s,end:o}=i,r=e.length,{compare:a,between:l,normalize:c}=cr(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:s,end:o}=i,{between:r,normalize:a}=cr(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cv||l(s,b,g)&&0!==a(s,b),_=()=>!v||0===a(o,g)||l(o,b,g);for(let t=h,i=h;t<=d;++t)m=e[t%r],m.skip||(g=c(m[n]),g!==b&&(v=l(g,s,o),null===y&&x()&&(y=0===a(g,s)?t:i),null!==y&&_()&&(p.push(hr({start:y,end:t,loop:u,count:r,style:f})),y=null),i=t,b=g));return null!==y&&p.push(hr({start:y,end:d,loop:u,count:r,style:f})),p}function ur(t,e){const i=[],n=t.segments;for(let s=0;sn({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Os.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let o,r=s.length-1,a=!1;for(;r>=0;--r)o=s[r],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),a=!0):(s[r]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var yr=new vr;const xr="transparent",_r={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Fs(t||xr),s=n.valid&&Fs(e||xr);return s&&s.valid?s.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class wr{constructor(t,e,i,n){const s=e[i];n=wo([t.to,n,s,t.from]);const o=wo([t.from,s,n]);this._active=!0,this._fn=t.fn||_r[t.type||typeof o],this._easing=Rs[t.easing]||Rs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=wo([t.to,e,n,t.from]),this._from=wo([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||e1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,r,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t{const s=t[n];if(!Cn(s))return;const o={};for(const t of e)o[t]=s[t];(Tn(s.properties)&&s.properties||[n]).forEach(t=>{t!==n&&i.has(t)||i.set(t,o)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),o=Object.keys(e),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const l=o[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=s[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,r);continue}h.cancel()}d&&d.duration?(s[l]=h=new wr(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(yr.add(this._chart,i),!0):void 0}}function Sr(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:n?o:s,end:n?s:o}}function Mr(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=n.length;s0||!i&&e<0)return s.index}return null}function Cr(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,r,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Lr(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i],void 0!==e[n]._visualValues&&void 0!==e[n]._visualValues[i]&&delete e[n]._visualValues[i]}}}const Dr=t=>"reset"===t||"none"===t,Ir=(t,e)=>e?t:Object.assign({},t);class Rr{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Er(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Lr(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=e.xAxisID=Dn(i.xAxisID,Pr(t,"x")),o=e.yAxisID=Dn(i.yAxisID,Pr(t,"y")),r=e.rAxisID=Dn(i.rAxisID,Pr(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,s,o,r),c=e.vAxisID=n(a,o,s,r);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ss(this._data,this),t._stacked&&Lr(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Cn(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:n}=e,s="x"===i.axis?"x":"y",o="x"===n.axis?"x":"y",r=Object.keys(t),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l{const e="_onData"+qn(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const s=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),s}})}))),this._syncList=[],this._data=e}var n,s}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=Er(e.vScale,e),e.stack!==i.stack&&(n=!0,Lr(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&(Cr(this,e._parsed),e._stacked=Er(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=Tn(n[t])?this.parseArrayData(i,n,t,e):Cn(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const s=()=>null===l[r]||d&&l[r]t&&!e.hidden&&e._stacked&&{keys:Mr(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}(r);let d,u;function f(){u=n[d];const e=u[r.axis];return!Pn(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,s,o;for(n=0,s=e.length;n=0&&tthis.getContext(i,n,e),h);return f.$shared&&(f.$shared=a,s[o]=Object.freeze(Ir(f,a))),f}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,o=`animation-${e}`,r=s[o];if(r)return r;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),o=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(o,this.getContext(t,i,e))}const l=new kr(n,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Dr(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(e,s)||s!==n;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:o}}updateElement(t,e,i,n){Dr(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Dr(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,s=e.length,o=Math.min(s,n);o&&this.parse(0,o),s>n?this._insertElements(n,s-n,t):s{for(t.length+=e,r=t.length-1;r>=o;r--)t[r]=t[r-e]};for(a(s),r=t;rt-e))}return t._cache.$bar}(e,t.type);let n,s,o,r,a=e._length;const l=()=>{32767!==o&&-32768!==o&&(Yn(r)&&(a=Math.min(a,Math.abs(o-r)||a)),r=o)};for(n=0,s=i.length;nMath.abs(a)&&(l=a,c=r),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function zr(t,e,i,n){const s=t.iScale,o=t.vScale,r=s.getLabels(),a=s===o,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:n,color:s,useBorderRadius:o,borderRadius:r}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((e,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:e,fillStyle:l.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(a),lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:l.borderWidth,strokeStyle:l.borderColor,textAlign:n,pointStyle:i,borderRadius:o&&(r||l.borderRadius),index:a}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let s,o,r=t=>+i[t];if(Cn(i[t])){const{key:t="value"}=this._parsing;r=e=>+Un(i[e],t)}for(s=t,o=t+e;sbs(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>bs(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),g=f(0,c,d),m=f(es,h,u),b=p(Gn,c,d),v=p(Gn+es,h,u);n=(g-b)/2,s=(m-v)/2,o=-(g+b)/2,r=-(m+v)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}(u,d,a),b=(i.width-o)/f,v=(i.height-o)/p,y=Math.max(Math.min(b,v)/2,0),x=In(this.options.radius,y),_=(x-Math.max(x*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=m*x,n.total=this.calculateTotal(),this.outerRadius=x-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*h,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*s/Kn)}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,r=o.chartArea,a=o.options.animation,l=(r.left+r.right)/2,c=(r.top+r.bottom)/2,h=s&&a.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,{sharedOptions:f,includeOptions:p}=this._getSharedOptions(e,n);let g,m=this._getRotation();for(g=0;g0&&!isNaN(t)?Kn*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=Vs(e._parsed[t],i.options.locale);return{label:n[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,o,r,a;if(!t)for(n=0,s=i.data.datasets.length;n{const o=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:n,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=Vs(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:s}}parseObjectData(t,e,i,n){return Fo.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{const n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(ne.max&&(e.max=n))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),o=(s-Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=s-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,r=o.options.animation,a=this._cachedMeta.rScale,l=a.xCenter,c=a.yCenter,h=a.getIndexAngle(0)-.5*Gn;let d,u=h;const f=360/this.countVisibleElements();for(d=0;d{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?hs(this.resolveDataElementOptions(t,e).angle||i):0}}var qr=Object.freeze({__proto__:null,BarController:class extends Rr{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,n){return zr(t,e,i,n)}parseArrayData(t,e,i,n){return zr(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:s,vScale:o}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,l="x"===s.axis?r:a,c="x"===o.axis?r:a,h=[];let d,u,f,p;for(d=i,u=i+n;dt.controller.options.grouped),s=i.options.stacked,o=[],r=this._cachedMeta.controller.getParsed(e),a=r&&r[i.axis],l=t=>{const e=t._parsed.find(t=>t[i.axis]===a),n=e&&e[t.vScale.axis];if(An(n)||isNaN(n))return!0};for(const i of n)if((void 0===e||!l(i))&&((!1===s||-1===o.indexOf(i.stack)||void 0===s&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Dn("x"===this.chart.options.indexAxis?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const n=this._getStacks(t,i),s=void 0!==e?n.indexOf(e):-1;return-1===s?n.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let s,o;for(s=0,o=e.data.length;s=i?1:-1)}(d,e,r)*o,u===r&&(m-=d/2);const t=e.getPixelForDecimal(0),s=e.getPixelForDecimal(1),l=Math.min(t,s),f=Math.max(t,s);m=Math.max(Math.min(m,f),l),h=m+d,i&&!c&&(a._stacks[e.axis]._visualValues[n]=e.getValueForPixel(h)-e.getValueForPixel(m))}if(m===e.getPixelForValue(r)){const t=os(d)*e.getLineWidthForValue(r)/2;m+=t,d-=t}return{size:d,base:m,head:h,center:h+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,s=n.skipNull,o=Dn(n.maxBarThickness,1/0);let r,a;const l=this._getAxisCount();if(e.grouped){const i=s?this._getStackCount(t):e.stackCount,c="flex"===n.barThickness?function(t,e,i,n){const s=e.pixels,o=s[t];let r=t>0?s[t-1]:null,a=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:s}=e,o=this.getParsed(t),r=n.getLabelForValue(o.x),a=s.getLabelForValue(o.y),l=o._custom;return{label:i[t]||"",value:"("+r+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(e,n),c=o.axis,h=r.axis;for(let d=e;d0&&this.getParsed(e-1);for(let i=0;i=b){v.skip=!0;continue}const x=this.getParsed(i),_=An(x[u]),w=v[d]=o.getPixelForValue(x[d],i),k=v[u]=s||_?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,x,a):x[u],i);v.skip=isNaN(w)||isNaN(k)||_,v.stop=i>0&&Math.abs(x[d]-y[d])>g,p&&(v.parsed=x,v.raw=l.data[i]),h&&(v.options=c||this.resolveDataElementOptions(i,f.active?"active":n)),m||this.updateElement(f,i,v,n),y=x}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends $r{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:Ur,RadarController:class extends Rr{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return Fo.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this._cachedMeta.rScale,o="reset"===n;for(let r=e;r0&&this.getParsed(e-1);for(let c=e;c0&&Math.abs(i[u]-v[u])>m,g&&(p.parsed=i,p.raw=l.data[c]),d&&(p.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),b||this.updateElement(e,c,p,n),v=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const s=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,s,o)/2}}});function Yr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xr{static override(t){Object.assign(Xr.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Yr()}parse(){return Yr()}format(){return Yr()}add(){return Yr()}diff(){return Yr()}startOf(){return Yr()}endOf(){return Yr()}}var Jr=Xr;function Gr(t,e,i,n){const{controller:s,data:o,_sorted:r}=t,a=s._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&"r"!==e&&r&&o.length){const r=a._reversePixels?ws:_s;if(!n){const n=r(o,e,i);if(l){const{vScale:e}=s._cachedMeta,{_parsed:i}=t,o=i.slice(0,n.lo+1).reverse().findIndex(t=>!An(t[e.axis]));n.lo-=Math.max(0,o);const r=i.slice(n.hi).findIndex(t=>!An(t[e.axis]));n.hi+=Math.max(0,r)}return n}if(s._sharedOptions){const t=o[0],n="function"==typeof t.getRange&&t.getRange(e);if(n){const t=r(o,e,i-n),s=r(o,e,i+n);return{lo:t.lo,hi:s.hi}}}}return{lo:0,hi:o.length-1}}function Kr(t,e,i,n,s){const o=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=o.length;t{t[r]&&t[r](e[i],s)&&(o.push({element:t,datasetIndex:n,index:l}),a=a||t.inRange(e.x,e.y,s))}),n&&!a?[]:o}var ia={evaluateInteractionItems:Kr,modes:{index(t,e,i,n){const s=Ko(e,t),o=i.axis||"x",r=i.includeInvisible||!1,a=i.intersect?Qr(t,s,o,n,r):ta(t,s,o,!1,n,r),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,n){const s=Ko(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;let a=i.intersect?Qr(t,s,o,n,r):ta(t,s,o,!1,n,r);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;tQr(t,Ko(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){const s=Ko(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;return ta(t,s,o,i.intersect,n,r)},x:(t,e,i,n)=>ea(t,Ko(e,t),"x",i.intersect,n),y:(t,e,i,n)=>ea(t,Ko(e,t),"y",i.intersect,n)}};const na=["left","top","right","bottom"];function sa(t,e){return t.filter(t=>t.pos===e)}function oa(t,e){return t.filter(t=>-1===na.indexOf(t.pos)&&t.box.axis===e)}function ra(t,e){return t.sort((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function aa(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:s}=i;if(!t||!na.includes(n))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let o,r,a;for(o=0,r=t.length;o{n[t]=Math.max(e[t],i[t])}),n}return n(t?["left","right"]:["top","bottom"])}function ua(t,e,i,n){const s=[];let o,r,a,l,c,h;for(o=0,r=t.length,c=0;ot.box.fullSize),!0),n=ra(sa(e,"left"),!0),s=ra(sa(e,"right")),o=ra(sa(e,"top"),!0),r=ra(sa(e,"bottom")),a=oa(e,"x"),l=oa(e,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:sa(e,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;jn(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},s);ca(u,xo(n));const f=Object.assign({maxPadding:u,w:o,h:r,x:s.left,y:s.top},s),p=aa(l.concat(c),d);ua(a.fullSize,f,d,p),ua(l,f,d,p),ua(c,f,d,p)&&ua(l,f,d,p),function(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),pa(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,pa(a.rightAndBottom,f,d,p),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},jn(a.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class ma{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class ba extends ma{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const va="$chartjs",ya={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xa=t=>null===t||""===t;const _a=!!er&&{passive:!0};function wa(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,_a)}function ka(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Sa(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||ka(i.addedNodes,n),e=e&&!ka(i.removedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function Ma(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||ka(i.removedNodes,n),e=e&&!ka(i.addedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}const Oa=new Map;let Ea=0;function Aa(){const t=window.devicePixelRatio;t!==Ea&&(Ea=t,Oa.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Ta(t,e,i){const n=t.canvas,s=n&&qo(n);if(!s)return;const o=Es((t,e)=>{const n=s.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||o(i,n)});return r.observe(s),function(t,e){Oa.size||window.addEventListener("resize",Aa),Oa.set(t,e)}(t,o),r}function Ca(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Oa.delete(t),Oa.size||window.removeEventListener("resize",Aa)}(t)}function Pa(t,e,i){const n=t.canvas,s=Es(e=>{null!==t.ctx&&i(function(t,e){const i=ya[t.type]||t.type,{x:n,y:s}=Ko(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==s?s:null}}(e,t))},t);return function(t,e,i){t&&t.addEventListener(e,i,_a)}(n,e,s),s}class La extends ma{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),s=t.getAttribute("width");if(t[va]={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",xa(s)){const e=ir(t,"width");void 0!==e&&(t.width=e)}if(xa(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ir(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[va])return!1;const i=e[va].initial;["height","width"].forEach(t=>{const n=i[t];An(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e[va],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:Sa,detach:Ma,resize:Ta}[e]||Pa;n[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:Ca,detach:Ca,resize:Ca}[e]||wa)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Zo(t,e,i,n)}isAttached(t){const e=t&&qo(t);return!(!e||!e.isConnected)}}class Da{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return ls(this.x)&&ls(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}function Ia(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),s=t._maxLength/i;return Math.floor(Math.min(n,s))}(t),s=Math.min(i.maxTicksLimit||n,n),o=i.major.enabled?function(t){const e=[];let i,n;for(i=0,n=t.length;is)return function(t,e,i,n){let s,o=0,r=i[0];for(n=Math.ceil(n),s=0;st-e).pop(),e}(n);for(let t=0,e=o.length-1;ts)return e}return Math.max(s,1)}(o,e,s);if(r>0){let t,i;const n=r>1?Math.round((l-a)/(r-1)):null;for(Ra(e,c,h,An(n)?0:a-n,a),t=0,i=r-1;t"top"===e||"left"===e?t[e]+i:t[e]-i,Fa=(t,e)=>Math.min(e||t,t);function za(t,e){const i=[],n=t.length/e,s=t.length;let o=0;for(;or+a)))return c}function Na(t){return t.drawTicks?t.tickLength:0}function Wa(t,e){if(!t.display)return 0;const i=_o(t.font,e),n=xo(t.padding);return(Tn(t.text)?t.text.length:1)*i.lineHeight+n.height}function Va(t,e,i){let n=As(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Ha extends Da{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=Ln(t,Number.POSITIVE_INFINITY),e=Ln(e,Number.NEGATIVE_INFINITY),i=Ln(i,Number.POSITIVE_INFINITY),n=Ln(n,Number.NEGATIVE_INFINITY),{min:Ln(t,i),max:Ln(e,n),minDefined:Pn(t),maxDefined:Pn(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:s,maxDefined:o}=this.getUserBounds();if(s&&o)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let a=0,l=r.length;an?n:i,n=s&&i>n?i:n,{min:Ln(i,Ln(n,i)),max:Ln(n,Ln(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Rn(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:s}=t,o=In(e,(s-n)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(n,-Math.abs(o)),max:r(s,o)}}(this,s,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=vs(this.chart.width-h,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),h+6>o&&(o=u/(i-(t.offset?.5:1)),r=this.maxHeight-Na(t.grid)-e.padding-Wa(t.title,this.chart.options.font),a=Math.sqrt(h*h+d*d),l=ds(Math.min(Math.asin(vs((c.highest.height+6)/o,-1,1)),Math.asin(vs(r/a,-1,1))-Math.asin(vs(d/a,-1,1)))),l=Math.max(n,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){Rn(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Rn(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const o=Wa(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Na(s)+o):(t.height=this.maxHeight,t.width=Na(s)+o),i.display&&this.ticks.length){const{first:e,last:n,widest:s,highest:o}=this._getLabelSizes(),a=2*i.padding,l=hs(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(r){const e=i.mirror?0:h*s.width+c*o.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:c*s.width+h*o.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:s,padding:o},position:r}=this.options,a=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;a?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?h=t.width:"inner"!==s&&(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-r+o)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-c+o)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+o,this.paddingBottom=n+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Rn(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s({width:o[t]||0,height:r[t]||0});return{first:k(0),last:k(e-1),widest:k(_),highest:k(w),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return vs(this._alignToPixels?Zs(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tr*n?r/i:a/n:a*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:s,position:o,border:r}=n,a=s.offset,l=this.isHorizontal(),c=this.ticks.length+(a?1:0),h=Na(s),d=[],u=r.setContext(this.getContext()),f=u.display?u.width:0,p=f/2,g=function(t){return Zs(i,t,f)};let m,b,v,y,x,_,w,k,S,M,O,E;if("top"===o)m=g(this.bottom),_=this.bottom-h,k=m-p,M=g(t.top)+p,E=t.bottom;else if("bottom"===o)m=g(this.top),M=t.top,E=g(t.bottom)-p,_=m+p,k=this.top+h;else if("left"===o)m=g(this.right),x=this.right-h,w=m-p,S=g(t.left)+p,O=t.right;else if("right"===o)m=g(this.left),S=t.left,O=g(t.right)-p,x=m+p,w=this.left+h;else if("x"===e){if("center"===o)m=g((t.top+t.bottom)/2+.5);else if(Cn(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}M=t.top,E=t.bottom,_=m+p,k=_+h}else if("y"===e){if("center"===o)m=g((t.left+t.right)/2);else if(Cn(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}x=m-p,w=x-h,S=t.left,O=t.right}const A=Dn(n.ticks.maxTicksLimit,c),T=Math.max(1,Math.ceil(c/A));for(b=0;b0&&(o-=n/2)}d={left:o,top:s,width:n+e.width,height:i+e.height,color:t.backdropColor}}g.push({label:y,font:S,textOffset:E,options:{rotation:p,color:i,strokeColor:a,strokeWidth:c,textAlign:u,textBaseline:A,translation:[x,_],backdrop:d}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-hs(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:s}}=this.options,o=t+s,r=this._getLabelSizes().widest.width;let a,l;return"left"===e?n?(l=this.right+s,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l+=r)):(l=this.right-o,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l=this.left)):"right"===e?n?(l=this.left+s,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l-=r)):(l=this.left+o,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:s,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,s,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(e=>e.value===t);if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,o=n.length;s{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,o;for(s=0,o=e.length;s{const n=i.split("."),s=n.pop(),o=[t].concat(n).join("."),r=e[i].split("."),a=r.pop(),l=r.join(".");Gs.route(o,s,l,a)})}(e,t.defaultRoutes);t.descriptors&&Gs.describe(e,t.descriptors)}(t,o,i),this.override&&Gs.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Gs[n]&&(delete Gs[n][i],this.override&&delete Us[i])}}class Ua{constructor(){this.controllers=new $a(Rr,"datasets",!0),this.elements=new $a(Da,"elements"),this.plugins=new $a(Object,"plugins"),this.scales=new $a(Ha,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):jn(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=qn(t);Rn(i["before"+n],[],i),e[t](i),Rn(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Xa(t,e){return e||!1!==t?!0===t?{}:t:null}function Ja(t,{plugin:e,local:i},n,s){const o=t.pluginScopeKeys(e),r=t.getOptionScopes(n,o);return i&&e.defaults&&r.push(e.defaults),t.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ga(t,e){const i=Gs.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Ka(t){if("x"===t||"y"===t||"r"===t)return t}function Qa(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function Za(t,...e){if(Ka(t))return t;for(const i of e){const e=i.axis||Qa(i.position)||t.length>1&&Ka(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function tl(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function el(t,e){const i=Us[t.type]||{scales:{}},n=e.scales||{},s=Ga(t.type,e),o=Object.create(null);return Object.keys(n).forEach(e=>{const r=n[e];if(!Cn(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const a=Za(e,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return tl(t,"x",i[0])||tl(t,"y",i[0])}return{}}(e,t),Gs.scales[r.type]),l=function(t,e){return t===e?"_index_":"_value_"}(a,s),c=i.scales||{};o[e]=Vn(Object.create(null),[{axis:a},r,c[a],c[l]])}),t.data.datasets.forEach(i=>{const s=i.type||t.type,r=i.indexAxis||Ga(s,e),a=(Us[s]||{}).scales||{};Object.keys(a).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),s=i[e+"AxisID"]||e;o[s]=o[s]||Object.create(null),Vn(o[s],[{axis:e},n[s],a[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];Vn(e,[Gs.scales[e.type],Gs.scale])}),o}function il(t){const e=t.options||(t.options={});e.plugins=Dn(e.plugins,{}),e.scales=el(t,e)}function nl(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const sl=new Map,ol=new Set;function rl(t,e){let i=sl.get(t);return i||(i=e(),sl.set(t,i),ol.add(i)),i}const al=(t,e,i)=>{const n=Un(e,i);void 0!==n&&t.add(n)};class ll{constructor(t){this._config=function(t){return(t=t||{}).data=nl(t.data),il(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=nl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),il(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return rl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return rl(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return rl(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return rl(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:s}=this,o=this._cachedScopes(t,i),r=o.get(e);if(r)return r;const a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>al(a,t,e))),e.forEach(t=>al(a,n,t)),e.forEach(t=>al(a,Us[s]||{},t)),e.forEach(t=>al(a,Gs,t)),e.forEach(t=>al(a,qs,t))});const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),ol.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Us[e]||{},Gs.datasets[e]||{},{type:e},Gs,qs]}resolveNamedOptions(t,e,i,n=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=cl(this._resolverCache,t,n);let a=o;if(function(t,e){const{isScriptable:i,isIndexable:n}=Oo(t);for(const s of e){const e=i(s),o=n(s),r=(o||e)&&t[s];if(e&&(Xn(r)||hl(r))||o&&Tn(r))return!0}return!1}(o,e)){s.$shared=!1;a=Mo(o,i=Xn(i)?i():i,this.createResolver(t,i,r))}for(const t of e)s[t]=a[t];return s}createResolver(t,e,i=[""],n){const{resolver:s}=cl(this._resolverCache,t,i);return Cn(e)?Mo(s,e,void 0,n):s}}function cl(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const s=i.join();let o=n.get(s);if(!o){o={resolver:So(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(s,o)}return o}const hl=t=>Cn(t)&&Object.getOwnPropertyNames(t).some(e=>Xn(t[e]));const dl=["top","bottom","left","right","chartArea"];function ul(t,e){return"top"===t||"bottom"===t||-1===dl.indexOf(t)&&"x"===e}function fl(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function pl(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Rn(i&&i.onComplete,[t],e)}function gl(t){const e=t.chart,i=e.options.animation;Rn(i&&i.onProgress,[t],e)}function ml(t){return Uo()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const bl={},vl=t=>{const e=ml(t);return Object.values(bl).filter(t=>t.canvas===e).pop()};function yl(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const o=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=o)}}}class xl{static defaults=Gs;static instances=bl;static overrides=Us;static registry=qa;static version="4.5.1";static getChart=vl;static register(...t){qa.add(...t),_l()}static unregister(...t){qa.remove(...t),_l()}constructor(t,e){const i=this.config=new ll(e),n=ml(t),s=vl(n);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Uo()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?ba:La}(n)),this.platform.updateConfig(i);const r=this.platform.acquireContext(n,o.aspectRatio),a=r&&r.canvas,l=a&&a.height,c=a&&a.width;this.id=En(),this.ctx=r,this.canvas=a,this.width=c,this.height=l,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ya,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),o.resizeDelay||0),this._dataChanges=[],bl[this.id]=this,r&&a?(yr.listen(this,"complete",pl),yr.listen(this,"progress",gl),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:s}=this;return An(t)?e&&s?s:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return qa}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return to(this.canvas,this.ctx),this}stop(){return yr.stop(this),this}resize(t,e){yr.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,t,e,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,tr(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Rn(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){jn(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let s=[];e&&(s=s.concat(Object.keys(e).map(t=>{const i=e[t],n=Za(t,i),s="r"===n,o="x"===n;return{options:i,dposition:s?"chartArea":o?"bottom":"left",dtype:s?"radialLinear":o?"category":"linear"}}))),jn(s,e=>{const s=e.options,o=s.id,r=Za(o,s),a=Dn(s.type,e.dtype);void 0!==s.position&&ul(s.position,r)===ul(e.dposition)||(s.position=e.dposition),n[o]=!0;let l=null;if(o in i&&i[o].type===a)l=i[o];else{l=new(qa.getScale(a))({id:o,type:a,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(s,t)}),jn(n,(t,e)=>{t||delete i[e]}),jn(i,t=>{ga.configure(this,t,t.options),ga.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(fl("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){jn(this.scales,t=>{ga.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);Jn(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e){yl(t,n,"_removeElements"===i?-s:s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;ga.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],jn(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},n=br(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(n&&so(e,n),t.controller.draw(),n&&oo(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return no(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const s=ia.modes[e];return"function"==typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=ko(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,n);Yn(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(s,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),yr.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};jn(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():o()}unbindEvents(){jn(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},jn(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,o,r,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),r=0,a=t.length;r{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!Fn(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=s(e,t),r=i?t:s(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:s}=this,o=e,r=this._getActiveElements(t,n,i,o),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,Rn(s.onHover,[t,r,this],this),a&&Rn(s.onClick,[t,r,this],this));const c=!Fn(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}function _l(){return jn(xl.instances,t=>t._plugins.invalidate())}function wl(t,e,i,n){const s=bo(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(i-e)/2,r=Math.min(o,n*e/2),a=t=>{const e=(i-Math.min(o,t))*n/2;return vs(t,0,Math.min(o,e))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:vs(s.innerStart,0,r),innerEnd:vs(s.innerEnd,0,r)}}function kl(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function Sl(t,e,i,n,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=e,d=Math.max(e.outerRadius+n+i-c,0),u=h>0?h+n+i+c:0;let f=0;const p=s-l;if(n){const t=((h>0?h-n:0)+(d>0?d-n:0))/2;f=(p-(0!==t?p*t/(t+n):p))/2}const g=(p-Math.max(.001,p*d-i/Gn)/d)/2,m=l+g+f,b=s-g-f,{outerStart:v,outerEnd:y,innerStart:x,innerEnd:_}=wl(e,u,d,b-m),w=d-v,k=d-y,S=m+v/w,M=b-y/k,O=u+x,E=u+_,A=m+x/O,T=b-_/E;if(t.beginPath(),o){const e=(S+M)/2;if(t.arc(r,a,d,S,e),t.arc(r,a,d,e,M),y>0){const e=kl(k,M,r,a);t.arc(e.x,e.y,y,M,b+es)}const i=kl(E,b,r,a);if(t.lineTo(i.x,i.y),_>0){const e=kl(E,T,r,a);t.arc(e.x,e.y,_,b+es,T+Math.PI)}const n=(b-_/u+(m+x/u))/2;if(t.arc(r,a,u,b-_/u,n,!0),t.arc(r,a,u,n,m+x/u,!0),x>0){const e=kl(O,A,r,a);t.arc(e.x,e.y,x,A+Math.PI,m-es)}const s=kl(w,m,r,a);if(t.lineTo(s.x,s.y),v>0){const e=kl(w,S,r,a);t.arc(e.x,e.y,v,m-es,S)}}else{t.moveTo(r,a);const e=Math.cos(S)*d+r,i=Math.sin(S)*d+a;t.lineTo(e,i);const n=Math.cos(M)*d+r,s=Math.sin(M)*d+a;t.lineTo(n,s)}t.closePath()}function Ml(t,e,i,n,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=e,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u,borderRadius:f}=l,p="inner"===l.borderAlign;if(!c)return;t.setLineDash(d||[]),t.lineDashOffset=u,p?(t.lineWidth=2*c,t.lineJoin=h||"round"):(t.lineWidth=c,t.lineJoin=h||"bevel");let g=e.endAngle;if(o){Sl(t,e,i,n,g,s);for(let e=0;es?(c=s/l,t.arc(o,r,l,i+c,n-c,!0)):t.arc(o,r,s,i+es,n-es),t.closePath(),t.clip()}(t,e,g),l.selfJoin&&g-r>=Gn&&0===f&&"miter"!==h&&function(t,e,i){const{startAngle:n,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=e,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/r,ms(n-i));if(t.beginPath(),t.arc(s,o,r-c/2,n+d/2,i-d/2),a>0){const e=Math.min(c/a,ms(n-i));t.arc(s,o,a+c/2,i-e/2,n+e/2,!0)}else{const e=Math.min(c/2,r*ms(n-i));if("round"===h)t.arc(s,o,e,i-Gn/2,n+Gn/2,!0);else if("bevel"===h){const r=2*e*e,a=-r*Math.cos(i+Gn/2)+s,l=-r*Math.sin(i+Gn/2)+o,c=r*Math.cos(n+Gn/2)+s,h=r*Math.sin(n+Gn/2)+o;t.lineTo(a,l),t.lineTo(c,h)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}(t,e,g),o||(Sl(t,e,i,n,g,s),t.stroke())}function Ol(t,e,i=e){t.lineCap=Dn(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Dn(i.borderDash,e.borderDash)),t.lineDashOffset=Dn(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Dn(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Dn(i.borderWidth,e.borderWidth),t.strokeStyle=Dn(i.borderColor,e.borderColor)}function El(t,e,i){t.lineTo(i.x,i.y)}function Al(t,e,i={}){const n=t.length,{start:s=0,end:o=n-1}=i,{start:r,end:a}=e,l=Math.max(s,r),c=Math.min(o,a),h=sa&&o>a;return{count:n,start:l,loop:e.loop,ilen:c(r+(c?a-t:t))%o,y=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=s[v(0)],t.moveTo(d.x,d.y)),h=0;h<=a;++h){if(d=s[v(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ip&&(p=i),m=(b*m+e)/++b):(y(),t.lineTo(e,i),u=n,b=0,f=p=i),g=i}y()}function Pl(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?Cl:Tl}const Ll="function"==typeof Path2D;function Dl(t,e,i,n){Ll&&!e.options.segment?function(t,e,i,n){let s=e._path;s||(s=e._path=new Path2D,e.path(s,i,n)&&s.closePath()),Ol(t,e.options),t.stroke(s)}(t,e,i,n):function(t,e,i,n){const{segments:s,options:o}=e,r=Pl(e);for(const a of s)Ol(t,o,a.style),t.beginPath(),r(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}class Il extends Da{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;$o(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const o=!!t._loop,{start:r,end:a}=function(t,e,i,n){let s=0,o=e-1;if(i&&!n)for(;ss&&t[o%e].skip;)o--;return o%=e,{start:s,end:o}}(i,s,o,n);return fr(t,!0===n?[{start:r,end:a,loop:o}]:function(t,e,i,n){const s=t.length,o=[];let r,a=e,l=t[e];for(r=e+1;r<=i;++r){const i=t[r%s];i.skip||i.stop?l.skip||(n=!1,o.push({start:e%s,end:(r-1)%s,loop:n}),e=a=i.stop?r:null):(a=r,l.skip&&(e=r)),l=i}return null!==a&&o.push({start:e%s,end:a%s,loop:n}),o}(i,r,a"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:s,distance:o}=fs(n,{x:t,y:e}),{startAngle:r,endAngle:a,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,u=Dn(h,a-r),f=bs(s,r,a)&&r!==a,p=u>=Kn||f,g=ys(o,l+d,c+d);return p&&g}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:a,spacing:l}=this.options,c=(n+s)/2,h=(o+r+l+a)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/4,s=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>Kn?Math.floor(i/Kn):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*n,Math.sin(r)*n);const a=n*(1-Math.sin(Math.min(Gn,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,n,s){const{fullCircles:o,startAngle:r,circumference:a}=e;let l=e.endAngle;if(o){Sl(t,e,i,n,l,s);for(let e=0;et.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ul(t){return Hl[t%Hl.length]}function ql(t){return $l[t%$l.length]}function Yl(t){let e=0;return(i,n)=>{const s=t.getDatasetMeta(n).controller;s instanceof $r?e=function(t,e){return t.backgroundColor=t.data.map(()=>Ul(e++)),e}(i,e):s instanceof Ur?e=function(t,e){return t.backgroundColor=t.data.map(()=>ql(e++)),e}(i,e):s&&(e=function(t,e){return t.borderColor=Ul(e),t.backgroundColor=ql(e),++e}(i,e))}}function Xl(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var Jl={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:n},options:s}=t.config,{elements:o}=s,r=Xl(n)||(a=s)&&(a.borderColor||a.backgroundColor)||o&&Xl(o)||"rgba(0,0,0,0.1)"!==Gs.borderColor||"rgba(0,0,0,0.1)"!==Gs.backgroundColor;var a;if(!i.forceOverride&&r)return;const l=Yl(t);n.forEach(l)}};function Gl(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Kl(t){t.data.datasets.forEach(t=>{Gl(t)})}var Ql={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Kl(t);const n=t.width;t.data.datasets.forEach((e,s)=>{const{_data:o,indexAxis:r}=e,a=t.getDatasetMeta(s),l=o||e.data;if("y"===wo([r,t.options.indexAxis]))return;if(!a.controller.supportsDecimation)return;const c=t.scales[a.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let{start:h,count:d}=function(t,e){const i=e.length;let n,s=0;const{iScale:o}=t,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(s=vs(_s(e,o.axis,r).lo,0,i-1)),n=c?vs(_s(e,o.axis,a).hi+1,s,i)-s:i-s,{start:s,count:n}}(a,l);if(d<=(i.threshold||4*n))return void Gl(e);let u;switch(An(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":u=function(t,e,i,n,s){const o=s.samples||n;if(o>=i)return t.slice(e,e+i);const r=[],a=(i-2)/(o-2);let l=0;const c=e+i-1;let h,d,u,f,p,g=e;for(r[l++]=t[g],h=0;hu&&(u=f,d=t[n],p=n);r[l++]=d,g=p}return r[l++]=t[c],r}(l,h,d,n,i);break;case"min-max":u=function(t,e,i,n){let s,o,r,a,l,c,h,d,u,f,p=0,g=0;const m=[],b=e+i-1,v=t[e].x,y=t[b].x-v;for(s=e;sf&&(f=a,h=s),p=(g*p+o.x)/++g;else{const i=s-1;if(!An(c)&&!An(h)){const e=Math.min(c,h),n=Math.max(c,h);e!==d&&e!==i&&m.push({...t[e],x:p}),n!==d&&n!==i&&m.push({...t[n],x:p})}s>0&&i!==d&&m.push(t[i]),m.push(o),l=e,g=0,u=f=a,c=h=d=s}}return m}(l,h,d,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=u})},destroy(t){Kl(t)}};function Zl(t,e,i,n){if(n)return;let s=e[t],o=i[t];return"angle"===t&&(s=ms(s),o=ms(o)),{property:t,start:s,end:o}}function tc(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function ec(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function ic(t,e){let i=[],n=!1;return Tn(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:n=null}=t||{},s=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=tc(t,e,s);const r=s[t],a=s[e];null!==n?(o.push({x:r.x,y:n}),o.push({x:a.x,y:n})):null!==i&&(o.push({x:i,y:r.y}),o.push({x:i,y:a.y}))}),o}(t,e),i.length?new Il({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function nc(t){return t&&!1!==t.fill}function sc(t,e,i){let n=t[e].fill;const s=[e];let o;if(!i)return n;for(;!1!==n&&-1===s.indexOf(n);){if(!Pn(n))return n;if(o=t[n],!o)return!1;if(o.visible)return n;s.push(n),n=o.fill}return!1}function oc(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=Dn(i&&i.target,i);void 0===n&&(n=!!e.backgroundColor);if(!1===n||null===n)return!1;if(!0===n)return"origin";return n}(t);if(Cn(n))return!isNaN(n.value)&&n;let s=parseFloat(n);return Pn(s)&&Math.floor(s)===s?function(t,e,i,n){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=n)return!1;return i}(n[0],e,s,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function rc(t,e,i){const n=[];for(let s=0;s=0;--e){const i=s[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),n&&i.fill&&hc(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;nc(i)&&hc(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;nc(n)&&"beforeDatasetDraw"===i.drawTime&&hc(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const bc=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}};class vc extends Da{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Rn(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,n=_o(i.font),s=n.size,o=this._computeTitleHeight(),{boxWidth:r,itemHeight:a}=bc(i,s);let l,c;e.font=n.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(o,s,r,a)+10):(c=this.maxHeight,l=this._fitCols(o,n,r,a)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:s,maxWidth:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],c=n+r;let h=t;s.textAlign="left",s.textBaseline="middle";let d=-1,u=-c;return this.legendItems.forEach((t,f)=>{const p=i+e/2+s.measureText(t.text).width;(0===f||l[l.length-1]+p+2*r>o)&&(h+=c,l[l.length-(f>0?0:1)]=0,u+=c,d++),a[f]={left:0,top:u,row:d,width:p,height:n},l[l.length-1]+=p+r}),h}_fitCols(t,e,i,n){const{ctx:s,maxHeight:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-t;let h=r,d=0,u=0,f=0,p=0;return this.legendItems.forEach((t,o)=>{const{itemWidth:g,itemHeight:m}=function(t,e,i,n,s){const o=function(t,e,i,n){let s=t.text;s&&"string"!=typeof s&&(s=s.reduce((t,e)=>t.length>e.length?t:e));return e+i.size/2+n.measureText(s).width}(n,t,e,i),r=function(t,e,i){let n=t;"string"!=typeof e.text&&(n=yc(e,i));return n}(s,n,e.lineHeight);return{itemWidth:o,itemHeight:r}}(i,e,s,t,n);o>0&&u+m+2*r>c&&(h+=d+r,l.push({width:d,height:u}),f+=d+r,p++,d=u=0),a[o]={left:f,top:u,col:p,width:g,height:m},d=Math.max(d,g),u+=m+r}),h+=d,l.push({width:d,height:u}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:s}}=this,o=rr(s,this.left,this.width);if(this.isHorizontal()){let s=0,r=Ts(i,this.left+n,this.right-this.lineWidths[s]);for(const a of e)s!==a.row&&(s=a.row,r=Ts(i,this.left+n,this.right-this.lineWidths[s])),a.top+=this.top+t+n,a.left=o.leftForLtr(o.x(r),a.width),r+=a.width+n}else{let s=0,r=Ts(i,this.top+t+n,this.bottom-this.columnSizes[s].height);for(const a of e)a.col!==s&&(s=a.col,r=Ts(i,this.top+t+n,this.bottom-this.columnSizes[s].height)),a.top=r,a.left+=this.left+n,a.left=o.leftForLtr(o.x(a.left),a.width),r+=a.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;so(t,this),this._draw(),oo(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:s,labels:o}=t,r=Gs.color,a=rr(t.rtl,this.left,this.width),l=_o(o.font),{padding:c}=o,h=l.size,d=h/2;let u;this.drawTitle(),n.textAlign=a.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:f,boxHeight:p,itemHeight:g}=bc(o,h),m=this.isHorizontal(),b=this._computeTitleHeight();u=m?{x:Ts(s,this.left+c,this.right-i[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:Ts(s,this.top+b+c,this.bottom-e[0].height),line:0},ar(this.ctx,t.textDirection);const v=g+c;this.legendItems.forEach((y,x)=>{n.strokeStyle=y.fontColor,n.fillStyle=y.fontColor;const _=n.measureText(y.text).width,w=a.textAlign(y.textAlign||(y.textAlign=o.textAlign)),k=f+d+_;let S=u.x,M=u.y;a.setWidth(this.width),m?x>0&&S+k+c>this.right&&(M=u.y+=v,u.line++,S=u.x=Ts(s,this.left+c,this.right-i[u.line])):x>0&&M+v>this.bottom&&(S=u.x=S+e[u.line].width+c,u.line++,M=u.y=Ts(s,this.top+b+c,this.bottom-e[u.line].height));if(function(t,e,i){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;n.save();const s=Dn(i.lineWidth,1);if(n.fillStyle=Dn(i.fillStyle,r),n.lineCap=Dn(i.lineCap,"butt"),n.lineDashOffset=Dn(i.lineDashOffset,0),n.lineJoin=Dn(i.lineJoin,"miter"),n.lineWidth=s,n.strokeStyle=Dn(i.strokeStyle,r),n.setLineDash(Dn(i.lineDash,[])),o.usePointStyle){const r={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:s},l=a.xPlus(t,f/2);io(n,r,l,e+d,o.pointStyleWidth&&f)}else{const o=e+Math.max((h-p)/2,0),r=a.leftForLtr(t,f),l=yo(i.borderRadius);n.beginPath(),Object.values(l).some(t=>0!==t)?uo(n,{x:r,y:o,w:f,h:p,radius:l}):n.rect(r,o,f,p),n.fill(),0!==s&&n.stroke()}n.restore()}(a.x(S),M,y),S=((t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e)(w,S+f+d,m?S+k:this.right,t.rtl),function(t,e,i){ho(n,i.text,t,e+g/2,l,{strikethrough:i.hidden,textAlign:a.textAlign(i.textAlign)})}(a.x(S),M,y),m)u.x+=k+c;else if("string"!=typeof y.text){const t=l.lineHeight;u.y+=yc(y,t)+c}else u.y+=v}),lr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=_o(e.font),n=xo(e.padding);if(!e.display)return;const s=rr(t.rtl,this.left,this.width),o=this.ctx,r=e.position,a=i.size/2,l=n.top+a;let c,h=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,h=Ts(t.align,h,this.right-d);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);c=l+Ts(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=Ts(r,h,h+d);o.textAlign=s.textAlign(As(r)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,ho(o,e.text,u,c,i)}_computeTitleHeight(){const t=this.options.title,e=_o(t.font),i=xo(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,s;if(ys(t,this.left,this.right)&&ys(e,this.top,this.bottom))for(s=this.legendHitBoxes,i=0;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const l=t.controller.getStyle(i?0:void 0),c=xo(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:s||l.textAlign,borderRadius:r&&(a||l.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class _c extends Da{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=Tn(i.text)?i.text.length:1;this._padding=xo(i.padding);const s=n*_o(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:s,options:o}=this,r=o.align;let a,l,c,h=0;return this.isHorizontal()?(l=Ts(r,i,s),c=e+t,a=s-i):("left"===o.position?(l=i+t,c=Ts(r,n,e),h=-.5*Gn):(l=s-t,c=Ts(r,e,n),h=.5*Gn),a=n-e),{titleX:l,titleY:c,maxWidth:a,rotation:h}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=_o(e.font),n=i.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:r,rotation:a}=this._drawArgs(n);ho(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:a,textAlign:As(e.align),textBaseline:"middle",translation:[s,o]})}}var wc={id:"title",_element:_c,start(t,e,i){!function(t,e){const i=new _c({ctx:t.ctx,options:e,chart:t});ga.configure(t,i,e),ga.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;ga.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;ga.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const kc=new WeakMap;var Sc={id:"subtitle",start(t,e,i){const n=new _c({ctx:t.ctx,options:i,chart:t});ga.configure(t,n,i),ga.addBox(t,n),kc.set(t,n)},stop(t){ga.removeBox(t,kc.get(t)),kc.delete(t)},beforeUpdate(t,e,i){const n=kc.get(t);ga.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Mc={average(t){if(!t.length)return!1;let e,i,n=new Set,s=0,o=0;for(e=0,i=t.length;et+e)/n.size,y:s/o}},nearest(t,e){if(!t.length)return!1;let i,n,s,o=e.x,r=e.y,a=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i-1?t.split("\n"):t}function Ac(t,e){const{element:i,datasetIndex:n,index:s}=e,o=t.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:t,label:r,parsed:o.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function Tc(t,e){const i=t.chart.ctx,{body:n,footer:s,title:o}=t,{boxWidth:r,boxHeight:a}=e,l=_o(e.bodyFont),c=_o(e.titleFont),h=_o(e.footerFont),d=o.length,u=s.length,f=n.length,p=xo(e.padding);let g=p.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b){g+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing}u&&(g+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let v=0;const y=function(t){m=Math.max(m,i.measureText(t).width+v)};return i.save(),i.font=c.string,jn(t.title,y),i.font=l.string,jn(t.beforeBody.concat(t.afterBody),y),v=e.displayColors?r+2+e.boxPadding:0,jn(n,t=>{jn(t.before,y),jn(t.lines,y),jn(t.after,y)}),v=0,i.font=h.string,jn(t.footer,y),i.restore(),m+=p.width,{width:m,height:g}}function Cc(t,e,i,n){const{x:s,width:o}=i,{width:r,chartArea:{left:a,right:l}}=t;let c="center";return"center"===n?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),function(t,e,i,n){const{x:s,width:o}=n,r=i.caretSize+i.caretPadding;return"left"===t&&s+o+r>e.width||"right"===t&&s-o-r<0||void 0}(c,t,e,i)&&(c="center"),c}function Pc(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Cc(t,e,i,n),yAlign:n}}function Lc(t,e,i,n){const{caretSize:s,caretPadding:o,cornerRadius:r}=t,{xAlign:a,yAlign:l}=i,c=s+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=yo(r);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const g=function(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}(e,l,c);return"center"===l?"left"===a?p+=c:"right"===a&&(p-=c):"left"===a?p-=Math.max(h,u)+s:"right"===a&&(p+=Math.max(d,f)+s),{x:vs(p,0,n.width-e.width),y:vs(g,0,n.height-e.height)}}function Dc(t,e,i){const n=xo(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function Ic(t){return Oc([],Ec(t))}function Rc(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const jc={beforeTitle:On,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex{const e={before:[],lines:[],after:[]},s=Rc(i,t);Oc(e.before,Ec(Fc(s,"beforeLabel",this,t))),Oc(e.lines,Fc(s,"label",this,t)),Oc(e.after,Ec(Fc(s,"afterLabel",this,t))),n.push(e)}),n}getAfterBody(t,e){return Ic(Fc(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=Fc(i,"beforeFooter",this,t),s=Fc(i,"footer",this,t),o=Fc(i,"afterFooter",this,t);let r=[];return r=Oc(r,Ec(n)),r=Oc(r,Ec(s)),r=Oc(r,Ec(o)),r}_createItems(t){const e=this._active,i=this.chart.data,n=[],s=[],o=[];let r,a,l=[];for(r=0,a=e.length;rt.filter(e,n,s,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),jn(l,e=>{const i=Rc(t.callbacks,e);n.push(Fc(i,"labelColor",this,e)),s.push(Fc(i,"labelPointStyle",this,e)),o.push(Fc(i,"labelTextColor",this,e))}),this.labelColors=n,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,o=[];if(n.length){const t=Mc[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Tc(this,i),r=Object.assign({},t,e),a=Pc(this.chart,i,r),l=Lc(i,r,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:h}=yo(r),{x:d,y:u}=t,{width:f,height:p}=e;let g,m,b,v,y,x;return"center"===s?(y=u+p/2,"left"===n?(g=d,m=g-o,v=y+o,x=y-o):(g=d+f,m=g+o,v=y-o,x=y+o),b=g):(m="left"===n?d+Math.max(a,c)+o:"right"===n?d+f-Math.max(l,h)-o:this.caretX,"top"===s?(v=u,y=v-o,g=m-o,b=m+o):(v=u+p,y=v+o,g=m+o,b=m-o),x=v),{x1:g,x2:m,x3:b,y1:v,y2:y,y3:x}}drawTitle(t,e,i){const n=this.title,s=n.length;let o,r,a;if(s){const l=rr(i.rtl,this.x,this.width);for(t.x=Dc(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=_o(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,a=0;a0!==t)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,uo(t,{x:e,y:f,w:l,h:a,radius:r}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),uo(t,{x:i,y:f+1,w:l-2,h:a-2,radius:r}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(e,f,l,a),t.strokeRect(e,f,l,a),t.fillStyle=o.backgroundColor,t.fillRect(i,f+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:l,boxPadding:c}=i,h=_o(i.bodyFont);let d=h.lineHeight,u=0;const f=rr(i.rtl,this.x,this.width),p=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+s},g=f.textAlign(o);let m,b,v,y,x,_,w;for(e.textAlign=o,e.textBaseline="middle",e.font=h.string,t.x=Dc(this,g,i),e.fillStyle=i.bodyColor,jn(this.beforeBody,p),u=r&&"right"!==g?"center"===o?l/2+c:l+2+c:0,y=0,_=n.length;y<_;++y){for(m=n[y],b=this.labelTextColors[y],e.fillStyle=b,jn(m.before,p),v=m.lines,r&&v.length&&(this._drawColorBox(e,t,y,f,i),d=Math.max(h.lineHeight,a)),x=0,w=v.length;x0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=Mc[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Tc(this,t),r=Object.assign({},i,this._size),a=Pc(e,t,r),l=Lc(t,r,a,e);n._to===l.x&&s._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=xo(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,n,e),ar(t,e.textDirection),s.y+=o.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),lr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),s=!Fn(i,n),o=this._positionChanged(n,e);(s||o)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,s=this._active||[],o=this._getActiveElements(t,s,e,i),r=this._positionChanged(o,t),a=e||!Fn(o,s)||r;return a&&(this._active=o,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));const o=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,o=Mc[s.position].call(this,t,e);return!1!==o&&(i!==o.x||n!==o.y)}}var Bc={id:"tooltip",_element:zc,positioners:Mc,afterInit(t,e,i){i&&(t.tooltip=new zc({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:jc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Nc=Object.freeze({__proto__:null,Colors:Jl,Decimation:Ql,Filler:mc,Legend:xc,SubTitle:Sc,Title:wc,Tooltip:Bc});function Wc(t,e,i,n){const s=t.indexOf(e);if(-1===s)return((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n);return s!==t.lastIndexOf(e)?i:s}function Vc(t){const e=this.getLabels();return t>=0&&tf&&(S=as(k*S/f/u)*u),An(a)||(x=Math.pow(10,a),S=Math.ceil(S*x)/x),"ticks"===n?(_=Math.floor(p/S)*S,w=Math.ceil(g/S)*S):(_=p,w=g),m&&b&&s&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((r-o)/s,S/1e3)?(k=Math.round(Math.min((r-o)/S,c)),S=(r-o)/k,_=o,w=r):v?(_=m?o:_,w=b?r:w,k=l-1,S=(w-_)/k):(k=(w-_)/S,k=rs(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const M=Math.max(us(S),us(_));x=Math.pow(10,An(a)?M:a),_=Math.round(_*x)/x,w=Math.round(w*x)/x;let O=0;for(m&&(d&&_!==o?(i.push({value:o}),_r)break;i.push({value:t})}return b&&d&&w!==r?i.length&&rs(i[i.length-1].value,r,$c(r,y,t))?i[i.length-1].value=r:i.push({value:r}):b&&w!==r||i.push({value:w}),i}function $c(t,e,{horizontal:i,minRotation:n}){const s=hs(n),o=(i?Math.sin(s):Math.cos(s))||.001,r=.75*e*(""+t).length;return Math.min(e/o,r)}class Uc extends Ha{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return An(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:s}=this;const o=t=>n=e?n:t,r=t=>s=i?s:t;if(t){const t=os(n),e=os(s);t<0&&e<0?r(0):t>0&&e>0&&o(0)}if(n===s){let e=0===s?1:Math.abs(.05*s);r(s+e),t||o(n-e)}this.min=n,this.max=s}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=Hc({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&cs(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Vs(t,this.chart.options.locale,this.options.ticks.format)}}class qc extends Uc{static id="linear";static defaults={ticks:{callback:$s.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pn(t)?t:0,this.max=Pn(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=hs(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,s.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Yc=t=>Math.floor(ss(t)),Xc=(t,e)=>Math.pow(10,Yc(t)+e);function Jc(t){return 1===t/Math.pow(10,Yc(t))}function Gc(t,e,i){const n=Math.pow(10,i),s=Math.floor(t/n);return Math.ceil(e/n)-s}function Kc(t,{min:e,max:i}){e=Ln(t.min,e);const n=[],s=Yc(e);let o=function(t,e){let i=Yc(e-t);for(;Gc(t,e,i)>10;)i++;for(;Gc(t,e,i)<10;)i--;return Math.min(i,Yc(t))}(e,i),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((e-l)*r)/r,h=Math.floor((e-l)/a/10)*a*10;let d=Math.floor((c-h)/Math.pow(10,o)),u=Ln(t.min,Math.round((l+h+d*Math.pow(10,o))*r)/r);for(;u=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),u=Math.round((l+h+d*Math.pow(10,o))*r)/r;const f=Ln(t.max,u);return n.push({value:f,major:Jc(f),significand:d}),n}class Qc extends Ha{static id="logarithmic";static defaults={ticks:{callback:$s.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Uc.prototype.parse.apply(this,[t,e]);if(0!==i)return Pn(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pn(t)?Math.max(0,t):null,this.max=Pn(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Pn(this._userMin)&&(this.min=t===Xc(this.min,0)?Xc(this.min,-1):Xc(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const s=e=>i=t?i:e,o=t=>n=e?n:t;i===n&&(i<=0?(s(1),o(10)):(s(Xc(i,-1)),o(Xc(n,1)))),i<=0&&s(Xc(n,-1)),n<=0&&o(Xc(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=Kc({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&cs(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":Vs(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ss(t),this._valueRange=ss(this.max)-ss(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ss(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Zc(t){const e=t.ticks;if(e.display&&t.display){const t=xo(e.backdropPadding);return Dn(e.font&&e.font.size,Gs.font.size)+t.height}return 0}function th(t,e,i){return i=Tn(i)?i:[i],{w:Qs(t,e.string,i),h:i.length*e.lineHeight}}function eh(t,e,i,n,s){return t===n||t===s?{start:e-i/2,end:e+i/2}:ts?{start:e-i,end:e}:{start:e,end:e+i}}function ih(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],s=[],o=t._pointLabels.length,r=t.options.pointLabels,a=r.centerPointLabels?Gn/o:0;for(let l=0;le.r&&(a=(n.end-e.r)/o,t.r=Math.max(t.r,e.r+a)),s.starte.b&&(l=(s.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}function sh(t,e,i){const n=t.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=i,l=t.getPointPosition(e,n+s+r,o),c=Math.round(ds(ms(l.angle+es))),h=function(t,e,i){90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e);return t}(l.y,a.h,c),d=function(t){if(0===t||180===t)return"center";if(t<180)return"left";return"right"}(c),u=function(t,e,i){"right"===i?t-=e:"center"===i&&(t-=e/2);return t}(l.x,a.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:u,top:h,right:u+a.w,bottom:h+a.h}}function oh(t,e){if(!e)return!0;const{left:i,top:n,right:s,bottom:o}=t;return!(no({x:i,y:n},e)||no({x:i,y:o},e)||no({x:s,y:n},e)||no({x:s,y:o},e))}function rh(t,e,i){const{left:n,top:s,right:o,bottom:r}=i,{backdropColor:a}=e;if(!An(a)){const i=yo(e.borderRadius),l=xo(e.backdropPadding);t.fillStyle=a;const c=n-l.left,h=s-l.top,d=o-n+l.width,u=r-s+l.height;Object.values(i).some(t=>0!==t)?(t.beginPath(),uo(t,{x:c,y:h,w:d,h:u,radius:i}),t.fill()):t.fillRect(c,h,d,u)}}function ah(t,e,i,n){const{ctx:s}=t;if(i)s.arc(t.xCenter,t.yCenter,e,0,Kn);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let o=1;ot,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=xo(Zc(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Pn(t)&&!isNaN(t)?t:0,this.max=Pn(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Zc(this.options))}generateTickLabels(t){Uc.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{const i=Rn(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?ih(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){return ms(t*(Kn/(this._pointLabels.length||1))+hs(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(An(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(An(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t=0;s--){const e=t._pointLabelItems[s];if(!e.visible)continue;const o=n.setContext(t.getPointLabelContext(s));rh(i,o,e);const r=_o(o.font),{x:a,y:l,textAlign:c}=e;ho(i,t._pointLabels[s],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}(this,o),n.display&&this.ticks.forEach((t,e)=>{if(0!==e||0===e&&this.min<0){a=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),r=n.setContext(i),l=s.setContext(i);!function(t,e,i,n,s){const o=t.ctx,r=e.circular,{color:a,lineWidth:l}=e;!r&&!n||!a||!l||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),ah(t,i,r,n),o.closePath(),o.stroke(),o.restore())}(this,r,a,o,l)}}),i.display){for(t.save(),r=o-1;r>=0;r--){const n=i.setContext(this.getPointLabelContext(r)),{color:s,lineWidth:o}=n;o&&s&&(t.lineWidth=o,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,a=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),l=this.getPointPosition(r,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,r)=>{if(0===r&&this.min>=0&&!e.reverse)return;const a=i.setContext(this.getContext(r)),l=_o(a.font);if(s=this.getDistanceFromCenterForValue(this.ticks[r].value),a.showLabelBackdrop){t.font=l.string,o=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=xo(a.backdropPadding);t.fillRect(-o/2-e.left,-s-l.size/2-e.top,o+e.width,l.size+e.height)}ho(t,n.label,0,-s,l,{color:a.color,strokeColor:a.textStrokeColor,strokeWidth:a.textStrokeWidth})}),t.restore()}drawTitle(){}}const ch={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},hh=Object.keys(ch);function dh(t,e){return t-e}function uh(t,e){if(An(e))return null;const i=t._adapter,{parser:n,round:s,isoWeekday:o}=t._parseOpts;let r=e;return"function"==typeof n&&(r=n(r)),Pn(r)||(r="string"==typeof n?i.parse(r,n):i.parse(r)),null===r?null:(s&&(r="week"!==s||!ls(o)&&!0!==o?i.startOf(r,s):i.startOf(r,"isoWeek",o)),+r)}function fh(t,e,i,n){const s=hh.length;for(let o=hh.indexOf(t);o=e?i[n]:i[s]]=!0}}else t[e]=!0}function gh(t,e,i){const n=[],s={},o=e.length;let r,a;for(r=0;r=0&&(e[l].major=!0);return e}(t,n,s,i):n}class mh extends Ha{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),n=this._adapter=new Jr(t.adapters.date);n.init(e),Vn(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:uh(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:s,minDefined:o,maxDefined:r}=this.getUserBounds();function a(t){o||isNaN(t.min)||(n=Math.min(n,t.min)),r||isNaN(t.max)||(s=Math.max(s,t.max))}o&&r||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=Pn(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),s=Pn(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,s-1),this.max=Math.max(n+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const s=this.min,o=function(t,e,i){let n=0,s=t.length;for(;nn&&t[s-1]>i;)s--;return n>0||s=hh.indexOf(i);o--){const i=hh[o];if(ch[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return hh[i?hh.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=hh.indexOf(t)+1,i=hh.length;e+t.value))}initOffsets(t=[]){let e,i,n=0,s=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),s=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=vs(n,0,o),s=vs(s,0,o),this._offsets={start:n,end:s,factor:1/(n+1+s)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,s=n.time,o=s.unit||fh(s.minUnit,e,i,this._getLabelCapacity(e)),r=Dn(n.ticks.stepSize,1),a="week"===o&&s.isoWeekday,l=ls(a)||!0===a,c={};let h,d,u=e;if(l&&(u=+t.startOf(u,"isoWeek",a)),u=+t.startOf(u,l?"day":o),t.diff(i,e,o)>1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+o);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;h+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,n=this._unit,s=e||i[n];return this._adapter.format(t,s)}_tickFormatFunction(t,e,i,n){const s=this.options,o=s.ticks.callback;if(o)return Rn(o,[t,e,i],this);const r=s.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&r[a],h=l&&r[l],d=i[e],u=l&&h&&d&&d.major;return this._adapter.format(t,n||(u?h:c))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=_s(t,"pos",e)),({pos:n,time:o}=t[a]),({pos:s,time:r}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=_s(t,"time",e)),({time:n,pos:o}=t[a]),({time:s,pos:r}=t[l]));const c=s-n;return c?o+(r-o)*(e-n)/c:o}var vh=Object.freeze({__proto__:null,CategoryScale:class extends Ha{static id="category";static defaults={ticks:{callback:Vc}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(An(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:vs(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:Wc(i,t,Dn(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){return Vc.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:qc,LogarithmicScale:Qc,RadialLinearScale:lh,TimeScale:mh,TimeSeriesScale:class extends mh{static id="timeseries";static defaults=mh.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=bh(e,this.min),this._tableRange=bh(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let o,r,a,l,c;for(o=0,r=t.length;o=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,r=n.length;ot-e)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(bh(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return bh(this._table,i*this._tableRange+this._minPos,!0)}}});const yh=[qr,Vl,Nc,vh];xl.register(...yh);const xh=xl;var _h=i(998),wh=i.n(_h);const kh={data:{},nonce:"",context:null,init(t){this.context=t;const e=t.querySelectorAll("[data-progress]"),i=t.querySelectorAll("[data-chart]");[...e].forEach(t=>{t.dataset.url&&(this.data[t.dataset.url]||(this.data[t.dataset.url]={items:[],poll:null}),this.data[t.dataset.url].items.push(t)),"line"===t.dataset.progress?this.line(t):"circle"===t.dataset.progress&&this.circle(t),this.nonce||(this.nonce=t.dataset?.nonce)});for(const t in this.data)this.getValues(t);[...i].forEach(t=>{const e={labels:JSON.parse(t.dataset.dates),datasets:[{backgroundColor:t.dataset.color,borderColor:t.dataset.color,data:JSON.parse(t.dataset.data),cubicInterpolationMode:"monotone"}]};new xh(t,{type:"line",data:e,options:{responsive:!0,radius:0,interaction:{intersect:!1},plugins:{legend:{display:!1}},scales:{y:{suggestedMin:0,ticks:{color:"#999999",callback:(t,e)=>wh()(t,{decimals:2,scale:"SI"})},grid:{color:"#d3dce3"}},x:{ticks:{color:"#999999"},grid:{color:"#d3dce3"}}}}})})},line(t){new(Ui().Line)(t,{strokeWidth:2,easing:"easeInOut",duration:1400,color:t.dataset.color,trailColor:"#d3dce3",trailWidth:2,svgStyle:{width:"100%",height:"100%",display:"block"}}).animate(t.dataset.value/100)},circle(t){t.dataset.basetext=t.dataset.text,t.dataset.text="";const e=t.dataset.value,i=this;if(t.bar=new(Ui().Circle)(t,{strokeWidth:3,easing:"easeInOut",duration:1400,color:t.dataset.color,trailColor:"#d3dce3",trailWidth:3,svgStyle:null,text:{autoStyleContainer:!1,style:{color:"#222222"}},step(e,n){const s=Math.floor(100*n.value());i.setText(n,parseFloat(s),t.dataset.text)}}),!t.dataset.url){const i=e/100;t.bar.animate(i)}},getValues(t){this.data[t].poll&&(clearTimeout(this.data[t].poll),this.data[t].poll=null),Pt({path:t,method:"GET",headers:{"X-WP-Nonce":this.nonce}}).then(e=>{this.data[t].items.forEach(i=>{void 0!==e[i.dataset.basetext]?i.dataset.text=e[i.dataset.basetext]:i.dataset.text=i.dataset.basetext,i.bar.animate(e[i.dataset.value]),i.dataset.poll&&!this.data[t].poll&&(this.data[t].poll=setTimeout(()=>{this.getValues(t)},1e4))});for(const t in e){const i=this.context.querySelectorAll(`[data-key="${t}"]`),n=this.context.querySelectorAll(`[data-text="${t}"]`);i.forEach(i=>{i.dataset.value=e[t],i.dispatchEvent(new Event("focus"))}),n.forEach(i=>{i.innerText=e[t],i.classList.contains("cld-toggle")&&(e[t]?i.classList.remove("hidden"):i.classList.add("hidden"))})}})},setText(t,e,i){if(!t)return;const n=document.createElement("span"),s=document.createElement("h2"),o=document.createTextNode(i);s.innerText=e+"%",n.appendChild(s),n.appendChild(o),t.setText(n)}},Sh=kh,Mh={key:"_cld_pending_state",data:null,pending:null,changed:!1,previous:{},init(){this.data=cldData.stateData?cldData.stateData:{};let t=localStorage.getItem(this.key);t&&(t=JSON.parse(t),this.data={...this.data,...t},this.sendStates()),this.previous=JSON.stringify(this.data)},_update(){this.pending&&(clearTimeout(this.pending),localStorage.removeItem(this.key)),this.previous!==JSON.stringify(this.data)&&(this.pending=setTimeout(()=>this.sendStates(),2e3),localStorage.setItem(this.key,JSON.stringify(this.data)))},set(t,e){this.data[t]&&this.data[t]===e||(this.data[t]=e,this._update())},get(t){let e=null;return this.data[t]&&(e=this.data[t]),e},sendStates(){fetch(cldData.stateURL,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":cldData.stateNonce},body:JSON.stringify(this.data)}).then(t=>t.json()).then(t=>{t.success&&(this.previous=JSON.stringify(t.state),localStorage.removeItem(this.key))})}},Oh={init(t){[...t.querySelectorAll("[data-remove]")].forEach(t=>{t.addEventListener("click",e=>{if(t.dataset.message&&!confirm(t.dataset.message))return;const i=document.getElementById(t.dataset.remove);i.parentNode.removeChild(i)})})}},Eh={values:{},inputs:{},context:null,init(t){this.context=t;t.querySelectorAll("[data-tags]").forEach(t=>this.bind(t))},bind(t){t.innerText=t.dataset.placeholder;const e=t.dataset.tags,i=document.getElementById(e),n=this.context.querySelectorAll(`[data-tags-delete="${e}"]`);this.values[e]=JSON.parse(i.value),this.inputs[e]=i,t.boundInput=e,t.boundDisplay=this.context.querySelector(`[data-tags-display="${e}"]`),t.boundDisplay.addEventListener("click",e=>{t.focus()}),t.addEventListener("focus",e=>{t.innerText=null}),t.addEventListener("blur",e=>{3{if("Tab"===i.key)3{"Comma"!==e.code&&"Enter"!==e.code&&"Tab"!==e.code&&"Space"!==e.code||(e.preventDefault(),3{t.parentNode.control=t,t.parentNode.style.width=getComputedStyle(t.parentNode).width,t.addEventListener("click",e=>{e.stopPropagation(),this.deleteTag(t)})})},deleteTag(t){const e=t.parentNode,i=e.dataset.inputId,n=this.values[i].indexOf(e.dataset.value);0<=n&&this.values[i].splice(n,1),e.style.width=0,e.style.opacity=0,e.style.padding=0,e.style.margin=0,setTimeout(()=>{e.parentNode.removeChild(e)},500),this.updateInput(i)},captureTag(t,e){if(this[t.dataset.format]&&"string"!=typeof(e=this[t.dataset.format](e)))return t.classList.add("pulse"),void setTimeout(()=>{t.classList.remove("pulse")},1e3);if(!this.validateUnique(t.boundDisplay,e)){const i=this.createTag(e);i.dataset.inputId=t.boundInput,this.values[t.boundInput].push(e),t.innerText=null,t.boundDisplay.insertBefore(i,t),i.style.width=getComputedStyle(i).width,i.style.opacity=1,this.updateInput(t.boundInput)}},createTag(t){const e=document.createElement("span"),i=document.createElement("span"),n=document.createElement("span");return e.classList.add("cld-input-tags-item"),i.classList.add("cld-input-tags-item-text"),n.className="cld-input-tags-item-delete dashicons dashicons-no-alt",n.addEventListener("click",()=>this.deleteTag(n)),i.innerText=t,e.appendChild(i),e.appendChild(n),e.dataset.value=t,e.style.opacity=0,e.control=n,e},validateUnique(t,e){const i=t.querySelector(`[data-value="${e}"]`);let n=!1;return i&&(i.classList.remove("pulse"),i.classList.add("pulse"),setTimeout(()=>{i.classList.remove("pulse")},500),n=!0),n},updateInput(t){this.inputs[t].value=JSON.stringify(this.values[t])},host(t){!1===/^(?:http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)/.test(t)&&(t="https://"+t);let e="";try{e=new URL(t)}catch(t){return t}return decodeURIComponent(e.host)}},Ah=Eh,Th={suffixInputs:null,init(t){this.suffixInputs=t.querySelectorAll("[data-suffix]"),[...this.suffixInputs].forEach(t=>this.bindInput(t))},bindInput(t){const e=document.getElementById(t.dataset.suffix),i=e.dataset.template.split("@value");this.setSuffix(e,i,t.value),t.addEventListener("change",()=>this.setSuffix(e,i,t.value)),t.addEventListener("input",()=>this.setSuffix(e,i,t.value))},setSuffix(t,e,i){t.innerHTML="",t.classList.add("hidden"),-1===["none","off",""].indexOf(i)&&t.classList.remove("hidden");const n=document.createTextNode(e.join(i));t.appendChild(n)}},Ch={wrappers:null,frame:null,error:'data:image/svg+xml;utf8,%26%23x26A0%3B︎',init(t){this.wrappers=t.querySelectorAll(".cld-size-items"),this.wrappers.forEach(t=>{const e=t.querySelectorAll(".cld-size-selector-item");e.forEach(i=>{i.addEventListener("click",()=>{e.forEach(t=>{delete t.dataset.selected}),i.dataset.selected=!0,this.switchSizeContent(t,i.dataset.size)})});const i=t.querySelector(".cld-size-selector-item[data-selected]");i&&this.switchSizeContent(t,i.dataset.size)})},switchSizeContent(t,e){t.querySelectorAll(".cld-size-content").forEach(t=>{t.style.display="none"});const i=t.querySelector(`.cld-size-content[data-size="${e}"]`);i&&(i.style.display="block",this.buildImages(t,i))},buildImages(t,e){const i=t.dataset.base,n=e.querySelector(".regular-text"),s=e.querySelector(".disable-toggle");if(!n||!s)return;const o=e.querySelectorAll("img"),r=n.value.length?n.value.replace(" ",""):n.placeholder;if(o.forEach(t=>{const e=t.dataset.size,o=t.dataset.file;s.checked?(n.disabled=!0,t.src=`${i}/${e}/${o}`):(n.disabled=!1,t.src=`${i}/${e},${r}/${o}`),t.bound||(t.addEventListener("error",()=>{t.src=this.error}),t.bound=!0)}),!n.bound){let i=null;n.addEventListener("input",()=>{i&&clearTimeout(i),i=setTimeout(()=>{this.buildImages(t,e)},1e3)}),n.bound=!0}s.bound||(s.addEventListener("change",()=>{this.buildImages(t,e)}),s.bound=!0);const a=e.querySelector(".clear-crop-input");a&&!a.bound&&(a.addEventListener("click",()=>{n.value="",this.buildImages(t,e)}),a.bound=!0)}},Ph={bindings:{},parent_check_data:{},check_parents:{},_init(t){const e=t.querySelectorAll("[data-condition]"),i=t.querySelectorAll("[data-toggle]"),n=t.querySelectorAll("[data-for]"),s=t.querySelectorAll("[data-tooltip]"),o=t.querySelectorAll("[data-bind-trigger]"),r=t.querySelectorAll("[data-main]"),a=t.querySelectorAll("[data-file]"),l=t.querySelectorAll("[data-auto-suffix]"),c=t.querySelectorAll("[data-confirm]"),h={};Mh.init(),Hi.bind(r),l.forEach(t=>this._autoSuffix(t)),o.forEach(t=>this._trigger(t)),i.forEach(t=>this._toggle(t)),e.forEach(t=>this._bind(t)),n.forEach(t=>this._alias(t)),a.forEach(t=>this._files(t,h)),Bi(s,{theme:"cloudinary",arrow:!1,placement:"bottom-start",aria:{content:"auto",expanded:"auto"},content:t=>document.getElementById(t.dataset.tooltip).innerHTML}),[...o].forEach(t=>{t.dispatchEvent(new Event("input"))}),c.forEach(t=>{t.addEventListener("click",e=>{confirm(t.dataset.confirm)||(e.preventDefault(),e.stopPropagation())})}),Sh.init(t),Oh.init(t),Ah.init(t),Th.init(t),Ch.init(t)},_autoSuffix(t){const e=t.dataset.autoSuffix;let i="";const n=[...e.split(";")].map(t=>0===t.indexOf("*")?(i=t.replace("*",""),i):t);t.addEventListener("change",()=>{const e=t.value.replace(" ",""),s=e.replace(/[^0-9]/g,""),o=e.replace(/[0-9]/g,"").toLowerCase();s&&(-1===n.indexOf(o)?t.value=s+i:t.value=s+o)}),t.dispatchEvent(new Event("change"))},_files(t,e){const i=t.dataset.parent;i&&(this.check_parents[i]=document.getElementById(i),this.parent_check_data[i]||(this.parent_check_data[i]=this.check_parents[i].value?JSON.parse(this.check_parents[i].value):[]),t.addEventListener("change",()=>{const n=this.parent_check_data[i].indexOf(t.value);t.checked?this.parent_check_data[i].push(t.value):this.parent_check_data[i].splice(n,1),e[i]&&clearTimeout(e[i]),e[i]=setTimeout(()=>{this._compileParent(i)},10)}))},_compileParent(t){this.check_parents[t].value=JSON.stringify(this.parent_check_data[t]),this.check_parents[t].dispatchEvent(new Event("change"))},_bind(t){t.condition=JSON.parse(t.dataset.condition);for(const e in t.condition)this.bindings[e]&&this.bindings[e].elements.push(t)},_trigger(t){const e=t.dataset.bindTrigger,i=this;i.bindings[e]={input:t,value:t.value,checked:!0,elements:[]},t.addEventListener("change",function(e){t.dispatchEvent(new Event("input"))}),t.addEventListener("input",function(){if(i.bindings[e].value=t.value,"checkbox"===t.type&&(i.bindings[e].checked=t.checked),"radio"!==t.type||!1!==t.checked)for(const n in i.bindings[e].elements)i.toggle(i.bindings[e].elements[n],t)})},_alias(t){t.addEventListener("click",function(){document.getElementById(t.dataset.for).dispatchEvent(new Event("click"))})},_toggle(t){const e=this,i=document.querySelector('[data-wrap="'+t.dataset.toggle+'"]');if(!i)return;const n=Mh.get(t.id);t.addEventListener("click",function(n){n.stopPropagation();const s=i.classList.contains("open")?"closed":"open";e.toggle(i,t,s)}),n!==t.dataset.state&&this.toggle(i,t,n)},toggle(t,e,i){if(!i){i="open";for(const e in t.condition){let n=this.bindings[e].value;const s=t.condition[e];"boolean"==typeof s&&(n=this.bindings[e].checked),s!==n&&(i="closed")}}"closed"===i?this.close(t,e):this.open(t,e),Mh.set(e.id,i)},open(t,e){const i=t.getElementsByClassName("cld-ui-input");t.classList.remove("closed"),t.classList.add("open"),e&&e.classList.contains("dashicons")&&(e.classList.remove("dashicons-arrow-down-alt2"),e.classList.add("dashicons-arrow-up-alt2")),[...i].forEach(function(t){t.dataset.disabled=!1})},close(t,e){const i=t.getElementsByClassName("cld-ui-input");t.classList.remove("open"),t.classList.add("closed"),e&&e.classList.contains("dashicons")&&(e.classList.remove("dashicons-arrow-up-alt2"),e.classList.add("dashicons-arrow-down-alt2")),[...i].forEach(function(t){t.dataset.disabled=!0})}},Lh=document.querySelectorAll(".cld-settings,.cld-meta-box");Lh.length&&Lh.forEach(t=>{t&&window.addEventListener("load",Ph._init(t))});const Dh={config:null,init(){this.config||"undefined"!=typeof cldData&&cldData.analytics&&cldData.analytics.enabled&&(this.config=cldData.analytics,Pt.use(Pt.createNonceMiddleware(this.config.nonce)))},track(t,e={},i="activation_funnel",n=null){if(this.config||this.init(),this.config&&this.config.enabled&&t)try{Pt({url:this.config.endpoint,method:"POST",data:{event_name:t,event_category:i,funnel_step:n,params:e}}).catch(()=>{})}catch(t){}},trackReliable(t,e={},i="activation_funnel"){if(this.config||this.init(),this.config&&this.config.enabled&&t)if(navigator.sendBeacon)try{const n=this.config.endpoint.includes("?")?"&":"?",s=this.config.endpoint+n+"_wpnonce="+encodeURIComponent(this.config.nonce),o=new Blob([JSON.stringify({event_name:t,event_category:i,funnel_step:null,params:e})],{type:"application/json"});navigator.sendBeacon(s,o)}catch(t){}else this.track(t,e,i)}};window.addEventListener("load",()=>Dh.init());const Ih=Dh,Rh={storageKey:"_cld_wizard",testing:null,connectAttempts:0,startedEntry:!1,startedTracked:!1,next:document.querySelector('[data-navigate="next"]'),back:document.querySelector('[data-navigate="back"]'),lock:document.getElementById("pad-lock"),lockIcon:document.getElementById("lock-icon"),options:document.querySelectorAll('.cld-ui-input[type="checkbox"]'),settings:document.getElementById("optimize"),tabBar:document.getElementById("wizard-tabs"),tracking:document.getElementById("tracking"),complete:document.getElementById("complete-wizard"),tabs:{"tab-1":document.getElementById("tab-icon-1"),"tab-2":document.getElementById("tab-icon-2"),"tab-3":document.getElementById("tab-icon-3")},content:{"tab-1":document.getElementById("tab-1"),"tab-2":document.getElementById("tab-2"),"tab-3":document.getElementById("tab-3"),"tab-4":document.getElementById("tab-4")},connection:{error:document.getElementById("connection-error"),success:document.getElementById("connection-success"),working:document.getElementById("connection-working")},debounceConnect:null,updateConnection:document.getElementById("update-connection"),cancelUpdateConnection:document.getElementById("cancel-update-connection"),config:{},didSave:!1,init(){if(!cldData.wizard)return;this.config=cldData.wizard.config,window.localStorage.getItem(this.storageKey)&&(this.config=JSON.parse(window.localStorage.getItem(this.storageKey))),document.location.hash.length&&this.hashChange(),Pt.use(Pt.createNonceMiddleware(cldData.wizard.saveNonce));const t=document.querySelectorAll("[data-navigate]"),e=document.getElementById("connect.cloudinary_url");this.updateConnection.addEventListener("click",()=>{this.lockNext(),e.parentNode.classList.remove("hidden"),this.cancelUpdateConnection.classList.remove("hidden"),this.updateConnection.classList.add("hidden")}),this.cancelUpdateConnection.addEventListener("click",()=>{this.unlockNext(),e.parentNode.classList.add("hidden"),this.cancelUpdateConnection.classList.add("hidden"),this.updateConnection.classList.remove("hidden"),this.config.cldString=!0,e.value="",this.connection.error.classList.remove("active"),this.connection.success.classList.add("active")}),[...t].forEach(t=>{t.addEventListener("click",()=>{this.navigate(t.dataset.navigate)})}),this.lock.addEventListener("click",()=>{this.lockIcon.classList.toggle("dashicons-unlock"),this.settings.classList.toggle("disabled"),this.options.forEach(t=>{t.disabled=t.disabled?"":"disabled"})}),e.addEventListener("input",t=>{this.lockNext(),this.startedEntry||(this.startedEntry=!0,Ih.track("credentials_entry_started",{},"activation_funnel",3));const i=e.value.replace("CLOUDINARY_URL=","");this.connection.error.classList.remove("active"),this.connection.success.classList.remove("active"),this.connection.working.classList.remove("active"),i.length&&(this.testing=i,this.debounceConnect&&clearTimeout(this.debounceConnect),this.debounceConnect=setTimeout(()=>{const t=this.evaluateConnectionString(i);Ih.track("credentials_format_validated",{format_valid:t,invalid_reason:t?"":this.invalidReason(i)},"activation_funnel",3),t?(this.connection.working.classList.add("active"),this.testConnection(i)):this.connection.error.classList.add("active")},500))}),this.config.cldString&&(e.parentNode.classList.add("hidden"),this.updateConnection.classList.remove("hidden"));const i=document.querySelector('a[href="https://cloudinary.com/signup"]');i&&i.addEventListener("click",()=>{Ih.track("wizard_signup_clicked",{},"activation_funnel",2)}),this.complete&&this.complete.addEventListener("click",()=>{Ih.track("wizard_dashboard_clicked",{},"activation_funnel",7)}),this.getTab(this.config.tab),this.initFeatures(),window.addEventListener("hashchange",t=>{this.hashChange()})},hashChange(){const t=parseInt(document.location.hash.replace("#",""));t&&0t&&this.getTab(t)},initFeatures(){const t=(t,e)=>{Ih.track("wizard_setting_toggled",{setting_key:t,enabled:e},"activation_funnel",4)},e=document.getElementById("media_library");e.checked=this.config.mediaLibrary,e.addEventListener("change",()=>{this.setConfig("mediaLibrary",e.checked),t("media_library",e.checked)});const i=document.getElementById("non_media");i.checked=this.config.nonMedia,i.addEventListener("change",()=>{this.setConfig("nonMedia",i.checked),t("non_media",i.checked)});const n=document.getElementById("advanced");n.checked=this.config.advanced,n.addEventListener("change",()=>{this.setConfig("advanced",n.checked),t("advanced",n.checked)})},getCurrent(){return this.content[`tab-${this.config.tab}`]},hideTabs(){Object.keys(this.content).forEach(t=>{this.hide(this.content[t])})},completeTab(t){this.incompleteTab(),Object.keys(this.tabs).forEach(e=>{const i=parseInt(this.tabs[e].dataset.tab);t>i?this.tabs[e].classList.add("complete"):t===i&&this.tabs[e].classList.add("active")})},incompleteTab(t){Object.keys(this.tabs).forEach(t=>{this.tabs[t].classList.remove("complete","active")})},getCurrentTab(){return this.tabs[`tab-icon-${this.config.tab}`]},getTab(t){if(4===t&&window.localStorage.getItem(this.storageKey)&&!this.didSave)return void this.saveConfig();const e=this.getCurrent(),i=document.getElementById(`tab-${t}`);switch(this.hideTabs(),this.completeTab(t),this.hide(document.getElementById(`tab-${this.config.tab}`)),e.classList.remove("active"),this.show(i),this.show(this.next),this.hide(this.lock),t){case 1:this.hide(this.back),this.unlockNext(),this.startedTracked||(this.startedTracked=!0,this.config.wizardStartedAt||this.setConfig("wizardStartedAt",Date.now()),Ih.track("wizard_started",{entry_point:this.getEntryPoint()},"activation_funnel",2));break;case 2:Ih.track("wizard_connect_viewed",{},"activation_funnel",3),this.show(this.back),this.config.cldString?this.showSuccess():(this.lockNext(),setTimeout(()=>{document.getElementById("connect.cloudinary_url").focus()},0)),this.updateConnection.classList.contains("hidden")&&this.lockNext();break;case 3:if(!this.config.cldString)return void(document.location.hash="1");Ih.track("wizard_settings_viewed",{},"activation_funnel",4),this.show(this.lock),this.show(this.back);break;case 4:if(!this.config.cldString)return void(document.location.hash="1");Ih.track("wizard_completed",{time_to_complete_sec:this.timeToCompleteSec()},"activation_funnel",6),this.hide(this.tabBar),this.hide(this.next),this.hide(this.back)}this.setConfig("tab",t)},navigate(t){"next"===t?this.navigateNext():"back"===t&&this.navigateBack()},navigateBack(){document.location.hash=this.config.tab-1},navigateNext(){document.location.hash=this.config.tab+1},showError(){this.connection.error.classList.add("active"),this.connection.success.classList.remove("active")},showSuccess(){this.connection.error.classList.remove("active"),this.connection.success.classList.add("active")},show(t){t.classList.remove("hidden"),t.style.display=""},hide(t){t.classList.add("hidden"),t.style.display="none"},lockNext(){this.next.disabled="disabled"},unlockNext(){this.next.disabled=""},evaluateConnectionString:t=>new RegExp(/^(?:CLOUDINARY_URL=)?(cloudinary:\/\/){1}(\d*)[:]{1}([^@]*)[@]{1}([^@]*)$/gim).test(t),invalidReason(t){const e=t.replace("CLOUDINARY_URL=","");if(0!==e.indexOf("cloudinary://"))return"missing_scheme";if(-1===e.indexOf("@"))return"missing_cloud_name";const i=e.replace("cloudinary://","").split("@")[0];return-1===i.indexOf(":")?"missing_secret":/^\d+$/.test(i.split(":")[0])?"invalid_format":"invalid_api_key"},getEntryPoint:()=>-1!==document.referrer.indexOf("plugins.php")?"auto_redirect":"menu",timeToCompleteSec(){const t=this.config.wizardStartedAt;return t?Math.max(0,Math.round((Date.now()-t)/1e3)):null},testConnection(t){this.connectAttempts+=1,Ih.track("connection_test_started",{attempt_number:this.connectAttempts},"activation_funnel",3),Pt({path:cldData.wizard.testURL,data:{cloudinary_url:t,attempt_number:this.connectAttempts},method:"POST"}).then(e=>{e.url===this.testing&&(this.connection.working.classList.remove("active"),"connection_error"===e.type?this.showError():"connection_success"===e.type&&(this.showSuccess(),this.unlockNext(),this.setConfig("cldString",t)))})},setConfig(t,e){this.config[t]=e,window.localStorage.setItem(this.storageKey,JSON.stringify(this.config))},saveConfig(){this.lockNext(),this.next.innerText=$("Setting up Cloudinary","cloudinary"),this.didSave=!0,Pt({path:cldData.wizard.saveURL,data:this.config,method:"POST"}).then(t=>{this.next.innerText=$("Next","cloudinary"),this.unlockNext(),this.getTab(4),window.localStorage.removeItem(this.storageKey)}).fail(t=>{this.didSave=!1})}};window.addEventListener("load",()=>Rh.init());const jh={select:document.getElementById("connect.offload"),tooltip:null,descriptions:{},change(){[...this.descriptions].forEach(t=>{t.classList.remove("selected")}),this.tooltip.querySelector("."+this.select.value).classList.add("selected")},addEventListener(){this.select.addEventListener("change",this.change.bind(this))},_init(){this.select&&(this.addEventListener(),this.tooltip=this.select.parentNode.querySelector(".cld-tooltip"),this.descriptions=this.tooltip.querySelectorAll("li"),this.change())}};window.addEventListener("load",()=>jh._init());const Fh={pageReloader:document.getElementById("page-reloader"),init(){if(!cldData.extensions)return;Pt.use(Pt.createNonceMiddleware(cldData.extensions.nonce));[...document.querySelectorAll("[data-extension]")].forEach(t=>{t.addEventListener("change",e=>{t.spinner||(t.spinner=this.createSpinner(),t.parentNode.appendChild(t.spinner)),t.debounce&&clearTimeout(t.debounce),t.debounce=setTimeout(()=>{this.toggleExtension(t),t.debounce=null},1e3)})})},toggleExtension(t){const e=t.dataset.extension,i=t.checked;Ih.track("extension_toggled",{extension_id:e,enabled:i},"features"),Pt({path:cldData.extensions.url,data:{extension:e,enabled:i},method:"POST"}).then(e=>{t.spinner&&(t.parentNode.removeChild(t.spinner),delete t.spinner),Object.keys(e).forEach(t=>{document.querySelectorAll(`[data-text="${t}"]`).forEach(i=>{i.innerText=e[t]})}),this.pageReloader.style.display="block"})},createSpinner(){const t=document.createElement("span");return t.classList.add("spinner"),t.classList.add("cld-extension-spinner"),t}};window.addEventListener("load",()=>Fh.init());const zh={tabButtonSelectors:null,selectedTabID:"",deselectOldTab(){document.getElementById(this.selectedTabID).classList.remove("is-active"),this.filterActive([...this.tabButtonSelectors]).classList.remove("is-active")},selectCurrentTab(t){this.selectedTabID=t.dataset.tab,t.classList.add("is-active"),document.getElementById(this.selectedTabID).classList.add("is-active")},selectTab(t){t.preventDefault(),t.target.classList.contains("is-active")||(this.deselectOldTab(),this.selectCurrentTab(t.target))},filterTabs(){[...this.tabButtonSelectors].forEach(t=>{t.dataset.tab&&t.addEventListener("click",this.selectTab.bind(this))})},filterActive:t=>t.filter(t=>t.classList.contains("is-active")).pop(),init(){this.tabButtonSelectors=document.querySelectorAll(".cld-page-tabs-tab button"),0!==this.tabButtonSelectors.length&&(this.selectCurrentTab(this.filterActive([...this.tabButtonSelectors])),this.filterTabs())}};window.addEventListener("load",()=>zh.init());const Bh={init(){document.querySelectorAll(".cld-special-offer-link").forEach(t=>{t.addEventListener("click",()=>{Ih.track("special_offer_clicked",{offer_id:"small_plan_29"},"settings")})})}};window.addEventListener("load",()=>Bh.init());i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p;window.$=window.jQuery})()})(); +(()=>{var t={951(t,e){var i,n,s,o;o=function(){var t="BKMGTPEZY".split("");function e(t,e){return t&&t.toLowerCase()===e.toLowerCase()}return function(i,n){return i="number"==typeof i?i:0,(n=n||{}).fixed="number"==typeof n.fixed?n.fixed:2,n.spacer="string"==typeof n.spacer?n.spacer:" ",n.calculate=function(t){var s=e(t,"si")?["k","B"]:["K","iB"],o=e(t,"si")?1e3:1024,r=Math.log(i)/Math.log(o)|0,a=i/Math.pow(o,r),l=a.toFixed(n.fixed);return r-1<3&&!e(t,"si")&&e(t,"jedec")&&(s[1]="B"),{suffix:r?(s[0]+"MGTPEZY")[r-1]+s[1]:1==(0|l)?"Byte":"Bytes",magnitude:r,result:a,fixed:l,bits:{result:a/8,fixed:(a/8).toFixed(n.fixed)}}},n.to=function(n,s){var o=e(s,"si")?1e3:1024,r=t.indexOf("string"==typeof n?n[0].toUpperCase():"B"),a=i;if(-1===r||0===r)return a.toFixed(2);for(;r>0;r--)a/=o;return a.toFixed(2)},n.human=function(t){var e=n.calculate(t);return e.fixed+n.spacer+e.suffix},n}},t.exports?t.exports=o():(n=[],void 0===(s="function"==typeof(i=o)?i.apply(e,n):i)||(t.exports=s))},998(t,e){var i,n,s;n=[],i=function(){"use strict";function t(t,e){var i,s,o;for(i=1,s=arguments.length;i>1].factor>t?s=e-1:n=e;return i[n]},r.prototype.parse=function(t,e){var i=t.match(this._regexp);if(null!==i){var s,o=i[3];if(n(this._prefixes,o))s=this._prefixes[o];else{if(e||(o=o.toLowerCase(),!n(this._lcPrefixes,o)))return;o=this._lcPrefixes[o],s=this._prefixes[o]}var r=+i[2];return void 0!==i[1]&&(r=-r),{factor:s,prefix:o,unit:i[4],value:r}}};var a={binary:r.create(",Ki,Mi,Gi,Ti,Pi,Ei,Zi,Yi".split(","),1024),SI:r.create("q,r,y,z,a,f,p,n,µ,m,,k,M,G,T,P,E,Z,Y,R,Q".split(","),1e3,-10)},l=t({},a.binary._prefixes),c=a.SI._prefixes;for(var h in c)c[h]>=1&&(l[h]=c[h]);var d=new r(l),u={maxDecimals:2,separator:" ",unit:""},f={rounding:"round",scale:"SI",strict:!1};function p(t,e){var n=i(e,u,"decimals"),s=E(t,e,void 0!==n?n:i(e,u,"maxDecimals"));t=void 0!==n?s.value.toFixed(n):String(s.value);var o=s.prefix+i(e,u,"unit");return""===o?t:t+i(e,u,"separator")+o}var g={scale:"binary",unit:"B"};function m(e,i){return p(e,void 0===i?g:t({},g,i))}function b(t,e){return x(_(t,e))}var v={scale:d,unit:"B"};function y(e,i){return x(w(e,void 0===i?v:t({},v,i),!0))}function x(t){var e=String(t.value).split(".")[1];if(void 0!==e&&-1===e.indexOf("e")){var i=Math.pow(10,e.length),n=Math.round(t.value*i)*t.factor;if(n%1==0&&Math.abs(n)<=s)return n/i}return t.value*t.factor}function _(t,e){return w(t,e,!1)}function w(t,e,n){if("string"!=typeof t)throw new TypeError("str must be a string");var s=o(a,i(e,f,"scale"));if(void 0===s)throw new Error("missing scale");var r=i(e,f,"strict"),l=i(e,f,"unit");if(void 0!==l){var c=(t=t.trim()).slice(-l.length);""!==l&&(c===l||n&&!r&&c.toLowerCase()===l.toLowerCase())?t=t.slice(0,-l.length):l=""}var h=s.parse(t,r);if(void 0===h||void 0!==l&&""!==h.unit)throw new Error("cannot parse str");return void 0!==l&&(h.unit=l),h}var k={ceil:function(t){return Math.ceil(+t.toPrecision(15))},floor:function(t){return Math.floor(+t.toPrecision(15))},round:Math.round},M={ceil:"floor",floor:"ceil"};function S(t,e){return t<10*e?10:1}function O(t,e){return E(t,e,i(e,f,"maxDecimals"))}function E(t,e,s){if("number"!=typeof t||t!=t)throw new TypeError("value must be a number");if(0===t)return{value:0,prefix:""};if(!isFinite(t))return{value:t,prefix:""};var r=t<0;r&&(t=-t);var l=o(a,i(e,f,"scale"));if(void 0===l)throw new Error("missing scale");var c=i(e,f,"rounding");if(!n(k,c))throw new Error("invalid rounding");r&&n(M,c)&&(c=M[c]);var h,d=k[c],u="auto"===s;void 0===s||u||(h=Math.pow(10,s));var p,g=i(e,f,"prefix");if(void 0!==g){if(!n(l._prefixes,g))throw new Error("invalid prefix");p=l._prefixes[g]}else{var m=l.findPrefix(t);if(void 0!==s)do{p=m.factor,u&&(h=S(t,p));var b=p/h;t=d(t/b)*b}while((m=l.findPrefix(t)).factor!==p);else p=m.factor;g=m.prefix}return u&&(h=S(t,p)),t=void 0===h?t/p:d(t*h/p)/h,{prefix:g,value:r?-t:t}}return p.bytes=m,p.parse=b,b.bytes=y,b.raw=_,p.raw=O,p.Scale=r,p},void 0===(s="function"==typeof i?i.apply(e,n):i)||(t.exports=s)},336(t){var e,i="loading"in HTMLImageElement.prototype,n="loading"in HTMLIFrameElement.prototype,s="onscroll"in window;function o(t){var e,i,n=[];"picture"===t.parentNode.tagName.toLowerCase()&&((i=(e=t.parentNode).querySelector("source[data-lazy-remove]"))&&e.removeChild(i),n=Array.prototype.slice.call(t.parentNode.querySelectorAll("source"))),n.push(t),n.forEach(function(t){t.hasAttribute("data-lazy-srcset")&&(t.setAttribute("srcset",t.getAttribute("data-lazy-srcset")),t.removeAttribute("data-lazy-srcset"))}),t.setAttribute("src",t.getAttribute("data-lazy-src")),t.removeAttribute("data-lazy-src")}function r(t){var o=document.createElement("div");for(o.innerHTML=function(t){var o=t.textContent||t.innerHTML,r="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 "+((o.match(/width=['"](\d+)['"]/)||!1)[1]||1)+" "+((o.match(/height=['"](\d+)['"]/)||!1)[1]||1)+"%27%3E%3C/svg%3E";return(/\n-1}function zt(t,e){var i=this.__data__,n=te(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this}function Nt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e1?i[s-1]:void 0,r=s>2?i[2]:void 0;for(o=t.length>3&&"function"==typeof o?(s--,o):void 0,r&&ke(i[0],i[1],r)&&(o=s<3?void 0:o,s=1),e=Object(e);++n-1&&t%1==0&&t0){if(++e>=o)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function De(t){if(null!=t){try{return ot.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ie(t,e){return t===e||t!=t&&e!=e}var Re=se(function(){return arguments}())?se:function(t){return He(t)&&rt.call(t,"callee")&&!bt.call(t,"callee")},je=Array.isArray;function Fe(t){return null!=t&&We(t.length)&&!Be(t)}function ze(t){return He(t)&&Fe(t)}var Ne=_t||Ke;function Be(t){if(!Ve(t))return!1;var e=ne(t);return e==p||e==g||e==h||e==x}function We(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Ve(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function He(t){return null!=t&&"object"==typeof t}function $e(t){if(!He(t)||ne(t)!=y)return!1;var e=gt(t);if(null===e)return!0;var i=rt.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&ot.call(i)==ct}var Ue=X?K(X):re;function qe(t){return ge(t,Ye(t))}function Ye(t){return Fe(t)?Kt(t,!0):ae(t)}var Xe=me(function(t,e,i){le(t,e,i)});function Je(t){return function(){return t}}function Ge(t){return t}function Ke(){return!1}e.exports=Xe}).call(this)}).call(this,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,i,n){var s,o;s=self,o=function(){return function(){"use strict";var t={720:function(t,e,i){i.r(e),i.d(e,{Scene:function(){return ae},Tweenable:function(){return St},interpolate:function(){return ee},processTweens:function(){return bt},setBezierFunction:function(){return H},shouldScheduleUpdate:function(){return xt},tween:function(){return Ot},unsetBezierFunction:function(){return $}});var n={};i.r(n),i.d(n,{bounce:function(){return R},bouncePast:function(){return j},easeFrom:function(){return z},easeFromTo:function(){return F},easeInBack:function(){return A},easeInCirc:function(){return M},easeInCubic:function(){return c},easeInExpo:function(){return _},easeInOutBack:function(){return C},easeInOutCirc:function(){return O},easeInOutCubic:function(){return d},easeInOutExpo:function(){return k},easeInOutQuad:function(){return l},easeInOutQuart:function(){return p},easeInOutQuint:function(){return b},easeInOutSine:function(){return x},easeInQuad:function(){return r},easeInQuart:function(){return u},easeInQuint:function(){return g},easeInSine:function(){return v},easeOutBack:function(){return T},easeOutBounce:function(){return E},easeOutCirc:function(){return S},easeOutCubic:function(){return h},easeOutExpo:function(){return w},easeOutQuad:function(){return a},easeOutQuart:function(){return f},easeOutQuint:function(){return m},easeOutSine:function(){return y},easeTo:function(){return N},elastic:function(){return P},linear:function(){return o},swingFrom:function(){return D},swingFromTo:function(){return L},swingTo:function(){return I}});var s={};i.r(s),i.d(s,{afterTween:function(){return Jt},beforeTween:function(){return Xt},doesApply:function(){return qt},tweenCreated:function(){return Yt}});var o=function(t){return t},r=function(t){return Math.pow(t,2)},a=function(t){return-(Math.pow(t-1,2)-1)},l=function(t){return(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2)},c=function(t){return Math.pow(t,3)},h=function(t){return Math.pow(t-1,3)+1},d=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)},u=function(t){return Math.pow(t,4)},f=function(t){return-(Math.pow(t-1,4)-1)},p=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},g=function(t){return Math.pow(t,5)},m=function(t){return Math.pow(t-1,5)+1},b=function(t){return(t/=.5)<1?.5*Math.pow(t,5):.5*(Math.pow(t-2,5)+2)},v=function(t){return 1-Math.cos(t*(Math.PI/2))},y=function(t){return Math.sin(t*(Math.PI/2))},x=function(t){return-.5*(Math.cos(Math.PI*t)-1)},_=function(t){return 0===t?0:Math.pow(2,10*(t-1))},w=function(t){return 1===t?1:1-Math.pow(2,-10*t)},k=function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},M=function(t){return-(Math.sqrt(1-t*t)-1)},S=function(t){return Math.sqrt(1-Math.pow(t-1,2))},O=function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},E=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},A=function(t){var e=1.70158;return t*t*((e+1)*t-e)},T=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},C=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},P=function(t){return-1*Math.pow(4,-8*t)*Math.sin((6*t-1)*(2*Math.PI)/2)+1},L=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},D=function(t){var e=1.70158;return t*t*((e+1)*t-e)},I=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},R=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},j=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?2-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?2-(7.5625*(t-=2.25/2.75)*t+.9375):2-(7.5625*(t-=2.625/2.75)*t+.984375)},F=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},z=function(t){return Math.pow(t,4)},N=function(t){return Math.pow(t,.25)};function B(t,e,i,n,s,o){var r,a,l,c,h,d=0,u=0,f=0,p=function(t){return((d*t+u)*t+f)*t},g=function(t){return(3*d*t+2*u)*t+f},m=function(t){return t>=0?t:0-t};return d=1-(f=3*e)-(u=3*(n-e)-f),l=1-(h=3*i)-(c=3*(s-i)-h),r=t,a=function(t){return 1/(200*t)}(o),function(t){return((l*t+c)*t+h)*t}(function(t,e){var i,n,s,o,r,a;for(s=t,a=0;a<8;a++){if(o=p(s)-t,m(o)(n=1))return n;for(;io?i=s:n=s,s=.5*(n-i)+i}return s}(r,a))}var W,V=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.25,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.25,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.75,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.75;return function(s){return B(s,t,e,i,n,1)}},H=function(t,e,i,n,s){var o=V(e,i,n,s);return o.displayName=t,o.x1=e,o.y1=i,o.x2=n,o.y2=s,St.formulas[t]=o},$=function(t){return delete St.formulas[t]};function U(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function q(t,e){for(var i=0;it.length)&&(e=t.length);for(var i=0,n=new Array(e);ia?a:e;t._hasEnded=l>=a;var c=o-(a-l),h=t._filters.length>0;if(t._hasEnded)return t._render(r,t._data,c),t.stop(!0);h&&t._applyFilter(rt),l1&&void 0!==arguments[1]?arguments[1]:it,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Array.isArray(e))return V.apply(void 0,X(e));var n=Y(e);if(pt[e])return pt[e];if(n===ct||n===lt)for(var s in t)i[s]=e;else for(var o in t)i[o]=e[o]||it;return i},kt=function(t){t===ut?(ut=t._next)?ut._previous=null:ft=null:t===ft?(ft=t._previous)?ft._next=null:ut=null:(tt=t._previous,et=t._next,tt._next=et,et._previous=tt),t._previous=t._next=null},Mt="function"==typeof Promise?Promise:null;W=Symbol.toStringTag;var St=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;U(this,t),Q(this,W,"Promise"),this._config={},this._data={},this._delay=0,this._filters=[],this._next=null,this._previous=null,this._timestamp=null,this._hasEnded=!1,this._resolve=null,this._reject=null,this._currentState=e||{},this._originalState={},this._targetState={},this._start=dt,this._render=dt,this._promiseCtor=Mt,i&&this.setConfig(i)}var e;return e=[{key:"_applyFilter",value:function(t){for(var e=this._filters.length;e>0;e--){var i=this._filters[e-e][t];i&&i(this)}}},{key:"tween",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return this._isPlaying&&this.stop(),!e&&this._config||this.setConfig(e),this._pausedAtTime=null,this._timestamp=t.now(),this._start(this.get(),this._data),this._delay&&this._render(this._currentState,this._data,0),this._resume(this._timestamp)}},{key:"setConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this._config;for(var n in e)i[n]=e[n];var s=i.promise,o=void 0===s?this._promiseCtor:s,r=i.start,a=void 0===r?dt:r,l=i.finish,c=i.render,h=void 0===c?this._config.step||dt:c,d=i.step,u=void 0===d?dt:d;this._data=i.data||i.attachment||this._data,this._isPlaying=!1,this._pausedAtTime=null,this._scheduleId=null,this._delay=e.delay||0,this._start=a,this._render=h||u,this._duration=i.duration||500,this._promiseCtor=o,l&&(this._resolve=l);var f=e.from,p=e.to,g=void 0===p?{}:p,m=this._currentState,b=this._originalState,v=this._targetState;for(var y in f)m[y]=f[y];var x=!1;for(var _ in m){var w=m[_];x||Y(w)!==ct||(x=!0),b[_]=w,v[_]=g.hasOwnProperty(_)?g[_]:w}if(this._easing=wt(this._currentState,i.easing,this._easing),this._filters.length=0,x){for(var k in t.filters)t.filters[k].doesApply(this)&&this._filters.push(t.filters[k]);this._applyFilter(at)}return this}},{key:"then",value:function(t,e){var i=this;return this._promise=new this._promiseCtor(function(t,e){i._resolve=t,i._reject=e}),this._promise.then(t,e)}},{key:"catch",value:function(t){return this.then().catch(t)}},{key:"finally",value:function(t){return this.then().finally(t)}},{key:"get",value:function(){return K({},this._currentState)}},{key:"set",value:function(t){this._currentState=t}},{key:"pause",value:function(){if(this._isPlaying)return this._pausedAtTime=t.now(),this._isPlaying=!1,kt(this),this}},{key:"resume",value:function(){return this._resume()}},{key:"_resume",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.now();return null===this._timestamp?this.tween():this._isPlaying?this._promise:(this._pausedAtTime&&(this._timestamp+=e-this._pausedAtTime,this._pausedAtTime=null),this._isPlaying=!0,null===ut?(ut=this,ft=this):(this._previous=ft,ft._next=this,ft=this),this)}},{key:"seek",value:function(e){e=Math.max(e,0);var i=t.now();return this._timestamp+e===0||(this._timestamp=i-e,mt(this,i)),this}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._isPlaying)return this;this._isPlaying=!1,kt(this);var e=this._filters.length>0;return t&&(e&&this._applyFilter(rt),gt(1,this._currentState,this._originalState,this._targetState,1,0,this._easing),e&&(this._applyFilter(st),this._applyFilter(ot))),this._resolve&&this._resolve({data:this._data,state:this._currentState,tweenable:this}),this._resolve=null,this._reject=null,this}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._currentState,i=this._data;return this._isPlaying?(this._reject&&this._reject({data:i,state:e,tweenable:this}),this._resolve=null,this._reject=null,this.stop(t)):this}},{key:"isPlaying",value:function(){return this._isPlaying}},{key:"hasEnded",value:function(){return this._hasEnded}},{key:"setScheduleFunction",value:function(e){t.setScheduleFunction(e)}},{key:"data",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t&&(this._data=K({},t)),this._data}},{key:"dispose",value:function(){for(var t in this)delete this[t]}}],e&&q(t.prototype,e),t}();function Ot(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new St;return e.tween(t),e.tweenable=e,e}Q(St,"now",function(){return Z}),Q(St,"setScheduleFunction",function(t){return ht=t}),Q(St,"filters",{}),Q(St,"formulas",pt),xt(!0);var Et,At,Tt=/(\d|-|\.)/,Ct=/([^\-0-9.]+)/g,Pt=/[0-9.-]+/g,Lt=(Et=Pt.source,At=/,\s*/.source,new RegExp("rgba?\\(".concat(Et).concat(At).concat(Et).concat(At).concat(Et,"(").concat(At).concat(Et,")?\\)"),"g")),Dt=/^.*\(/,It=/#([0-9]|[a-f]){3,6}/gi,Rt="VAL",jt=function(t,e){return t.map(function(t,i){return"_".concat(e,"_").concat(i)})};function Ft(t){return parseInt(t,16)}var zt=function(t){return"rgb(".concat((e=t,3===(e=e.replace(/#/,"")).length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[Ft(e.substr(0,2)),Ft(e.substr(2,2)),Ft(e.substr(4,2))]).join(","),")");var e},Nt=function(t,e,i){var n=e.match(t),s=e.replace(t,Rt);return n&&n.forEach(function(t){return s=s.replace(Rt,i(t))}),s},Bt=function(t){for(var e in t){var i=t[e];"string"==typeof i&&i.match(It)&&(t[e]=Nt(It,i,zt))}},Wt=function(t){var e=t.match(Pt),i=e.slice(0,3).map(Math.floor),n=t.match(Dt)[0];if(3===e.length)return"".concat(n).concat(i.join(","),")");if(4===e.length)return"".concat(n).concat(i.join(","),",").concat(e[3],")");throw new Error("Invalid rgbChunk: ".concat(t))},Vt=function(t){return t.match(Pt)},Ht=function(t,e){var i={};return e.forEach(function(e){i[e]=t[e],delete t[e]}),i},$t=function(t,e){return e.map(function(e){return t[e]})},Ut=function(t,e){return e.forEach(function(e){return t=t.replace(Rt,+e.toFixed(4))}),t},qt=function(t){for(var e in t._currentState)if("string"==typeof t._currentState[e])return!0;return!1};function Yt(t){var e=t._currentState;[e,t._originalState,t._targetState].forEach(Bt),t._tokenData=function(t){var e,i,n={};for(var s in t){var o=t[s];"string"==typeof o&&(n[s]={formatString:(e=o,i=void 0,i=e.match(Ct),i?(1===i.length||e.charAt(0).match(Tt))&&i.unshift(""):i=["",""],i.join(Rt)),chunkNames:jt(Vt(o),s)})}return n}(e)}function Xt(t){var e=t._currentState,i=t._originalState,n=t._targetState,s=t._easing,o=t._tokenData;!function(t,e){var i=function(i){var n=e[i].chunkNames,s=t[i];if("string"==typeof s){var o=s.split(" "),r=o[o.length-1];n.forEach(function(e,i){return t[e]=o[i]||r})}else n.forEach(function(e){return t[e]=s});delete t[i]};for(var n in e)i(n)}(s,o),[e,i,n].forEach(function(t){return function(t,e){var i=function(i){Vt(t[i]).forEach(function(n,s){return t[e[i].chunkNames[s]]=+n}),delete t[i]};for(var n in e)i(n)}(t,o)})}function Jt(t){var e=t._currentState,i=t._originalState,n=t._targetState,s=t._easing,o=t._tokenData;[e,i,n].forEach(function(t){return function(t,e){for(var i in e){var n=e[i],s=n.chunkNames,o=n.formatString,r=Ut(o,$t(Ht(t,s),s));t[i]=Nt(Lt,r,Wt)}}(t,o)}),function(t,e){for(var i in e){var n=e[i].chunkNames,s=t[n[0]];t[i]="string"==typeof s?n.map(function(e){var i=t[e];return delete t[e],i}).join(" "):s}}(s,o)}function Gt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function Kt(t){for(var e=1;e4&&void 0!==arguments[4]?arguments[4]:0,o=Kt({},t),r=wt(t,n);for(var a in Zt._filters.length=0,Zt.set({}),Zt._currentState=o,Zt._originalState=t,Zt._targetState=e,Zt._easing=r,te)te[a].doesApply(Zt)&&Zt._filters.push(te[a]);Zt._applyFilter("tweenCreated"),Zt._applyFilter("beforeTween");var l=gt(i,o,t,e,1,s,r);return Zt._applyFilter("afterTween"),l};function ie(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);it.strokeWidth&&(e=t.trailWidth);var i=50-e/2;return s.render(this._pathTemplate,{radius:i,"2radius":2*i})},o.prototype._trailString=function(t){return this._pathString(t)},e.exports=o},{"./shape":8,"./utils":10}],4:[function(t,e,i){var n=t("./shape"),s=t("./utils"),o=function(t,e){this._pathTemplate=e.vertical?"M {center},100 L {center},0":"M 0,{center} L 100,{center}",n.apply(this,arguments)};o.prototype=new n,o.prototype.constructor=o,o.prototype._initializeSvg=function(t,e){var i=e.vertical?"0 0 "+e.strokeWidth+" 100":"0 0 100 "+e.strokeWidth;t.setAttribute("viewBox",i),t.setAttribute("preserveAspectRatio","none")},o.prototype._pathString=function(t){return s.render(this._pathTemplate,{center:t.strokeWidth/2})},o.prototype._trailString=function(t){return this._pathString(t)},e.exports=o},{"./shape":8,"./utils":10}],5:[function(t,e,i){e.exports={Line:t("./line"),Circle:t("./circle"),SemiCircle:t("./semicircle"),Square:t("./square"),Path:t("./path"),Shape:t("./shape"),utils:t("./utils")}},{"./circle":3,"./line":4,"./path":6,"./semicircle":7,"./shape":8,"./square":9,"./utils":10}],6:[function(t,e,i){var n=t("shifty"),s=t("./utils"),o=n.Tweenable,r={easeIn:"easeInCubic",easeOut:"easeOutCubic",easeInOut:"easeInOutCubic"},a=function t(e,i){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");var n;i=s.extend({delay:0,duration:800,easing:"linear",from:{},to:{},step:function(){}},i),n=s.isString(e)?document.querySelector(e):e,this.path=n,this._opts=i,this._tweenable=null;var o=this.path.getTotalLength();this.path.style.strokeDasharray=o+" "+o,this.set(0)};a.prototype.value=function(){var t=this._getComputedDashOffset(),e=this.path.getTotalLength();return parseFloat((1-t/e).toFixed(6),10)},a.prototype.set=function(t){this.stop(),this.path.style.strokeDashoffset=this._progressToOffset(t);var e=this._opts.step;if(s.isFunction(e)){var i=this._easing(this._opts.easing);e(this._calculateTo(t,i),this._opts.shape||this,this._opts.attachment)}},a.prototype.stop=function(){this._stopTween(),this.path.style.strokeDashoffset=this._getComputedDashOffset()},a.prototype.animate=function(t,e,i){e=e||{},s.isFunction(e)&&(i=e,e={});var n=s.extend({},e),r=s.extend({},this._opts);e=s.extend(r,e);var a=this._easing(e.easing),l=this._resolveFromAndTo(t,a,n);this.stop(),this.path.getBoundingClientRect();var c=this._getComputedDashOffset(),h=this._progressToOffset(t),d=this;this._tweenable=new o,this._tweenable.tween({from:s.extend({offset:c},l.from),to:s.extend({offset:h},l.to),duration:e.duration,delay:e.delay,easing:a,step:function(t){d.path.style.strokeDashoffset=t.offset;var i=e.shape||d;e.step(t,i,e.attachment)}}).then(function(t){s.isFunction(i)&&i()}).catch(function(t){throw console.error("Error in tweening:",t),t})},a.prototype._getComputedDashOffset=function(){var t=window.getComputedStyle(this.path,null);return parseFloat(t.getPropertyValue("stroke-dashoffset"),10)},a.prototype._progressToOffset=function(t){var e=this.path.getTotalLength();return e-t*e},a.prototype._resolveFromAndTo=function(t,e,i){return i.from&&i.to?{from:i.from,to:i.to}:{from:this._calculateFrom(e),to:this._calculateTo(t,e)}},a.prototype._calculateFrom=function(t){return n.interpolate(this._opts.from,this._opts.to,this.value(),t)},a.prototype._calculateTo=function(t,e){return n.interpolate(this._opts.from,this._opts.to,t,e)},a.prototype._stopTween=function(){null!==this._tweenable&&(this._tweenable.stop(!0),this._tweenable=null)},a.prototype._easing=function(t){return r.hasOwnProperty(t)?r[t]:t},e.exports=a},{"./utils":10,shifty:2}],7:[function(t,e,i){var n=t("./shape"),s=t("./circle"),o=t("./utils"),r=function(t,e){this._pathTemplate="M 50,50 m -{radius},0 a {radius},{radius} 0 1 1 {2radius},0",this.containerAspectRatio=2,n.apply(this,arguments)};r.prototype=new n,r.prototype.constructor=r,r.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 50")},r.prototype._initializeTextContainer=function(t,e,i){t.text.style&&(i.style.top="auto",i.style.bottom="0",t.text.alignToBottom?o.setStyle(i,"transform","translate(-50%, 0)"):o.setStyle(i,"transform","translate(-50%, 50%)"))},r.prototype._pathString=s.prototype._pathString,r.prototype._trailString=s.prototype._trailString,e.exports=r},{"./circle":3,"./shape":8,"./utils":10}],8:[function(t,e,i){var n=t("./path"),s=t("./utils"),o="Object is destroyed",r=function t(e,i){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");if(0!==arguments.length){this._opts=s.extend({color:"#555",strokeWidth:1,trailColor:null,trailWidth:null,fill:null,text:{style:{color:null,position:"absolute",left:"50%",top:"50%",padding:0,margin:0,transform:{prefix:!0,value:"translate(-50%, -50%)"}},autoStyleContainer:!0,alignToBottom:!0,value:null,className:"progressbar-text"},svgStyle:{display:"block",width:"100%"},warnings:!1},i,!0),s.isObject(i)&&void 0!==i.svgStyle&&(this._opts.svgStyle=i.svgStyle),s.isObject(i)&&s.isObject(i.text)&&void 0!==i.text.style&&(this._opts.text.style=i.text.style);var o,r=this._createSvgView(this._opts);if(!(o=s.isString(e)?document.querySelector(e):e))throw new Error("Container does not exist: "+e);this._container=o,this._container.appendChild(r.svg),this._opts.warnings&&this._warnContainerAspectRatio(this._container),this._opts.svgStyle&&s.setStyles(r.svg,this._opts.svgStyle),this.svg=r.svg,this.path=r.path,this.trail=r.trail,this.text=null;var a=s.extend({attachment:void 0,shape:this},this._opts);this._progressPath=new n(r.path,a),s.isObject(this._opts.text)&&null!==this._opts.text.value&&this.setText(this._opts.text.value)}};r.prototype.animate=function(t,e,i){if(null===this._progressPath)throw new Error(o);this._progressPath.animate(t,e,i)},r.prototype.stop=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath.stop()},r.prototype.pause=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.pause()},r.prototype.resume=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.resume()},r.prototype.destroy=function(){if(null===this._progressPath)throw new Error(o);this.stop(),this.svg.parentNode.removeChild(this.svg),this.svg=null,this.path=null,this.trail=null,this._progressPath=null,null!==this.text&&(this.text.parentNode.removeChild(this.text),this.text=null)},r.prototype.set=function(t){if(null===this._progressPath)throw new Error(o);this._progressPath.set(t)},r.prototype.value=function(){if(null===this._progressPath)throw new Error(o);return void 0===this._progressPath?0:this._progressPath.value()},r.prototype.setText=function(t){if(null===this._progressPath)throw new Error(o);null===this.text&&(this.text=this._createTextContainer(this._opts,this._container),this._container.appendChild(this.text)),s.isObject(t)?(s.removeChildren(this.text),this.text.appendChild(t)):this.text.innerHTML=t},r.prototype._createSvgView=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");this._initializeSvg(e,t);var i=null;(t.trailColor||t.trailWidth)&&(i=this._createTrail(t),e.appendChild(i));var n=this._createPath(t);return e.appendChild(n),{svg:e,path:n,trail:i}},r.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 100")},r.prototype._createPath=function(t){var e=this._pathString(t);return this._createPathElement(e,t)},r.prototype._createTrail=function(t){var e=this._trailString(t),i=s.extend({},t);return i.trailColor||(i.trailColor="#eee"),i.trailWidth||(i.trailWidth=i.strokeWidth),i.color=i.trailColor,i.strokeWidth=i.trailWidth,i.fill=null,this._createPathElement(e,i)},r.prototype._createPathElement=function(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",t),i.setAttribute("stroke",e.color),i.setAttribute("stroke-width",e.strokeWidth),e.fill?i.setAttribute("fill",e.fill):i.setAttribute("fill-opacity","0"),i},r.prototype._createTextContainer=function(t,e){var i=document.createElement("div");i.className=t.text.className;var n=t.text.style;return n&&(t.text.autoStyleContainer&&(e.style.position="relative"),s.setStyles(i,n),n.color||(i.style.color=t.color)),this._initializeTextContainer(t,e,i),i},r.prototype._initializeTextContainer=function(t,e,i){},r.prototype._pathString=function(t){throw new Error("Override this function for each progress bar")},r.prototype._trailString=function(t){throw new Error("Override this function for each progress bar")},r.prototype._warnContainerAspectRatio=function(t){if(this.containerAspectRatio){var e=window.getComputedStyle(t,null),i=parseFloat(e.getPropertyValue("width"),10),n=parseFloat(e.getPropertyValue("height"),10);s.floatEquals(this.containerAspectRatio,i/n)||(console.warn("Incorrect aspect ratio of container","#"+t.id,"detected:",e.getPropertyValue("width")+"(width)","/",e.getPropertyValue("height")+"(height)","=",i/n),console.warn("Aspect ratio of should be",this.containerAspectRatio))}},e.exports=r},{"./path":6,"./utils":10}],9:[function(t,e,i){var n=t("./shape"),s=t("./utils"),o=function(t,e){this._pathTemplate="M 0,{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{strokeWidth}",this._trailTemplate="M {startMargin},{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{halfOfStrokeWidth}",n.apply(this,arguments)};o.prototype=new n,o.prototype.constructor=o,o.prototype._pathString=function(t){var e=100-t.strokeWidth/2;return s.render(this._pathTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2})},o.prototype._trailString=function(t){var e=100-t.strokeWidth/2;return s.render(this._trailTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2,startMargin:t.strokeWidth/2-t.trailWidth/2})},e.exports=o},{"./shape":8,"./utils":10}],10:[function(t,e,i){var n=t("lodash.merge"),s="Webkit Moz O ms".split(" "),o=.001;function r(t,e){var i=t;for(var n in e)if(e.hasOwnProperty(n)){var s=e[n],o=new RegExp("\\{"+n+"\\}","g");i=i.replace(o,s)}return i}function a(t,e,i){for(var n=t.style,o=0;oo[0];break;case"lt":i=this.value{const e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.hasOwn(t,e),(()=>{let t;globalThis.importScripts&&(t=globalThis.location+"");const e=globalThis.document;if(!t&&e&&("SCRIPT"===e.currentScript?.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){const i=e.getElementsByTagName("script");if(i.length){let e=i.length-1;for(;e>-1&&(!t||!/^https?:/.test(t));)t=i[e--].src}}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),i.p=t})(),(()=>{"use strict";i(336),i(712),i(544);const t={sample:{image:document.getElementById("transformation-sample-image"),video:document.getElementById("transformation-sample-video")},preview:{image:document.getElementById("sample-image"),video:document.getElementById("sample-video")},fields:document.getElementsByClassName("cld-ui-input"),button:{image:document.getElementById("refresh-image-preview"),video:document.getElementById("refresh-video-preview")},spinner:{image:document.getElementById("image-loader"),video:document.getElementById("video-loader")},optimization:{image:document.getElementById("image_settings.image_optimization"),video:document.getElementById("video_settings.video_optimization")},error_container:document.getElementById("cld-preview-error"),activeItem:null,elements:{image:[],video:[]},_placeItem(t){null!==t&&(t.style.display="block",t.style.visibility="visible",t.style.position="absolute",t.style.top=t.parentElement.clientHeight/2-t.clientHeight/2+"px",t.style.left=t.parentElement.clientWidth/2-t.clientWidth/2+"px")},_setLoading(t){this.sample[t]&&(this.button[t].style.display="block",this._placeItem(this.button[t]),this.preview[t].style.opacity="0.1")},_build(t){if(!this.sample[t])return;this.sample[t].innerHTML="",this.elements[t]=[];for(const e of this.fields){if(t!==e.dataset.context||e.dataset.disabled&&"true"===e.dataset.disabled)continue;let i=e.value.trim();if(i.length){if("select-one"===e.type){if("none"===i||!1===this.optimization[t].checked)continue;i=e.dataset.meta+"_"+i}else t=e.dataset.context,e.dataset.meta&&(i=e.dataset.meta+"_"+i),e.dataset.suffix&&(i+=e.dataset.suffix),i=this._transformations(i,t,!0);i&&this.elements[t].push(i)}}let e="";this.elements[t].length&&(e="/"+this._getGlobalTransformationElements(t).replace(/ /g,"%20")),this.sample[t].textContent=e,this.sample[t].parentElement.href="https://res.cloudinary.com/demo/"+this.sample[t].parentElement.innerText.trim().replace("../","").replace(/ /g,"%20")},_clearLoading(t){this.spinner[t].style.visibility="hidden",this.activeItem=null,this.preview[t].style.opacity=1},_refresh(t,e){if(t&&t.preventDefault(),!this.sample[e])return;const i=this,n=CLD_GLOBAL_TRANSFORMATIONS[e].preview_url+this._getGlobalTransformationElements(e)+CLD_GLOBAL_TRANSFORMATIONS[e].file;if(this.button[e].style.display="none",this._placeItem(this.spinner[e]),"image"===e){const t=new Image;t.onload=function(){i.preview[e].src=this.src,i._clearLoading(e),i.error_container&&(i.error_container.style.display="none"),t.remove()},t.onerror=function(){const t=i.elements[e].includes("f_mp4");i.error_container&&(i.error_container.style.display="block",t?(i.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[e].warning.replace("%s","f_mp4"),i.error_container.classList.replace("settings-alert-error","settings-alert-warning")):(i.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[e].error,i.error_container.classList.replace("settings-alert-warning","settings-alert-error"))),i._clearLoading(e)},t.src=n}else{const t=i._transformations(i._getGlobalTransformationElements(e),e);samplePlayer.source({publicId:"sailing_boat",transformation:t}),i._clearLoading(e)}},_getGlobalTransformationElements(t){let e=[];return e.push(this.elements[t].slice(0,2).join(",")),e.push(this.elements[t].slice(2).join(",")),e=e.filter(t=>t).join("/"),e},_transformations(t,e,i=!1){const n=CLD_GLOBAL_TRANSFORMATIONS[e].valid_types;let s=null;const o=t.split("/"),r=[];for(let t=0;t":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},n=["(","?"],s={")":["("],":":["?","?:"]},o=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var r={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,i){if(t)throw e;return i}};function a(t){var i=function(t){for(var i,r,a,l,c=[],h=[];i=t.match(o);){for(r=i[0],(a=t.substr(0,i.index).trim())&&c.push(a);l=h.pop();){if(s[r]){if(s[r][0]===l){r=s[r][1]||r;break}}else if(n.indexOf(l)>=0||e[l]1===t?0:1},d=/^i18n\.(n?gettext|has_translation)(_|$)/;var u=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var f=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var p=function(t,e){return function(i,n,s,o=10){const r=t[e];if(!f(i))return;if(!u(n))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof o)return void console.error("If specified, the hook priority must be a number.");const a={callback:s,priority:o,namespace:n};if(r[i]){const t=r[i].handlers;let e;for(e=t.length;e>0&&!(o>=t[e-1].priority);e--);e===t.length?t[e]=a:t.splice(e,0,a),r.__current.forEach(t=>{t.name===i&&t.currentIndex>=e&&t.currentIndex++})}else r[i]={handlers:[a],runs:0};"hookAdded"!==i&&t.doAction("hookAdded",i,n,s,o)}};var g=function(t,e,i=!1){return function(n,s){const o=t[e];if(!f(n))return;if(!i&&!u(s))return;if(!o[n])return 0;let r=0;if(i)r=o[n].handlers.length,o[n]={runs:o[n].runs,handlers:[]};else{const t=o[n].handlers;for(let e=t.length-1;e>=0;e--)t[e].namespace===s&&(t.splice(e,1),r++,o.__current.forEach(t=>{t.name===n&&t.currentIndex>=e&&t.currentIndex--}))}return"hookRemoved"!==n&&t.doAction("hookRemoved",n,s),r}};var m=function(t,e){return function(i,n){const s=t[e];return void 0!==n?i in s&&s[i].handlers.some(t=>t.namespace===n):i in s}};var b=function(t,e,i,n){return function(s,...o){const r=t[e];r[s]||(r[s]={handlers:[],runs:0}),r[s].runs++;const a=r[s].handlers;if(!a||!a.length)return i?o[0]:void 0;const l={name:s,currentIndex:0};return(n?async function(){try{r.__current.add(l);let t=i?o[0]:void 0;for(;l.currentIndex0:Array.from(n.__current).some(t=>t.name===i)}};var x=function(t,e){return function(i){const n=t[e];if(f(i))return n[i]&&n[i].runs?n[i].runs:0}},_=class{actions;filters;addAction;addFilter;removeAction;removeFilter;hasAction;hasFilter;removeAllActions;removeAllFilters;doAction;doActionAsync;applyFilters;applyFiltersAsync;currentAction;currentFilter;doingAction;doingFilter;didAction;didFilter;constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=p(this,"actions"),this.addFilter=p(this,"filters"),this.removeAction=g(this,"actions"),this.removeFilter=g(this,"filters"),this.hasAction=m(this,"actions"),this.hasFilter=m(this,"filters"),this.removeAllActions=g(this,"actions",!0),this.removeAllFilters=g(this,"filters",!0),this.doAction=b(this,"actions",!1,!1),this.doActionAsync=b(this,"actions",!1,!0),this.applyFilters=b(this,"filters",!0,!1),this.applyFiltersAsync=b(this,"filters",!0,!0),this.currentAction=v(this,"actions"),this.currentFilter=v(this,"filters"),this.doingAction=y(this,"actions"),this.doingFilter=y(this,"filters"),this.didAction=x(this,"actions"),this.didFilter=x(this,"filters")}};var w=function(){return new _}(),{addAction:k,addFilter:M,removeAction:S,removeFilter:O,hasAction:E,hasFilter:A,removeAllActions:T,removeAllFilters:C,doAction:P,doActionAsync:L,applyFilters:D,applyFiltersAsync:I,currentAction:R,currentFilter:j,doingAction:F,doingFilter:z,didAction:N,didFilter:B,actions:W,filters:V}=w,H=((t,e,i)=>{const n=new c({}),s=new Set,o=()=>{s.forEach(t=>t())},r=(t,e="default")=>{n.data[e]={...n.data[e],...t},n.data[e][""]={...h,...n.data[e]?.[""]},delete n.pluralForms[e]},a=(t,e)=>{r(t,e),o()},l=(t="default",e,i,s,o)=>(n.data[t]||r(void 0,t),n.dcnpgettext(t,e,i,s,o)),u=t=>t||"default",f=(t,e,n)=>{let s=l(n,e,t);return i?(s=i.applyFilters("i18n.gettext_with_context",s,t,e,n),i.applyFilters("i18n.gettext_with_context_"+u(n),s,t,e,n)):s};if(t&&a(t,e),i){const t=t=>{d.test(t)&&o()};i.addAction("hookAdded","core/i18n",t),i.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:(t="default")=>n.data[t],setLocaleData:a,addLocaleData:(t,e="default")=>{n.data[e]={...n.data[e],...t,"":{...h,...n.data[e]?.[""],...t?.[""]}},delete n.pluralForms[e],o()},resetLocaleData:(t,e)=>{n.data={},n.pluralForms={},a(t,e)},subscribe:t=>(s.add(t),()=>s.delete(t)),__:(t,e)=>{let n=l(e,void 0,t);return i?(n=i.applyFilters("i18n.gettext",n,t,e),i.applyFilters("i18n.gettext_"+u(e),n,t,e)):n},_x:f,_n:(t,e,n,s)=>{let o=l(s,void 0,t,e,n);return i?(o=i.applyFilters("i18n.ngettext",o,t,e,n,s),i.applyFilters("i18n.ngettext_"+u(s),o,t,e,n,s)):o},_nx:(t,e,n,s,o)=>{let r=l(o,s,t,e,n);return i?(r=i.applyFilters("i18n.ngettext_with_context",r,t,e,n,s,o),i.applyFilters("i18n.ngettext_with_context_"+u(o),r,t,e,n,s,o)):r},isRTL:()=>"rtl"===f("ltr","text direction"),hasTranslation:(t,e,s)=>{const o=e?e+""+t:t;let r=!!n.data?.[s??"default"]?.[o];return i&&(r=i.applyFilters("i18n.has_translation",r,t,e,s),r=i.applyFilters("i18n.has_translation_"+u(s),r,t,e,s)),r}}})(void 0,void 0,w),$=(H.getLocaleData.bind(H),H.setLocaleData.bind(H),H.resetLocaleData.bind(H),H.subscribe.bind(H),H.__.bind(H)),U=(H._x.bind(H),H._n.bind(H),H._nx.bind(H),H.isRTL.bind(H),H.hasTranslation.bind(H),["@wordpress/admin-ui","@wordpress/api-fetch","@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/boot","@wordpress/commands","@wordpress/compose","@wordpress/connectors","@wordpress/workflows","@wordpress/components","@wordpress/core-actions","@wordpress/core-commands","@wordpress/core-data","@wordpress/core-fields","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/font-list-route","@wordpress/format-library","@wordpress/notices","@wordpress/patterns","@wordpress/preferences","@wordpress/rich-text","@wordpress/route","@wordpress/router","@wordpress/routes","@wordpress/storybook","@wordpress/theme","@wordpress/dataviews","@wordpress/sync","@wordpress/fields","@wordpress/lazy-editor","@wordpress/media-editor","@wordpress/media-utils","@wordpress/upload-media","@wordpress/global-styles-engine","@wordpress/global-styles-ui","@wordpress/ui","@wordpress/views","@wordpress/widget-dashboard"]);function q(t,e){if(!t)throw new Error("Cannot lock an undefined object.");const i=t;J in i||(i[J]={}),X.set(i[J],e)}function Y(t){if(!t)throw new Error("Cannot unlock an undefined object.");const e=t;if(!(J in e))throw new Error("Cannot unlock an object that was not locked before. ");return X.get(e[J])}var X=new WeakMap,J=Symbol("Private API ID");var{lock:G,unlock:K}=((t,e)=>{if(!U.includes(e))throw new Error(`You tried to opt-in to unstable APIs as module "${e}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress."!==t)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return{lock:q,unlock:Y}})("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/api-fetch");var Q=function(t){const e=(t,i)=>{const{headers:n={}}=t;for(const s in n)if("x-wp-nonce"===s.toLowerCase()&&n[s]===e.nonce)return i(t);return i({...t,headers:{...n,"X-WP-Nonce":e.nonce}})};return e.nonce=t,e},Z=(t,e)=>{let i,n,s=t.path;return"string"==typeof t.namespace&&"string"==typeof t.endpoint&&(i=t.namespace.replace(/^\/|\/$/g,""),n=t.endpoint.replace(/^\//,""),s=n?i+"/"+n:i),delete t.namespace,delete t.endpoint,e({...t,path:s})},tt=t=>(e,i)=>Z(e,e=>{let n,s=e.url,o=e.path;return"string"==typeof o&&(n=t,-1!==t.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(o=o.replace("?","&")),s=n+o),i({...e,url:s})});function et(t){try{return decodeURIComponent(t)}catch{return t}}function it(t){const e=t.indexOf("?");if(-1===e)return t;const i=t.slice(0,e),n=t.slice(e+1);return n?i+"?"+n.split("&").map(t=>t.split("=")).map(t=>t.map(et)).sort((t,e)=>t[0].localeCompare(e[0])).map(t=>t.map(encodeURIComponent)).map(t=>t.join("=")).join("&"):i}function nt(t){return(function(t){let e;try{e=new URL(t,"http://example.com").search.substring(1)}catch{}if(e)return e}(t)||"").replace(/\+/g,"%20").split("&").reduce((t,e)=>{const i=e.indexOf("="),n=-1!==i,s=et(n?e.slice(0,i):e);if(s){const o=n?et(e.slice(i+1)):"";!function(t,e,i){const n=e.length,s=n-1;for(let o=0;o{"link"===e.toLowerCase()&&(t.headers[e]=i.replace(/<([^>]+)>/,(t,e)=>`<${encodeURI(e)}>`))}),Promise.resolve(e?t.body:new window.Response(JSON.stringify(t.body),{status:200,statusText:"OK",headers:t.headers}))}}var ct=function(t){const{OPTIONS:e={},...i}=Object.fromEntries(Object.entries(t).map(([t,e])=>[it(t),e])),n=new Set(Object.keys(i)),s=new Set(Object.keys(e));let o=!1;const r=(t,r)=>{const{parse:a=!0}=t;let l=t.path;if(!l&&t.url){const{rest_route:e,...i}=nt(t.url);"string"==typeof e&&(l=ot(e,i))}if("string"!=typeof l)return r(t);const c=t.method||"GET",h=it(l);if("GET"===c&&i[h]){const t=i[h];return o||delete i[h],n.delete(h),lt(t,!!a)}if("OPTIONS"===c&&e[h]){const t=e[h];return o||delete e[h],s.delete(h),lt(t,!!a)}return r(t)};return r[rt]=()=>{o=!0},r[at]=()=>{const t=[...Array.from(n,t=>`GET ${t}`),...Array.from(s,t=>`OPTIONS ${t}`)];t.length?console.warn("[api-fetch][preload] Some preloads were never consumed:",t):console.log("[api-fetch][preload] All preloads consumed."),n.clear(),s.clear();for(const t of Object.keys(i))delete i[t];for(const t of Object.keys(e))delete e[t]},r},ht=({path:t,url:e,...i},n)=>({...i,url:e&&ot(e,n),path:t&&ot(t,n)}),dt=t=>t.json?t.json():Promise.reject(t),ut=t=>{const{next:e}=(t=>{if(!t)return{};const e=t.match(/<([^>]+)>; rel="next"/);return e?{next:e[1]}:{}})(t.headers.get("link"));return e},ft=async(t,e)=>{if(!1===t.parse)return e(t);if(!(t=>{const e=!!t.path&&-1!==t.path.indexOf("per_page=-1"),i=!!t.url&&-1!==t.url.indexOf("per_page=-1");return e||i})(t))return e(t);const i=await Pt({...ht(t,{per_page:100}),parse:!1}),n=await dt(i);if(!Array.isArray(n))return n;let s=ut(i);if(!s)return n;let o=[].concat(n);for(;s;){const e=await Pt({...t,path:void 0,url:s,parse:!1}),i=await dt(e);o=o.concat(i),s=ut(e)}return o},pt=new Set(["PATCH","PUT","DELETE"]),gt="GET",mt=(t,e)=>{const{method:i=gt}=t;return pt.has(i.toUpperCase())&&(t={...t,headers:{"Content-Type":"application/json",...t.headers,"X-HTTP-Method-Override":i},method:"POST"}),e(t)};function bt(t,e){return nt(t)[e]}function vt(t,e){return void 0!==bt(t,e)}async function yt(t,e=!1){try{if("function"!=typeof t.text)return await t.json();const i=await t.text();return e&&""===i?null:JSON.parse(i)}catch{throw{code:"invalid_json",message:$("The response is not a valid JSON response."),data:{status:t.status}}}}async function xt(t,e=!0){return e?204===t.status?null:await yt(t,!0):t}async function _t(t,e=!0){if(!e)throw t;const i=await yt(t);if(i&&"object"==typeof i&&!Array.isArray(i)&&void 0===i.data)throw{...i,data:{status:t.status}};throw i}var wt=(t,e)=>{if(!function(t){const e=!!t.method&&"POST"===t.method;return(!!t.path&&-1!==t.path.indexOf("/wp/v2/media")||!!t.url&&-1!==t.url.indexOf("/wp/v2/media"))&&e}(t))return e(t);let i=0;const n=t=>(i++,e({path:`/wp/v2/media/${t}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>i<5?n(t):(e({path:`/wp/v2/media/${t}?force=true`,method:"DELETE"}),Promise.reject())));return e({...t,parse:!1}).catch(e=>{if(!(e instanceof globalThis.Response))return Promise.reject(e);const i=e.headers.get("x-wp-upload-attachment-id");return e.status>=500&&e.status<600&&i?n(i).catch(()=>!1!==t.parse?Promise.reject({code:"post_process",message:$("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(e)):_t(e,t.parse)}).then(e=>xt(e,t.parse))};function kt(t,...e){const i=t.replace(/^[^#]*/,""),n=(t=t.replace(/#.*/,"")).indexOf("?");if(-1===n)return t+i;const s=nt(t),o=t.substr(0,n);e.forEach(t=>delete s[t]);const r=st(s);return(r?o+"?"+r:o)+i}var Mt=t=>(e,i)=>{if("string"==typeof e.url){const i=bt(e.url,"wp_theme_preview");void 0===i?e.url=ot(e.url,{wp_theme_preview:t}):""===i&&(e.url=kt(e.url,"wp_theme_preview"))}if("string"==typeof e.path){const i=bt(e.path,"wp_theme_preview");void 0===i?e.path=ot(e.path,{wp_theme_preview:t}):""===i&&(e.path=kt(e.path,"wp_theme_preview"))}return i(e)},St={Accept:"application/json, */*;q=0.1"},Ot={credentials:"include"},Et=[(t,e)=>("string"!=typeof t.url||vt(t.url,"_locale")||(t.url=ot(t.url,{_locale:"user"})),"string"!=typeof t.path||vt(t.path,"_locale")||(t.path=ot(t.path,{_locale:"user"})),e(t)),Z,mt,ft];var At=t=>{const{url:e,path:i,data:n,parse:s=!0,...o}=t;let{body:r,headers:a}=t;a={...St,...a},n&&(r=JSON.stringify(n),a["Content-Type"]="application/json");return globalThis.fetch(e||i||window.location.href,{...Ot,...o,body:r,headers:a}).then(t=>t.ok?xt(t,s):_t(t,s),t=>{if(t&&"AbortError"===t.name)throw t;if(!globalThis.navigator.onLine)throw{code:"offline_error",message:$("Unable to connect. Please check your Internet connection.")};throw{code:"fetch_error",message:$("Could not get a valid response from the server.")}})},Tt=At;var Ct=t=>Et.reduceRight((t,e)=>i=>e(i,t),Tt)(t).catch(e=>"rest_cookie_invalid_nonce"!==e.code?Promise.reject(e):globalThis.fetch(Ct.nonceEndpoint).then(t=>t.ok?t.text():Promise.reject(e)).then(e=>(Ct.nonceMiddleware.nonce=e,Ct(t))));Ct.use=function(t){Et.unshift(t)},Ct.unregister=function(t){const e=Et.indexOf(t);return-1!==e&&(Et.splice(e,1),!0)},Ct.setFetchHandler=function(t){Tt=t},Ct.defaultFetchHandler=At,Ct.privateApis={},G(Ct.privateApis,{enablePreloadMultiUse:function(){for(const t of Et)t[rt]?.()},clearPreloadedData:function(){for(const t of Et)t[at]?.()}}),Ct.createNonceMiddleware=Q,Ct.createPreloadingMiddleware=ct,Ct.createRootURLMiddleware=tt,Ct.fetchAllMiddleware=ft,Ct.httpV1Middleware=mt,Ct.mediaUploadMiddleware=wt,Ct.createThemePreviewMiddleware=Mt;var Pt=Ct;const Lt={wpWrap:document.getElementById("wpwrap"),adminbar:document.getElementById("wpadminbar"),wpContent:document.getElementById("wpbody-content"),libraryWrap:document.getElementById("cloudinary-dam"),cloudinaryHeader:document.getElementById("cloudinary-header"),wpFooter:document.getElementById("wpfooter"),importStatus:document.getElementById("import-status"),downloading:{},_init(){const t=this,e=this.libraryWrap,i=this.importStatus;"undefined"!=typeof CLDN&&document.querySelector(CLDN.mloptions.inline_container)&&(Pt.use(Pt.createNonceMiddleware(CLDN.nonce)),cloudinary.openMediaLibrary(CLDN.mloptions,{insertHandler(n){const s=[];for(let o=0;o{o.style.opacity=1},250),void 0!==n.fetch?Pt({path:cldData.dam.fetch_url,data:{src:n.url,filename:n.filename,attachment_id:n.attachment_id,transformations:n.transformations},method:"POST"}).then(e=>{e&&!1===e.success&&t.showError(e.data)}).catch(e=>{t.showError(e&&e.message)}).finally(()=>{t.removeProgress(s,r)}):t.removeProgress(s,r)})}}}),window.addEventListener("resize",function(){t._resize()}),t._resize())},_resize(){this.libraryWrap.style.height=this.wpFooter.offsetTop-this.libraryWrap.offsetTop-this.adminbar.offsetHeight+"px"},removeProgress(t,e){const i=t[e];delete t[e],i.removeChild(i.firstChild),setTimeout(()=>{i.style.opacity=0,setTimeout(()=>{i.parentNode.removeChild(i),Object.keys(t).length||(this.libraryWrap.style.marginRight="0px",this.importStatus.style.display="none")},1e3)},500)},showError(t){window.alert(t||$("Could not import the asset.","cloudinary"))},makeProgress(t){const e=document.createElement("div"),i=document.createElement("span"),n=document.createElement("span");return e.classList.add("cld-import-item"),i.classList.add("spinner"),n.classList.add("cld-import-item-id"),n.innerText=t.public_id,e.appendChild(i),e.appendChild(n),e}};window.addEventListener("load",()=>Lt._init());const Dt={_init(){const t=this;if("undefined"!=typeof CLDIS){[...document.getElementsByClassName("cld-notice-box")].forEach(e=>{const i=e.getElementsByClassName("notice-dismiss");i.length&&i[0].addEventListener("click",i=>{e.style.height=e.offsetHeight+"px",i.preventDefault(),setTimeout(function(){t._dismiss(e)},5)})})}},_dismiss(t){const e=t.dataset.dismiss,i=parseInt(t.dataset.duration);t.classList.add("dismissed"),t.style.height="0px",setTimeout(function(){t.remove()},400),00&&Bt(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Bt(n.height)/t.offsetHeight||1);var r=(Rt(t)?It(t):window).visualViewport,a=!Vt()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/s,c=(n.top+(a&&r?r.offsetTop:0))/o,h=n.width/s,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function $t(t){var e=It(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ut(t){return t?(t.nodeName||"").toLowerCase():null}function qt(t){return((Rt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Yt(t){return Ht(qt(t)).left+$t(t).scrollLeft}function Xt(t){return It(t).getComputedStyle(t)}function Jt(t){var e=Xt(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function Gt(t,e,i){void 0===i&&(i=!1);var n,s,o=jt(e),r=jt(e)&&function(t){var e=t.getBoundingClientRect(),i=Bt(e.width)/t.offsetWidth||1,n=Bt(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=qt(e),l=Ht(t,r,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!i)&&(("body"!==Ut(e)||Jt(a))&&(c=(n=e)!==It(n)&&jt(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:$t(n)),jt(e)?((h=Ht(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=Yt(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function Kt(t){var e=Ht(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Qt(t){return"html"===Ut(t)?t:t.assignedSlot||t.parentNode||(Ft(t)?t.host:null)||qt(t)}function Zt(t){return["html","body","#document"].indexOf(Ut(t))>=0?t.ownerDocument.body:jt(t)&&Jt(t)?t:Zt(Qt(t))}function te(t,e){var i;void 0===e&&(e=[]);var n=Zt(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=It(n),r=s?[o].concat(o.visualViewport||[],Jt(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(te(Qt(r)))}function ee(t){return["table","td","th"].indexOf(Ut(t))>=0}function ie(t){return jt(t)&&"fixed"!==Xt(t).position?t.offsetParent:null}function ne(t){for(var e=It(t),i=ie(t);i&&ee(i)&&"static"===Xt(i).position;)i=ie(i);return i&&("html"===Ut(i)||"body"===Ut(i)&&"static"===Xt(i).position)?e:i||function(t){var e=/firefox/i.test(Wt());if(/Trident/i.test(Wt())&&jt(t)&&"fixed"===Xt(t).position)return null;var i=Qt(t);for(Ft(i)&&(i=i.host);jt(i)&&["html","body"].indexOf(Ut(i))<0;){var n=Xt(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}var se="top",oe="bottom",re="right",ae="left",le="auto",ce=[se,oe,re,ae],he="start",de="end",ue="viewport",fe="popper",pe=ce.reduce(function(t,e){return t.concat([e+"-"+he,e+"-"+de])},[]),ge=[].concat(ce,[le]).reduce(function(t,e){return t.concat([e,e+"-"+he,e+"-"+de])},[]),me=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function be(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}}),n.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){i.has(t.name)||s(t)}),n}var ve={placement:"bottom",modifiers:[],strategy:"absolute"};function ye(){for(var t=arguments.length,e=new Array(t),i=0;i=0?"x":"y"}function Se(t){var e,i=t.reference,n=t.element,s=t.placement,o=s?we(s):null,r=s?ke(s):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case se:e={x:a,y:i.y-n.height};break;case oe:e={x:a,y:i.y+i.height};break;case re:e={x:i.x+i.width,y:l};break;case ae:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?Me(o):null;if(null!=c){var h="y"===c?"height":"width";switch(r){case he:e[c]=e[c]-(i[h]/2-n[h]/2);break;case de:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}var Oe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ee(t){var e,i=t.popper,n=t.popperRect,s=t.placement,o=t.variation,r=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,d=t.isFixed,u=r.x,f=void 0===u?0:u,p=r.y,g=void 0===p?0:p,m="function"==typeof h?h({x:f,y:g}):{x:f,y:g};f=m.x,g=m.y;var b=r.hasOwnProperty("x"),v=r.hasOwnProperty("y"),y=ae,x=se,_=window;if(c){var w=ne(i),k="clientHeight",M="clientWidth";if(w===It(i)&&"static"!==Xt(w=qt(i)).position&&"absolute"===a&&(k="scrollHeight",M="scrollWidth"),s===se||(s===ae||s===re)&&o===de)x=oe,g-=(d&&w===_&&_.visualViewport?_.visualViewport.height:w[k])-n.height,g*=l?1:-1;if(s===ae||(s===se||s===oe)&&o===de)y=re,f-=(d&&w===_&&_.visualViewport?_.visualViewport.width:w[M])-n.width,f*=l?1:-1}var S,O=Object.assign({position:a},c&&Oe),E=!0===h?function(t,e){var i=t.x,n=t.y,s=e.devicePixelRatio||1;return{x:Bt(i*s)/s||0,y:Bt(n*s)/s||0}}({x:f,y:g},It(i)):{x:f,y:g};return f=E.x,g=E.y,l?Object.assign({},O,((S={})[x]=v?"0":"",S[y]=b?"0":"",S.transform=(_.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",S)):Object.assign({},O,((e={})[x]=v?g+"px":"",e[y]=b?f+"px":"",e.transform="",e))}const Ae={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];jt(s)&&Ut(s)&&(Object.assign(s.style,i),Object.keys(n).forEach(function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(t){var n=e.elements[t],s=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce(function(t,e){return t[e]="",t},{});jt(n)&&Ut(n)&&(Object.assign(n.style,o),Object.keys(s).forEach(function(t){n.removeAttribute(t)}))})}},requires:["computeStyles"]};const Te={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.offset,o=void 0===s?[0,0]:s,r=ge.reduce(function(t,i){return t[i]=function(t,e,i){var n=we(t),s=[ae,se].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[ae,re].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}(i,e.rects,o),t},{}),a=r[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}};var Ce={left:"right",right:"left",bottom:"top",top:"bottom"};function Pe(t){return t.replace(/left|right|bottom|top/g,function(t){return Ce[t]})}var Le={start:"end",end:"start"};function De(t){return t.replace(/start|end/g,function(t){return Le[t]})}function Ie(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Ft(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Re(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function je(t,e,i){return e===ue?Re(function(t,e){var i=It(t),n=qt(t),s=i.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=Vt();(c||!c&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+Yt(t),y:l}}(t,i)):Rt(e)?function(t,e){var i=Ht(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):Re(function(t){var e,i=qt(t),n=$t(t),s=null==(e=t.ownerDocument)?void 0:e.body,o=zt(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=zt(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+Yt(t),l=-n.scrollTop;return"rtl"===Xt(s||i).direction&&(a+=zt(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}(qt(t)))}function Fe(t,e,i,n){var s="clippingParents"===e?function(t){var e=te(Qt(t)),i=["absolute","fixed"].indexOf(Xt(t).position)>=0&&jt(t)?ne(t):t;return Rt(i)?e.filter(function(t){return Rt(t)&&Ie(t,i)&&"body"!==Ut(t)}):[]}(t):[].concat(e),o=[].concat(s,[i]),r=o[0],a=o.reduce(function(e,i){var s=je(t,i,n);return e.top=zt(s.top,e.top),e.right=Nt(s.right,e.right),e.bottom=Nt(s.bottom,e.bottom),e.left=zt(s.left,e.left),e},je(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ze(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Ne(t,e){return e.reduce(function(e,i){return e[i]=t,e},{})}function Be(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=void 0===n?t.placement:n,o=i.strategy,r=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?"clippingParents":a,c=i.rootBoundary,h=void 0===c?ue:c,d=i.elementContext,u=void 0===d?fe:d,f=i.altBoundary,p=void 0!==f&&f,g=i.padding,m=void 0===g?0:g,b=ze("number"!=typeof m?m:Ne(m,ce)),v=u===fe?"reference":fe,y=t.rects.popper,x=t.elements[p?v:u],_=Fe(Rt(x)?x:x.contextElement||qt(t.elements.popper),l,h,r),w=Ht(t.elements.reference),k=Se({reference:w,element:y,strategy:"absolute",placement:s}),M=Re(Object.assign({},y,k)),S=u===fe?M:w,O={top:_.top-S.top+b.top,bottom:S.bottom-_.bottom+b.bottom,left:_.left-S.left+b.left,right:S.right-_.right+b.right},E=t.modifiersData.offset;if(u===fe&&E){var A=E[s];Object.keys(O).forEach(function(t){var e=[re,oe].indexOf(t)>=0?1:-1,i=[se,oe].indexOf(t)>=0?"y":"x";O[t]+=A[i]*e})}return O}function We(t,e,i){return zt(t,Nt(e,i))}const Ve={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0!==r&&r,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,u=i.tether,f=void 0===u||u,p=i.tetherOffset,g=void 0===p?0:p,m=Be(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),b=we(e.placement),v=ke(e.placement),y=!v,x=Me(b),_="x"===x?"y":"x",w=e.modifiersData.popperOffsets,k=e.rects.reference,M=e.rects.popper,S="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,O="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),E=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,A={x:0,y:0};if(w){if(o){var T,C="y"===x?se:ae,P="y"===x?oe:re,L="y"===x?"height":"width",D=w[x],I=D+m[C],R=D-m[P],j=f?-M[L]/2:0,F=v===he?k[L]:M[L],z=v===he?-M[L]:-k[L],N=e.elements.arrow,B=f&&N?Kt(N):{width:0,height:0},W=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=W[C],H=W[P],$=We(0,k[L],B[L]),U=y?k[L]/2-j-$-V-O.mainAxis:F-$-V-O.mainAxis,q=y?-k[L]/2+j+$+H+O.mainAxis:z+$+H+O.mainAxis,Y=e.elements.arrow&&ne(e.elements.arrow),X=Y?"y"===x?Y.clientTop||0:Y.clientLeft||0:0,J=null!=(T=null==E?void 0:E[x])?T:0,G=D+q-J,K=We(f?Nt(I,D+U-J-X):I,D,f?zt(R,G):R);w[x]=K,A[x]=K-D}if(a){var Q,Z="x"===x?se:ae,tt="x"===x?oe:re,et=w[_],it="y"===_?"height":"width",nt=et+m[Z],st=et-m[tt],ot=-1!==[se,ae].indexOf(b),rt=null!=(Q=null==E?void 0:E[_])?Q:0,at=ot?nt:et-k[it]-M[it]-rt+O.altAxis,lt=ot?et+k[it]+M[it]-rt-O.altAxis:st,ct=f&&ot?function(t,e,i){var n=We(t,e,i);return n>i?i:n}(at,et,lt):We(f?at:nt,et,f?lt:st);w[_]=ct,A[_]=ct-et}e.modifiersData[n]=A}},requiresIfExists:["offset"]};const He={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,s=t.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,a=we(i.placement),l=Me(a),c=[ae,re].indexOf(a)>=0?"height":"width";if(o&&r){var h=function(t,e){return ze("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Ne(t,ce))}(s.padding,i),d=Kt(o),u="y"===l?se:ae,f="y"===l?oe:re,p=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],g=r[l]-i.rects.reference[l],m=ne(o),b=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,v=p/2-g/2,y=h[u],x=b-d[c]-h[f],_=b/2-d[c]/2+v,w=We(y,_,x),k=l;i.modifiersData[n]=((e={})[k]=w,e.centerOffset=w-_,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Ie(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function $e(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Ue(t){return[se,re,oe,ae].some(function(e){return t[e]>=0})}var qe=xe({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,l=It(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(t){t.addEventListener("scroll",i.update,_e)}),a&&l.addEventListener("resize",i.update,_e),function(){o&&c.forEach(function(t){t.removeEventListener("scroll",i.update,_e)}),a&&l.removeEventListener("resize",i.update,_e)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=Se({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:we(e.placement),variation:ke(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Ee(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ee(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},Ae,Te,{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0===r||r,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,u=i.altBoundary,f=i.flipVariations,p=void 0===f||f,g=i.allowedAutoPlacements,m=e.options.placement,b=we(m),v=l||(b===m||!p?[Pe(m)]:function(t){if(we(t)===le)return[];var e=Pe(t);return[De(t),e,De(e)]}(m)),y=[m].concat(v).reduce(function(t,i){return t.concat(we(i)===le?function(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,o=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?ge:l,h=ke(n),d=h?a?pe:pe.filter(function(t){return ke(t)===h}):ce,u=d.filter(function(t){return c.indexOf(t)>=0});0===u.length&&(u=d);var f=u.reduce(function(e,i){return e[i]=Be(t,{placement:i,boundary:s,rootBoundary:o,padding:r})[we(i)],e},{});return Object.keys(f).sort(function(t,e){return f[t]-f[e]})}(e,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:g}):i)},[]),x=e.rects.reference,_=e.rects.popper,w=new Map,k=!0,M=y[0],S=0;S=0,C=T?"width":"height",P=Be(e,{placement:O,boundary:h,rootBoundary:d,altBoundary:u,padding:c}),L=T?A?re:ae:A?oe:se;x[C]>_[C]&&(L=Pe(L));var D=Pe(L),I=[];if(o&&I.push(P[E]<=0),a&&I.push(P[L]<=0,P[D]<=0),I.every(function(t){return t})){M=O,k=!1;break}w.set(O,I)}if(k)for(var R=function(t){var e=y.find(function(e){var i=w.get(e);if(i)return i.slice(0,t).every(function(t){return t})});if(e)return M=e,"break"},j=p?3:1;j>0;j--){if("break"===R(j))break}e.placement!==M&&(e.modifiersData[n]._skip=!0,e.placement=M,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Ve,He,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=Be(e,{elementContext:"reference"}),a=Be(e,{altBoundary:!0}),l=$e(r,n),c=$e(a,s,o),h=Ue(l),d=Ue(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}}]}),Ye="tippy-content",Xe="tippy-backdrop",Je="tippy-arrow",Ge="tippy-svg-arrow",Ke={passive:!0,capture:!0},Qe=function(){return document.body};function Ze(t,e,i){if(Array.isArray(t)){var n=t[e];return n??(Array.isArray(i)?i[e]:i)}return t}function ti(t,e){var i={}.toString.call(t);return 0===i.indexOf("[object")&&i.indexOf(e+"]")>-1}function ei(t,e){return"function"==typeof t?t.apply(void 0,e):t}function ii(t,e){return 0===e?t:function(n){clearTimeout(i),i=setTimeout(function(){t(n)},e)};var i}function ni(t){return[].concat(t)}function si(t,e){-1===t.indexOf(e)&&t.push(e)}function oi(t){return t.split("-")[0]}function ri(t){return[].slice.call(t)}function ai(t){return Object.keys(t).reduce(function(e,i){return void 0!==t[i]&&(e[i]=t[i]),e},{})}function li(){return document.createElement("div")}function ci(t){return["Element","Fragment"].some(function(e){return ti(t,e)})}function hi(t){return ti(t,"MouseEvent")}function di(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function ui(t){return ci(t)?[t]:function(t){return ti(t,"NodeList")}(t)?ri(t):Array.isArray(t)?t:ri(document.querySelectorAll(t))}function fi(t,e){t.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function pi(t,e){t.forEach(function(t){t&&t.setAttribute("data-state",e)})}function gi(t){var e,i=ni(t)[0];return null!=i&&null!=(e=i.ownerDocument)&&e.body?i.ownerDocument:document}function mi(t,e,i){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(e){t[n](e,i)})}function bi(t,e){for(var i=e;i;){var n;if(t.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var vi={isTouch:!1},yi=0;function xi(){vi.isTouch||(vi.isTouch=!0,window.performance&&document.addEventListener("mousemove",_i))}function _i(){var t=performance.now();t-yi<20&&(vi.isTouch=!1,document.removeEventListener("mousemove",_i)),yi=t}function wi(){var t=document.activeElement;if(di(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}var ki=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Mi={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Si=Object.assign({appendTo:Qe,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Mi,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Oi=Object.keys(Si);function Ei(t){var e=(t.plugins||[]).reduce(function(e,i){var n,s=i.name,o=i.defaultValue;s&&(e[s]=void 0!==t[s]?t[s]:null!=(n=Si[s])?n:o);return e},{});return Object.assign({},t,e)}function Ai(t,e){var i=Object.assign({},e,{content:ei(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(Ei(Object.assign({},Si,{plugins:e}))):Oi).reduce(function(e,i){var n=(t.getAttribute("data-tippy-"+i)||"").trim();if(!n)return e;if("content"===i)e[i]=n;else try{e[i]=JSON.parse(n)}catch(t){e[i]=n}return e},{})}(t,e.plugins));return i.aria=Object.assign({},Si.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?e.interactive:i.aria.expanded,content:"auto"===i.aria.content?e.interactive?null:"describedby":i.aria.content},i}function Ti(t,e){t.innerHTML=e}function Ci(t){var e=li();return!0===t?e.className=Je:(e.className=Ge,ci(t)?e.appendChild(t):Ti(e,t)),e}function Pi(t,e){ci(e.content)?(Ti(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ti(t,e.content):t.textContent=e.content)}function Li(t){var e=t.firstElementChild,i=ri(e.children);return{box:e,content:i.find(function(t){return t.classList.contains(Ye)}),arrow:i.find(function(t){return t.classList.contains(Je)||t.classList.contains(Ge)}),backdrop:i.find(function(t){return t.classList.contains(Xe)})}}function Di(t){var e=li(),i=li();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=li();function s(i,n){var s=Li(e),o=s.box,r=s.content,a=s.arrow;n.theme?o.setAttribute("data-theme",n.theme):o.removeAttribute("data-theme"),"string"==typeof n.animation?o.setAttribute("data-animation",n.animation):o.removeAttribute("data-animation"),n.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?o.setAttribute("role",n.role):o.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||Pi(r,t.props),n.arrow?a?i.arrow!==n.arrow&&(o.removeChild(a),o.appendChild(Ci(n.arrow))):o.appendChild(Ci(n.arrow)):a&&o.removeChild(a)}return n.className=Ye,n.setAttribute("data-state","hidden"),Pi(n,t.props),e.appendChild(i),i.appendChild(n),s(t.props,t.props),{popper:e,onUpdate:s}}Di.$$tippy=!0;var Ii=1,Ri=[],ji=[];function Fi(t,e){var i,n,s,o,r,a,l,c,h=Ai(t,Object.assign({},Si,Ei(ai(e)))),d=!1,u=!1,f=!1,p=!1,g=[],m=ii(Y,h.interactiveDebounce),b=Ii++,v=(c=h.plugins).filter(function(t,e){return c.indexOf(t)===e}),y={id:b,reference:t,popper:li(),popperInstance:null,props:h,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(s)},setProps:function(e){0;if(y.state.isDestroyed)return;D("onBeforeUpdate",[y,e]),U();var i=y.props,n=Ai(t,Object.assign({},i,ai(e),{ignoreAttributes:!0}));y.props=n,$(),i.interactiveDebounce!==n.interactiveDebounce&&(j(),m=ii(Y,n.interactiveDebounce));i.triggerTarget&&!n.triggerTarget?ni(i.triggerTarget).forEach(function(t){t.removeAttribute("aria-expanded")}):n.triggerTarget&&t.removeAttribute("aria-expanded");R(),L(),w&&w(i,n);y.popperInstance&&(K(),Z().forEach(function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}));D("onAfterUpdate",[y,e])},setContent:function(t){y.setProps({content:t})},show:function(){0;var t=y.state.isVisible,e=y.state.isDestroyed,i=!y.state.isEnabled,n=vi.isTouch&&!y.props.touch,s=Ze(y.props.duration,0,Si.duration);if(t||e||i||n)return;if(A().hasAttribute("disabled"))return;if(D("onShow",[y],!1),!1===y.props.onShow(y))return;y.state.isVisible=!0,E()&&(_.style.visibility="visible");L(),B(),y.state.isMounted||(_.style.transition="none");if(E()){var o=C();fi([o.box,o.content],0)}a=function(){var t;if(y.state.isVisible&&!p){if(p=!0,_.offsetHeight,_.style.transition=y.props.moveTransition,E()&&y.props.animation){var e=C(),i=e.box,n=e.content;fi([i,n],s),pi([i,n],"visible")}I(),R(),si(ji,y),null==(t=y.popperInstance)||t.forceUpdate(),D("onMount",[y]),y.props.animation&&E()&&function(t,e){V(t,e)}(s,function(){y.state.isShown=!0,D("onShown",[y])})}},function(){var t,e=y.props.appendTo,i=A();t=y.props.interactive&&e===Qe||"parent"===e?i.parentNode:ei(e,[i]);t.contains(_)||t.appendChild(_);y.state.isMounted=!0,K(),!1}()},hide:function(){0;var t=!y.state.isVisible,e=y.state.isDestroyed,i=!y.state.isEnabled,n=Ze(y.props.duration,1,Si.duration);if(t||e||i)return;if(D("onHide",[y],!1),!1===y.props.onHide(y))return;y.state.isVisible=!1,y.state.isShown=!1,p=!1,d=!1,E()&&(_.style.visibility="hidden");if(j(),W(),L(!0),E()){var s=C(),o=s.box,r=s.content;y.props.animation&&(fi([o,r],n),pi([o,r],"hidden"))}I(),R(),y.props.animation?E()&&function(t,e){V(t,function(){!y.state.isVisible&&_.parentNode&&_.parentNode.contains(_)&&e()})}(n,y.unmount):y.unmount()},hideWithInteractivity:function(t){0;T().addEventListener("mousemove",m),si(Ri,m),m(t)},enable:function(){y.state.isEnabled=!0},disable:function(){y.hide(),y.state.isEnabled=!1},unmount:function(){0;y.state.isVisible&&y.hide();if(!y.state.isMounted)return;Q(),Z().forEach(function(t){t._tippy.unmount()}),_.parentNode&&_.parentNode.removeChild(_);ji=ji.filter(function(t){return t!==y}),y.state.isMounted=!1,D("onHidden",[y])},destroy:function(){0;if(y.state.isDestroyed)return;y.clearDelayTimeouts(),y.unmount(),U(),delete t._tippy,y.state.isDestroyed=!0,D("onDestroy",[y])}};if(!h.render)return y;var x=h.render(y),_=x.popper,w=x.onUpdate;_.setAttribute("data-tippy-root",""),_.id="tippy-"+y.id,y.popper=_,t._tippy=y,_._tippy=y;var k=v.map(function(t){return t.fn(y)}),M=t.hasAttribute("aria-expanded");return $(),R(),L(),D("onCreate",[y]),h.showOnCreate&&tt(),_.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),_.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&T().addEventListener("mousemove",m)}),y;function S(){var t=y.props.touch;return Array.isArray(t)?t:[t,0]}function O(){return"hold"===S()[0]}function E(){var t;return!(null==(t=y.props.render)||!t.$$tippy)}function A(){return l||t}function T(){var t=A().parentNode;return t?gi(t):document}function C(){return Li(_)}function P(t){return y.state.isMounted&&!y.state.isVisible||vi.isTouch||o&&"focus"===o.type?0:Ze(y.props.delay,t?0:1,Si.delay)}function L(t){void 0===t&&(t=!1),_.style.pointerEvents=y.props.interactive&&!t?"":"none",_.style.zIndex=""+y.props.zIndex}function D(t,e,i){var n;(void 0===i&&(i=!0),k.forEach(function(i){i[t]&&i[t].apply(i,e)}),i)&&(n=y.props)[t].apply(n,e)}function I(){var e=y.props.aria;if(e.content){var i="aria-"+e.content,n=_.id;ni(y.props.triggerTarget||t).forEach(function(t){var e=t.getAttribute(i);if(y.state.isVisible)t.setAttribute(i,e?e+" "+n:n);else{var s=e&&e.replace(n,"").trim();s?t.setAttribute(i,s):t.removeAttribute(i)}})}}function R(){!M&&y.props.aria.expanded&&ni(y.props.triggerTarget||t).forEach(function(t){y.props.interactive?t.setAttribute("aria-expanded",y.state.isVisible&&t===A()?"true":"false"):t.removeAttribute("aria-expanded")})}function j(){T().removeEventListener("mousemove",m),Ri=Ri.filter(function(t){return t!==m})}function F(e){if(!vi.isTouch||!f&&"mousedown"!==e.type){var i=e.composedPath&&e.composedPath()[0]||e.target;if(!y.props.interactive||!bi(_,i)){if(ni(y.props.triggerTarget||t).some(function(t){return bi(t,i)})){if(vi.isTouch)return;if(y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else D("onClickOutside",[y,e]);!0===y.props.hideOnClick&&(y.clearDelayTimeouts(),y.hide(),u=!0,setTimeout(function(){u=!1}),y.state.isMounted||W())}}}function z(){f=!0}function N(){f=!1}function B(){var t=T();t.addEventListener("mousedown",F,!0),t.addEventListener("touchend",F,Ke),t.addEventListener("touchstart",N,Ke),t.addEventListener("touchmove",z,Ke)}function W(){var t=T();t.removeEventListener("mousedown",F,!0),t.removeEventListener("touchend",F,Ke),t.removeEventListener("touchstart",N,Ke),t.removeEventListener("touchmove",z,Ke)}function V(t,e){var i=C().box;function n(t){t.target===i&&(mi(i,"remove",n),e())}if(0===t)return e();mi(i,"remove",r),mi(i,"add",n),r=n}function H(e,i,n){void 0===n&&(n=!1),ni(y.props.triggerTarget||t).forEach(function(t){t.addEventListener(e,i,n),g.push({node:t,eventType:e,handler:i,options:n})})}function $(){var t;O()&&(H("touchstart",q,{passive:!0}),H("touchend",X,{passive:!0})),(t=y.props.trigger,t.split(/\s+/).filter(Boolean)).forEach(function(t){if("manual"!==t)switch(H(t,q),t){case"mouseenter":H("mouseleave",X);break;case"focus":H(ki?"focusout":"blur",J);break;case"focusin":H("focusout",J)}})}function U(){g.forEach(function(t){var e=t.node,i=t.eventType,n=t.handler,s=t.options;e.removeEventListener(i,n,s)}),g=[]}function q(t){var e,i=!1;if(y.state.isEnabled&&!G(t)&&!u){var n="focus"===(null==(e=o)?void 0:e.type);o=t,l=t.currentTarget,R(),!y.state.isVisible&&hi(t)&&Ri.forEach(function(e){return e(t)}),"click"===t.type&&(y.props.trigger.indexOf("mouseenter")<0||d)&&!1!==y.props.hideOnClick&&y.state.isVisible?i=!0:tt(t),"click"===t.type&&(d=!i),i&&!n&&et(t)}}function Y(t){var e=t.target,i=A().contains(e)||_.contains(e);if("mousemove"!==t.type||!i){var n=Z().concat(_).map(function(t){var e,i=null==(e=t._tippy.popperInstance)?void 0:e.state;return i?{popperRect:t.getBoundingClientRect(),popperState:i,props:h}:null}).filter(Boolean);(function(t,e){var i=e.clientX,n=e.clientY;return t.every(function(t){var e=t.popperRect,s=t.popperState,o=t.props.interactiveBorder,r=oi(s.placement),a=s.modifiersData.offset;if(!a)return!0;var l="bottom"===r?a.top.y:0,c="top"===r?a.bottom.y:0,h="right"===r?a.left.x:0,d="left"===r?a.right.x:0,u=e.top-n+l>o,f=n-e.bottom-c>o,p=e.left-i+h>o,g=i-e.right-d>o;return u||f||p||g})})(n,t)&&(j(),et(t))}}function X(t){G(t)||y.props.trigger.indexOf("click")>=0&&d||(y.props.interactive?y.hideWithInteractivity(t):et(t))}function J(t){y.props.trigger.indexOf("focusin")<0&&t.target!==A()||y.props.interactive&&t.relatedTarget&&_.contains(t.relatedTarget)||et(t)}function G(t){return!!vi.isTouch&&O()!==t.type.indexOf("touch")>=0}function K(){Q();var e=y.props,i=e.popperOptions,n=e.placement,s=e.offset,o=e.getReferenceClientRect,r=e.moveTransition,l=E()?Li(_).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||A()}:t,h={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(E()){var i=C().box;["placement","reference-hidden","escaped"].forEach(function(t){"placement"===t?i.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?i.setAttribute("data-"+t,""):i.removeAttribute("data-"+t)}),e.attributes.popper={}}}},d=[{name:"offset",options:{offset:s}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!r}},h];E()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==i?void 0:i.modifiers)||[]),y.popperInstance=qe(c,_,Object.assign({},i,{placement:n,onFirstUpdate:a,modifiers:d}))}function Q(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function Z(){return ri(_.querySelectorAll("[data-tippy-root]"))}function tt(t){y.clearDelayTimeouts(),t&&D("onTrigger",[y,t]),B();var e=P(!0),n=S(),s=n[0],o=n[1];vi.isTouch&&"hold"===s&&o&&(e=o),e?i=setTimeout(function(){y.show()},e):y.show()}function et(t){if(y.clearDelayTimeouts(),D("onUntrigger",[y,t]),y.state.isVisible){if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&d)){var e=P(!1);e?n=setTimeout(function(){y.state.isVisible&&y.hide()},e):s=requestAnimationFrame(function(){y.hide()})}}else W()}}function zi(t,e){void 0===e&&(e={});var i=Si.plugins.concat(e.plugins||[]);document.addEventListener("touchstart",xi,Ke),window.addEventListener("blur",wi);var n=Object.assign({},e,{plugins:i}),s=ui(t).reduce(function(t,e){var i=e&&Fi(e,n);return i&&t.push(i),t},[]);return ci(t)?s[0]:s}zi.defaultProps=Si,zi.setDefaultProps=function(t){Object.keys(t).forEach(function(e){Si[e]=t[e]})},zi.currentInput=vi;Object.assign({},Ae,{effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow)}});zi.setDefaultProps({render:Di});const Ni=zi;var Bi=i(951),Wi=i.n(Bi);const Vi={controlled:null,bind(t){this.controlled=t,this.controlled.forEach(t=>{this._main(t)}),this._init()},_init(){this.controlled.forEach(t=>{this._checkUp(t)})},_main(t){const e=JSON.parse(t.dataset.main);t.dataset.size&&(t.filesize=parseInt(t.dataset.size,10)),t.mains=e.map(e=>{const i=document.getElementById(e),n=document.getElementById(e+"_size_wrapper");return n&&(i.filesize=0,i.sizespan=n),this._addChild(i,t),i}),this._bindEvents(t),t.mains.forEach(t=>{this._bindEvents(t)})},_bindEvents(t){t.eventBound||(t.addEventListener("click",e=>{const i=e.target;i.elements&&(this._checkDown(i),this._evaluateSize(i)),i.mains&&this._checkUp(t)}),t.eventBound=!0)},_addChild(t,e){const i=t.elements?t.elements:[];-1===i.indexOf(e)&&(i.push(e),t.elements=i)},_removeChild(t,e){const i=t.elements.indexOf(e);-1{e.checked!==t.checked&&(e.checked=t.checked,e.disabled&&(e.checked=!1),e.dispatchEvent(new Event("change")))}),t.elements.forEach(e=>{this._checkDown(e),e.elements||this._checkUp(e,t)}))},_checkUp(t,e){t.mains&&[...t.mains].forEach(t=>{t!==e&&this._evaluateCheckStatus(t),this._checkUp(t),this._evaluateSize(t)})},_evaluateCheckStatus(t){let e=0,i=t.classList.contains("partial");i&&(t.classList.remove("partial"),i=!1),t.elements.forEach(n=>{null!==n.parentNode?(e+=n.checked,n.classList.contains("partial")&&(i=!0)):this._removeChild(t,n)});let n="some";e===t.elements.length?n="on":0===e?n="off":i=!0,i&&t.classList.add("partial");const s="off"!==n;t.checked===s&&t.value===n||(t.value=n,t.checked=s,t.dispatchEvent(new Event("change")))},_evaluateSize(t){if(t.sizespan&&t.elements){t.filesize=0,t.elements.forEach(e=>{e.checked&&(t.filesize+=e.filesize)});let e=null;0Math.max(Math.min(t,i),e);function Xi(t){return Yi(qi(2.55*t),0,255)}function Ji(t){return Yi(qi(255*t),0,255)}function Gi(t){return Yi(qi(t/2.55)/100,0,1)}function Ki(t){return Yi(qi(100*t),0,100)}const Qi={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Zi=[..."0123456789ABCDEF"],tn=t=>Zi[15&t],en=t=>Zi[(240&t)>>4]+Zi[15&t],nn=t=>(240&t)>>4==(15&t);function sn(t){var e=(t=>nn(t.r)&&nn(t.g)&&nn(t.b)&&nn(t.a))(t)?tn:en;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const on=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function rn(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function an(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function ln(t,e,i){const n=rn(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function cn(t){const e=t.r/255,i=t.g/255,n=t.b/255,s=Math.max(e,i,n),o=Math.min(e,i,n),r=(s+o)/2;let a,l,c;return s!==o&&(c=s-o,l=r>.5?c/(2-s-o):c/(s+o),a=function(t,e,i,n,s){return t===s?(e-i)/n+(e>16&255,o>>8&255,255&o]}return t}(),mn.transparent=[0,0,0,0]);const e=mn[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const vn=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const yn=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,xn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function _n(t,e,i){if(t){let n=cn(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=dn(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function wn(t,e){return t?Object.assign(e||{},t):t}function kn(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Ji(t[3]))):(e=wn(t,{r:0,g:0,b:0,a:1})).a=Ji(e.a),e}function Mn(t){return"r"===t.charAt(0)?function(t){const e=vn.exec(t);let i,n,s,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?Xi(t):Yi(255*t,0,255)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?Xi(i):Yi(i,0,255)),n=255&(e[4]?Xi(n):Yi(n,0,255)),s=255&(e[6]?Xi(s):Yi(s,0,255)),{r:i,g:n,b:s,a:o}}}(t):fn(t)}class Sn{constructor(t){if(t instanceof Sn)return t;const e=typeof t;let i;var n,s,o;"object"===e?i=kn(t):"string"===e&&(o=(n=t).length,"#"===n[0]&&(4===o||5===o?s={r:255&17*Qi[n[1]],g:255&17*Qi[n[2]],b:255&17*Qi[n[3]],a:5===o?17*Qi[n[4]]:255}:7!==o&&9!==o||(s={r:Qi[n[1]]<<4|Qi[n[2]],g:Qi[n[3]]<<4|Qi[n[4]],b:Qi[n[5]]<<4|Qi[n[6]],a:9===o?Qi[n[7]]<<4|Qi[n[8]]:255})),i=s||bn(t)||Mn(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=wn(this._rgb);return t&&(t.a=Gi(t.a)),t}set rgb(t){this._rgb=kn(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Gi(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?sn(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=cn(t),i=e[0],n=Ki(e[1]),s=Ki(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${Gi(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let s;const o=e===s?.5:e,r=2*o-1,a=i.a-n.a,l=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-l,i.r=255&l*i.r+s*n.r+.5,i.g=255&l*i.g+s*n.g+.5,i.b=255&l*i.b+s*n.b+.5,i.a=o*i.a+(1-o)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const n=xn(Gi(t.r)),s=xn(Gi(t.g)),o=xn(Gi(t.b));return{r:Ji(yn(n+i*(xn(Gi(e.r))-n))),g:Ji(yn(s+i*(xn(Gi(e.g))-s))),b:Ji(yn(o+i*(xn(Gi(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Sn(this.rgb)}alpha(t){return this._rgb.a=Ji(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=qi(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return _n(this._rgb,2,t),this}darken(t){return _n(this._rgb,2,-t),this}saturate(t){return _n(this._rgb,1,t),this}desaturate(t){return _n(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=cn(t);i[0]=un(i[0]+e),i=dn(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function On(){}const En=(()=>{let t=0;return()=>t++})();function An(t){return null==t}function Tn(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function Cn(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function Pn(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function Ln(t,e){return Pn(t)?t:e}function Dn(t,e){return void 0===t?e:t}const In=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Rn(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function jn(t,e,i,n){let s,o,r;if(Tn(t))if(o=t.length,n)for(s=o-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;st,x:t=>t.x,y:t=>t.y};function Un(t,e){const i=$n[e]||($n[e]=function(t){const e=function(t){const e=t.split("."),i=[];let n="";for(const t of e)n+=t,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function qn(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Yn=t=>void 0!==t,Xn=t=>"function"==typeof t,Jn=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};const Gn=Math.PI,Kn=2*Gn,Qn=Kn+Gn,Zn=Number.POSITIVE_INFINITY,ts=Gn/180,es=Gn/2,is=Gn/4,ns=2*Gn/3,ss=Math.log10,os=Math.sign;function rs(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function xs(t,e,i){i=i||(i=>t[i]1;)n=o+s>>1,i(n)?o=n:s=n;return{lo:o,hi:s}}const _s=(t,e,i,n)=>xs(t,i,n?n=>{const s=t[n][e];return st[n][e]xs(t,i,n=>t[n][e]>=i);const ks=["push","pop","shift","splice","unshift"];function Ms(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(ks.forEach(e=>{delete t[e]}),delete t._chartjs)}function Ss(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Os="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Es(t,e){let i=[],n=!1;return function(...s){i=s,n||(n=!0,Os.call(window,()=>{n=!1,t.apply(e,i)}))}}const As=t=>"start"===t?"left":"end"===t?"right":"center",Ts=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function Cs(t,e,i){const n=e.length;let s=0,o=n;if(t._sorted){const{iScale:r,vScale:a,_parsed:l}=t,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,h=r.axis,{min:d,max:u,minDefined:f,maxDefined:p}=r.getUserBounds();if(f){if(s=Math.min(_s(l,h,d).lo,i?n:_s(e,h,r.getPixelForValue(d)).lo),c){const t=l.slice(0,s+1).reverse().findIndex(t=>!An(t[a.axis]));s-=Math.max(0,t)}s=vs(s,0,n-1)}if(p){let t=Math.max(_s(l,r.axis,u,!0).hi+1,i?0:_s(e,h,r.getPixelForValue(u),!0).hi+1);if(c){const e=l.slice(t-1).findIndex(t=>!An(t[a.axis]));t+=Math.max(0,e)}o=vs(t,s,n)-s}else o=n-s}return{start:s,count:o}}function Ps(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const o=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),o}const Ls=t=>0===t||1===t,Ds=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*Kn/i),Is=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*Kn/i)+1,Rs={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*es),easeOutSine:t=>Math.sin(t*es),easeInOutSine:t=>-.5*(Math.cos(Gn*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Ls(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Ls(t)?t:Ds(t,.075,.3),easeOutElastic:t=>Ls(t)?t:Is(t,.075,.3),easeInOutElastic(t){const e=.1125;return Ls(t)?t:t<.5?.5*Ds(2*t,e,.45):.5+.5*Is(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Rs.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*Rs.easeInBounce(2*t):.5*Rs.easeOutBounce(2*t-1)+.5};function js(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Fs(t){return js(t)?t:new Sn(t)}function zs(t){return js(t)?t:new Sn(t).saturate(.5).darken(.1).hexString()}const Ns=["x","y","borderWidth","radius","tension"],Bs=["color","borderColor","backgroundColor"];const Ws=new Map;function Vs(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=Ws.get(i);return n||(n=new Intl.NumberFormat(t,e),Ws.set(i,n)),n}(e,i).format(t)}const Hs={values:t=>Tn(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let s,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(s="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const r=ss(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Vs(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(ss(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?Hs.numeric.call(this,t,e,i):""}};var $s={formatters:Hs};const Us=Object.create(null),qs=Object.create(null);function Ys(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>zs(e.backgroundColor),this.hoverBorderColor=(t,e)=>zs(e.borderColor),this.hoverColor=(t,e)=>zs(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Xs(this,t,e)}get(t){return Ys(this,t)}describe(t,e){return Xs(qs,t,e)}override(t,e){return Xs(Us,t,e)}route(t,e,i,n){const s=Ys(this,t),o=Ys(this,i),r="_"+e;Object.defineProperties(s,{[r]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=o[n];return Cn(t)?Object.assign({},e,t):Dn(t,e)},set(t){this[r]=t}}})}apply(t){t.forEach(t=>t(this))}}var Gs=new Js({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Bs},numbers:{type:"number",properties:Ns}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:$s.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function Ks(t,e,i,n,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,i.push(s)),o>n&&(n=o),n}function Qs(t,e,i,n){let s=(n=n||{}).data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},o=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const a=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function no(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==o.strokeColor;let l,c;for(t.save(),t.font=s.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),An(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l+t||0;function bo(t,e){const i={},n=Cn(e),s=n?Object.keys(e):e,o=Cn(t)?n?i=>Dn(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of s)i[t]=mo(o(t));return i}function vo(t){return bo(t,{top:"y",right:"x",bottom:"y",left:"x"})}function yo(t){return bo(t,["topLeft","topRight","bottomLeft","bottomRight"])}function xo(t){const e=vo(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function _o(t,e){t=t||{},e=e||Gs.font;let i=Dn(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=Dn(t.style,e.style);n&&!(""+n).match(po)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:Dn(t.family,e.family),lineHeight:go(Dn(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:Dn(t.weight,e.weight),string:""};return s.string=function(t){return!t||An(t.size)||An(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(s),s}function wo(t,e,i,n){let s,o,r,a=!0;for(s=0,o=t.length;st[0]){const o=i||t;void 0===n&&(n=Ro("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:n,_getTarget:s,override:i=>Mo([i,...t],e,o,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>To(i,n,()=>function(t,e,i,n){let s;for(const o of e)if(s=Ro(Eo(o,t),i),void 0!==s)return Ao(t,s)?Do(i,n,t,s):s}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>jo(t).includes(e),ownKeys:t=>jo(t),set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function So(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Oo(t,n),setContext:e=>So(t,e,i,n),override:s=>So(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>To(t,e,()=>function(t,e,i){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=t;let a=n[e];Xn(a)&&r.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(o,r||n);a.delete(t),Ao(t,l)&&(l=Do(s._scopes,s,t,l));return l}(e,a,t,i));Tn(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=i;if(void 0!==o.index&&n(t))return e[o.index%e.length];if(Cn(e[0])){const i=e,n=s._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=Do(n,s,t,l);e.push(So(i,o,r&&r[t],a))}}return e}(e,a,t,r.isIndexable));Ao(e,a)&&(a=So(a,s,o&&o[e],r));return a}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function Oo(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:Xn(i)?i:()=>i,isIndexable:Xn(n)?n:()=>n}}const Eo=(t,e)=>t?t+qn(e):e,Ao=(t,e)=>Cn(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function To(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const n=i();return t[e]=n,n}function Co(t,e,i){return Xn(t)?t(e,i):t}const Po=(t,e)=>!0===t?e:"string"==typeof t?Un(e,t):void 0;function Lo(t,e,i,n,s){for(const o of e){const e=Po(i,o);if(e){t.add(e);const o=Co(e._fallback,i,s);if(void 0!==o&&o!==i&&o!==n)return o}else if(!1===e&&void 0!==n&&i!==n)return null}return!1}function Do(t,e,i,n){const s=e._rootScopes,o=Co(e._fallback,i,n),r=[...t,...s],a=new Set;a.add(n);let l=Io(a,r,i,o||i,n);return null!==l&&((void 0===o||o===i||(l=Io(a,r,o,l,n),null!==l))&&Mo(Array.from(a),[""],s,o,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];if(Tn(s)&&Cn(i))return i;return s||{}}(e,i,n)))}function Io(t,e,i,n,s){for(;i;)i=Lo(t,e,i,n,s);return i}function Ro(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function jo(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function Fo(t,e,i,n){const{iScale:s}=t,{key:o="r"}=this._parsing,r=new Array(n);let a,l,c,h;for(a=0,l=n;ae"x"===t?"y":"x";function Wo(t,e,i,n){const s=t.skip?e:t,o=e,r=i.skip?e:i,a=ps(o,s),l=ps(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function Vo(t,e="x"){const i=Bo(e),n=t.length,s=Array(n).fill(0),o=Array(n);let r,a,l,c=No(t,0);for(r=0;r!t.skip)),"monotone"===e.cubicInterpolationMode)Vo(t,s);else{let i=n?t[t.length-1]:t[0];for(o=0,r=t.length;ot.ownerDocument.defaultView.getComputedStyle(t,null);const Jo=["top","right","bottom","left"];function Go(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const o=Jo[s];n[o]=parseFloat(t[e+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function Ko(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,s=Xo(i),o="border-box"===s.boxSizing,r=Go(s,"padding"),a=Go(s,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:s,offsetY:o}=n;let r,a,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,o,t.target))r=s,a=o;else{const t=e.getBoundingClientRect();r=n.clientX-t.left,a=n.clientY-t.top,l=!0}return{x:r,y:a,box:l}}(t,i),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:p}=e;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/p*i.height/n)}}const Qo=t=>Math.round(10*t)/10;function Zo(t,e,i,n){const s=Xo(t),o=Go(s,"margin"),r=Yo(s.maxWidth,t,"clientWidth")||Zn,a=Yo(s.maxHeight,t,"clientHeight")||Zn,l=function(t,e,i){let n,s;if(void 0===e||void 0===i){const o=t&&qo(t);if(o){const t=o.getBoundingClientRect(),r=Xo(o),a=Go(r,"border","width"),l=Go(r,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=Yo(r.maxWidth,o,"clientWidth"),s=Yo(r.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||Zn,maxHeight:s||Zn}}(t,e,i);let{width:c,height:h}=l;if("content-box"===s.boxSizing){const t=Go(s,"border","width"),e=Go(s,"padding");c-=e.width+t.width,h-=e.height+t.height}c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=Qo(Math.min(c,r,l.maxWidth)),h=Qo(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Qo(c/2));return(void 0!==e||void 0!==i)&&n&&l.height&&h>l.height&&(h=l.height,c=Qo(Math.floor(h*n))),{width:c,height:h}}function tr(t,e,i){const n=e||1,s=Qo(t.height*n),o=Qo(t.width*n);t.height=Qo(t.height),t.width=Qo(t.width);const r=t.canvas;r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`);const a=Math.floor(s),l=Math.floor(o);return(t.currentDevicePixelRatio!==n||r.height!==a||r.width!==l)&&(t.currentDevicePixelRatio=n,r.height=a,r.width=l,t.ctx.setTransform(n,0,0,n,0,0),!0)}const er=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Uo()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function ir(t,e){const i=function(t,e){return Xo(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function nr(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function sr(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function or(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},r=nr(t,s,i),a=nr(s,o,i),l=nr(o,e,i),c=nr(r,a,i),h=nr(a,l,i);return nr(c,h,i)}function rr(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function ar(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function lr(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function cr(t){return"angle"===t?{between:bs,compare:gs,normalize:ms}:{between:ys,compare:(t,e)=>t-e,normalize:t=>t}}function hr({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:s}}function dr(t,e,i){if(!i)return[t];const{property:n,start:s,end:o}=i,r=e.length,{compare:a,between:l,normalize:c}=cr(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:s,end:o}=i,{between:r,normalize:a}=cr(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cv||l(s,b,g)&&0!==a(s,b),_=()=>!v||0===a(o,g)||l(o,b,g);for(let t=h,i=h;t<=d;++t)m=e[t%r],m.skip||(g=c(m[n]),g!==b&&(v=l(g,s,o),null===y&&x()&&(y=0===a(g,s)?t:i),null!==y&&_()&&(p.push(hr({start:y,end:t,loop:u,count:r,style:f})),y=null),i=t,b=g));return null!==y&&p.push(hr({start:y,end:d,loop:u,count:r,style:f})),p}function ur(t,e){const i=[],n=t.segments;for(let s=0;sn({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Os.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let o,r=s.length-1,a=!1;for(;r>=0;--r)o=s[r],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),a=!0):(s[r]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var yr=new vr;const xr="transparent",_r={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Fs(t||xr),s=n.valid&&Fs(e||xr);return s&&s.valid?s.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class wr{constructor(t,e,i,n){const s=e[i];n=wo([t.to,n,s,t.from]);const o=wo([t.from,s,n]);this._active=!0,this._fn=t.fn||_r[t.type||typeof o],this._easing=Rs[t.easing]||Rs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=wo([t.to,e,n,t.from]),this._from=wo([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||e1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,r,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t{const s=t[n];if(!Cn(s))return;const o={};for(const t of e)o[t]=s[t];(Tn(s.properties)&&s.properties||[n]).forEach(t=>{t!==n&&i.has(t)||i.set(t,o)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),o=Object.keys(e),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const l=o[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=s[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,r);continue}h.cancel()}d&&d.duration?(s[l]=h=new wr(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(yr.add(this._chart,i),!0):void 0}}function Mr(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:n?o:s,end:n?s:o}}function Sr(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=n.length;s0||!i&&e<0)return s.index}return null}function Cr(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,r,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Lr(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;e&&void 0!==e[n]&&void 0!==e[n][i]&&(delete e[n][i],void 0!==e[n]._visualValues&&void 0!==e[n]._visualValues[i]&&delete e[n]._visualValues[i])}}}const Dr=t=>"reset"===t||"none"===t,Ir=(t,e)=>e?t:Object.assign({},t);class Rr{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Er(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Lr(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=e.xAxisID=Dn(i.xAxisID,Pr(t,"x")),o=e.yAxisID=Dn(i.yAxisID,Pr(t,"y")),r=e.rAxisID=Dn(i.rAxisID,Pr(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,s,o,r),c=e.vAxisID=n(a,o,s,r);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ms(this._data,this),t._stacked&&Lr(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Cn(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:n}=e,s="x"===i.axis?"x":"y",o="x"===n.axis?"x":"y",r=Object.keys(t),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l{const e="_onData"+qn(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const s=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),s}})}))),this._syncList=[],this._data=e}var n,s}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=Er(e.vScale,e),e.stack!==i.stack&&(n=!0,Lr(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&(Cr(this,e._parsed),e._stacked=Er(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=Tn(n[t])?this.parseArrayData(i,n,t,e):Cn(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const s=()=>null===l[r]||d&&l[r]t&&!e.hidden&&e._stacked&&{keys:Sr(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}(r);let d,u;function f(){u=n[d];const e=u[r.axis];return!Pn(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,s,o;for(n=0,s=e.length;n=0&&tthis.getContext(i,n,e),h);return f.$shared&&(f.$shared=a,s[o]=Object.freeze(Ir(f,a))),f}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,o=`animation-${e}`,r=s[o];if(r)return r;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),o=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(o,this.getContext(t,i,e))}const l=new kr(n,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Dr(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(e,s)||s!==n;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:o}}updateElement(t,e,i,n){Dr(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Dr(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,s=e.length,o=Math.min(s,n);o&&this.parse(0,o),s>n?this._insertElements(n,s-n,t):s{for(t.length+=e,r=t.length-1;r>=o;r--)t[r]=t[r-e]};for(a(s),r=t;rt-e))}return t._cache.$bar}(e,t.type);let n,s,o,r,a=e._length;const l=()=>{32767!==o&&-32768!==o&&(Yn(r)&&(a=Math.min(a,Math.abs(o-r)||a)),r=o)};for(n=0,s=i.length;nMath.abs(a)&&(l=a,c=r),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function zr(t,e,i,n){const s=t.iScale,o=t.vScale,r=s.getLabels(),a=s===o,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base"spacing"!==t&&"spacingMode"!==t,_indexable:t=>"spacing"!==t&&"spacingMode"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:n,color:s,useBorderRadius:o,borderRadius:r}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((e,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:e,fillStyle:l.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(a),lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:l.borderWidth,strokeStyle:l.borderColor,textAlign:n,pointStyle:i,borderRadius:o&&(r||l.borderRadius),index:a}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let s,o,r=t=>+i[t];if(Cn(i[t])){const{key:t="value"}=this._parsing;r=e=>+Un(i[e],t)}for(s=t,o=t+e;sbs(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>bs(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),g=f(0,c,d),m=f(es,h,u),b=p(Gn,c,d),v=p(Gn+es,h,u);n=(g-b)/2,s=(m-v)/2,o=-(g+b)/2,r=-(m+v)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}(u,d,a),b=(i.width-o)/f,v=(i.height-o)/p,y=Math.max(Math.min(b,v)/2,0),x=In(this.options.radius,y),_=(x-Math.max(x*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=m*x,n.total=this.calculateTotal(),this.outerRadius=x-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*h,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*s/Kn)}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,r=o.chartArea,a=o.options.animation,l=(r.left+r.right)/2,c=(r.top+r.bottom)/2,h=s&&a.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,{sharedOptions:f,includeOptions:p}=this._getSharedOptions(e,n);let g,m=this._getRotation();for(g=0;g0&&!isNaN(t)?Kn*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=Vs(e._parsed[t],i.options.locale);return{label:n[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,o,r,a;if(!t)for(n=0,s=i.data.datasets.length;n{const o=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:n,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=Vs(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:s}}parseObjectData(t,e,i,n){return Fo.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{const n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(ne.max&&(e.max=n))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),o=(s-Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=s-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,r=o.options.animation,a=this._cachedMeta.rScale,l=a.xCenter,c=a.yCenter,h=a.getIndexAngle(0)-.5*Gn;let d,u=h;const f=360/this.countVisibleElements();for(d=0;d{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?hs(this.resolveDataElementOptions(t,e).angle||i):0}}var qr=Object.freeze({__proto__:null,BarController:class extends Rr{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,n){return zr(t,e,i,n)}parseArrayData(t,e,i,n){return zr(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:s,vScale:o}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,l="x"===s.axis?r:a,c="x"===o.axis?r:a,h=[];let d,u,f,p;for(d=i,u=i+n;dt.controller.options.grouped),s=i.options.stacked,o=[],r=this._cachedMeta.controller.getParsed(e),a=r&&r[i.axis],l=t=>{const e=t._parsed.find(t=>t[i.axis]===a),n=e&&e[t.vScale.axis];if(An(n)||isNaN(n))return!0};for(const i of n)if((void 0===e||!l(i))&&((!1===s||-1===o.indexOf(i.stack)||void 0===s&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Dn("x"===this.chart.options.indexAxis?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const n=this._getStacks(t,i),s=void 0!==e?n.indexOf(e):-1;return-1===s?n.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let s,o;for(s=0,o=e.data.length;s=i?1:-1)}(d,e,r)*o,u===r&&(m-=d/2);const t=e.getPixelForDecimal(0),s=e.getPixelForDecimal(1),l=Math.min(t,s),f=Math.max(t,s);m=Math.max(Math.min(m,f),l),h=m+d,i&&!c&&(a._stacks[e.axis]._visualValues[n]=e.getValueForPixel(h)-e.getValueForPixel(m))}if(m===e.getPixelForValue(r)){const t=os(d)*e.getLineWidthForValue(r)/2;m+=t,d-=t}return{size:d,base:m,head:h,center:h+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,s=n.skipNull,o=Dn(n.maxBarThickness,1/0);let r,a;const l=this._getAxisCount();if(e.grouped){const i=s?this._getStackCount(t):e.stackCount,c="flex"===n.barThickness?function(t,e,i,n){const s=e.pixels,o=s[t];let r=t>0?s[t-1]:null,a=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:s}=e,o=this.getParsed(t),r=n.getLabelForValue(o.x),a=s.getLabelForValue(o.y),l=o._custom;return{label:i[t]||"",value:"("+r+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(e,n),c=o.axis,h=r.axis;for(let d=e;d0&&this.getParsed(e-1);for(let i=0;i=b){v.skip=!0;continue}const x=this.getParsed(i),_=An(x[u]),w=v[d]=o.getPixelForValue(x[d],i),k=v[u]=s||_?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,x,a):x[u],i);v.skip=isNaN(w)||isNaN(k)||_,v.stop=i>0&&Math.abs(x[d]-y[d])>g,p&&(v.parsed=x,v.raw=l.data[i]),h&&(v.options=c||this.resolveDataElementOptions(i,f.active?"active":n)),m||this.updateElement(f,i,v,n),y=x}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends $r{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:Ur,RadarController:class extends Rr{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return Fo.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this._cachedMeta.rScale,o="reset"===n;for(let r=e;r0&&this.getParsed(e-1);for(let c=e;c0&&Math.abs(i[u]-v[u])>m,g&&(p.parsed=i,p.raw=l.data[c]),d&&(p.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),b||this.updateElement(e,c,p,n),v=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const s=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,s,o)/2}}});function Yr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xr{static override(t){Object.assign(Xr.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Yr()}parse(){return Yr()}format(){return Yr()}add(){return Yr()}diff(){return Yr()}startOf(){return Yr()}endOf(){return Yr()}}var Jr=Xr;function Gr(t,e,i,n){const{controller:s,data:o,_sorted:r}=t,a=s._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&"r"!==e&&r&&o.length){const r=a._reversePixels?ws:_s;if(!n){const n=r(o,e,i);if(l){const{vScale:e}=s._cachedMeta,{_parsed:i}=t,o=i.slice(0,n.lo+1).reverse().findIndex(t=>!An(t[e.axis]));n.lo-=Math.max(0,o);const r=i.slice(n.hi).findIndex(t=>!An(t[e.axis]));n.hi+=Math.max(0,r)}return n}if(s._sharedOptions){const t=o[0],n="function"==typeof t.getRange&&t.getRange(e);if(n){const t=r(o,e,i-n),s=r(o,e,i+n);return{lo:t.lo,hi:s.hi}}}}return{lo:0,hi:o.length-1}}function Kr(t,e,i,n,s){const o=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=o.length;t{t[r]&&t[r](e[i],s)&&(o.push({element:t,datasetIndex:n,index:l}),a=a||t.inRange(e.x,e.y,s))}),n&&!a?[]:o}var ia={evaluateInteractionItems:Kr,modes:{index(t,e,i,n){const s=Ko(e,t),o=i.axis||"x",r=i.includeInvisible||!1,a=i.intersect?Qr(t,s,o,n,r):ta(t,s,o,!1,n,r),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,n){const s=Ko(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;let a=i.intersect?Qr(t,s,o,n,r):ta(t,s,o,!1,n,r);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;tQr(t,Ko(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){const s=Ko(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;return ta(t,s,o,i.intersect,n,r)},x:(t,e,i,n)=>ea(t,Ko(e,t),"x",i.intersect,n),y:(t,e,i,n)=>ea(t,Ko(e,t),"y",i.intersect,n)}};const na=["left","top","right","bottom"];function sa(t,e){return t.filter(t=>t.pos===e)}function oa(t,e){return t.filter(t=>-1===na.indexOf(t.pos)&&t.box.axis===e)}function ra(t,e){return t.sort((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function aa(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:s}=i;if(!t||!na.includes(n))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let o,r,a;for(o=0,r=t.length;o{n[t]=Math.max(e[t],i[t])}),n}return n(t?["left","right"]:["top","bottom"])}function ua(t,e,i,n){const s=[];let o,r,a,l,c,h;for(o=0,r=t.length,c=0;ot.box.fullSize),!0),n=ra(sa(e,"left"),!0),s=ra(sa(e,"right")),o=ra(sa(e,"top"),!0),r=ra(sa(e,"bottom")),a=oa(e,"x"),l=oa(e,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:sa(e,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;jn(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},s);ca(u,xo(n));const f=Object.assign({maxPadding:u,w:o,h:r,x:s.left,y:s.top},s),p=aa(l.concat(c),d);ua(a.fullSize,f,d,p),ua(l,f,d,p),ua(c,f,d,p)&&ua(l,f,d,p),function(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),pa(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,pa(a.rightAndBottom,f,d,p),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},jn(a.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class ma{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class ba extends ma{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const va="$chartjs",ya={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xa=t=>null===t||""===t;const _a=!!er&&{passive:!0};function wa(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,_a)}function ka(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Ma(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||ka(i.addedNodes,n),e=e&&!ka(i.removedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function Sa(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||ka(i.removedNodes,n),e=e&&!ka(i.addedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}const Oa=new Map;let Ea=0;function Aa(){const t=window.devicePixelRatio;t!==Ea&&(Ea=t,Oa.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Ta(t,e,i){const n=t.canvas,s=n&&qo(n);if(!s)return;const o=Es((t,e)=>{const n=s.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||o(i,n)});return r.observe(s),function(t,e){Oa.size||window.addEventListener("resize",Aa),Oa.set(t,e)}(t,o),r}function Ca(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Oa.delete(t),Oa.size||window.removeEventListener("resize",Aa)}(t)}function Pa(t,e,i){const n=t.canvas,s=Es(e=>{null!==t.ctx&&i(function(t,e){const i=ya[t.type]||t.type,{x:n,y:s}=Ko(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==s?s:null}}(e,t))},t);return function(t,e,i){t&&t.addEventListener(e,i,_a)}(n,e,s),s}class La extends ma{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),s=t.getAttribute("width");if(t[va]={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",xa(s)){const e=ir(t,"width");void 0!==e&&(t.width=e)}if(xa(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ir(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[va])return!1;const i=e[va].initial;["height","width"].forEach(t=>{const n=i[t];An(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e[va],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:Ma,detach:Sa,resize:Ta}[e]||Pa;n[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:Ca,detach:Ca,resize:Ca}[e]||wa)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Zo(t,e,i,n)}isAttached(t){const e=t&&qo(t);return!(!e||!e.isConnected)}}class Da{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return ls(this.x)&&ls(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}function Ia(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),s=t._maxLength/i;return Math.floor(Math.min(n,s))}(t),s=Math.min(i.maxTicksLimit||n,n),o=i.major.enabled?function(t){const e=[];let i,n;for(i=0,n=t.length;is)return function(t,e,i,n){let s,o=0,r=i[0];for(n=Math.ceil(n),s=0;st-e).pop(),e}(n);for(let t=0,e=o.length-1;ts)return e}return Math.max(s,1)}(o,e,s);if(r>0){let t,i;const n=r>1?Math.round((l-a)/(r-1)):null;for(Ra(e,c,h,An(n)?0:a-n,a),t=0,i=r-1;t"top"===e||"left"===e?t[e]+i:t[e]-i,Fa=(t,e)=>Math.min(e||t,t);function za(t,e){const i=[],n=t.length/e,s=t.length;let o=0;for(;or+a)))return c}function Ba(t){return t.drawTicks?t.tickLength:0}function Wa(t,e){if(!t.display)return 0;const i=_o(t.font,e),n=xo(t.padding);return(Tn(t.text)?t.text.length:1)*i.lineHeight+n.height}function Va(t,e,i){let n=As(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Ha extends Da{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=Ln(t,Number.POSITIVE_INFINITY),e=Ln(e,Number.NEGATIVE_INFINITY),i=Ln(i,Number.POSITIVE_INFINITY),n=Ln(n,Number.NEGATIVE_INFINITY),{min:Ln(t,i),max:Ln(e,n),minDefined:Pn(t),maxDefined:Pn(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:s,maxDefined:o}=this.getUserBounds();if(s&&o)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let a=0,l=r.length;an?n:i,n=s&&i>n?i:n,{min:Ln(i,Ln(n,i)),max:Ln(n,Ln(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Rn(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:s}=t,o=In(e,(s-n)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(n,-Math.abs(o)),max:r(s,o)}}(this,s,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=vs(this.chart.width-h,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),h+6>o&&(o=u/(i-(t.offset?.5:1)),r=this.maxHeight-Ba(t.grid)-e.padding-Wa(t.title,this.chart.options.font),a=Math.sqrt(h*h+d*d),l=ds(Math.min(Math.asin(vs((c.highest.height+6)/o,-1,1)),Math.asin(vs(r/a,-1,1))-Math.asin(vs(d/a,-1,1)))),l=Math.max(n,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){Rn(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Rn(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const o=Wa(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Ba(s)+o):(t.height=this.maxHeight,t.width=Ba(s)+o),i.display&&this.ticks.length){const{first:e,last:n,widest:s,highest:o}=this._getLabelSizes(),a=2*i.padding,l=hs(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(r){const e=i.mirror?0:h*s.width+c*o.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:c*s.width+h*o.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:s,padding:o},position:r}=this.options,a=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;a?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?h=t.width:"inner"!==s&&(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-r+o)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-c+o)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+o,this.paddingBottom=n+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Rn(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s({width:o[t]||0,height:r[t]||0});return{first:k(0),last:k(e-1),widest:k(_),highest:k(w),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return vs(this._alignToPixels?Zs(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tr*n?r/i:a/n:a*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:s,position:o,border:r}=n,a=s.offset,l=this.isHorizontal(),c=this.ticks.length+(a?1:0),h=Ba(s),d=[],u=r.setContext(this.getContext()),f=u.display?u.width:0,p=f/2,g=function(t){return Zs(i,t,f)};let m,b,v,y,x,_,w,k,M,S,O,E;if("top"===o)m=g(this.bottom),_=this.bottom-h,k=m-p,S=g(t.top)+p,E=t.bottom;else if("bottom"===o)m=g(this.top),S=t.top,E=g(t.bottom)-p,_=m+p,k=this.top+h;else if("left"===o)m=g(this.right),x=this.right-h,w=m-p,M=g(t.left)+p,O=t.right;else if("right"===o)m=g(this.left),M=t.left,O=g(t.right)-p,x=m+p,w=this.left+h;else if("x"===e){if("center"===o)m=g((t.top+t.bottom)/2+.5);else if(Cn(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}S=t.top,E=t.bottom,_=m+p,k=_+h}else if("y"===e){if("center"===o)m=g((t.left+t.right)/2);else if(Cn(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}x=m-p,w=x-h,M=t.left,O=t.right}const A=Dn(n.ticks.maxTicksLimit,c),T=Math.max(1,Math.ceil(c/A));for(b=0;b0&&(o-=n/2)}d={left:o,top:s,width:n+e.width,height:i+e.height,color:t.backdropColor}}g.push({label:y,font:M,textOffset:E,options:{rotation:p,color:i,strokeColor:a,strokeWidth:c,textAlign:u,textBaseline:A,translation:[x,_],backdrop:d}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-hs(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:s}}=this.options,o=t+s,r=this._getLabelSizes().widest.width;let a,l;return"left"===e?n?(l=this.right+s,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l+=r)):(l=this.right-o,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l=this.left)):"right"===e?n?(l=this.left+s,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l-=r)):(l=this.left+o,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:s,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,s,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(e=>e.value===t);if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,o=n.length;s{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,o;for(s=0,o=e.length;s{const n=i.split("."),s=n.pop(),o=[t].concat(n).join("."),r=e[i].split("."),a=r.pop(),l=r.join(".");Gs.route(o,s,l,a)})}(e,t.defaultRoutes);t.descriptors&&Gs.describe(e,t.descriptors)}(t,o,i),this.override&&Gs.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Gs[n]&&(delete Gs[n][i],this.override&&delete Us[i])}}class Ua{constructor(){this.controllers=new $a(Rr,"datasets",!0),this.elements=new $a(Da,"elements"),this.plugins=new $a(Object,"plugins"),this.scales=new $a(Ha,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):jn(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=qn(t);Rn(i["before"+n],[],i),e[t](i),Rn(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Xa(t,e){return e||!1!==t?!0===t?{}:t:null}function Ja(t,{plugin:e,local:i},n,s){const o=t.pluginScopeKeys(e),r=t.getOptionScopes(n,o);return i&&e.defaults&&r.push(e.defaults),t.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ga(t,e){const i=Gs.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Ka(t){if("x"===t||"y"===t||"r"===t)return t}function Qa(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function Za(t,...e){if(Ka(t))return t;for(const i of e){const e=i.axis||Qa(i.position)||t.length>1&&Ka(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function tl(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function el(t,e){const i=Us[t.type]||{scales:{}},n=e.scales||{},s=Ga(t.type,e),o=Object.create(null);return Object.keys(n).forEach(e=>{const r=n[e];if(!Cn(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const a=Za(e,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return tl(t,"x",i[0])||tl(t,"y",i[0])}return{}}(e,t),Gs.scales[r.type]),l=function(t,e){return t===e?"_index_":"_value_"}(a,s),c=i.scales||{};o[e]=Vn(Object.create(null),[{axis:a},r,c[a],c[l]])}),t.data.datasets.forEach(i=>{const s=i.type||t.type,r=i.indexAxis||Ga(s,e),a=(Us[s]||{}).scales||{};Object.keys(a).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),s=i[e+"AxisID"]||e;o[s]=o[s]||Object.create(null),Vn(o[s],[{axis:e},n[s],a[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];Vn(e,[Gs.scales[e.type],Gs.scale])}),o}function il(t){const e=t.options||(t.options={});e.plugins=Dn(e.plugins,{}),e.scales=el(t,e)}function nl(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const sl=new Map,ol=new Set;function rl(t,e){let i=sl.get(t);return i||(i=e(),sl.set(t,i),ol.add(i)),i}const al=(t,e,i)=>{const n=Un(e,i);void 0!==n&&t.add(n)};class ll{constructor(t){this._config=function(t){return(t=t||{}).data=nl(t.data),il(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=nl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),il(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return rl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return rl(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return rl(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return rl(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:s}=this,o=this._cachedScopes(t,i),r=o.get(e);if(r)return r;const a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>al(a,t,e))),e.forEach(t=>al(a,n,t)),e.forEach(t=>al(a,Us[s]||{},t)),e.forEach(t=>al(a,Gs,t)),e.forEach(t=>al(a,qs,t))});const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),ol.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Us[e]||{},Gs.datasets[e]||{},{type:e},Gs,qs]}resolveNamedOptions(t,e,i,n=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=cl(this._resolverCache,t,n);let a=o;if(function(t,e){const{isScriptable:i,isIndexable:n}=Oo(t);for(const s of e){const e=i(s),o=n(s),r=(o||e)&&t[s];if(e&&(Xn(r)||hl(r))||o&&Tn(r))return!0}return!1}(o,e)){s.$shared=!1;a=So(o,i=Xn(i)?i():i,this.createResolver(t,i,r))}for(const t of e)s[t]=a[t];return s}createResolver(t,e,i=[""],n){const{resolver:s}=cl(this._resolverCache,t,i);return Cn(e)?So(s,e,void 0,n):s}}function cl(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const s=i.join();let o=n.get(s);if(!o){o={resolver:Mo(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(s,o)}return o}const hl=t=>Cn(t)&&Object.getOwnPropertyNames(t).some(e=>Xn(t[e]));const dl=["top","bottom","left","right","chartArea"];function ul(t,e){return"top"===t||"bottom"===t||-1===dl.indexOf(t)&&"x"===e}function fl(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function pl(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Rn(i&&i.onComplete,[t],e)}function gl(t){const e=t.chart,i=e.options.animation;Rn(i&&i.onProgress,[t],e)}function ml(t){return Uo()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const bl={},vl=t=>{const e=ml(t);return Object.values(bl).filter(t=>t.canvas===e).pop()};function yl(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const o=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=o)}}}class xl{static defaults=Gs;static instances=bl;static overrides=Us;static registry=qa;static version="4.6.1";static getChart=vl;static register(...t){qa.add(...t),_l()}static unregister(...t){qa.remove(...t),_l()}constructor(t,e){const i=this.config=new ll(e),n=ml(t),s=vl(n);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Uo()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?ba:La}(n)),this.platform.updateConfig(i);const r=this.platform.acquireContext(n,o.aspectRatio),a=r&&r.canvas,l=a&&a.height,c=a&&a.width;this.id=En(),this.ctx=r,this.canvas=a,this.width=c,this.height=l,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ya,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),o.resizeDelay||0),this._dataChanges=[],bl[this.id]=this,r&&a?(yr.listen(this,"complete",pl),yr.listen(this,"progress",gl),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:s}=this;return An(t)?e&&s?s:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return qa}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return to(this.canvas,this.ctx),this}stop(){return yr.stop(this),this}resize(t,e){yr.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,t,e,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,tr(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Rn(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){jn(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let s=[];e&&(s=s.concat(Object.keys(e).map(t=>{const i=e[t],n=Za(t,i),s="r"===n,o="x"===n;return{options:i,dposition:s?"chartArea":o?"bottom":"left",dtype:s?"radialLinear":o?"category":"linear"}}))),jn(s,e=>{const s=e.options,o=s.id,r=Za(o,s),a=Dn(s.type,e.dtype);void 0!==s.position&&ul(s.position,r)===ul(e.dposition)||(s.position=e.dposition),n[o]=!0;let l=null;if(o in i&&i[o].type===a)l=i[o];else{l=new(qa.getScale(a))({id:o,type:a,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(s,t)}),jn(n,(t,e)=>{t||delete i[e]}),jn(i,t=>{ga.configure(this,t,t.options),ga.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(fl("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){jn(this.scales,t=>{ga.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);Jn(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e){yl(t,n,"_removeElements"===i?-s:s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;ga.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],jn(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},n=br(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(n&&so(e,n),t.controller.draw(),n&&oo(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return no(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const s=ia.modes[e];return"function"==typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=ko(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,n);Yn(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(s,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),yr.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};jn(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():o()}unbindEvents(){jn(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},jn(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,o,r,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),r=0,a=t.length;r{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!Fn(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=s(e,t),r=i?t:s(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:s}=this,o=e,r=this._getActiveElements(t,n,i,o),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,Rn(s.onHover,[t,r,this],this),a&&Rn(s.onClick,[t,r,this],this));const c=!Fn(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}function _l(){return jn(xl.instances,t=>t._plugins.invalidate())}function wl(t,e,i,n){const s=bo(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(i-e)/2,r=Math.min(o,n*e/2),a=t=>{const e=(i-Math.min(o,t))*n/2;return vs(t,0,Math.min(o,e))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:vs(s.innerStart,0,r),innerEnd:vs(s.innerEnd,0,r)}}function kl(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function Ml(t,e,i,n,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=e,{spacingMode:d="angular"}=e.options,u=s-l;if(o&&e.options.selfJoin&&Math.abs(u)>=Kn-1e-4)return void function(t,e,i,n){const{x:s,y:o,startAngle:r,pixelMargin:a,innerRadius:l}=e,c=Math.max(e.outerRadius+n+i-a,0),h=l>0?l+n+i+a:0;t.beginPath(),t.arc(s,o,c,r,r+Kn),h>0&&(t.moveTo(s+Math.cos(r)*h,o+Math.sin(r)*h),t.arc(s,o,h,r+Kn,r,!0)),t.closePath()}(t,e,i,n);const f=Math.max(e.outerRadius+n+i-c,0);let p=h>0?h+n+i+c:0,g=0,m=0;const b=f>0?Math.max(.001,u*f-i/Gn)/f:.001,v=(u-b)/2;if(n){const t=((h>0?h-n:0)+(f>0?f-n:0))/2,e=(u-(0!==t?u*t/(t+n):u))/2,i=t>0?Math.asin(Math.min(1,n/t)):0,s=Math.max(0,b/2-.001),o=Math.sin(s);if("parallel"===d){if(0===p&&o>0){const t=n/o,e=Math.max(0,f-.001);p=Math.min(t,e)}const t=Math.min(f>0?f*o:Number.POSITIVE_INFINITY,p>0?p*o:Number.POSITIVE_INFINITY),e=Math.min(n,t);g=f>0?Math.asin(Math.min(1,e/f)):Math.min(s,i),m=p>0?Math.asin(Math.min(1,e/p)):g}else"proportional"===d?(g=Math.min(s,e),m=Math.min(s,e)):(g=Math.min(s,i),m=Math.min(s,i))}const y=l+v+g,x=s-v-g,_=l+v+m,w=s-v-m,k=Math.min(x-y,w-_),{outerStart:M,outerEnd:S,innerStart:O,innerEnd:E}=wl(e,p,f,k),A=f-M,T=f-S,C=y+M/A,P=x-S/T,L=p+O,D=p+E,I=_+O/L,R=w-E/D;if(t.beginPath(),o){const e=(C+P)/2;if(t.arc(r,a,f,C,e),t.arc(r,a,f,e,P),S>0){const e=kl(T,P,r,a);t.arc(e.x,e.y,S,P,x+es)}const i=kl(D,w,r,a);if(t.lineTo(i.x,i.y),E>0){const e=kl(D,R,r,a);t.arc(e.x,e.y,E,w+es,R+Math.PI)}const n=(w-E/p+(_+O/p))/2;if(t.arc(r,a,p,w-E/p,n,!0),t.arc(r,a,p,n,_+O/p,!0),O>0){const e=kl(L,I,r,a);t.arc(e.x,e.y,O,I+Math.PI,_-es)}const s=kl(A,y,r,a);if(t.lineTo(s.x,s.y),M>0){const e=kl(A,C,r,a);t.arc(e.x,e.y,M,y-es,C)}}else{t.moveTo(r,a);const e=Math.cos(C)*f+r,i=Math.sin(C)*f+a;t.lineTo(e,i);const n=Math.cos(P)*f+r,s=Math.sin(P)*f+a;t.lineTo(n,s)}t.closePath()}function Sl(t,e,i,n,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=e,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u,borderRadius:f}=l,p="inner"===l.borderAlign;if(!c)return;t.setLineDash(d||[]),t.lineDashOffset=u,p?(t.lineWidth=2*c,t.lineJoin=h||"round"):(t.lineWidth=c,t.lineJoin=h||"bevel");let g=e.endAngle;const m=Math.abs(g-r)>=Kn-1e-4;if(o){Ml(t,e,i,n,g,s);for(let e=0;es?(c=s/l,t.arc(o,r,l,i+c,n-c,!0)):t.arc(o,r,s,i+es,n-es),t.closePath(),t.clip()}(t,e,g);!(m&&e.innerRadius>0)&&l.selfJoin&&g-r>=Gn&&0===f&&"miter"!==h&&function(t,e,i){const{startAngle:n,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=e,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/r,ms(n-i));if(t.beginPath(),t.arc(s,o,r-c/2,n+d/2,i-d/2),a>0){const e=Math.min(c/a,ms(n-i));t.arc(s,o,a+c/2,i-e/2,n+e/2,!0)}else{const e=Math.min(c/2,r*ms(n-i));if("round"===h)t.arc(s,o,e,i-Gn/2,n+Gn/2,!0);else if("bevel"===h){const r=2*e*e,a=-r*Math.cos(i+Gn/2)+s,l=-r*Math.sin(i+Gn/2)+o,c=r*Math.cos(n+Gn/2)+s,h=r*Math.sin(n+Gn/2)+o;t.lineTo(a,l),t.lineTo(c,h)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}(t,e,g),o||(Ml(t,e,i,n,g,s),t.stroke())}function Ol(t,e,i=e){t.lineCap=Dn(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Dn(i.borderDash,e.borderDash)),t.lineDashOffset=Dn(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Dn(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Dn(i.borderWidth,e.borderWidth),t.strokeStyle=Dn(i.borderColor,e.borderColor)}function El(t,e,i){t.lineTo(i.x,i.y)}function Al(t,e,i={}){const n=t.length,{start:s=0,end:o=n-1}=i,{start:r,end:a}=e,l=Math.max(s,r),c=Math.min(o,a),h=sa&&o>a;return{count:n,start:l,loop:e.loop,ilen:c(r+(c?a-t:t))%o,y=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=s[v(0)],t.moveTo(d.x,d.y)),h=0;h<=a;++h){if(d=s[v(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ip&&(p=i),m=(b*m+e)/++b):(y(),t.lineTo(e,i),u=n,b=0,f=p=i),g=i}y()}function Pl(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?Cl:Tl}const Ll="function"==typeof Path2D;function Dl(t,e,i,n){Ll&&!e.options.segment?function(t,e,i,n){let s=e._path;s||(s=e._path=new Path2D,e.path(s,i,n)&&s.closePath()),Ol(t,e.options),t.stroke(s)}(t,e,i,n):function(t,e,i,n){const{segments:s,options:o}=e,r=Pl(e);for(const a of s)Ol(t,o,a.style),t.beginPath(),r(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}class Il extends Da{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;$o(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const o=!!t._loop,{start:r,end:a}=function(t,e,i,n){let s=0,o=e-1;if(i&&!n)for(;ss&&t[o%e].skip;)o--;return o%=e,{start:s,end:o}}(i,s,o,n);return fr(t,!0===n?[{start:r,end:a,loop:o}]:function(t,e,i,n){const s=t.length,o=[];let r,a=e,l=t[e];for(r=e+1;r<=i;++r){const i=t[r%s];i.skip||i.stop?l.skip||(n=!1,o.push({start:e%s,end:(r-1)%s,loop:n}),e=a=i.stop?r:null):(a=r,l.skip&&(e=r)),l=i}return null!==a&&o.push({start:e%s,end:a%s,loop:n}),o}(i,r,a"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;circular;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,this.circular=!1,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:s,distance:o}=fs(n,{x:t,y:e}),{startAngle:r,endAngle:a,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,u=Dn(h,a-r),f=bs(s,r,a)&&r!==a,p=u>=Kn||f,g=ys(o,l+d,c+d);return p&&g}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:a,spacing:l}=this.options,c=(n+s)/2,h=(o+r+l+a)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/4,s=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>Kn?Math.floor(i/Kn):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*n,Math.sin(r)*n);const a=n*(1-Math.sin(Math.min(Gn,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,n,s){const{fullCircles:o,startAngle:r,circumference:a}=e;let l=e.endAngle;if(o){Ml(t,e,i,n,l,s);for(let e=0;et.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ul(t){return Hl[t%Hl.length]}function ql(t){return $l[t%$l.length]}function Yl(t){let e=0;return(i,n)=>{const s=t.getDatasetMeta(n).controller;s instanceof $r?e=function(t,e){return t.backgroundColor=t.data.map(()=>Ul(e++)),e}(i,e):s instanceof Ur?e=function(t,e){return t.backgroundColor=t.data.map(()=>ql(e++)),e}(i,e):s&&(e=function(t,e){return t.borderColor=Ul(e),t.backgroundColor=ql(e),++e}(i,e))}}function Xl(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var Jl={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:n},options:s}=t.config,{elements:o}=s,r=Xl(n)||(a=s)&&(a.borderColor||a.backgroundColor)||o&&Xl(o)||"rgba(0,0,0,0.1)"!==Gs.borderColor||"rgba(0,0,0,0.1)"!==Gs.backgroundColor;var a;if(!i.forceOverride&&r)return;const l=Yl(t);n.forEach(l)}};function Gl(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Kl(t){t.data.datasets.forEach(t=>{Gl(t)})}var Ql={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Kl(t);const n=t.width;t.data.datasets.forEach((e,s)=>{const{_data:o,indexAxis:r}=e,a=t.getDatasetMeta(s),l=o||e.data;if("y"===wo([r,t.options.indexAxis]))return;if(!a.controller.supportsDecimation)return;const c=t.scales[a.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let{start:h,count:d}=function(t,e){const i=e.length;let n,s=0;const{iScale:o}=t,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(s=vs(_s(e,o.axis,r).lo,0,i-1)),n=c?vs(_s(e,o.axis,a).hi+1,s,i)-s:i-s,{start:s,count:n}}(a,l);if(d<=(i.threshold||4*n))return void Gl(e);let u;switch(An(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":u=function(t,e,i,n,s){const o=s.samples||n;if(o>=i)return t.slice(e,e+i);const r=[],a=(i-2)/(o-2);let l=0;const c=e+i-1;let h,d,u,f,p,g=e;for(r[l++]=t[g],h=0;hu&&(u=f,d=t[n],p=n);r[l++]=d,g=p}return r[l++]=t[c],r}(l,h,d,n,i);break;case"min-max":u=function(t,e,i,n){let s,o,r,a,l,c,h,d,u,f,p=0,g=0;const m=[],b=e+i-1,v=t[e].x,y=t[b].x-v;for(s=e;sf&&(f=a,h=s),p=(g*p+o.x)/++g;else{const i=s-1;if(!An(c)&&!An(h)){const e=Math.min(c,h),n=Math.max(c,h);e!==d&&e!==i&&m.push({...t[e],x:p}),n!==d&&n!==i&&m.push({...t[n],x:p})}s>0&&i!==d&&m.push(t[i]),m.push(o),l=e,g=0,u=f=a,c=h=d=s}}return m}(l,h,d,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=u})},destroy(t){Kl(t)}};function Zl(t,e,i,n){if(n)return;let s=e[t],o=i[t];return"angle"===t&&(s=ms(s),o=ms(o)),{property:t,start:s,end:o}}function tc(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function ec(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function ic(t,e){let i=[],n=!1;return Tn(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:n=null}=t||{},s=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=tc(t,e,s);const r=s[t],a=s[e];null!==n?(o.push({x:r.x,y:n}),o.push({x:a.x,y:n})):null!==i&&(o.push({x:i,y:r.y}),o.push({x:i,y:a.y}))}),o}(t,e),i.length?new Il({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function nc(t){return t&&!1!==t.fill}function sc(t,e,i){let n=t[e].fill;const s=[e];let o;if(!i)return n;for(;!1!==n&&-1===s.indexOf(n);){if(!Pn(n))return n;if(o=t[n],!o)return!1;if(o.visible)return n;s.push(n),n=o.fill}return!1}function oc(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=Dn(i&&i.target,i);void 0===n&&(n=!!e.backgroundColor);if(!1===n||null===n)return!1;if(!0===n)return"origin";return n}(t);if(Cn(n))return!isNaN(n.value)&&n;let s=parseFloat(n);return Pn(s)&&Math.floor(s)===s?function(t,e,i,n){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=n)return!1;return i}(n[0],e,s,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function rc(t,e,i){const n=[];for(let s=0;s=0;--e){const i=s[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),n&&i.fill&&hc(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;nc(i)&&hc(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;nc(n)&&"beforeDatasetDraw"===i.drawTime&&hc(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const bc=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}};class vc extends Da{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Rn(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,n=_o(i.font),s=n.size,o=this._computeTitleHeight(),{boxWidth:r,itemHeight:a}=bc(i,s);let l,c;e.font=n.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(o,s,r,a)+10):(c=this.maxHeight,l=this._fitCols(o,n,r,a)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:s,maxWidth:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],c=n+r;let h=t;s.textAlign="left",s.textBaseline="middle";let d=-1,u=-c;return this.legendItems.forEach((t,f)=>{const p=i+e/2+s.measureText(t.text).width;(0===f||l[l.length-1]+p+2*r>o)&&(h+=c,l[l.length-(f>0?0:1)]=0,u+=c,d++),a[f]={left:0,top:u,row:d,width:p,height:n},l[l.length-1]+=p+r}),h}_fitCols(t,e,i,n){const{ctx:s,maxHeight:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-t;let h=r,d=0,u=0,f=0,p=0;return this.legendItems.forEach((t,o)=>{const{itemWidth:g,itemHeight:m}=function(t,e,i,n,s){const o=function(t,e,i,n){let s=t.text;s&&"string"!=typeof s&&(s=s.reduce((t,e)=>t.length>e.length?t:e));return e+i.size/2+n.measureText(s).width}(n,t,e,i),r=function(t,e,i){let n=t;"string"!=typeof e.text&&(n=yc(e,i));return n}(s,n,e.lineHeight);return{itemWidth:o,itemHeight:r}}(i,e,s,t,n);o>0&&u+m+2*r>c&&(h+=d+r,l.push({width:d,height:u}),f+=d+r,p++,d=u=0),a[o]={left:f,top:u,col:p,width:g,height:m},d=Math.max(d,g),u+=m+r}),h+=d,l.push({width:d,height:u}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:s}}=this,o=rr(s,this.left,this.width);if(this.isHorizontal()){let s=0,r=Ts(i,this.left+n,this.right-this.lineWidths[s]);for(const a of e)s!==a.row&&(s=a.row,r=Ts(i,this.left+n,this.right-this.lineWidths[s])),a.top+=this.top+t+n,a.left=o.leftForLtr(o.x(r),a.width),r+=a.width+n}else{let s=0,r=Ts(i,this.top+t+n,this.bottom-this.columnSizes[s].height);for(const a of e)a.col!==s&&(s=a.col,r=Ts(i,this.top+t+n,this.bottom-this.columnSizes[s].height)),a.top=r,a.left+=this.left+n,a.left=o.leftForLtr(o.x(a.left),a.width),r+=a.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;so(t,this),this._draw(),oo(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:s,labels:o}=t,r=Gs.color,a=rr(t.rtl,this.left,this.width),l=_o(o.font),{padding:c}=o,h=l.size,d=h/2;let u;this.drawTitle(),n.textAlign=a.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:f,boxHeight:p,itemHeight:g}=bc(o,h),m=this.isHorizontal(),b=this._computeTitleHeight();u=m?{x:Ts(s,this.left+c,this.right-i[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:Ts(s,this.top+b+c,this.bottom-e[0].height),line:0},ar(this.ctx,t.textDirection);const v=g+c;this.legendItems.forEach((y,x)=>{n.strokeStyle=y.fontColor,n.fillStyle=y.fontColor;const _=n.measureText(y.text).width,w=a.textAlign(y.textAlign||(y.textAlign=o.textAlign)),k=f+d+_;let M=u.x,S=u.y;a.setWidth(this.width),m?x>0&&M+k+c>this.right&&(S=u.y+=v,u.line++,M=u.x=Ts(s,this.left+c,this.right-i[u.line])):x>0&&S+v>this.bottom&&(M=u.x=M+e[u.line].width+c,u.line++,S=u.y=Ts(s,this.top+b+c,this.bottom-e[u.line].height));if(function(t,e,i){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;n.save();const s=Dn(i.lineWidth,1);if(n.fillStyle=Dn(i.fillStyle,r),n.lineCap=Dn(i.lineCap,"butt"),n.lineDashOffset=Dn(i.lineDashOffset,0),n.lineJoin=Dn(i.lineJoin,"miter"),n.lineWidth=s,n.strokeStyle=Dn(i.strokeStyle,r),n.setLineDash(Dn(i.lineDash,[])),o.usePointStyle){const r={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:s},l=a.xPlus(t,f/2);io(n,r,l,e+d,o.pointStyleWidth&&f)}else{const o=e+Math.max((h-p)/2,0),r=a.leftForLtr(t,f),l=yo(i.borderRadius);n.beginPath(),Object.values(l).some(t=>0!==t)?uo(n,{x:r,y:o,w:f,h:p,radius:l}):n.rect(r,o,f,p),n.fill(),0!==s&&n.stroke()}n.restore()}(a.x(M),S,y),M=((t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e)(w,M+f+d,m?M+k:this.right,t.rtl),function(t,e,i){ho(n,i.text,t,e+g/2,l,{strikethrough:i.hidden,textAlign:a.textAlign(i.textAlign)})}(a.x(M),S,y),m)u.x+=k+c;else if("string"!=typeof y.text){const t=l.lineHeight;u.y+=yc(y,t)+c}else u.y+=v}),lr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=_o(e.font),n=xo(e.padding);if(!e.display)return;const s=rr(t.rtl,this.left,this.width),o=this.ctx,r=e.position,a=i.size/2,l=n.top+a;let c,h=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,h=Ts(t.align,h,this.right-d);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);c=l+Ts(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=Ts(r,h,h+d);o.textAlign=s.textAlign(As(r)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,ho(o,e.text,u,c,i)}_computeTitleHeight(){const t=this.options.title,e=_o(t.font),i=xo(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,s;if(ys(t,this.left,this.right)&&ys(e,this.top,this.bottom))for(s=this.legendHitBoxes,i=0;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const l=t.controller.getStyle(i?0:void 0),c=xo(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:s||l.textAlign,borderRadius:r&&(a||l.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class _c extends Da{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=Tn(i.text)?i.text.length:1;this._padding=xo(i.padding);const s=n*_o(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:s,options:o}=this,r=o.align;let a,l,c,h=0;return this.isHorizontal()?(l=Ts(r,i,s),c=e+t,a=s-i):("left"===o.position?(l=i+t,c=Ts(r,n,e),h=-.5*Gn):(l=s-t,c=Ts(r,e,n),h=.5*Gn),a=n-e),{titleX:l,titleY:c,maxWidth:a,rotation:h}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=_o(e.font),n=i.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:r,rotation:a}=this._drawArgs(n);ho(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:a,textAlign:As(e.align),textBaseline:"middle",translation:[s,o]})}}var wc={id:"title",_element:_c,start(t,e,i){!function(t,e){const i=new _c({ctx:t.ctx,options:e,chart:t});ga.configure(t,i,e),ga.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;ga.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;ga.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const kc=new WeakMap;var Mc={id:"subtitle",start(t,e,i){const n=new _c({ctx:t.ctx,options:i,chart:t});ga.configure(t,n,i),ga.addBox(t,n),kc.set(t,n)},stop(t){ga.removeBox(t,kc.get(t)),kc.delete(t)},beforeUpdate(t,e,i){const n=kc.get(t);ga.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Sc={average(t){if(!t.length)return!1;let e,i,n=new Set,s=0,o=0;for(e=0,i=t.length;et+e)/n.size,y:s/o}},nearest(t,e){if(!t.length)return!1;let i,n,s,o=e.x,r=e.y,a=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i-1?t.split("\n"):t}function Ac(t,e){const{element:i,datasetIndex:n,index:s}=e,o=t.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:t,label:r,parsed:o.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function Tc(t,e){const i=t.chart.ctx,{body:n,footer:s,title:o}=t,{boxWidth:r,boxHeight:a}=e,l=_o(e.bodyFont),c=_o(e.titleFont),h=_o(e.footerFont),d=o.length,u=s.length,f=n.length,p=xo(e.padding);let g=p.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b){g+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing}u&&(g+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let v=0;const y=function(t){m=Math.max(m,i.measureText(t).width+v)};return i.save(),i.font=c.string,jn(t.title,y),i.font=l.string,jn(t.beforeBody.concat(t.afterBody),y),v=e.displayColors?r+2+e.boxPadding:0,jn(n,t=>{jn(t.before,y),jn(t.lines,y),jn(t.after,y)}),v=0,i.font=h.string,jn(t.footer,y),i.restore(),m+=p.width,{width:m,height:g}}function Cc(t,e,i,n){const{x:s,width:o}=i,{width:r,chartArea:{left:a,right:l}}=t;let c="center";return"center"===n?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),function(t,e,i,n){const{x:s,width:o}=n,r=i.caretSize+i.caretPadding;return"left"===t&&s+o+r>e.width||"right"===t&&s-o-r<0||void 0}(c,t,e,i)&&(c="center"),c}function Pc(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Cc(t,e,i,n),yAlign:n}}function Lc(t,e,i,n){const{caretSize:s,caretPadding:o,cornerRadius:r}=t,{xAlign:a,yAlign:l}=i,c=s+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=yo(r);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const g=function(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}(e,l,c);return"center"===l?"left"===a?p+=c:"right"===a&&(p-=c):"left"===a?p-=Math.max(h,u)+s:"right"===a&&(p+=Math.max(d,f)+s),{x:vs(p,0,n.width-e.width),y:vs(g,0,n.height-e.height)}}function Dc(t,e,i){const n=xo(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function Ic(t){return Oc([],Ec(t))}function Rc(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const jc={beforeTitle:On,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex{const e={before:[],lines:[],after:[]},s=Rc(i,t);Oc(e.before,Ec(Fc(s,"beforeLabel",this,t))),Oc(e.lines,Fc(s,"label",this,t)),Oc(e.after,Ec(Fc(s,"afterLabel",this,t))),n.push(e)}),n}getAfterBody(t,e){return Ic(Fc(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=Fc(i,"beforeFooter",this,t),s=Fc(i,"footer",this,t),o=Fc(i,"afterFooter",this,t);let r=[];return r=Oc(r,Ec(n)),r=Oc(r,Ec(s)),r=Oc(r,Ec(o)),r}_createItems(t){const e=this._active,i=this.chart.data,n=[],s=[],o=[];let r,a,l=[];for(r=0,a=e.length;rt.filter(e,n,s,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),jn(l,e=>{const i=Rc(t.callbacks,e);n.push(Fc(i,"labelColor",this,e)),s.push(Fc(i,"labelPointStyle",this,e)),o.push(Fc(i,"labelTextColor",this,e))}),this.labelColors=n,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,o=[];if(n.length){const t=Sc[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Tc(this,i),r=Object.assign({},t,e),a=Pc(this.chart,i,r),l=Lc(i,r,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:h}=yo(r),{x:d,y:u}=t,{width:f,height:p}=e;let g,m,b,v,y,x;return"center"===s?(y=u+p/2,"left"===n?(g=d,m=g-o,v=y+o,x=y-o):(g=d+f,m=g+o,v=y-o,x=y+o),b=g):(m="left"===n?d+Math.max(a,c)+o:"right"===n?d+f-Math.max(l,h)-o:this.caretX,"top"===s?(v=u,y=v-o,g=m-o,b=m+o):(v=u+p,y=v+o,g=m+o,b=m-o),x=v),{x1:g,x2:m,x3:b,y1:v,y2:y,y3:x}}drawTitle(t,e,i){const n=this.title,s=n.length;let o,r,a;if(s){const l=rr(i.rtl,this.x,this.width);for(t.x=Dc(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=_o(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,a=0;a0!==t)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,uo(t,{x:e,y:f,w:l,h:a,radius:r}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),uo(t,{x:i,y:f+1,w:l-2,h:a-2,radius:r}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(e,f,l,a),t.strokeRect(e,f,l,a),t.fillStyle=o.backgroundColor,t.fillRect(i,f+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:l,boxPadding:c}=i,h=_o(i.bodyFont);let d=h.lineHeight,u=0;const f=rr(i.rtl,this.x,this.width),p=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+s},g=f.textAlign(o);let m,b,v,y,x,_,w;for(e.textAlign=o,e.textBaseline="middle",e.font=h.string,t.x=Dc(this,g,i),e.fillStyle=i.bodyColor,jn(this.beforeBody,p),u=r&&"right"!==g?"center"===o?l/2+c:l+2+c:0,y=0,_=n.length;y<_;++y){for(m=n[y],b=this.labelTextColors[y],e.fillStyle=b,jn(m.before,p),v=m.lines,r&&v.length&&(this._drawColorBox(e,t,y,f,i),d=Math.max(h.lineHeight,a)),x=0,w=v.length;x0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=Sc[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Tc(this,t),r=Object.assign({},i,this._size),a=Pc(e,t,r),l=Lc(t,r,a,e);n._to===l.x&&s._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=xo(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,n,e),ar(t,e.textDirection),s.y+=o.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),lr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),s=!Fn(i,n),o=this._positionChanged(n,e);(s||o)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,s=this._active||[],o=this._getActiveElements(t,s,e,i),r=this._positionChanged(o,t),a=e||!Fn(o,s)||r;return a&&(this._active=o,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));const o=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,o=Sc[s.position].call(this,t,e);return!1!==o&&(i!==o.x||n!==o.y)}}var Nc={id:"tooltip",_element:zc,positioners:Sc,afterInit(t,e,i){i&&(t.tooltip=new zc({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:jc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Bc=Object.freeze({__proto__:null,Colors:Jl,Decimation:Ql,Filler:mc,Legend:xc,SubTitle:Mc,Title:wc,Tooltip:Nc});function Wc(t,e,i,n){const s=t.indexOf(e);if(-1===s)return((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n);return s!==t.lastIndexOf(e)?i:s}function Vc(t){const e=this.getLabels();return t>=0&&tf&&(M=as(k*M/f/u)*u),An(a)||(x=Math.pow(10,a),M=Math.ceil(M*x)/x),"ticks"===n?(_=Math.floor(p/M)*M,w=Math.ceil(g/M)*M):(_=p,w=g),m&&b&&s&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((r-o)/s,M/1e3)?(k=Math.round(Math.min((r-o)/M,c)),M=(r-o)/k,_=o,w=r):v?(_=m?o:_,w=b?r:w,k=l-1,M=(w-_)/k):(k=(w-_)/M,k=rs(k,Math.round(k),M/1e3)?Math.round(k):Math.ceil(k));const S=Math.max(us(M),us(_));x=Math.pow(10,An(a)?S:a),_=Math.round(_*x)/x,w=Math.round(w*x)/x;let O=0;for(m&&(d&&_!==o?(i.push({value:o}),_r)break;i.push({value:t})}return b&&d&&w!==r?i.length&&rs(i[i.length-1].value,r,$c(r,y,t))?i[i.length-1].value=r:i.push({value:r}):b&&w!==r||i.push({value:w}),i}function $c(t,e,{horizontal:i,minRotation:n}){const s=hs(n),o=(i?Math.sin(s):Math.cos(s))||.001,r=.75*e*(""+t).length;return Math.min(e/o,r)}class Uc extends Ha{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return An(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:s}=this;const o=t=>n=e?n:t,r=t=>s=i?s:t;if(t){const t=os(n),e=os(s);t<0&&e<0?r(0):t>0&&e>0&&o(0)}if(n===s){let e=0===s?1:Math.abs(.05*s);r(s+e),t||o(n-e)}this.min=n,this.max=s}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=Hc({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&cs(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Vs(t,this.chart.options.locale,this.options.ticks.format)}}class qc extends Uc{static id="linear";static defaults={ticks:{callback:$s.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pn(t)?t:0,this.max=Pn(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=hs(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,s.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Yc=t=>Math.floor(ss(t)),Xc=(t,e)=>Math.pow(10,Yc(t)+e);function Jc(t){return 1===t/Math.pow(10,Yc(t))}function Gc(t,e,i){const n=Math.pow(10,i),s=Math.floor(t/n);return Math.ceil(e/n)-s}function Kc(t,{min:e,max:i}){e=Ln(t.min,e);const n=[],s=Yc(e);let o=function(t,e){let i=Yc(e-t);for(;Gc(t,e,i)>10;)i++;for(;Gc(t,e,i)<10;)i--;return Math.min(i,Yc(t))}(e,i),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((e-l)*r)/r,h=Math.floor((e-l)/a/10)*a*10;let d=Math.floor((c-h)/Math.pow(10,o)),u=Ln(t.min,Math.round((l+h+d*Math.pow(10,o))*r)/r);for(;u=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),u=Math.round((l+h+d*Math.pow(10,o))*r)/r;const f=Ln(t.max,u);return n.push({value:f,major:Jc(f),significand:d}),n}class Qc extends Ha{static id="logarithmic";static defaults={ticks:{callback:$s.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Uc.prototype.parse.apply(this,[t,e]);if(0!==i)return Pn(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pn(t)?Math.max(0,t):null,this.max=Pn(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Pn(this._userMin)&&(this.min=t===Xc(this.min,0)?Xc(this.min,-1):Xc(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const s=e=>i=t?i:e,o=t=>n=e?n:t;i===n&&(i<=0?(s(1),o(10)):(s(Xc(i,-1)),o(Xc(n,1)))),i<=0&&s(Xc(n,-1)),n<=0&&o(Xc(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=Kc({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&cs(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":Vs(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ss(t),this._valueRange=ss(this.max)-ss(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ss(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Zc(t){const e=t.ticks;if(e.display&&t.display){const t=xo(e.backdropPadding);return Dn(e.font&&e.font.size,Gs.font.size)+t.height}return 0}function th(t,e,i){return i=Tn(i)?i:[i],{w:Qs(t,e.string,i),h:i.length*e.lineHeight}}function eh(t,e,i,n,s){return t===n||t===s?{start:e-i/2,end:e+i/2}:ts?{start:e-i,end:e}:{start:e,end:e+i}}function ih(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],s=[],o=t._pointLabels.length,r=t.options.pointLabels,a=r.centerPointLabels?Gn/o:0;for(let l=0;le.r&&(a=(n.end-e.r)/o,t.r=Math.max(t.r,e.r+a)),s.starte.b&&(l=(s.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}function sh(t,e,i){const n=t.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=i,l=t.getPointPosition(e,n+s+r,o),c=Math.round(ds(ms(l.angle+es))),h=function(t,e,i){90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e);return t}(l.y,a.h,c),d=function(t){if(0===t||180===t)return"center";if(t<180)return"left";return"right"}(c),u=function(t,e,i){"right"===i?t-=e:"center"===i&&(t-=e/2);return t}(l.x,a.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:u,top:h,right:u+a.w,bottom:h+a.h}}function oh(t,e){if(!e)return!0;const{left:i,top:n,right:s,bottom:o}=t;return!(no({x:i,y:n},e)||no({x:i,y:o},e)||no({x:s,y:n},e)||no({x:s,y:o},e))}function rh(t,e,i){const{left:n,top:s,right:o,bottom:r}=i,{backdropColor:a}=e;if(!An(a)){const i=yo(e.borderRadius),l=xo(e.backdropPadding);t.fillStyle=a;const c=n-l.left,h=s-l.top,d=o-n+l.width,u=r-s+l.height;Object.values(i).some(t=>0!==t)?(t.beginPath(),uo(t,{x:c,y:h,w:d,h:u,radius:i}),t.fill()):t.fillRect(c,h,d,u)}}function ah(t,e,i,n){const{ctx:s}=t;if(i)s.arc(t.xCenter,t.yCenter,e,0,Kn);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let o=1;ot,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=xo(Zc(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Pn(t)&&!isNaN(t)?t:0,this.max=Pn(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Zc(this.options))}generateTickLabels(t){Uc.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{const i=Rn(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?ih(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){return ms(t*(Kn/(this._pointLabels.length||1))+hs(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(An(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(An(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t=0;s--){const e=t._pointLabelItems[s];if(!e.visible)continue;const o=n.setContext(t.getPointLabelContext(s));rh(i,o,e);const r=_o(o.font),{x:a,y:l,textAlign:c}=e;ho(i,t._pointLabels[s],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}(this,o),n.display&&this.ticks.forEach((t,e)=>{if(0!==e||0===e&&this.min<0){a=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),r=n.setContext(i),l=s.setContext(i);!function(t,e,i,n,s){const o=t.ctx,r=e.circular,{color:a,lineWidth:l}=e;!r&&!n||!a||!l||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),ah(t,i,r,n),o.closePath(),o.stroke(),o.restore())}(this,r,a,o,l)}}),i.display){for(t.save(),r=o-1;r>=0;r--){const n=i.setContext(this.getPointLabelContext(r)),{color:s,lineWidth:o}=n;o&&s&&(t.lineWidth=o,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,a=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),l=this.getPointPosition(r,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,r)=>{if(0===r&&this.min>=0&&!e.reverse)return;const a=i.setContext(this.getContext(r)),l=_o(a.font);if(s=this.getDistanceFromCenterForValue(this.ticks[r].value),a.showLabelBackdrop){t.font=l.string,o=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=xo(a.backdropPadding);t.fillRect(-o/2-e.left,-s-l.size/2-e.top,o+e.width,l.size+e.height)}ho(t,n.label,0,-s,l,{color:a.color,strokeColor:a.textStrokeColor,strokeWidth:a.textStrokeWidth})}),t.restore()}drawTitle(){}}const ch={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},hh=Object.keys(ch);function dh(t,e){return t-e}function uh(t,e){if(An(e))return null;const i=t._adapter,{parser:n,round:s,isoWeekday:o}=t._parseOpts;let r=e;return"function"==typeof n&&(r=n(r)),Pn(r)||(r="string"==typeof n?i.parse(r,n):i.parse(r)),null===r?null:(s&&(r="week"!==s||!ls(o)&&!0!==o?i.startOf(r,s):i.startOf(r,"isoWeek",o)),+r)}function fh(t,e,i,n){const s=hh.length;for(let o=hh.indexOf(t);o=e?i[n]:i[s]]=!0}}else t[e]=!0}function gh(t,e,i){const n=[],s={},o=e.length;let r,a;for(r=0;r=0&&(e[l].major=!0);return e}(t,n,s,i):n}class mh extends Ha{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),n=this._adapter=new Jr(t.adapters.date);n.init(e),Vn(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:uh(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:s,minDefined:o,maxDefined:r}=this.getUserBounds();function a(t){o||isNaN(t.min)||(n=Math.min(n,t.min)),r||isNaN(t.max)||(s=Math.max(s,t.max))}o&&r||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=Pn(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),s=Pn(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,s-1),this.max=Math.max(n+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const s=this.min,o=function(t,e,i){let n=0,s=t.length;for(;nn&&t[s-1]>i;)s--;return n>0||s=hh.indexOf(i);o--){const i=hh[o];if(ch[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return hh[i?hh.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=hh.indexOf(t)+1,i=hh.length;e+t.value))}initOffsets(t=[]){let e,i,n=0,s=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),s=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=vs(n,0,o),s=vs(s,0,o),this._offsets={start:n,end:s,factor:1/(n+1+s)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,s=n.time,o=s.unit||fh(s.minUnit,e,i,this._getLabelCapacity(e)),r=Dn(n.ticks.stepSize,1),a="week"===o&&s.isoWeekday,l=ls(a)||!0===a,c={};let h,d,u=e;if(l&&(u=+t.startOf(u,"isoWeek",a)),u=+t.startOf(u,l?"day":o),t.diff(i,e,o)>1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+o);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;h+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,n=this._unit,s=e||i[n];return this._adapter.format(t,s)}_tickFormatFunction(t,e,i,n){const s=this.options,o=s.ticks.callback;if(o)return Rn(o,[t,e,i],this);const r=s.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&r[a],h=l&&r[l],d=i[e],u=l&&h&&d&&d.major;return this._adapter.format(t,n||(u?h:c))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=_s(t,"pos",e)),({pos:n,time:o}=t[a]),({pos:s,time:r}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=_s(t,"time",e)),({time:n,pos:o}=t[a]),({time:s,pos:r}=t[l]));const c=s-n;return c?o+(r-o)*(e-n)/c:o}var vh=Object.freeze({__proto__:null,CategoryScale:class extends Ha{static id="category";static defaults={ticks:{callback:Vc}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(An(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:vs(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:Wc(i,t,Dn(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){return Vc.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:qc,LogarithmicScale:Qc,RadialLinearScale:lh,TimeScale:mh,TimeSeriesScale:class extends mh{static id="timeseries";static defaults=mh.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=bh(e,this.min),this._tableRange=bh(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let o,r,a,l,c;for(o=0,r=t.length;o=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,r=n.length;ot-e)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(bh(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return bh(this._table,i*this._tableRange+this._minPos,!0)}}});const yh=[qr,Vl,Bc,vh];xl.register(...yh);const xh=xl;var _h=i(998),wh=i.n(_h);const kh={data:{},nonce:"",context:null,init(t){this.context=t;const e=t.querySelectorAll("[data-progress]"),i=t.querySelectorAll("[data-chart]");[...e].forEach(t=>{t.dataset.url&&(this.data[t.dataset.url]||(this.data[t.dataset.url]={items:[],poll:null}),this.data[t.dataset.url].items.push(t)),"line"===t.dataset.progress?this.line(t):"circle"===t.dataset.progress&&this.circle(t),this.nonce||(this.nonce=t.dataset?.nonce)});for(const t in this.data)this.getValues(t);[...i].forEach(t=>{const e={labels:JSON.parse(t.dataset.dates),datasets:[{backgroundColor:t.dataset.color,borderColor:t.dataset.color,data:JSON.parse(t.dataset.data),cubicInterpolationMode:"monotone"}]};new xh(t,{type:"line",data:e,options:{responsive:!0,radius:0,interaction:{intersect:!1},plugins:{legend:{display:!1}},scales:{y:{suggestedMin:0,ticks:{color:"#999999",callback:(t,e)=>wh()(t,{decimals:2,scale:"SI"})},grid:{color:"#d3dce3"}},x:{ticks:{color:"#999999"},grid:{color:"#d3dce3"}}}}})})},line(t){new(Ui().Line)(t,{strokeWidth:2,easing:"easeInOut",duration:1400,color:t.dataset.color,trailColor:"#d3dce3",trailWidth:2,svgStyle:{width:"100%",height:"100%",display:"block"}}).animate(t.dataset.value/100)},circle(t){t.dataset.basetext=t.dataset.text,t.dataset.text="";const e=t.dataset.value,i=this;if(t.bar=new(Ui().Circle)(t,{strokeWidth:3,easing:"easeInOut",duration:1400,color:t.dataset.color,trailColor:"#d3dce3",trailWidth:3,svgStyle:null,text:{autoStyleContainer:!1,style:{color:"#222222"}},step(e,n){const s=Math.floor(100*n.value());i.setText(n,parseFloat(s),t.dataset.text)}}),!t.dataset.url){const i=e/100;t.bar.animate(i)}},getValues(t){this.data[t].poll&&(clearTimeout(this.data[t].poll),this.data[t].poll=null),Pt({path:t,method:"GET",headers:{"X-WP-Nonce":this.nonce}}).then(e=>{this.data[t].items.forEach(i=>{void 0!==e[i.dataset.basetext]?i.dataset.text=e[i.dataset.basetext]:i.dataset.text=i.dataset.basetext,i.bar.animate(e[i.dataset.value]),i.dataset.poll&&!this.data[t].poll&&(this.data[t].poll=setTimeout(()=>{this.getValues(t)},1e4))});for(const t in e){const i=this.context.querySelectorAll(`[data-key="${t}"]`),n=this.context.querySelectorAll(`[data-text="${t}"]`);i.forEach(i=>{i.dataset.value=e[t],i.dispatchEvent(new Event("focus"))}),n.forEach(i=>{i.innerText=e[t],i.classList.contains("cld-toggle")&&(e[t]?i.classList.remove("hidden"):i.classList.add("hidden"))})}})},setText(t,e,i){if(!t)return;const n=document.createElement("span"),s=document.createElement("h2"),o=document.createTextNode(i);s.innerText=e+"%",n.appendChild(s),n.appendChild(o),t.setText(n)}},Mh=kh,Sh={key:"_cld_pending_state",data:null,pending:null,changed:!1,previous:{},init(){this.data=cldData.stateData?cldData.stateData:{};let t=localStorage.getItem(this.key);t&&(t=JSON.parse(t),this.data={...this.data,...t},this.sendStates()),this.previous=JSON.stringify(this.data)},_update(){this.pending&&(clearTimeout(this.pending),localStorage.removeItem(this.key)),this.previous!==JSON.stringify(this.data)&&(this.pending=setTimeout(()=>this.sendStates(),2e3),localStorage.setItem(this.key,JSON.stringify(this.data)))},set(t,e){this.data[t]&&this.data[t]===e||(this.data[t]=e,this._update())},get(t){let e=null;return this.data[t]&&(e=this.data[t]),e},sendStates(){fetch(cldData.stateURL,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":cldData.stateNonce},body:JSON.stringify(this.data)}).then(t=>t.json()).then(t=>{t.success&&(this.previous=JSON.stringify(t.state),localStorage.removeItem(this.key))})}},Oh={init(t){[...t.querySelectorAll("[data-remove]")].forEach(t=>{t.addEventListener("click",e=>{if(t.dataset.message&&!confirm(t.dataset.message))return;const i=document.getElementById(t.dataset.remove);i.parentNode.removeChild(i)})})}},Eh={values:{},inputs:{},context:null,init(t){this.context=t;t.querySelectorAll("[data-tags]").forEach(t=>this.bind(t))},bind(t){t.innerText=t.dataset.placeholder;const e=t.dataset.tags,i=document.getElementById(e),n=this.context.querySelectorAll(`[data-tags-delete="${e}"]`);this.values[e]=JSON.parse(i.value),this.inputs[e]=i,t.boundInput=e,t.boundDisplay=this.context.querySelector(`[data-tags-display="${e}"]`),t.boundDisplay.addEventListener("click",e=>{t.focus()}),t.addEventListener("focus",e=>{t.innerText=null}),t.addEventListener("blur",e=>{3{if("Tab"===i.key)3{"Comma"!==e.code&&"Enter"!==e.code&&"Tab"!==e.code&&"Space"!==e.code||(e.preventDefault(),3{t.parentNode.control=t,t.parentNode.style.width=getComputedStyle(t.parentNode).width,t.addEventListener("click",e=>{e.stopPropagation(),this.deleteTag(t)})})},deleteTag(t){const e=t.parentNode,i=e.dataset.inputId,n=this.values[i].indexOf(e.dataset.value);0<=n&&this.values[i].splice(n,1),e.style.width=0,e.style.opacity=0,e.style.padding=0,e.style.margin=0,setTimeout(()=>{e.parentNode.removeChild(e)},500),this.updateInput(i)},captureTag(t,e){if(this[t.dataset.format]&&"string"!=typeof(e=this[t.dataset.format](e)))return t.classList.add("pulse"),void setTimeout(()=>{t.classList.remove("pulse")},1e3);if(!this.validateUnique(t.boundDisplay,e)){const i=this.createTag(e);i.dataset.inputId=t.boundInput,this.values[t.boundInput].push(e),t.innerText=null,t.boundDisplay.insertBefore(i,t),i.style.width=getComputedStyle(i).width,i.style.opacity=1,this.updateInput(t.boundInput)}},createTag(t){const e=document.createElement("span"),i=document.createElement("span"),n=document.createElement("span");return e.classList.add("cld-input-tags-item"),i.classList.add("cld-input-tags-item-text"),n.className="cld-input-tags-item-delete dashicons dashicons-no-alt",n.addEventListener("click",()=>this.deleteTag(n)),i.innerText=t,e.appendChild(i),e.appendChild(n),e.dataset.value=t,e.style.opacity=0,e.control=n,e},validateUnique(t,e){const i=t.querySelector(`[data-value="${e}"]`);let n=!1;return i&&(i.classList.remove("pulse"),i.classList.add("pulse"),setTimeout(()=>{i.classList.remove("pulse")},500),n=!0),n},updateInput(t){this.inputs[t].value=JSON.stringify(this.values[t])},host(t){!1===/^(?:http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)/.test(t)&&(t="https://"+t);let e="";try{e=new URL(t)}catch(t){return t}return decodeURIComponent(e.host)}},Ah=Eh,Th={suffixInputs:null,init(t){this.suffixInputs=t.querySelectorAll("[data-suffix]"),[...this.suffixInputs].forEach(t=>this.bindInput(t))},bindInput(t){const e=document.getElementById(t.dataset.suffix),i=e.dataset.template.split("@value");this.setSuffix(e,i,t.value),t.addEventListener("change",()=>this.setSuffix(e,i,t.value)),t.addEventListener("input",()=>this.setSuffix(e,i,t.value))},setSuffix(t,e,i){t.innerHTML="",t.classList.add("hidden"),-1===["none","off",""].indexOf(i)&&t.classList.remove("hidden");const n=document.createTextNode(e.join(i));t.appendChild(n)}},Ch={wrappers:null,frame:null,error:'data:image/svg+xml;utf8,%26%23x26A0%3B︎',init(t){this.wrappers=t.querySelectorAll(".cld-size-items"),this.wrappers.forEach(t=>{const e=t.querySelectorAll(".cld-size-selector-item");e.forEach(i=>{i.addEventListener("click",()=>{e.forEach(t=>{delete t.dataset.selected}),i.dataset.selected=!0,this.switchSizeContent(t,i.dataset.size)})});const i=t.querySelector(".cld-size-selector-item[data-selected]");i&&this.switchSizeContent(t,i.dataset.size)})},switchSizeContent(t,e){t.querySelectorAll(".cld-size-content").forEach(t=>{t.style.display="none"});const i=t.querySelector(`.cld-size-content[data-size="${e}"]`);i&&(i.style.display="block",this.buildImages(t,i))},buildImages(t,e){const i=t.dataset.base,n=e.querySelector(".regular-text"),s=e.querySelector(".disable-toggle");if(!n||!s)return;const o=e.querySelectorAll("img"),r=n.value.length?n.value.replace(" ",""):n.placeholder;if(o.forEach(t=>{const e=t.dataset.size,o=t.dataset.file;s.checked?(n.disabled=!0,t.src=`${i}/${e}/${o}`):(n.disabled=!1,t.src=`${i}/${e},${r}/${o}`),t.bound||(t.addEventListener("error",()=>{t.src=this.error}),t.bound=!0)}),!n.bound){let i=null;n.addEventListener("input",()=>{i&&clearTimeout(i),i=setTimeout(()=>{this.buildImages(t,e)},1e3)}),n.bound=!0}s.bound||(s.addEventListener("change",()=>{this.buildImages(t,e)}),s.bound=!0);const a=e.querySelector(".clear-crop-input");a&&!a.bound&&(a.addEventListener("click",()=>{n.value="",this.buildImages(t,e)}),a.bound=!0)}},Ph={bindings:{},parent_check_data:{},check_parents:{},_init(t){const e=t.querySelectorAll("[data-condition]"),i=t.querySelectorAll("[data-toggle]"),n=t.querySelectorAll("[data-for]"),s=t.querySelectorAll("[data-tooltip]"),o=t.querySelectorAll("[data-bind-trigger]"),r=t.querySelectorAll("[data-main]"),a=t.querySelectorAll("[data-file]"),l=t.querySelectorAll("[data-auto-suffix]"),c=t.querySelectorAll("[data-confirm]"),h={};Sh.init(),Hi.bind(r),l.forEach(t=>this._autoSuffix(t)),o.forEach(t=>this._trigger(t)),i.forEach(t=>this._toggle(t)),e.forEach(t=>this._bind(t)),n.forEach(t=>this._alias(t)),a.forEach(t=>this._files(t,h)),Ni(s,{theme:"cloudinary",arrow:!1,placement:"bottom-start",aria:{content:"auto",expanded:"auto"},content:t=>document.getElementById(t.dataset.tooltip).innerHTML}),[...o].forEach(t=>{t.dispatchEvent(new Event("input"))}),c.forEach(t=>{t.addEventListener("click",e=>{confirm(t.dataset.confirm)||(e.preventDefault(),e.stopPropagation())})}),Mh.init(t),Oh.init(t),Ah.init(t),Th.init(t),Ch.init(t)},_autoSuffix(t){const e=t.dataset.autoSuffix;let i="";const n=[...e.split(";")].map(t=>0===t.indexOf("*")?(i=t.replace("*",""),i):t);t.addEventListener("change",()=>{const e=t.value.replace(" ",""),s=e.replace(/[^0-9]/g,""),o=e.replace(/[0-9]/g,"").toLowerCase();s&&(-1===n.indexOf(o)?t.value=s+i:t.value=s+o)}),t.dispatchEvent(new Event("change"))},_files(t,e){const i=t.dataset.parent;i&&(this.check_parents[i]=document.getElementById(i),this.parent_check_data[i]||(this.parent_check_data[i]=this.check_parents[i].value?JSON.parse(this.check_parents[i].value):[]),t.addEventListener("change",()=>{const n=this.parent_check_data[i].indexOf(t.value);t.checked?this.parent_check_data[i].push(t.value):this.parent_check_data[i].splice(n,1),e[i]&&clearTimeout(e[i]),e[i]=setTimeout(()=>{this._compileParent(i)},10)}))},_compileParent(t){this.check_parents[t].value=JSON.stringify(this.parent_check_data[t]),this.check_parents[t].dispatchEvent(new Event("change"))},_bind(t){t.condition=JSON.parse(t.dataset.condition);for(const e in t.condition)this.bindings[e]&&this.bindings[e].elements.push(t)},_trigger(t){const e=t.dataset.bindTrigger,i=this;i.bindings[e]={input:t,value:t.value,checked:!0,elements:[]},t.addEventListener("change",function(e){t.dispatchEvent(new Event("input"))}),t.addEventListener("input",function(){if(i.bindings[e].value=t.value,"checkbox"===t.type&&(i.bindings[e].checked=t.checked),"radio"!==t.type||!1!==t.checked)for(const n in i.bindings[e].elements)i.toggle(i.bindings[e].elements[n],t)})},_alias(t){t.addEventListener("click",function(){document.getElementById(t.dataset.for).dispatchEvent(new Event("click"))})},_toggle(t){const e=this,i=document.querySelector('[data-wrap="'+t.dataset.toggle+'"]');if(!i)return;const n=Sh.get(t.id);t.addEventListener("click",function(n){n.stopPropagation();const s=i.classList.contains("open")?"closed":"open";e.toggle(i,t,s)}),n!==t.dataset.state&&this.toggle(i,t,n)},toggle(t,e,i){if(!i){i="open";for(const e in t.condition){let n=this.bindings[e].value;const s=t.condition[e];"boolean"==typeof s&&(n=this.bindings[e].checked),s!==n&&(i="closed")}}"closed"===i?this.close(t,e):this.open(t,e),Sh.set(e.id,i)},open(t,e){const i=t.getElementsByClassName("cld-ui-input");t.classList.remove("closed"),t.classList.add("open"),e&&e.classList.contains("dashicons")&&(e.classList.remove("dashicons-arrow-down-alt2"),e.classList.add("dashicons-arrow-up-alt2")),[...i].forEach(function(t){t.dataset.disabled=!1})},close(t,e){const i=t.getElementsByClassName("cld-ui-input");t.classList.remove("open"),t.classList.add("closed"),e&&e.classList.contains("dashicons")&&(e.classList.remove("dashicons-arrow-up-alt2"),e.classList.add("dashicons-arrow-down-alt2")),[...i].forEach(function(t){t.dataset.disabled=!0})}},Lh=document.querySelectorAll(".cld-settings,.cld-meta-box");Lh.length&&Lh.forEach(t=>{t&&window.addEventListener("load",Ph._init(t))});const Dh={config:null,init(){this.config||"undefined"!=typeof cldData&&cldData.analytics&&cldData.analytics.enabled&&(this.config=cldData.analytics,Pt.use(Pt.createNonceMiddleware(this.config.nonce)))},track(t,e={},i="activation_funnel",n=null){if(this.config||this.init(),this.config&&this.config.enabled&&t)try{Pt({url:this.config.endpoint,method:"POST",data:{event_name:t,event_category:i,funnel_step:n,params:e}}).catch(()=>{})}catch(t){}},trackReliable(t,e={},i="activation_funnel"){if(this.config||this.init(),this.config&&this.config.enabled&&t)if(navigator.sendBeacon)try{const n=this.config.endpoint.includes("?")?"&":"?",s=this.config.endpoint+n+"_wpnonce="+encodeURIComponent(this.config.nonce),o=new Blob([JSON.stringify({event_name:t,event_category:i,funnel_step:null,params:e})],{type:"application/json"});navigator.sendBeacon(s,o)}catch(t){}else this.track(t,e,i)}};window.addEventListener("load",()=>Dh.init());const Ih=Dh,Rh={storageKey:"_cld_wizard",testing:null,connectAttempts:0,startedEntry:!1,startedTracked:!1,next:document.querySelector('[data-navigate="next"]'),back:document.querySelector('[data-navigate="back"]'),lock:document.getElementById("pad-lock"),lockIcon:document.getElementById("lock-icon"),options:document.querySelectorAll('.cld-ui-input[type="checkbox"]'),settings:document.getElementById("optimize"),tabBar:document.getElementById("wizard-tabs"),tracking:document.getElementById("tracking"),complete:document.getElementById("complete-wizard"),tabs:{"tab-1":document.getElementById("tab-icon-1"),"tab-2":document.getElementById("tab-icon-2"),"tab-3":document.getElementById("tab-icon-3")},content:{"tab-1":document.getElementById("tab-1"),"tab-2":document.getElementById("tab-2"),"tab-3":document.getElementById("tab-3"),"tab-4":document.getElementById("tab-4")},connection:{error:document.getElementById("connection-error"),success:document.getElementById("connection-success"),working:document.getElementById("connection-working")},debounceConnect:null,updateConnection:document.getElementById("update-connection"),cancelUpdateConnection:document.getElementById("cancel-update-connection"),config:{},didSave:!1,init(){if(!cldData.wizard)return;this.config=cldData.wizard.config,window.localStorage.getItem(this.storageKey)&&(this.config=JSON.parse(window.localStorage.getItem(this.storageKey))),document.location.hash.length&&this.hashChange(),Pt.use(Pt.createNonceMiddleware(cldData.wizard.saveNonce));const t=document.querySelectorAll("[data-navigate]"),e=document.getElementById("connect.cloudinary_url");this.updateConnection.addEventListener("click",()=>{this.lockNext(),e.parentNode.classList.remove("hidden"),this.cancelUpdateConnection.classList.remove("hidden"),this.updateConnection.classList.add("hidden")}),this.cancelUpdateConnection.addEventListener("click",()=>{this.unlockNext(),e.parentNode.classList.add("hidden"),this.cancelUpdateConnection.classList.add("hidden"),this.updateConnection.classList.remove("hidden"),this.config.cldString=!0,e.value="",this.connection.error.classList.remove("active"),this.connection.success.classList.add("active")}),[...t].forEach(t=>{t.addEventListener("click",()=>{this.navigate(t.dataset.navigate)})}),this.lock.addEventListener("click",()=>{this.lockIcon.classList.toggle("dashicons-unlock"),this.settings.classList.toggle("disabled"),this.options.forEach(t=>{t.disabled=t.disabled?"":"disabled"})}),e.addEventListener("input",t=>{this.lockNext(),this.startedEntry||(this.startedEntry=!0,Ih.track("credentials_entry_started",{},"activation_funnel",3));const i=e.value.replace("CLOUDINARY_URL=","");this.connection.error.classList.remove("active"),this.connection.success.classList.remove("active"),this.connection.working.classList.remove("active"),i.length&&(this.testing=i,this.debounceConnect&&clearTimeout(this.debounceConnect),this.debounceConnect=setTimeout(()=>{const t=this.evaluateConnectionString(i);Ih.track("credentials_format_validated",{format_valid:t,invalid_reason:t?"":this.invalidReason(i)},"activation_funnel",3),t?(this.connection.working.classList.add("active"),this.testConnection(i)):this.connection.error.classList.add("active")},500))}),this.config.cldString&&(e.parentNode.classList.add("hidden"),this.updateConnection.classList.remove("hidden"));const i=document.querySelector('a[href="https://cloudinary.com/signup"]');i&&i.addEventListener("click",()=>{Ih.track("wizard_signup_clicked",{},"activation_funnel",2)}),this.complete&&this.complete.addEventListener("click",()=>{Ih.track("wizard_dashboard_clicked",{},"activation_funnel",7)}),this.getTab(this.config.tab),this.initFeatures(),window.addEventListener("hashchange",t=>{this.hashChange()})},hashChange(){const t=parseInt(document.location.hash.replace("#",""));t&&0t&&this.getTab(t)},initFeatures(){const t=(t,e)=>{Ih.track("wizard_setting_toggled",{setting_key:t,enabled:e},"activation_funnel",4)},e=document.getElementById("media_library");e.checked=this.config.mediaLibrary,e.addEventListener("change",()=>{this.setConfig("mediaLibrary",e.checked),t("media_library",e.checked)});const i=document.getElementById("non_media");i.checked=this.config.nonMedia,i.addEventListener("change",()=>{this.setConfig("nonMedia",i.checked),t("non_media",i.checked)});const n=document.getElementById("advanced");n.checked=this.config.advanced,n.addEventListener("change",()=>{this.setConfig("advanced",n.checked),t("advanced",n.checked)})},getCurrent(){return this.content[`tab-${this.config.tab}`]},hideTabs(){Object.keys(this.content).forEach(t=>{this.hide(this.content[t])})},completeTab(t){this.incompleteTab(),Object.keys(this.tabs).forEach(e=>{const i=parseInt(this.tabs[e].dataset.tab);t>i?this.tabs[e].classList.add("complete"):t===i&&this.tabs[e].classList.add("active")})},incompleteTab(t){Object.keys(this.tabs).forEach(t=>{this.tabs[t].classList.remove("complete","active")})},getCurrentTab(){return this.tabs[`tab-icon-${this.config.tab}`]},getTab(t){if(4===t&&window.localStorage.getItem(this.storageKey)&&!this.didSave)return void this.saveConfig();const e=this.getCurrent(),i=document.getElementById(`tab-${t}`);switch(this.hideTabs(),this.completeTab(t),this.hide(document.getElementById(`tab-${this.config.tab}`)),e.classList.remove("active"),this.show(i),this.show(this.next),this.hide(this.lock),t){case 1:this.hide(this.back),this.unlockNext(),this.startedTracked||(this.startedTracked=!0,this.config.wizardStartedAt||this.setConfig("wizardStartedAt",Date.now()),Ih.track("wizard_started",{entry_point:this.getEntryPoint()},"activation_funnel",2));break;case 2:Ih.track("wizard_connect_viewed",{},"activation_funnel",3),this.show(this.back),this.config.cldString?this.showSuccess():(this.lockNext(),setTimeout(()=>{document.getElementById("connect.cloudinary_url").focus()},0)),this.updateConnection.classList.contains("hidden")&&this.lockNext();break;case 3:if(!this.config.cldString)return void(document.location.hash="1");Ih.track("wizard_settings_viewed",{},"activation_funnel",4),this.show(this.lock),this.show(this.back);break;case 4:if(!this.config.cldString)return void(document.location.hash="1");Ih.track("wizard_completed",{time_to_complete_sec:this.timeToCompleteSec()},"activation_funnel",6),this.hide(this.tabBar),this.hide(this.next),this.hide(this.back)}this.setConfig("tab",t)},navigate(t){"next"===t?this.navigateNext():"back"===t&&this.navigateBack()},navigateBack(){document.location.hash=this.config.tab-1},navigateNext(){document.location.hash=this.config.tab+1},showError(){this.connection.error.classList.add("active"),this.connection.success.classList.remove("active")},showSuccess(){this.connection.error.classList.remove("active"),this.connection.success.classList.add("active")},show(t){t.classList.remove("hidden"),t.style.display=""},hide(t){t.classList.add("hidden"),t.style.display="none"},lockNext(){this.next.disabled="disabled"},unlockNext(){this.next.disabled=""},evaluateConnectionString:t=>new RegExp(/^(?:CLOUDINARY_URL=)?(cloudinary:\/\/){1}(\d*)[:]{1}([^@]*)[@]{1}([^@]*)$/gim).test(t),invalidReason(t){const e=t.replace("CLOUDINARY_URL=","");if(0!==e.indexOf("cloudinary://"))return"missing_scheme";if(-1===e.indexOf("@"))return"missing_cloud_name";const i=e.replace("cloudinary://","").split("@")[0];return-1===i.indexOf(":")?"missing_secret":/^\d+$/.test(i.split(":")[0])?"invalid_format":"invalid_api_key"},getEntryPoint:()=>-1!==document.referrer.indexOf("plugins.php")?"auto_redirect":"menu",timeToCompleteSec(){const t=this.config.wizardStartedAt;return t?Math.max(0,Math.round((Date.now()-t)/1e3)):null},testConnection(t){this.connectAttempts+=1,Ih.track("connection_test_started",{attempt_number:this.connectAttempts},"activation_funnel",3),Pt({path:cldData.wizard.testURL,data:{cloudinary_url:t,attempt_number:this.connectAttempts},method:"POST"}).then(e=>{e.url===this.testing&&(this.connection.working.classList.remove("active"),"connection_error"===e.type?this.showError():"connection_success"===e.type&&(this.showSuccess(),this.unlockNext(),this.setConfig("cldString",t)))})},setConfig(t,e){this.config[t]=e,window.localStorage.setItem(this.storageKey,JSON.stringify(this.config))},saveConfig(){this.lockNext(),this.next.innerText=$("Setting up Cloudinary","cloudinary"),this.didSave=!0,Pt({path:cldData.wizard.saveURL,data:this.config,method:"POST"}).then(t=>{this.next.innerText=$("Next","cloudinary"),this.unlockNext(),this.getTab(4),window.localStorage.removeItem(this.storageKey)}).fail(t=>{this.didSave=!1})}};window.addEventListener("load",()=>Rh.init());const jh={select:document.getElementById("connect.offload"),tooltip:null,descriptions:{},change(){[...this.descriptions].forEach(t=>{t.classList.remove("selected")}),this.tooltip.querySelector("."+this.select.value).classList.add("selected")},addEventListener(){this.select.addEventListener("change",this.change.bind(this))},_init(){this.select&&(this.addEventListener(),this.tooltip=this.select.parentNode.querySelector(".cld-tooltip"),this.descriptions=this.tooltip.querySelectorAll("li"),this.change())}};window.addEventListener("load",()=>jh._init());const Fh={pageReloader:document.getElementById("page-reloader"),init(){if(!cldData.extensions)return;Pt.use(Pt.createNonceMiddleware(cldData.extensions.nonce));[...document.querySelectorAll("[data-extension]")].forEach(t=>{t.addEventListener("change",e=>{t.spinner||(t.spinner=this.createSpinner(),t.parentNode.appendChild(t.spinner)),t.debounce&&clearTimeout(t.debounce),t.debounce=setTimeout(()=>{this.toggleExtension(t),t.debounce=null},1e3)})})},toggleExtension(t){const e=t.dataset.extension,i=t.checked;Ih.track("extension_toggled",{extension_id:e,enabled:i},"features"),Pt({path:cldData.extensions.url,data:{extension:e,enabled:i},method:"POST"}).then(e=>{t.spinner&&(t.parentNode.removeChild(t.spinner),delete t.spinner),Object.keys(e).forEach(t=>{document.querySelectorAll(`[data-text="${t}"]`).forEach(i=>{i.innerText=e[t]})}),this.pageReloader.style.display="block"})},createSpinner(){const t=document.createElement("span");return t.classList.add("spinner"),t.classList.add("cld-extension-spinner"),t}};window.addEventListener("load",()=>Fh.init());const zh={tabButtonSelectors:null,selectedTabID:"",deselectOldTab(){document.getElementById(this.selectedTabID).classList.remove("is-active"),this.filterActive([...this.tabButtonSelectors]).classList.remove("is-active")},selectCurrentTab(t){this.selectedTabID=t.dataset.tab,t.classList.add("is-active"),document.getElementById(this.selectedTabID).classList.add("is-active")},selectTab(t){t.preventDefault(),t.target.classList.contains("is-active")||(this.deselectOldTab(),this.selectCurrentTab(t.target))},filterTabs(){[...this.tabButtonSelectors].forEach(t=>{t.dataset.tab&&t.addEventListener("click",this.selectTab.bind(this))})},filterActive:t=>t.filter(t=>t.classList.contains("is-active")).pop(),init(){this.tabButtonSelectors=document.querySelectorAll(".cld-page-tabs-tab button"),0!==this.tabButtonSelectors.length&&(this.selectCurrentTab(this.filterActive([...this.tabButtonSelectors])),this.filterTabs())}};window.addEventListener("load",()=>zh.init());const Nh={init(){document.querySelectorAll(".cld-special-offer-link").forEach(t=>{t.addEventListener("click",()=>{Ih.track("special_offer_clicked",{offer_id:"small_plan_29"},"settings")})})}};window.addEventListener("load",()=>Nh.init());i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p;window.$=window.jQuery})()})(); //# sourceMappingURL=cloudinary.js.map \ No newline at end of file